summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-21 12:35:05 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-21 12:35:05 +0200
commitd2e8f6114903bd3f4841cec91bc77c1ca7e8dca4 (patch)
tree88327ab5fc2eda9fbd905f284584fe5879fbe0a1 /src/lib
parenta291e77b2cfc4ce1b780db0d8fa664fb8094d365 (diff)
dynamic_buffer is just std::vector<UINT8> (nw)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/cassimg.cpp4
-rw-r--r--src/lib/formats/ccvf_dsk.cpp4
-rw-r--r--src/lib/formats/cqm_dsk.cpp4
-rw-r--r--src/lib/formats/csw_cas.cpp4
-rw-r--r--src/lib/formats/d64_dsk.cpp2
-rw-r--r--src/lib/formats/dfi_dsk.cpp2
-rw-r--r--src/lib/formats/flopimg.cpp2
-rw-r--r--src/lib/formats/fsd_dsk.cpp2
-rw-r--r--src/lib/formats/g64_dsk.cpp4
-rw-r--r--src/lib/formats/hxchfe_dsk.cpp4
-rw-r--r--src/lib/formats/hxcmfm_dsk.cpp2
-rw-r--r--src/lib/formats/imd_dsk.cpp2
-rw-r--r--src/lib/formats/ipf_dsk.cpp8
-rw-r--r--src/lib/formats/ipf_dsk.h6
-rw-r--r--src/lib/formats/kc_cas.cpp2
-rw-r--r--src/lib/formats/mfi_dsk.cpp2
-rw-r--r--src/lib/formats/pasti_dsk.cpp2
-rw-r--r--src/lib/formats/td0_dsk.cpp2
-rw-r--r--src/lib/formats/victor9k_dsk.cpp2
-rw-r--r--src/lib/util/avhuff.cpp4
-rw-r--r--src/lib/util/avhuff.h4
-rw-r--r--src/lib/util/cdrom.cpp2
-rw-r--r--src/lib/util/chd.cpp18
-rw-r--r--src/lib/util/chd.h16
-rw-r--r--src/lib/util/chdcodec.cpp8
-rw-r--r--src/lib/util/chdcodec.h4
-rw-r--r--src/lib/util/corefile.cpp2
-rw-r--r--src/lib/util/corefile.h2
-rw-r--r--src/lib/util/coretmpl.h4
-rw-r--r--src/lib/util/huffman.cpp2
30 files changed, 61 insertions, 65 deletions
diff --git a/src/lib/formats/cassimg.cpp b/src/lib/formats/cassimg.cpp
index ac2e9f56900..39e3176e121 100644
--- a/src/lib/formats/cassimg.cpp
+++ b/src/lib/formats/cassimg.cpp
@@ -870,8 +870,8 @@ cassette_image::error cassette_legacy_construct(cassette_image *cassette,
cassette_image::error err;
int length;
int sample_count;
- dynamic_buffer bytes;
- dynamic_buffer chunk;
+ std::vector<UINT8> bytes;
+ std::vector<UINT8> chunk;
std::vector<INT16> samples;
int pos = 0;
UINT64 offset = 0;
diff --git a/src/lib/formats/ccvf_dsk.cpp b/src/lib/formats/ccvf_dsk.cpp
index 8e30dcfff33..abce7fb55da 100644
--- a/src/lib/formats/ccvf_dsk.cpp
+++ b/src/lib/formats/ccvf_dsk.cpp
@@ -90,11 +90,11 @@ bool ccvf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
const format &f = formats[0];
UINT64 size = io_generic_size(io);
- dynamic_buffer img(size);
+ std::vector<UINT8> img(size);
io_generic_read(io, &img[0], 0, size);
std::string ccvf = std::string((const char *)&img[0], size);
- dynamic_buffer bytes(78720);
+ std::vector<UINT8> bytes(78720);
int start = 0, end = 0;
std::string line;
diff --git a/src/lib/formats/cqm_dsk.cpp b/src/lib/formats/cqm_dsk.cpp
index ff191aec56c..94ba350c2a4 100644
--- a/src/lib/formats/cqm_dsk.cpp
+++ b/src/lib/formats/cqm_dsk.cpp
@@ -275,7 +275,7 @@ int cqm_format::identify(io_generic *io, UINT32 form_factor)
bool cqm_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
const int max_size = 4*1024*1024; // 4MB ought to be large enough for any floppy
- dynamic_buffer imagebuf(max_size);
+ std::vector<UINT8> imagebuf(max_size);
UINT8 header[CQM_HEADER_SIZE];
io_generic_read(io, header, 0, CQM_HEADER_SIZE);
@@ -318,7 +318,7 @@ bool cqm_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
int base_cell_count = rate*60/rpm;
int cqm_size = io_generic_size(io);
- dynamic_buffer cqmbuf(cqm_size);
+ std::vector<UINT8> cqmbuf(cqm_size);
io_generic_read(io, &cqmbuf[0], 0, cqm_size);
// decode the RLE data
diff --git a/src/lib/formats/csw_cas.cpp b/src/lib/formats/csw_cas.cpp
index 3b07576254b..0790dd16dee 100644
--- a/src/lib/formats/csw_cas.cpp
+++ b/src/lib/formats/csw_cas.cpp
@@ -52,7 +52,7 @@ static int csw_cas_to_wav_size( const UINT8 *casdata, int caslen )
UINT8 CompressionType;
UINT8 Flags;
UINT8 HeaderExtensionLength;
- dynamic_buffer gz_ptr;
+ std::vector<UINT8> gz_ptr;
int total_size;
z_stream d_stream;
@@ -172,7 +172,7 @@ static int csw_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes )
UINT8 HeaderExtensionLength;
INT8 Bit;
- dynamic_buffer gz_ptr;
+ std::vector<UINT8> gz_ptr;
int total_size;
z_stream d_stream;
int err;
diff --git a/src/lib/formats/d64_dsk.cpp b/src/lib/formats/d64_dsk.cpp
index b637d44c48c..2cece44c43a 100644
--- a/src/lib/formats/d64_dsk.cpp
+++ b/src/lib/formats/d64_dsk.cpp
@@ -215,7 +215,7 @@ bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
const format &f = formats[type];
UINT64 size = io_generic_size(io);
- dynamic_buffer img;
+ std::vector<UINT8> img;
if(size == (UINT32)f.sector_count*f.sector_base_size) {
img.resize(size + f.sector_count);
diff --git a/src/lib/formats/dfi_dsk.cpp b/src/lib/formats/dfi_dsk.cpp
index e8bb38d6dd0..dae3d737b67 100644
--- a/src/lib/formats/dfi_dsk.cpp
+++ b/src/lib/formats/dfi_dsk.cpp
@@ -68,7 +68,7 @@ bool dfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
UINT64 size = io_generic_size(io);
UINT64 pos = 4;
- dynamic_buffer data;
+ std::vector<UINT8> data;
int onerev_time = 0; // time for one revolution, used to guess clock and rpm for DFE2 files
unsigned long clock_rate = 100000000; // sample clock rate in megahertz
int rpm=360; // drive rpm
diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp
index 82f8d28ca93..72786f6422e 100644
--- a/src/lib/formats/flopimg.cpp
+++ b/src/lib/formats/flopimg.cpp
@@ -393,7 +393,7 @@ static floperr_t floppy_readwrite_sector(floppy_image_legacy *floppy, int head,
floperr_t err;
const struct FloppyCallbacks *fmt;
size_t this_buffer_len;
- dynamic_buffer alloc_buf;
+ std::vector<UINT8> alloc_buf;
UINT32 sector_length;
UINT8 *buffer_ptr = (UINT8 *)buffer;
floperr_t (*read_sector)(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen);
diff --git a/src/lib/formats/fsd_dsk.cpp b/src/lib/formats/fsd_dsk.cpp
index 2d31be1123c..cbf474da116 100644
--- a/src/lib/formats/fsd_dsk.cpp
+++ b/src/lib/formats/fsd_dsk.cpp
@@ -104,7 +104,7 @@ bool fsd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
result[0x20] = "Deleted Data";
UINT64 size = io_generic_size(io);
- dynamic_buffer img(size);
+ std::vector<UINT8> img(size);
io_generic_read(io, &img[0], 0, size);
UINT64 pos;
diff --git a/src/lib/formats/g64_dsk.cpp b/src/lib/formats/g64_dsk.cpp
index e85b5c34682..302bfc0e842 100644
--- a/src/lib/formats/g64_dsk.cpp
+++ b/src/lib/formats/g64_dsk.cpp
@@ -41,7 +41,7 @@ int g64_format::identify(io_generic *io, UINT32 form_factor)
bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
UINT64 size = io_generic_size(io);
- dynamic_buffer img(size);
+ std::vector<UINT8> img(size);
io_generic_read(io, &img[0], 0, size);
if (img[POS_VERSION]) {
@@ -115,7 +115,7 @@ bool g64_format::save(io_generic *io, floppy_image *image)
for (int head = 0; head < heads; head++) {
int tracks_written = 0;
- dynamic_buffer trackbuf(TRACK_LENGTH-2);
+ std::vector<UINT8> trackbuf(TRACK_LENGTH-2);
for (int track = 0; track < TRACK_COUNT; track++) {
UINT32 tpos = POS_TRACK_OFFSET + (track * 4);
diff --git a/src/lib/formats/hxchfe_dsk.cpp b/src/lib/formats/hxchfe_dsk.cpp
index cf959fdff32..1e532e140b2 100644
--- a/src/lib/formats/hxchfe_dsk.cpp
+++ b/src/lib/formats/hxchfe_dsk.cpp
@@ -233,7 +233,7 @@ bool hfe_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
}
// Load the tracks
- dynamic_buffer cylinder_buffer;
+ std::vector<UINT8> cylinder_buffer;
for(int cyl=0; cyl < m_cylinders; cyl++)
{
// actual data read
@@ -402,7 +402,7 @@ void hfe_format::generate_track_from_hfe_bitstream(int cyl, int head, int sample
bool hfe_format::save(io_generic *io, floppy_image *image)
{
- dynamic_buffer cylbuf;
+ std::vector<UINT8> cylbuf;
cylbuf.resize(0x6200);
UINT8 header[HEADER_LENGTH];
diff --git a/src/lib/formats/hxcmfm_dsk.cpp b/src/lib/formats/hxcmfm_dsk.cpp
index fe25f9158c9..07a05d3e2f6 100644
--- a/src/lib/formats/hxcmfm_dsk.cpp
+++ b/src/lib/formats/hxcmfm_dsk.cpp
@@ -76,7 +76,7 @@ bool mfm_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
// read header
io_generic_read(io, &header, 0, sizeof(header));
int counter = 0;
- dynamic_buffer trackbuf;
+ std::vector<UINT8> trackbuf;
for(int track=0; track < header.number_of_track; track++) {
for(int side=0; side < header.number_of_side; side++) {
// read location of
diff --git a/src/lib/formats/imd_dsk.cpp b/src/lib/formats/imd_dsk.cpp
index 7683f890986..13f155b638a 100644
--- a/src/lib/formats/imd_dsk.cpp
+++ b/src/lib/formats/imd_dsk.cpp
@@ -423,7 +423,7 @@ int imd_format::identify(io_generic *io, UINT32 form_factor)
bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
UINT64 size = io_generic_size(io);
- dynamic_buffer img(size);
+ std::vector<UINT8> img(size);
io_generic_read(io, &img[0], 0, size);
UINT64 pos;
diff --git a/src/lib/formats/ipf_dsk.cpp b/src/lib/formats/ipf_dsk.cpp
index 1292ce8b354..40ad1229ab8 100644
--- a/src/lib/formats/ipf_dsk.cpp
+++ b/src/lib/formats/ipf_dsk.cpp
@@ -45,7 +45,7 @@ int ipf_format::identify(io_generic *io, UINT32 form_factor)
bool ipf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
UINT64 size = io_generic_size(io);
- dynamic_buffer data(size);
+ std::vector<UINT8> data(size);
io_generic_read(io, &data[0], 0, size);
bool res = parse(data, image);
return res;
@@ -80,7 +80,7 @@ UINT32 ipf_format::crc32r(const UINT8 *data, UINT32 size)
return ~crc;
}
-bool ipf_format::parse(dynamic_buffer &data, floppy_image *image)
+bool ipf_format::parse(std::vector<UINT8> &data, floppy_image *image)
{
image->set_variant(floppy_image::DSDD); // Not handling anything else yet
tcount = 84*2+1; // Usual max
@@ -182,7 +182,7 @@ bool ipf_format::parse_data(const UINT8 *data, UINT32 &pos, UINT32 max_extra_siz
return true;
}
-bool ipf_format::scan_one_tag(dynamic_buffer &data, UINT32 &pos, UINT8 *&tag, UINT32 &tsize)
+bool ipf_format::scan_one_tag(std::vector<UINT8> &data, UINT32 &pos, UINT8 *&tag, UINT32 &tsize)
{
if(data.size()-pos < 12)
return false;
@@ -198,7 +198,7 @@ bool ipf_format::scan_one_tag(dynamic_buffer &data, UINT32 &pos, UINT8 *&tag, UI
return true;
}
-bool ipf_format::scan_all_tags(dynamic_buffer &data)
+bool ipf_format::scan_all_tags(std::vector<UINT8> &data)
{
UINT32 pos = 0;
UINT32 size = data.size();
diff --git a/src/lib/formats/ipf_dsk.h b/src/lib/formats/ipf_dsk.h
index a0a16d36daf..0df0e4c3285 100644
--- a/src/lib/formats/ipf_dsk.h
+++ b/src/lib/formats/ipf_dsk.h
@@ -50,8 +50,8 @@ private:
bool parse_imge(const UINT8 *imge);
bool parse_data(const UINT8 *data, UINT32 &pos, UINT32 max_extra_size);
- bool scan_one_tag(dynamic_buffer &data, UINT32 &pos, UINT8 *&tag, UINT32 &tsize);
- bool scan_all_tags(dynamic_buffer &data);
+ bool scan_one_tag(std::vector<UINT8> &data, UINT32 &pos, UINT8 *&tag, UINT32 &tsize);
+ bool scan_all_tags(std::vector<UINT8> &data);
static UINT32 r32(const UINT8 *p);
static UINT32 rb(const UINT8 *&p, int count);
@@ -81,7 +81,7 @@ private:
bool generate_track(track_info *t, floppy_image *image);
bool generate_tracks(floppy_image *image);
- bool parse(dynamic_buffer &data, floppy_image *image);
+ bool parse(std::vector<UINT8> &data, floppy_image *image);
};
extern const floppy_format_type FLOPPY_IPF_FORMAT;
diff --git a/src/lib/formats/kc_cas.cpp b/src/lib/formats/kc_cas.cpp
index e357261ec5e..2e9638d19c9 100644
--- a/src/lib/formats/kc_cas.cpp
+++ b/src/lib/formats/kc_cas.cpp
@@ -212,7 +212,7 @@ static int kc_handle_tap(INT16 *buffer, const UINT8 *casdata)
static int kc_handle_sss(INT16 *buffer, const UINT8 *casdata)
{
- dynamic_buffer sss(kc_image_size + 11);
+ std::vector<UINT8> sss(kc_image_size + 11);
// tries to generate the missing head
memset(&sss[0], 0xd3, 3);
diff --git a/src/lib/formats/mfi_dsk.cpp b/src/lib/formats/mfi_dsk.cpp
index b6d0f11e2c7..ea3eed8a29f 100644
--- a/src/lib/formats/mfi_dsk.cpp
+++ b/src/lib/formats/mfi_dsk.cpp
@@ -119,7 +119,7 @@ bool mfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
image->set_variant(h.variant);
- dynamic_buffer compressed;
+ std::vector<UINT8> compressed;
entry *ent = entries;
for(unsigned int cyl=0; cyl <= (h.cyl_count - 1) << 2; cyl += 4 >> resolution)
diff --git a/src/lib/formats/pasti_dsk.cpp b/src/lib/formats/pasti_dsk.cpp
index 78e016991d9..9ddce45138a 100644
--- a/src/lib/formats/pasti_dsk.cpp
+++ b/src/lib/formats/pasti_dsk.cpp
@@ -64,7 +64,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
UINT8 fh[16];
io_generic_read(io, fh, 0, 16);
- dynamic_buffer raw_track;
+ std::vector<UINT8> raw_track;
int tracks = fh[10];
int heads = 1+(tracks >= 160);
diff --git a/src/lib/formats/td0_dsk.cpp b/src/lib/formats/td0_dsk.cpp
index 69b3e5bfc14..51fa59488a6 100644
--- a/src/lib/formats/td0_dsk.cpp
+++ b/src/lib/formats/td0_dsk.cpp
@@ -838,7 +838,7 @@ bool td0_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
int track_spt;
int offset = 0;
const int max_size = 4*1024*1024; // 4MB ought to be large enough for any floppy
- dynamic_buffer imagebuf(max_size);
+ std::vector<UINT8> imagebuf(max_size);
UINT8 header[12];
io_generic_read(io, header, 0, 12);
diff --git a/src/lib/formats/victor9k_dsk.cpp b/src/lib/formats/victor9k_dsk.cpp
index bce82cdf028..5f0936a8048 100644
--- a/src/lib/formats/victor9k_dsk.cpp
+++ b/src/lib/formats/victor9k_dsk.cpp
@@ -257,7 +257,7 @@ bool victor9k_format::load(io_generic *io, UINT32 form_factor, floppy_image *ima
const format &f = formats[type];
UINT64 size = io_generic_size(io);
- dynamic_buffer img;
+ std::vector<UINT8> img;
img.resize(size);
io_generic_read(io, &img[0], 0, size);
diff --git a/src/lib/util/avhuff.cpp b/src/lib/util/avhuff.cpp
index 277f056c7ad..dbec214076a 100644
--- a/src/lib/util/avhuff.cpp
+++ b/src/lib/util/avhuff.cpp
@@ -308,7 +308,7 @@ UINT32 avhuff_encoder::raw_data_size(const UINT8 *data)
}
/**
- * @fn avhuff_error avhuff_encoder::assemble_data(dynamic_buffer &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize)
+ * @fn avhuff_error avhuff_encoder::assemble_data(std::vector<UINT8> &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize)
*
* @brief -------------------------------------------------
* assemble_data - assemble a datastream from raw bits
@@ -325,7 +325,7 @@ UINT32 avhuff_encoder::raw_data_size(const UINT8 *data)
* @return An avhuff_error.
*/
-avhuff_error avhuff_encoder::assemble_data(dynamic_buffer &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize)
+avhuff_error avhuff_encoder::assemble_data(std::vector<UINT8> &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize)
{
// sanity check the inputs
if (metadatasize > 255)
diff --git a/src/lib/util/avhuff.h b/src/lib/util/avhuff.h
index cdaa3ec5f3a..ca1bd4cec49 100644
--- a/src/lib/util/avhuff.h
+++ b/src/lib/util/avhuff.h
@@ -90,7 +90,7 @@ public:
// static helpers
static UINT32 raw_data_size(const UINT8 *data);
static UINT32 raw_data_size(UINT32 width, UINT32 height, UINT8 channels, UINT32 numsamples, UINT32 metadatasize = 0) { return 12 + channels * numsamples * 2 + width * height * 2; }
- static avhuff_error assemble_data(dynamic_buffer &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata = nullptr, UINT32 metadatasize = 0);
+ static avhuff_error assemble_data(std::vector<UINT8> &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata = nullptr, UINT32 metadatasize = 0);
private:
// delta-RLE Huffman encoder
@@ -127,7 +127,7 @@ private:
deltarle_encoder m_crcontext;
// audio encoding contexts
- dynamic_buffer m_audiobuffer;
+ std::vector<UINT8> m_audiobuffer;
#if AVHUFF_USE_FLAC
flac_encoder m_flac_encoder;
#else
diff --git a/src/lib/util/cdrom.cpp b/src/lib/util/cdrom.cpp
index 59a5b6cc18c..7b5dae18a4e 100644
--- a/src/lib/util/cdrom.cpp
+++ b/src/lib/util/cdrom.cpp
@@ -1225,7 +1225,7 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc)
printf("toc->numtrks = %u?!\n", toc->numtrks);
/* look for old-style metadata */
- dynamic_buffer oldmetadata;
+ std::vector<UINT8> oldmetadata;
err = chd->read_metadata(CDROM_OLD_METADATA_TAG, 0, oldmetadata);
if (err != CHDERR_NONE)
return err;
diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp
index 07da646dca3..8bce55cb947 100644
--- a/src/lib/util/chd.cpp
+++ b/src/lib/util/chd.cpp
@@ -1271,7 +1271,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex
}
/**
- * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output)
+ * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector<UINT8> &output)
*
* @brief Reads a metadata.
*
@@ -1285,7 +1285,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex
* @return The metadata.
*/
-chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output)
+chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector<UINT8> &output)
{
// wrap this for clean reporting
try
@@ -1349,7 +1349,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex
}
/**
- * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags)
+ * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector<UINT8> &output, chd_metadata_tag &resulttag, UINT8 &resultflags)
*
* @brief Reads a metadata.
*
@@ -1365,7 +1365,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex
* @return The metadata.
*/
-chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags)
+chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector<UINT8> &output, chd_metadata_tag &resulttag, UINT8 &resultflags)
{
// wrap this for clean reporting
try
@@ -1530,7 +1530,7 @@ chd_error chd_file::clone_all_metadata(chd_file &source)
try
{
// iterate over metadata entries in the source
- dynamic_buffer filedata;
+ std::vector<UINT8> filedata;
metadata_entry metaentry;
metaentry.metatag = 0;
metaentry.length = 0;
@@ -1577,7 +1577,7 @@ util::sha1_t chd_file::compute_overall_sha1(util::sha1_t rawsha1)
return rawsha1;
// iterate over metadata
- dynamic_buffer filedata;
+ std::vector<UINT8> filedata;
std::vector<metadata_hash> hasharray;
metadata_entry metaentry;
for (bool has_data = metadata_find(CHDMETATAG_WILDCARD, 0, metaentry); has_data; has_data = metadata_find(CHDMETATAG_WILDCARD, 0, metaentry, true))
@@ -1931,7 +1931,7 @@ chd_error chd_file::compress_v5_map()
util::crc16_t mapcrc = util::crc16_creator::simple(&m_rawmap[0], m_hunkcount * 12);
// create a buffer to hold the RLE data
- dynamic_buffer compression_rle(m_hunkcount);
+ std::vector<UINT8> compression_rle(m_hunkcount);
UINT8 *dest = &compression_rle[0];
// use a huffman encoder for 16 different codes, maximum length is 8 bits
@@ -2014,7 +2014,7 @@ chd_error chd_file::compress_v5_map()
}
// compute a tree and export it to the buffer
- dynamic_buffer compressed(m_hunkcount * 6);
+ std::vector<UINT8> compressed(m_hunkcount * 6);
bitstream_out bitbuf(&compressed[16], compressed.size() - 16);
huffman_error err = encoder.compute_tree_from_histo();
if (err != HUFFERR_NONE)
@@ -2155,7 +2155,7 @@ void chd_file::decompress_v5_map()
UINT8 parentbits = rawbuf[14];
// now read the map
- dynamic_buffer compressed(mapbytes);
+ std::vector<UINT8> compressed(mapbytes);
file_read(m_mapoffset + 16, &compressed[0], mapbytes);
bitstream_in bitbuf(&compressed[0], compressed.size());
diff --git a/src/lib/util/chd.h b/src/lib/util/chd.h
index b0eb4143374..51c6fed0b54 100644
--- a/src/lib/util/chd.h
+++ b/src/lib/util/chd.h
@@ -349,12 +349,12 @@ public:
// metadata management
chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::string &output);
- chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output);
+ chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector<UINT8> &output);
chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen);
- chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags);
+ chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector<UINT8> &output, chd_metadata_tag &resulttag, UINT8 &resultflags);
chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags = CHD_MDFLAGS_CHECKSUM);
chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const std::string &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input.c_str(), input.length() + 1, flags); }
- chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const dynamic_buffer &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, &input[0], input.size(), flags); }
+ chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const std::vector<UINT8> &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, &input[0], input.size(), flags); }
chd_error delete_metadata(chd_metadata_tag metatag, UINT32 metaindex);
chd_error clone_all_metadata(chd_file &source);
@@ -428,14 +428,14 @@ private:
// map information
UINT32 m_mapentrybytes; // length of each entry in a map
- dynamic_buffer m_rawmap; // raw map data
+ std::vector<UINT8> m_rawmap; // raw map data
// compression management
chd_decompressor * m_decompressor[4]; // array of decompression codecs
- dynamic_buffer m_compressed; // temporary buffer for compressed data
+ std::vector<UINT8> m_compressed; // temporary buffer for compressed data
// caching
- dynamic_buffer m_cache; // single-hunk cache for partial reads/writes
+ std::vector<UINT8> m_cache; // single-hunk cache for partial reads/writes
UINT32 m_cachehunk; // which hunk is in the cache?
};
@@ -571,8 +571,8 @@ private:
// work item thread
static const int WORK_BUFFER_HUNKS = 256;
osd_work_queue * m_work_queue; // queue for doing work on other threads
- dynamic_buffer m_work_buffer; // buffer containing hunk data to work on
- dynamic_buffer m_compressed_buffer;// buffer containing compressed data
+ std::vector<UINT8> m_work_buffer; // buffer containing hunk data to work on
+ std::vector<UINT8> m_compressed_buffer;// buffer containing compressed data
work_item m_work_item[WORK_BUFFER_HUNKS]; // status of each hunk
chd_compressor_group * m_codecs[WORK_MAX_THREADS]; // codecs to use
diff --git a/src/lib/util/chdcodec.cpp b/src/lib/util/chdcodec.cpp
index 041061c38e9..e2758f08a9e 100644
--- a/src/lib/util/chdcodec.cpp
+++ b/src/lib/util/chdcodec.cpp
@@ -258,7 +258,7 @@ private:
flac_encoder m_encoder;
z_stream m_deflater;
chd_zlib_allocator m_allocator;
- dynamic_buffer m_buffer;
+ std::vector<UINT8> m_buffer;
};
@@ -281,7 +281,7 @@ private:
flac_decoder m_decoder;
z_stream m_inflater;
chd_zlib_allocator m_allocator;
- dynamic_buffer m_buffer;
+ std::vector<UINT8> m_buffer;
};
@@ -350,7 +350,7 @@ private:
// internal state
_BaseCompressor m_base_compressor;
_SubcodeCompressor m_subcode_compressor;
- dynamic_buffer m_buffer;
+ std::vector<UINT8> m_buffer;
};
@@ -410,7 +410,7 @@ private:
// internal state
_BaseDecompressor m_base_decompressor;
_SubcodeDecompressor m_subcode_decompressor;
- dynamic_buffer m_buffer;
+ std::vector<UINT8> m_buffer;
};
diff --git a/src/lib/util/chdcodec.h b/src/lib/util/chdcodec.h
index bfde8d2cde7..0b56cbdeb9c 100644
--- a/src/lib/util/chdcodec.h
+++ b/src/lib/util/chdcodec.h
@@ -154,10 +154,10 @@ private:
// internal state
UINT32 m_hunkbytes; // number of bytes in a hunk
chd_compressor * m_compressor[4]; // array of active codecs
- dynamic_buffer m_compress_test; // test buffer for compression
+ std::vector<UINT8> m_compress_test; // test buffer for compression
#if CHDCODEC_VERIFY_COMPRESSION
chd_decompressor * m_decompressor[4]; // array of active codecs
- dynamic_buffer m_decompressed; // verification buffer
+ std::vector<UINT8> m_decompressed; // verification buffer
#endif
};
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp
index ff8f3137cc0..54dbca51813 100644
--- a/src/lib/util/corefile.cpp
+++ b/src/lib/util/corefile.cpp
@@ -1221,7 +1221,7 @@ osd_file::error core_file::load(std::string const &filename, void **data, std::u
return osd_file::error::NONE;
}
-osd_file::error core_file::load(std::string const &filename, dynamic_buffer &data)
+osd_file::error core_file::load(std::string const &filename, std::vector<UINT8> &data)
{
ptr file;
diff --git a/src/lib/util/corefile.h b/src/lib/util/corefile.h
index efbda400202..70b966c394c 100644
--- a/src/lib/util/corefile.h
+++ b/src/lib/util/corefile.h
@@ -101,7 +101,7 @@ public:
// open a file with the specified filename, read it into memory, and return a pointer
static osd_file::error load(std::string const &filename, void **data, std::uint32_t &length);
- static osd_file::error load(std::string const &filename, dynamic_buffer &data);
+ static osd_file::error load(std::string const &filename, std::vector<UINT8> &data);
// ----- file write -----
diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h
index aff90713dbb..e94e467f2b2 100644
--- a/src/lib/util/coretmpl.h
+++ b/src/lib/util/coretmpl.h
@@ -21,10 +21,6 @@
#include <utility>
#include <vector>
-
-typedef std::vector<UINT8> dynamic_buffer;
-
-
// ======================> simple_list
// a simple_list is a singly-linked list whose 'next' pointer is owned
diff --git a/src/lib/util/huffman.cpp b/src/lib/util/huffman.cpp
index 62756b89a17..c38d78853fb 100644
--- a/src/lib/util/huffman.cpp
+++ b/src/lib/util/huffman.cpp
@@ -316,7 +316,7 @@ huffman_error huffman_context_base::import_tree_huffman(bitstream_in &bitbuf)
huffman_error huffman_context_base::export_tree_huffman(bitstream_out &bitbuf)
{
// first RLE compress the lengths of all the nodes
- dynamic_buffer rle_data(m_numcodes);
+ std::vector<UINT8> rle_data(m_numcodes);
UINT8 *dest = &rle_data[0];
std::vector<UINT16> rle_lengths(m_numcodes/3);
UINT16 *lengths = &rle_lengths[0];