summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-12-04 07:06:18 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-12-04 07:06:18 +0100
commit5a2f80dcde2e76356bf568f1e2d71b054a7db45b (patch)
tree31e8369980a2e4548223f529c31e8ca6ade5ce20 /src/lib/formats
parent41681c1703244abe68cbcf3096ca259bd061cc08 (diff)
clang-modernize part 5
Diffstat (limited to 'src/lib/formats')
-rw-r--r--src/lib/formats/a26_cas.cpp4
-rw-r--r--src/lib/formats/ace_tap.cpp4
-rw-r--r--src/lib/formats/adam_cas.cpp2
-rw-r--r--src/lib/formats/ap2_dsk.cpp14
-rw-r--r--src/lib/formats/ap_dsk35.cpp18
-rw-r--r--src/lib/formats/apf_apt.cpp8
-rw-r--r--src/lib/formats/atari_dsk.cpp4
-rw-r--r--src/lib/formats/atom_tap.cpp2
-rw-r--r--src/lib/formats/basicdsk.cpp6
-rw-r--r--src/lib/formats/camplynx_cas.cpp6
-rw-r--r--src/lib/formats/cassimg.cpp20
-rw-r--r--src/lib/formats/cbm_tap.cpp10
-rw-r--r--src/lib/formats/ccvf_dsk.cpp2
-rw-r--r--src/lib/formats/cgen_cas.cpp4
-rw-r--r--src/lib/formats/coco_cas.cpp4
-rw-r--r--src/lib/formats/cqm_dsk.cpp2
-rw-r--r--src/lib/formats/csw_cas.cpp14
-rw-r--r--src/lib/formats/d88_dsk.cpp4
-rw-r--r--src/lib/formats/dsk_dsk.cpp6
-rw-r--r--src/lib/formats/fc100_cas.cpp4
-rw-r--r--src/lib/formats/flopimg.cpp36
-rw-r--r--src/lib/formats/fm7_cas.cpp4
-rw-r--r--src/lib/formats/fmsx_cas.cpp2
-rw-r--r--src/lib/formats/gtp_cas.cpp8
-rw-r--r--src/lib/formats/hect_dsk.cpp6
-rw-r--r--src/lib/formats/hect_tap.cpp8
-rw-r--r--src/lib/formats/imageutl.cpp2
-rw-r--r--src/lib/formats/imd_dsk.cpp10
-rw-r--r--src/lib/formats/ioprocs.cpp4
-rw-r--r--src/lib/formats/ipf_dsk.cpp6
-rw-r--r--src/lib/formats/kc_cas.cpp12
-rw-r--r--src/lib/formats/kim1_cas.cpp4
-rw-r--r--src/lib/formats/lviv_lvt.cpp2
-rw-r--r--src/lib/formats/mbee_cas.cpp4
-rw-r--r--src/lib/formats/mfi_dsk.cpp4
-rw-r--r--src/lib/formats/mz_cas.cpp4
-rw-r--r--src/lib/formats/nes_dsk.cpp4
-rw-r--r--src/lib/formats/orao_cas.cpp8
-rw-r--r--src/lib/formats/oric_tap.cpp2
-rw-r--r--src/lib/formats/p6001_cas.cpp4
-rw-r--r--src/lib/formats/pasti_dsk.cpp6
-rw-r--r--src/lib/formats/pc_dsk.cpp2
-rw-r--r--src/lib/formats/phc25_cas.cpp4
-rw-r--r--src/lib/formats/pmd_cas.cpp4
-rw-r--r--src/lib/formats/primoptp.cpp2
-rw-r--r--src/lib/formats/rk_cas.cpp18
-rw-r--r--src/lib/formats/sc3000_bit.cpp2
-rw-r--r--src/lib/formats/sol_cas.cpp4
-rw-r--r--src/lib/formats/sorc_cas.cpp4
-rw-r--r--src/lib/formats/sorc_dsk.cpp4
-rw-r--r--src/lib/formats/sord_cas.cpp2
-rw-r--r--src/lib/formats/spc1000_cas.cpp8
-rw-r--r--src/lib/formats/svi_cas.cpp2
-rw-r--r--src/lib/formats/td0_dsk.cpp10
-rw-r--r--src/lib/formats/thom_cas.cpp12
-rw-r--r--src/lib/formats/thom_dsk.cpp14
-rw-r--r--src/lib/formats/trs_cas.cpp4
-rw-r--r--src/lib/formats/tvc_cas.cpp2
-rw-r--r--src/lib/formats/tzx_cas.cpp14
-rw-r--r--src/lib/formats/uef_cas.cpp18
-rw-r--r--src/lib/formats/vg5k_cas.cpp4
-rw-r--r--src/lib/formats/vt_cas.cpp8
-rw-r--r--src/lib/formats/x07_cas.cpp4
-rw-r--r--src/lib/formats/x1_tap.cpp2
-rw-r--r--src/lib/formats/zx81_p.cpp4
65 files changed, 215 insertions, 215 deletions
diff --git a/src/lib/formats/a26_cas.cpp b/src/lib/formats/a26_cas.cpp
index 557a128a7af..d13b5270b45 100644
--- a/src/lib/formats/a26_cas.cpp
+++ b/src/lib/formats/a26_cas.cpp
@@ -129,7 +129,7 @@ static int a26_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) {
}
static int a26_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
- return a26_cas_do_work( NULL, casdata );
+ return a26_cas_do_work( nullptr, casdata );
}
static const struct CassetteLegacyWaveFiller a26_legacy_fill_wave = {
@@ -160,7 +160,7 @@ static const struct CassetteFormat a26_cassette_format = {
"a26",
a26_cassette_identify,
a26_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(a26_cassette_formats)
diff --git a/src/lib/formats/ace_tap.cpp b/src/lib/formats/ace_tap.cpp
index 3479d6ba1f5..10265ad5460 100644
--- a/src/lib/formats/ace_tap.cpp
+++ b/src/lib/formats/ace_tap.cpp
@@ -151,7 +151,7 @@ static int ace_tap_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return ace_handle_tap( NULL, casdata );
+ return ace_handle_tap( nullptr, casdata );
}
@@ -184,7 +184,7 @@ static const struct CassetteFormat ace_tap_format =
"tap",
ace_tap_identify,
ace_tap_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/adam_cas.cpp b/src/lib/formats/adam_cas.cpp
index 54d7427242d..0e38b97c1a0 100644
--- a/src/lib/formats/adam_cas.cpp
+++ b/src/lib/formats/adam_cas.cpp
@@ -204,7 +204,7 @@ static casserr_t coladam_ddp_load( cassette_image *cass )
static const struct CassetteFormat coladam_ddp =
-{ "ddp", coladam_ddp_identify, coladam_ddp_load, NULL /* no save */ };
+{ "ddp", coladam_ddp_identify, coladam_ddp_load, nullptr /* no save */ };
CASSETTE_FORMATLIST_START(coleco_adam_cassette_formats)
CASSETTE_FORMAT(coladam_ddp)
diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp
index 05a1927015a..cfc9b5350ef 100644
--- a/src/lib/formats/ap2_dsk.cpp
+++ b/src/lib/formats/ap2_dsk.cpp
@@ -232,7 +232,7 @@ static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, i
nibble = (UINT8 *)buffer;
nibble += sector * APPLE2_SMALL_NIBBLE_SIZE;
- disk_decode_nib(sector_buffer, nibble, NULL, NULL, NULL);
+ disk_decode_nib(sector_buffer, nibble, nullptr, nullptr, nullptr);
floppy_write_sector(floppy, head, track, sector, 0, sector_buffer, sizeof(sector_buffer), 0);
}
@@ -376,14 +376,14 @@ static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, i
if (buflen != APPLE2_SECTOR_SIZE)
return FLOPPY_ERROR_INTERNAL;
- err = floppy_load_track(floppy, head, track, FALSE, &track_data_v, NULL);
+ err = floppy_load_track(floppy, head, track, FALSE, &track_data_v, nullptr);
if (err)
return err;
track_data = (UINT8 *) track_data_v;
nibble = track_data + (sector * APPLE2_NIBBLE_SIZE);
- if (disk_decode_nib((UINT8 *)buffer, nibble, NULL, NULL, NULL))
+ if (disk_decode_nib((UINT8 *)buffer, nibble, nullptr, nullptr, nullptr))
return FLOPPY_ERROR_INVALIDIMAGE;
return FLOPPY_ERROR_SUCCESS;
@@ -465,7 +465,7 @@ static floperr_t apple2_nib_write_sector(floppy_image_legacy *floppy, int head,
if (buflen != APPLE2_SECTOR_SIZE)
return FLOPPY_ERROR_INTERNAL;
- err = floppy_load_track(floppy, head, track, TRUE, &track_data_v, NULL);
+ err = floppy_load_track(floppy, head, track, TRUE, &track_data_v, nullptr);
if (err)
return err;
track_data = (UINT8 *) track_data_v;
@@ -494,19 +494,19 @@ static UINT32 apple2_get_track_size(floppy_image_legacy *floppy, int head, int t
/* ----------------------------------------------------------------------- */
LEGACY_FLOPPY_OPTIONS_START( apple2 )
- LEGACY_FLOPPY_OPTION( apple2_do, "do,dsk,bin", "Apple ][ DOS order disk image", apple2_dsk_identify, apple2_do_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple2_do, "do,dsk,bin", "Apple ][ DOS order disk image", apple2_dsk_identify, apple2_do_construct, nullptr,
HEADS([1])
TRACKS([35])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple2_po, "po,dsk,bin", "Apple ][ ProDOS order disk image", apple2_dsk_identify, apple2_po_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple2_po, "po,dsk,bin", "Apple ][ ProDOS order disk image", apple2_dsk_identify, apple2_po_construct, nullptr,
HEADS([1])
TRACKS([35])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple2_nib, "dsk,nib", "Apple ][ Nibble order disk image", apple2_nib_identify, apple2_nib_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple2_nib, "dsk,nib", "Apple ][ Nibble order disk image", apple2_nib_identify, apple2_nib_construct, nullptr,
HEADS([1])
TRACKS([35])
SECTORS([16])
diff --git a/src/lib/formats/ap_dsk35.cpp b/src/lib/formats/ap_dsk35.cpp
index 9efd835120d..385ff326047 100644
--- a/src/lib/formats/ap_dsk35.cpp
+++ b/src/lib/formats/ap_dsk35.cpp
@@ -488,7 +488,7 @@ static UINT32 apple35_get_offset(floppy_image_legacy *floppy, int head, int trac
static floperr_t apple35_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
UINT32 data_offset;
- data_offset = apple35_get_offset(floppy, head, track, sector, NULL);
+ data_offset = apple35_get_offset(floppy, head, track, sector, nullptr);
if (data_offset == ~0)
{
return FLOPPY_ERROR_SEEKERROR;
@@ -503,7 +503,7 @@ static floperr_t apple35_write_sector(floppy_image_legacy *floppy, int head, int
{
UINT32 data_offset;
- data_offset = apple35_get_offset(floppy, head, track, sector, NULL);
+ data_offset = apple35_get_offset(floppy, head, track, sector, nullptr);
if (data_offset == ~0)
return FLOPPY_ERROR_SEEKERROR;
floppy_image_write(floppy, buffer, data_offset, buflen);
@@ -976,7 +976,7 @@ static floperr_t apple35_diskcopy_headerdecode(floppy_image_legacy *floppy, UINT
static FLOPPY_IDENTIFY(apple35_diskcopy_identify)
{
- *vote = apple35_diskcopy_headerdecode(floppy, NULL, NULL, NULL, NULL, NULL, NULL) ? 0 : 100;
+ *vote = apple35_diskcopy_headerdecode(floppy, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr) ? 0 : 100;
return FLOPPY_ERROR_SUCCESS;
}
@@ -1121,7 +1121,7 @@ static floperr_t apple35_2img_decode(floppy_image_legacy *floppy, UINT32 *image_
static FLOPPY_IDENTIFY(apple35_2img_identify)
{
- *vote = apple35_2img_decode(floppy, NULL, NULL, NULL) ? 0 : 100;
+ *vote = apple35_2img_decode(floppy, nullptr, nullptr, nullptr) ? 0 : 100;
return FLOPPY_ERROR_SUCCESS;
}
@@ -1175,12 +1175,12 @@ static FLOPPY_CONSTRUCT(apple35_2img_construct)
LEGACY_FLOPPY_OPTIONS_START( apple35_mac )
- LEGACY_FLOPPY_OPTION( apple35_raw, "dsk,img,image", "Apple raw 3.5\" disk image", apple35_raw_identify, apple35_raw_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_raw, "dsk,img,image", "Apple raw 3.5\" disk image", apple35_raw_identify, apple35_raw_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple35_dc, "dc,dc42,dsk,img,image", "Apple DiskCopy disk image", apple35_diskcopy_identify, apple35_diskcopy_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_dc, "dc,dc42,dsk,img,image", "Apple DiskCopy disk image", apple35_diskcopy_identify, apple35_diskcopy_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
@@ -1188,17 +1188,17 @@ LEGACY_FLOPPY_OPTIONS_START( apple35_mac )
LEGACY_FLOPPY_OPTIONS_END
LEGACY_FLOPPY_OPTIONS_START( apple35_iigs )
- LEGACY_FLOPPY_OPTION( apple35_raw, "dsk,img,image,po", "Apple raw 3.5\" disk image", apple35_raw_identify, apple35_raw_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_raw, "dsk,img,image,po", "Apple raw 3.5\" disk image", apple35_raw_identify, apple35_raw_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple35_dc, "dc,dsk,img,image", "Apple DiskCopy disk image", apple35_diskcopy_identify, apple35_diskcopy_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_dc, "dc,dsk,img,image", "Apple DiskCopy disk image", apple35_diskcopy_identify, apple35_diskcopy_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple35_2img, "2img,2mg", "Apple ][gs 2IMG disk image", apple35_2img_identify, apple35_2img_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_2img, "2img,2mg", "Apple ][gs 2IMG disk image", apple35_2img_identify, apple35_2img_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
diff --git a/src/lib/formats/apf_apt.cpp b/src/lib/formats/apf_apt.cpp
index b609a109ef6..f1a333f2c77 100644
--- a/src/lib/formats/apf_apt.cpp
+++ b/src/lib/formats/apf_apt.cpp
@@ -172,14 +172,14 @@ static int apf_apt_calculate_size_in_samples(const UINT8 *bytes, int length)
{
apf_image_size = length;
- return apf_apt_handle_cassette(NULL, bytes);
+ return apf_apt_handle_cassette(nullptr, bytes);
}
static int apf_cpf_calculate_size_in_samples(const UINT8 *bytes, int length)
{
apf_image_size = length;
- return apf_cpf_handle_cassette(NULL, bytes);
+ return apf_cpf_handle_cassette(nullptr, bytes);
}
//*********************************************************************************
@@ -210,7 +210,7 @@ static const struct CassetteFormat apf_cpf_format =
"cas,cpf",
apf_cpf_identify,
apf_cpf_load,
- NULL
+ nullptr
};
//*********************************************************************************
@@ -241,7 +241,7 @@ static const struct CassetteFormat apf_apt_format =
"apt",
apf_apt_identify,
apf_apt_load,
- NULL
+ nullptr
};
//*********************************************************************************
diff --git a/src/lib/formats/atari_dsk.cpp b/src/lib/formats/atari_dsk.cpp
index f5ccd03c952..d73cbf8185f 100644
--- a/src/lib/formats/atari_dsk.cpp
+++ b/src/lib/formats/atari_dsk.cpp
@@ -31,7 +31,7 @@ LEGACY_FLOPPY_OPTIONS_START( atari_only )
"Atari floppy disk image",
atari_dsk_identify,
atari_dsk_construct,
- NULL,
- NULL
+ nullptr,
+ nullptr
)
LEGACY_FLOPPY_OPTIONS_END0
diff --git a/src/lib/formats/atom_tap.cpp b/src/lib/formats/atom_tap.cpp
index 06d614a10b3..917500eace1 100644
--- a/src/lib/formats/atom_tap.cpp
+++ b/src/lib/formats/atom_tap.cpp
@@ -138,7 +138,7 @@ const struct CassetteFormat atom_tap_format =
"tap",
atom_tap_identify,
atom_tap_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START( atom_cassette_formats )
diff --git a/src/lib/formats/basicdsk.cpp b/src/lib/formats/basicdsk.cpp
index ee3ed133e91..9c08c97cc2b 100644
--- a/src/lib/formats/basicdsk.cpp
+++ b/src/lib/formats/basicdsk.cpp
@@ -184,7 +184,7 @@ static floperr_t basicdsk_format_track(floppy_image_legacy *floppy, int head, in
{
floperr_t err = FLOPPY_ERROR_SUCCESS;
UINT8 local_buffer[512];
- void *alloc_buffer = NULL;
+ void *alloc_buffer = nullptr;
void *buffer;
UINT32 sector_length;
int sector;
@@ -206,7 +206,7 @@ static floperr_t basicdsk_format_track(floppy_image_legacy *floppy, int head, in
}
else
{
- alloc_buffer = NULL;
+ alloc_buffer = nullptr;
buffer = local_buffer;
}
@@ -245,7 +245,7 @@ static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int hea
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
diff --git a/src/lib/formats/camplynx_cas.cpp b/src/lib/formats/camplynx_cas.cpp
index a525f18d3cb..15ed26c8201 100644
--- a/src/lib/formats/camplynx_cas.cpp
+++ b/src/lib/formats/camplynx_cas.cpp
@@ -150,7 +150,7 @@ static int camplynx_cassette_calculate_size_in_samples(const UINT8 *bytes, int l
{
camplynx_image_size = length;
- return camplynx_handle_cassette(NULL, bytes);
+ return camplynx_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller lynx48k_legacy_fill_wave =
@@ -200,7 +200,7 @@ static const struct CassetteFormat lynx48k_cassette_image_format =
"tap",
lynx48k_cassette_identify,
lynx48k_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat lynx128k_cassette_image_format =
@@ -208,7 +208,7 @@ static const struct CassetteFormat lynx128k_cassette_image_format =
"tap",
lynx128k_cassette_identify,
lynx128k_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(lynx48k_cassette_formats)
diff --git a/src/lib/formats/cassimg.cpp b/src/lib/formats/cassimg.cpp
index 3154def299a..aabc13ee393 100644
--- a/src/lib/formats/cassimg.cpp
+++ b/src/lib/formats/cassimg.cpp
@@ -100,7 +100,7 @@ static void cassette_finishinit(casserr_t err, cassette_image *cassette, cassett
if (cassette && (err || !outcassette))
{
cassette_close(cassette);
- cassette = NULL;
+ cassette = nullptr;
}
if (outcassette)
*outcassette = cassette;
@@ -133,7 +133,7 @@ casserr_t cassette_open_choices(void *file, const struct io_procs *procs, const
formats = cassette_default_formats;
/* create the cassette object */
- cassette = cassette_init(NULL, file, procs, flags);
+ cassette = cassette_init(nullptr, file, procs, flags);
if (!cassette)
{
err = CASSETTE_ERROR_OUTOFMEMORY;
@@ -141,7 +141,7 @@ casserr_t cassette_open_choices(void *file, const struct io_procs *procs, const
}
/* identify the image */
- format = NULL;
+ format = nullptr;
for (i = 0; !format && formats[i]; i++)
{
if (good_format(formats[i], extension, flags))
@@ -150,7 +150,7 @@ casserr_t cassette_open_choices(void *file, const struct io_procs *procs, const
memset(&opts, 0, sizeof(opts));
err = format->identify(cassette, &opts);
if (err == CASSETTE_ERROR_INVALIDIMAGE)
- format = NULL;
+ format = nullptr;
else if (err)
goto done;
}
@@ -189,8 +189,8 @@ casserr_t cassette_open(void *file, const struct io_procs *procs,
{
const struct CassetteFormat *formats[2];
formats[0] = format;
- formats[1] = NULL;
- return cassette_open_choices(file, procs, NULL, formats, flags, outcassette);
+ formats[1] = nullptr;
+ return cassette_open_choices(file, procs, nullptr, formats, flags, outcassette);
}
@@ -207,7 +207,7 @@ casserr_t cassette_create(void *file, const struct io_procs *procs, const struct
return CASSETTE_ERROR_INVALIDIMAGE;
/* is this a good format? */
- if (!good_format(format, NULL, flags))
+ if (!good_format(format, nullptr, flags))
return CASSETTE_ERROR_INVALIDIMAGE;
/* normalize arguments */
@@ -374,7 +374,7 @@ static casserr_t compute_manipulation_ranges(cassette_image *cassette, int chann
static casserr_t lookup_sample(cassette_image *cassette, int channel, size_t sample, INT32 **ptr)
{
- *ptr = NULL;
+ *ptr = nullptr;
size_t sample_blocknum = (sample / SAMPLES_PER_BLOCK) * cassette->channels + channel;
size_t sample_index = sample % SAMPLES_PER_BLOCK;
@@ -385,7 +385,7 @@ static casserr_t lookup_sample(cassette_image *cassette, int channel, size_t sam
memset(&cassette->blocks[osize], 0, (cassette->blocks.size()-osize)*sizeof(cassette->blocks[0]));
}
- if (cassette->blocks[sample_blocknum] == NULL)
+ if (cassette->blocks[sample_blocknum] == nullptr)
cassette->blocks[sample_blocknum] = global_alloc(sample_block);
sample_block &block = *cassette->blocks[sample_blocknum];
@@ -763,7 +763,7 @@ casserr_t cassette_read_modulated_data(cassette_image *cassette, int channel, do
casserr_t err;
UINT8 buffer_stack[1024];
UINT8 *buffer;
- UINT8 *alloc_buffer = NULL;
+ UINT8 *alloc_buffer = nullptr;
double delta;
double total_displacement = 0.0;
size_t this_length;
diff --git a/src/lib/formats/cbm_tap.cpp b/src/lib/formats/cbm_tap.cpp
index 23b8a8846ed..5c3033f9dad 100644
--- a/src/lib/formats/cbm_tap.cpp
+++ b/src/lib/formats/cbm_tap.cpp
@@ -157,7 +157,7 @@ static void toggle_wave_data(void )
static void cbm_output_wave( INT16 **buffer, int length )
{
- if (buffer == NULL)
+ if (buffer == nullptr)
return;
for( ; length > 0; length-- )
@@ -187,7 +187,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data )
/* int waveamp_high, waveamp_low; */
/* Log .TAP info but only once */
- if (!(buffer == NULL))
+ if (!(buffer == nullptr))
{
LOG_FORMATS("TAP version : %d\n", version);
LOG_FORMATS("Machine type : %d\n", system);
@@ -204,7 +204,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data )
}
/* is the .tap file corrupted? */
- if ((data == NULL) || (length <= CBM_HEADER_SIZE))
+ if ((data == nullptr) || (length <= CBM_HEADER_SIZE))
return -1;
@@ -321,7 +321,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data )
static int cbm_tap_to_wav_size( const UINT8 *tapdata, int taplen )
{
- int size = cbm_tap_do_work(NULL, taplen, tapdata);
+ int size = cbm_tap_do_work(nullptr, taplen, tapdata);
len = taplen;
return size;
@@ -364,7 +364,7 @@ static const struct CassetteFormat cbm_tap_cassette_format = {
"tap",
cbm_cassette_identify,
cbm_cassette_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/ccvf_dsk.cpp b/src/lib/formats/ccvf_dsk.cpp
index 09119a4b632..8e30dcfff33 100644
--- a/src/lib/formats/ccvf_dsk.cpp
+++ b/src/lib/formats/ccvf_dsk.cpp
@@ -109,7 +109,7 @@ bool ccvf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
if (byteoffs==78720) break;
hex[0]=line[byte * 2];
hex[1]=line[(byte * 2) + 1];
- bytes[byteoffs++] = strtol(hex, NULL, 16);
+ bytes[byteoffs++] = strtol(hex, nullptr, 16);
}
}
start = end + 1;
diff --git a/src/lib/formats/cgen_cas.cpp b/src/lib/formats/cgen_cas.cpp
index d9165441618..5cd4c3e1b0e 100644
--- a/src/lib/formats/cgen_cas.cpp
+++ b/src/lib/formats/cgen_cas.cpp
@@ -111,7 +111,7 @@ static int cgenie_cas_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return cgenie_handle_cas( NULL, casdata );
+ return cgenie_handle_cas( nullptr, casdata );
}
static const struct CassetteLegacyWaveFiller cgenie_cas_legacy_fill_wave =
@@ -143,7 +143,7 @@ static const struct CassetteFormat cgenie_cas_format =
"cas",
cgenie_cas_identify,
cgenie_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/coco_cas.cpp b/src/lib/formats/coco_cas.cpp
index e70b28d69c0..d9599aa8c5a 100644
--- a/src/lib/formats/coco_cas.cpp
+++ b/src/lib/formats/coco_cas.cpp
@@ -277,7 +277,7 @@ const struct CassetteFormat coco_cas_format =
"cas",
coco_cas_identify,
coco_cas_load,
- NULL
+ nullptr
};
const struct CassetteFormat alice32_cas_format =
@@ -285,7 +285,7 @@ const struct CassetteFormat alice32_cas_format =
"cas,c10,k7",
coco_cas_identify,
alice32_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/cqm_dsk.cpp b/src/lib/formats/cqm_dsk.cpp
index 5ecf4da3186..ff191aec56c 100644
--- a/src/lib/formats/cqm_dsk.cpp
+++ b/src/lib/formats/cqm_dsk.cpp
@@ -128,7 +128,7 @@ static floperr_t cqm_read_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t cqm_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
diff --git a/src/lib/formats/csw_cas.cpp b/src/lib/formats/csw_cas.cpp
index 94a45edde1f..336a9dde7cd 100644
--- a/src/lib/formats/csw_cas.cpp
+++ b/src/lib/formats/csw_cas.cpp
@@ -110,9 +110,9 @@ static int csw_cas_to_wav_size( const UINT8 *casdata, int caslen )
d_stream.avail_out = 1;
d_stream.total_out=0;
- d_stream.zalloc = 0;
- d_stream.zfree = 0;
- d_stream.opaque = 0;
+ d_stream.zalloc = nullptr;
+ d_stream.zfree = nullptr;
+ d_stream.opaque = nullptr;
d_stream.data_type=0;
err = inflateInit( &d_stream );
@@ -218,9 +218,9 @@ static int csw_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes )
d_stream.avail_out = 1;
d_stream.total_out=0;
- d_stream.zalloc = 0;
- d_stream.zfree = 0;
- d_stream.opaque = 0;
+ d_stream.zalloc = nullptr;
+ d_stream.zfree = nullptr;
+ d_stream.opaque = nullptr;
d_stream.data_type=0;
err = inflateInit( &d_stream );
@@ -300,7 +300,7 @@ static const struct CassetteFormat csw_cassette_format = {
"csw",
csw_cassette_identify,
csw_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(csw_cassette_formats)
diff --git a/src/lib/formats/d88_dsk.cpp b/src/lib/formats/d88_dsk.cpp
index f8383191e6d..b676db7fd21 100644
--- a/src/lib/formats/d88_dsk.cpp
+++ b/src/lib/formats/d88_dsk.cpp
@@ -319,7 +319,7 @@ FLOPPY_IDENTIFY(d88_dsk_identify)
{
UINT32 size;
- d88_get_header(floppy,&size,NULL,NULL,NULL);
+ d88_get_header(floppy,&size,nullptr,nullptr,nullptr);
if(floppy_image_size(floppy) == size)
{
@@ -517,7 +517,7 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
sdatapos += size;
} else
- sects[i].data = NULL;
+ sects[i].data = nullptr;
}
build_pc_track_mfm(track, head, image, cell_count, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size));
diff --git a/src/lib/formats/dsk_dsk.cpp b/src/lib/formats/dsk_dsk.cpp
index 6922071de25..4987a5bb52b 100644
--- a/src/lib/formats/dsk_dsk.cpp
+++ b/src/lib/formats/dsk_dsk.cpp
@@ -162,7 +162,7 @@ static floperr_t dsk_write_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t dsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -179,7 +179,7 @@ static floperr_t dsk_get_indexed_sector_info(floppy_image_legacy *floppy, int he
UINT8 sector_info[0x100];
int pos;
- retVal = get_offset(floppy, head, track, sector_index, FALSE, NULL);
+ retVal = get_offset(floppy, head, track, sector_index, FALSE, nullptr);
offset = dsk_get_track_offset(floppy,head,track);
pos = 0x18 + (sector_index << 3);
floppy_image_read(floppy, sector_info, offset, 0x100);
@@ -419,7 +419,7 @@ bool dsk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
sdatapos += sects[j].actual_size;
} else
- sects[j].data = NULL;
+ sects[j].data = nullptr;
if(extendformat)
pos += sector.data_length;
diff --git a/src/lib/formats/fc100_cas.cpp b/src/lib/formats/fc100_cas.cpp
index 415d3fb01db..01986e789bf 100644
--- a/src/lib/formats/fc100_cas.cpp
+++ b/src/lib/formats/fc100_cas.cpp
@@ -119,7 +119,7 @@ static int fc100_cassette_calculate_size_in_samples(const UINT8 *bytes, int leng
{
fc100_image_size = length;
- return fc100_handle_cassette(NULL, bytes);
+ return fc100_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller fc100_legacy_fill_wave =
@@ -148,7 +148,7 @@ static const struct CassetteFormat fc100_cassette_image_format =
"cas",
fc100_cassette_identify,
fc100_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(fc100_cassette_formats)
diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp
index e66df68cdbc..fa10ab3e4a9 100644
--- a/src/lib/formats/flopimg.cpp
+++ b/src/lib/formats/flopimg.cpp
@@ -81,11 +81,11 @@ static floppy_image_legacy *floppy_init(void *fp, const struct io_procs *procs,
floppy = (floppy_image_legacy *)malloc(sizeof(floppy_image_legacy));
if (!floppy)
- return NULL;
+ return nullptr;
memset(floppy, 0, sizeof(*floppy));
- floppy->tags = pool_alloc_lib(NULL);
- floppy->tag_data = NULL;
+ floppy->tags = pool_alloc_lib(nullptr);
+ floppy->tag_data = nullptr;
floppy->io.file = fp;
floppy->io.procs = procs;
floppy->io.filler = 0xFF;
@@ -151,7 +151,7 @@ static floperr_t floppy_open_internal(void *fp, const struct io_procs *procs, co
if (outfloppy)
{
/* call the format constructor */
- err = floppy_options[best_option].construct(floppy, &floppy_options[best_option], NULL);
+ err = floppy_options[best_option].construct(floppy, &floppy_options[best_option], nullptr);
if (err)
goto done;
@@ -168,7 +168,7 @@ done:
if (floppy && (!outfloppy || err))
{
floppy_close_internal(floppy, FALSE);
- floppy = NULL;
+ floppy = nullptr;
}
if (outoption)
@@ -183,7 +183,7 @@ done:
floperr_t floppy_identify(void *fp, const struct io_procs *procs, const char *extension,
const struct FloppyFormat *formats, int *identified_format)
{
- return floppy_open_internal(fp, procs, extension, formats, INT_MAX, FLOPPY_FLAGS_READONLY, NULL, identified_format);
+ return floppy_open_internal(fp, procs, extension, formats, INT_MAX, FLOPPY_FLAGS_READONLY, nullptr, identified_format);
}
@@ -191,7 +191,7 @@ floperr_t floppy_identify(void *fp, const struct io_procs *procs, const char *ex
floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extension,
const struct FloppyFormat *format, int flags, floppy_image_legacy **outfloppy)
{
- return floppy_open_internal(fp, procs, extension, format, 1, flags, outfloppy, NULL);
+ return floppy_open_internal(fp, procs, extension, format, 1, flags, outfloppy, nullptr);
}
@@ -199,7 +199,7 @@ floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extens
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const char *extension,
const struct FloppyFormat *formats, int flags, floppy_image_legacy **outfloppy)
{
- return floppy_open_internal(fp, procs, extension, formats, INT_MAX, flags, outfloppy, NULL);
+ return floppy_open_internal(fp, procs, extension, formats, INT_MAX, flags, outfloppy, nullptr);
}
@@ -231,11 +231,11 @@ static floperr_t option_to_floppy_error(optreserr_t oerr)
floperr_t floppy_create(void *fp, const struct io_procs *procs, const struct FloppyFormat *format, option_resolution *parameters, floppy_image_legacy **outfloppy)
{
- floppy_image_legacy *floppy = NULL;
+ floppy_image_legacy *floppy = nullptr;
optreserr_t oerr;
floperr_t err;
int heads, tracks, h, t;
- option_resolution *alloc_resolution = NULL;
+ option_resolution *alloc_resolution = nullptr;
assert(format);
@@ -307,7 +307,7 @@ done:
if (err && floppy)
{
floppy_close_internal(floppy, FALSE);
- floppy = NULL;
+ floppy = nullptr;
}
if (outfloppy)
@@ -474,7 +474,7 @@ static floperr_t floppy_readwrite_sector(floppy_image_legacy *floppy, int head,
{
/* find out the size of this sector */
if (indexed)
- err = fmt->get_indexed_sector_info(floppy, head, track, sector, NULL, NULL, NULL, &sector_length, NULL);
+ err = fmt->get_indexed_sector_info(floppy, head, track, sector, nullptr, nullptr, nullptr, &sector_length, nullptr);
else
err = fmt->get_sector_length(floppy, head, track, sector, &sector_length);
if (err)
@@ -683,7 +683,7 @@ floperr_t floppy_format_track(floppy_image_legacy *floppy, int head, int track,
{
floperr_t err;
struct FloppyCallbacks *format;
- option_resolution *alloc_resolution = NULL;
+ option_resolution *alloc_resolution = nullptr;
optreserr_t oerr;
/* supported? */
@@ -785,7 +785,7 @@ floperr_t floppy_get_sector_count(floppy_image_legacy *floppy, int head, int tra
do
{
- err = floppy_get_indexed_sector_info(floppy, head, track, sector_index, NULL, NULL, NULL, NULL, NULL);
+ err = floppy_get_indexed_sector_info(floppy, head, track, sector_index, nullptr, nullptr, nullptr, nullptr, nullptr);
if (!err)
sector_index++;
}
@@ -867,7 +867,7 @@ floperr_t floppy_load_track(floppy_image_legacy *floppy, int head, int track, in
error:
if (track_data)
- *track_data = NULL;
+ *track_data = nullptr;
if (track_length)
*track_length = 0;
return err;
@@ -923,7 +923,7 @@ const char *floppy_error(floperr_t err)
};
if ((err < 0) || (err >= ARRAY_LENGTH(error_messages)))
- return NULL;
+ return nullptr;
return error_messages[err];
}
@@ -1017,7 +1017,7 @@ const char *floppy_image::get_variant_name(UINT32 form_factor, UINT32 variant)
floppy_image_format_t::floppy_image_format_t()
{
- next = 0;
+ next = nullptr;
}
floppy_image_format_t::~floppy_image_format_t()
@@ -2184,7 +2184,7 @@ const floppy_image_format_t::desc_e *floppy_image_format_t::atari_st_fcp_get_des
case 11:
return atari_st_fcp_11;
}
- return 0;
+ return nullptr;
}
// Amiga layouts
diff --git a/src/lib/formats/fm7_cas.cpp b/src/lib/formats/fm7_cas.cpp
index b1ce8f397b4..52892fdea2e 100644
--- a/src/lib/formats/fm7_cas.cpp
+++ b/src/lib/formats/fm7_cas.cpp
@@ -65,7 +65,7 @@ static int fm7_cas_to_wav_size (const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return fm7_handle_t77(NULL,casdata);
+ return fm7_handle_t77(nullptr,casdata);
}
/*******************************************************************
@@ -104,7 +104,7 @@ static const struct CassetteFormat fm7_cassette_format = {
"t77",
fm7_cas_identify,
fm7_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(fm7_cassette_formats)
diff --git a/src/lib/formats/fmsx_cas.cpp b/src/lib/formats/fmsx_cas.cpp
index 10a26d2e232..c135880dc79 100644
--- a/src/lib/formats/fmsx_cas.cpp
+++ b/src/lib/formats/fmsx_cas.cpp
@@ -136,7 +136,7 @@ static const struct CassetteFormat fmsx_cas_format =
"tap,cas",
fmsx_cas_identify,
fmsx_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/gtp_cas.cpp b/src/lib/formats/gtp_cas.cpp
index 1711a0a76b5..4cdb546ea6b 100644
--- a/src/lib/formats/gtp_cas.cpp
+++ b/src/lib/formats/gtp_cas.cpp
@@ -33,7 +33,7 @@ static INT16 len;
static void gtp_output_wave( INT16 **buffer, int length ) {
- if ( buffer == NULL ) {
+ if ( buffer == nullptr ) {
return;
}
@@ -111,7 +111,7 @@ static int gtp_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
int size,n;
size = 0;
n = 0;
- if (casdata == NULL) return -1;
+ if (casdata == nullptr) return -1;
while(n<caslen) {
int block_type = casdata[n];
int block_size = casdata[n+2]*256 + casdata[n+1];
@@ -132,7 +132,7 @@ static int gtp_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) {
int i,size,n;
size = 0;
n = 0;
- if (bytes == NULL) return -1;
+ if (bytes == nullptr) return -1;
while(n<len)
{
int block_type = bytes[n];
@@ -192,7 +192,7 @@ static const struct CassetteFormat gtp_cassette_format = {
"gtp",
gtp_cassette_identify,
gtp_cassette_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/hect_dsk.cpp b/src/lib/formats/hect_dsk.cpp
index 8dfe445e6e4..4cd36008540 100644
--- a/src/lib/formats/hect_dsk.cpp
+++ b/src/lib/formats/hect_dsk.cpp
@@ -94,7 +94,7 @@ static FLOPPY_CONSTRUCT(hector_disc2_dsk800_construct)
}
LEGACY_FLOPPY_OPTIONS_START( hector_disc2 )
- LEGACY_FLOPPY_OPTION( hector_dsk, "HE2", "hector disc2 floppy disk image 200K", hector_disc2_dsk200_identify, hector_disc2_dsk200_construct, NULL, NULL)
- LEGACY_FLOPPY_OPTION( hector_dsk, "HE7", "hector disc2 floppy disk image 720K", hector_disc2_dsk720_identify, hector_disc2_dsk720_construct, NULL, NULL)
- LEGACY_FLOPPY_OPTION( hector_dsk, "HE8", "hector disc2 floppy disk image 800K", hector_disc2_dsk800_identify, hector_disc2_dsk800_construct, NULL, NULL)
+ LEGACY_FLOPPY_OPTION( hector_dsk, "HE2", "hector disc2 floppy disk image 200K", hector_disc2_dsk200_identify, hector_disc2_dsk200_construct, nullptr, nullptr)
+ LEGACY_FLOPPY_OPTION( hector_dsk, "HE7", "hector disc2 floppy disk image 720K", hector_disc2_dsk720_identify, hector_disc2_dsk720_construct, nullptr, nullptr)
+ LEGACY_FLOPPY_OPTION( hector_dsk, "HE8", "hector disc2 floppy disk image 800K", hector_disc2_dsk800_identify, hector_disc2_dsk800_construct, nullptr, nullptr)
LEGACY_FLOPPY_OPTIONS_END
diff --git a/src/lib/formats/hect_tap.cpp b/src/lib/formats/hect_tap.cpp
index 9110f07cc8c..7b2120ddae1 100644
--- a/src/lib/formats/hect_tap.cpp
+++ b/src/lib/formats/hect_tap.cpp
@@ -217,7 +217,7 @@ static int hector_tap_forth_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen ;
- return hector_handle_forth_tap( NULL, casdata );
+ return hector_handle_forth_tap( nullptr, casdata );
}
/*******************************************************************
@@ -236,7 +236,7 @@ static int hector_tap_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen ;
- return hector_handle_tap( NULL, casdata );//forth removed here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ return hector_handle_tap( nullptr, casdata );//forth removed here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
@@ -291,7 +291,7 @@ static const struct CassetteFormat hector_k7_format =
"k7,cin",
hector_k7_identify,
hector_k7_load,
- NULL
+ nullptr
};
static const struct CassetteFormat hector_k7Forth_format =
@@ -299,7 +299,7 @@ static const struct CassetteFormat hector_k7Forth_format =
"for",
hector_k7forth_identify,
hector_k7forth_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/imageutl.cpp b/src/lib/formats/imageutl.cpp
index e6386da44c8..2bf17be849c 100644
--- a/src/lib/formats/imageutl.cpp
+++ b/src/lib/formats/imageutl.cpp
@@ -168,7 +168,7 @@ void image_specify_extension(char *buffer, size_t buffer_len, const char *extens
len = strlen(buffer);
/* be aware that extension can be NULL */
- if (extension != NULL)
+ if (extension != nullptr)
{
while(extension[extension_pos] != '\0')
{
diff --git a/src/lib/formats/imd_dsk.cpp b/src/lib/formats/imd_dsk.cpp
index 2d74c87f9ef..05320686e40 100644
--- a/src/lib/formats/imd_dsk.cpp
+++ b/src/lib/formats/imd_dsk.cpp
@@ -155,7 +155,7 @@ static floperr_t imd_expand_file(floppy_image_legacy *floppy , UINT64 offset , s
return FLOPPY_ERROR_SUCCESS;
}
- UINT8 *buffer = global_alloc_array(UINT8 , size_after_off);
+ auto buffer = global_alloc_array(UINT8 , size_after_off);
// Read the part of file after offset
floppy_image_read(floppy , buffer , offset , size_after_off);
@@ -225,7 +225,7 @@ static floperr_t imd_write_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t imd_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -453,10 +453,10 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
const UINT8 *snum = &img[pos];
pos += sector_count;
- const UINT8 *tnum = head & 0x80 ? &img[pos] : NULL;
+ const UINT8 *tnum = head & 0x80 ? &img[pos] : nullptr;
if(tnum)
pos += sector_count;
- const UINT8 *hnum = head & 0x40 ? &img[pos] : NULL;
+ const UINT8 *hnum = head & 0x40 ? &img[pos] : nullptr;
if(hnum)
pos += sector_count;
@@ -475,7 +475,7 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
sects[i].actual_size = actual_size;
if(stype == 0 || stype > 8) {
- sects[i].data = NULL;
+ sects[i].data = nullptr;
} else {
sects[i].deleted = stype == 3 || stype == 4 || stype == 7 || stype == 8;
diff --git a/src/lib/formats/ioprocs.cpp b/src/lib/formats/ioprocs.cpp
index 2d75bff8b9f..24f92060a82 100644
--- a/src/lib/formats/ioprocs.cpp
+++ b/src/lib/formats/ioprocs.cpp
@@ -55,7 +55,7 @@ const struct io_procs stdio_ioprocs =
const struct io_procs stdio_ioprocs_noclose =
{
- NULL,
+ nullptr,
stdio_seekproc,
stdio_readproc,
stdio_writeproc,
@@ -109,7 +109,7 @@ const struct io_procs corefile_ioprocs =
const struct io_procs corefile_ioprocs_noclose =
{
- NULL,
+ nullptr,
corefile_seekproc,
corefile_readproc,
corefile_writeproc,
diff --git a/src/lib/formats/ipf_dsk.cpp b/src/lib/formats/ipf_dsk.cpp
index afb4c4ce9f3..ade50a8e2f9 100644
--- a/src/lib/formats/ipf_dsk.cpp
+++ b/src/lib/formats/ipf_dsk.cpp
@@ -88,7 +88,7 @@ bool ipf_format::parse(dynamic_buffer &data, floppy_image *image)
if(res)
res = generate_tracks(image);
global_free_array(tinfos);
- tinfos = NULL;
+ tinfos = nullptr;
return res;
}
@@ -118,9 +118,9 @@ bool ipf_format::parse_info(const UINT8 *info)
ipf_format::track_info *ipf_format::get_index(UINT32 idx)
{
if(idx > 1000)
- return 0;
+ return nullptr;
if(idx >= tcount) {
- track_info *ti1 = global_alloc_array_clear(track_info, idx+1);
+ auto ti1 = global_alloc_array_clear(track_info, idx+1);
memcpy(ti1, tinfos, tcount*sizeof(tinfos));
global_free_array(tinfos);
tcount = idx+1;
diff --git a/src/lib/formats/kc_cas.cpp b/src/lib/formats/kc_cas.cpp
index 32d7901cad5..40e261aed7f 100644
--- a/src/lib/formats/kc_cas.cpp
+++ b/src/lib/formats/kc_cas.cpp
@@ -245,7 +245,7 @@ static int kc_kcc_to_wav_size(const UINT8 *casdata, int caslen)
{
kc_image_size = caslen ;
- return kc_handle_kcc( NULL, casdata );
+ return kc_handle_kcc( nullptr, casdata );
}
@@ -277,7 +277,7 @@ static const struct CassetteFormat kc_kcc_format =
"kcc,kcb",
kc_kcc_identify,
kc_kcc_load,
- NULL
+ nullptr
};
@@ -297,7 +297,7 @@ static int kc_tap_to_wav_size(const UINT8 *casdata, int caslen)
{
kc_image_size = caslen ;
- return kc_handle_tap( NULL, casdata );
+ return kc_handle_tap( nullptr, casdata );
}
@@ -329,7 +329,7 @@ static const struct CassetteFormat kc_tap_format =
"tap,853,854,855,tp2,kcm",
kc_tap_identify,
kc_tap_load,
- NULL
+ nullptr
};
@@ -349,7 +349,7 @@ static int kc_sss_to_wav_size(const UINT8 *casdata, int caslen)
{
kc_image_size = caslen ;
- return kc_handle_sss( NULL, casdata );
+ return kc_handle_sss( nullptr, casdata );
}
@@ -380,7 +380,7 @@ static const struct CassetteFormat kc_sss_format =
"sss",
kc_sss_identify,
kc_sss_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/kim1_cas.cpp b/src/lib/formats/kim1_cas.cpp
index b8527e10462..db4c4a95a0b 100644
--- a/src/lib/formats/kim1_cas.cpp
+++ b/src/lib/formats/kim1_cas.cpp
@@ -156,7 +156,7 @@ static int kim1_kim_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return kim1_handle_kim( NULL, casdata );
+ return kim1_handle_kim( nullptr, casdata );
}
static const struct CassetteLegacyWaveFiller kim1_kim_legacy_fill_wave =
@@ -188,7 +188,7 @@ static const struct CassetteFormat kim1_kim_format =
"kim,kim1",
kim1_kim_identify,
kim1_kim_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/lviv_lvt.cpp b/src/lib/formats/lviv_lvt.cpp
index ecb1940eb6e..03172f6ac36 100644
--- a/src/lib/formats/lviv_lvt.cpp
+++ b/src/lib/formats/lviv_lvt.cpp
@@ -143,7 +143,7 @@ static const struct CassetteFormat lviv_lvt_image_format =
"lvt,lvr,lv0,lv1,lv2,lv3",
lviv_lvt_identify,
lviv_lvt_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/mbee_cas.cpp b/src/lib/formats/mbee_cas.cpp
index fe0a2ffbc24..58a8f81232a 100644
--- a/src/lib/formats/mbee_cas.cpp
+++ b/src/lib/formats/mbee_cas.cpp
@@ -224,7 +224,7 @@ static int mbee_tap_calculate_size_in_samples(const UINT8 *bytes, int length)
{
mbee_image_size = length;
- return mbee_handle_tap(NULL, bytes);
+ return mbee_handle_tap(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller mbee_tap_config =
@@ -253,7 +253,7 @@ static const struct CassetteFormat mbee_tap_image_format =
"tap",
mbee_tap_identify,
mbee_tap_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(mbee_cassette_formats)
diff --git a/src/lib/formats/mfi_dsk.cpp b/src/lib/formats/mfi_dsk.cpp
index 043d61b0d3d..b6d0f11e2c7 100644
--- a/src/lib/formats/mfi_dsk.cpp
+++ b/src/lib/formats/mfi_dsk.cpp
@@ -187,8 +187,8 @@ bool mfi_format::save(io_generic *io, floppy_image *image)
int pos = sizeof(header) + (tracks << resolution)*heads*sizeof(entry);
int epos = 0;
- UINT32 *precomp = global_alloc_array(UINT32, max_track_size);
- UINT8 *postcomp = global_alloc_array(UINT8, max_track_size*4 + 1000);
+ auto precomp = global_alloc_array(UINT32, max_track_size);
+ auto postcomp = global_alloc_array(UINT8, max_track_size*4 + 1000);
for(int track=0; track <= (tracks-1) << 2; track += 4 >> resolution)
for(int head=0; head<heads; head++) {
diff --git a/src/lib/formats/mz_cas.cpp b/src/lib/formats/mz_cas.cpp
index 154c4ae91c9..3a6b934b882 100644
--- a/src/lib/formats/mz_cas.cpp
+++ b/src/lib/formats/mz_cas.cpp
@@ -306,7 +306,7 @@ static const struct CassetteLegacyWaveFiller mz700_legacy_fill_wave =
fill_wave, /* fill_wave */
1, /* chunk_size */
2 * BYTE_SAMPLES, /* chunk_samples */
- NULL, /* chunk_sample_calc */
+ nullptr, /* chunk_sample_calc */
4400, // sample_frequency (tested ok with MZ-80K, MZ-80A, MZ-700, MZ-800, MZ-1500)
MZ700_WAVESAMPLES_HEADER, /* header_samples */
1 /* trailer_samples */
@@ -333,7 +333,7 @@ static const struct CassetteFormat mz700_cas_format =
"m12,mzf,mzt",
mz700_cas_identify,
mz700_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/nes_dsk.cpp b/src/lib/formats/nes_dsk.cpp
index 5fc263a5f26..f6560d5f053 100644
--- a/src/lib/formats/nes_dsk.cpp
+++ b/src/lib/formats/nes_dsk.cpp
@@ -69,7 +69,7 @@ LEGACY_FLOPPY_OPTIONS_START( nes_only )
"NES floppy disk image",
nes_dsk_identify,
nes_dsk_construct,
- NULL,
- NULL
+ nullptr,
+ nullptr
)
LEGACY_FLOPPY_OPTIONS_END0
diff --git a/src/lib/formats/orao_cas.cpp b/src/lib/formats/orao_cas.cpp
index 9e88119d825..784f9563cc0 100644
--- a/src/lib/formats/orao_cas.cpp
+++ b/src/lib/formats/orao_cas.cpp
@@ -23,7 +23,7 @@ static INT16 wave_data;
static int len;
static void orao_output_wave( INT16 **buffer, int length ) {
- if ( buffer == NULL ) {
+ if ( buffer == nullptr ) {
return;
}
@@ -36,7 +36,7 @@ static int orao_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
int i,j,size;
UINT8 b;
- if (casdata == NULL) return -1;
+ if (casdata == nullptr) return -1;
if (caslen <= ORAO_HEADER_SIZE) {
return -1;
}
@@ -59,7 +59,7 @@ static int orao_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) {
int i,j,size;
UINT8 b;
size = 0;
- if (bytes == NULL) return -1;
+ if (bytes == nullptr) return -1;
for (i=ORAO_HEADER_SIZE;i<len-ORAO_HEADER_SIZE;i++) {
for (j=0;j<8;j++) {
b = (bytes[i] >> j) & 1;
@@ -113,7 +113,7 @@ static const struct CassetteFormat orao_cassette_format = {
"tap",
orao_cassette_identify,
orao_cassette_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/oric_tap.cpp b/src/lib/formats/oric_tap.cpp
index 9dbf378db9b..ed2a7841076 100644
--- a/src/lib/formats/oric_tap.cpp
+++ b/src/lib/formats/oric_tap.cpp
@@ -513,7 +513,7 @@ static const struct CassetteFormat oric_tap_format =
"tap",
oric_tap_identify,
oric_tap_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/p6001_cas.cpp b/src/lib/formats/p6001_cas.cpp
index a0ce656e4eb..e91e4b40748 100644
--- a/src/lib/formats/p6001_cas.cpp
+++ b/src/lib/formats/p6001_cas.cpp
@@ -50,7 +50,7 @@ static int pc6001_cas_to_wav_size (const UINT8 *casdata, int caslen)
{
cas_size = caslen*8;
- return pc6001_handle_cas(NULL,casdata);
+ return pc6001_handle_cas(nullptr,casdata);
}
/*******************************************************************
@@ -89,7 +89,7 @@ static const struct CassetteFormat pc6001_cassette_format = {
"cas",
pc6001_cas_identify,
pc6001_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(pc6001_cassette_formats)
diff --git a/src/lib/formats/pasti_dsk.cpp b/src/lib/formats/pasti_dsk.cpp
index 6fa53b2590d..f6ed1556711 100644
--- a/src/lib/formats/pasti_dsk.cpp
+++ b/src/lib/formats/pasti_dsk.cpp
@@ -90,7 +90,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
io_generic_read(io, &raw_track[0], pos+16, entry_len-16);
- UINT8 *fuzz = fuzz_len ? &raw_track[16*sect] : 0;
+ UINT8 *fuzz = fuzz_len ? &raw_track[16*sect] : nullptr;
UINT8 *bdata = fuzz ? fuzz+fuzz_len : &raw_track[16*sect];
UINT8 *tdata = bdata;
@@ -105,7 +105,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
tsize = tdata[0] | (tdata[1] << 8);
tdata += 2;
} else
- tdata = 0;
+ tdata = nullptr;
if(0) {
printf("Track %2d.%d: el=%d fl=%d sect=%d flags=%04x tlen=%d/%d tnum=%d flags2=%02x sync=%x\n",
@@ -133,7 +133,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
int s_flags = sh[14] | (sh[15] << 8);
obs.sectors[s].data = bdata + s_off;
- obs.sectors[s].fuzzy_mask = 0;
+ obs.sectors[s].fuzzy_mask = nullptr;
memcpy(obs.sectors[s].id, sh+8, 6);
obs.sectors[s].time_ratio = s_time ? s_time / 16384.0 : 1;
obs.sectors[s].position = s_pos/8-12;
diff --git a/src/lib/formats/pc_dsk.cpp b/src/lib/formats/pc_dsk.cpp
index 19e0f21e08e..0ab32aff7b3 100644
--- a/src/lib/formats/pc_dsk.cpp
+++ b/src/lib/formats/pc_dsk.cpp
@@ -134,7 +134,7 @@ static FLOPPY_CONSTRUCT(pc_dsk_construct)
/* ----------------------------------------------------------------------- */
LEGACY_FLOPPY_OPTIONS_START( pc )
- LEGACY_FLOPPY_OPTION( pc_dsk, "dsk,ima,img,ufi,360", "PC floppy disk image", pc_dsk_identify, pc_dsk_construct, NULL,
+ LEGACY_FLOPPY_OPTION( pc_dsk, "dsk,ima,img,ufi,360", "PC floppy disk image", pc_dsk_identify, pc_dsk_construct, nullptr,
HEADS([1]-2)
TRACKS(40/[80])
SECTORS(8/[9]/10/15/18/36))
diff --git a/src/lib/formats/phc25_cas.cpp b/src/lib/formats/phc25_cas.cpp
index 1253bd98a3a..73dfdb17ff3 100644
--- a/src/lib/formats/phc25_cas.cpp
+++ b/src/lib/formats/phc25_cas.cpp
@@ -144,7 +144,7 @@ static int phc25_cassette_calculate_size_in_samples(const UINT8 *bytes, int leng
{
phc25_image_size = length;
- return phc25_handle_cassette(NULL, bytes);
+ return phc25_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller phc25_legacy_fill_wave =
@@ -173,7 +173,7 @@ static const struct CassetteFormat phc25_cassette_image_format =
"phc",
phc25_cassette_identify,
phc25_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(phc25_cassette_formats)
diff --git a/src/lib/formats/pmd_cas.cpp b/src/lib/formats/pmd_cas.cpp
index ba5baee1a65..4643eaf9251 100644
--- a/src/lib/formats/pmd_cas.cpp
+++ b/src/lib/formats/pmd_cas.cpp
@@ -181,7 +181,7 @@ static int pmd85_cassette_calculate_size_in_samples(const UINT8 *bytes, int leng
{
pmd85_image_size = length;
- return pmd85_handle_cassette(NULL, bytes);
+ return pmd85_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller pmd85_legacy_fill_wave =
@@ -210,7 +210,7 @@ static const struct CassetteFormat pmd85_cassette_image_format =
"pmd,tap,ptp",
pmd85_cassette_identify,
pmd85_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(pmd85_cassette_formats)
diff --git a/src/lib/formats/primoptp.cpp b/src/lib/formats/primoptp.cpp
index 635f66d25ac..23aab613c29 100644
--- a/src/lib/formats/primoptp.cpp
+++ b/src/lib/formats/primoptp.cpp
@@ -241,7 +241,7 @@ static const struct CassetteFormat primo_ptp_image_format =
"ptp",
primo_ptp_identify,
primo_ptp_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(primo_ptp_format)
diff --git a/src/lib/formats/rk_cas.cpp b/src/lib/formats/rk_cas.cpp
index 03139e1515d..968b8afdc23 100644
--- a/src/lib/formats/rk_cas.cpp
+++ b/src/lib/formats/rk_cas.cpp
@@ -217,63 +217,63 @@ static const struct CassetteFormat rku_cassette_format = {
"rku",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rk8_cassette_format = {
"rk8",
rk60_cassette_identify,
rk60_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rks_cassette_format = {
"rks",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rko_cassette_format = {
"rko",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rkr_cassette_format = {
"rk,rkr",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rka_cassette_format = {
"rka",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rkm_cassette_format = {
"rkm",
rk22_cassette_identify,
rk22_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rkp_cassette_format = {
"rkp",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat gam_cassette_format = {
"gam,g16,pki",
gam_cassette_identify,
gam_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(rku_cassette_formats)
diff --git a/src/lib/formats/sc3000_bit.cpp b/src/lib/formats/sc3000_bit.cpp
index 2b5fd635db5..f15488bda68 100644
--- a/src/lib/formats/sc3000_bit.cpp
+++ b/src/lib/formats/sc3000_bit.cpp
@@ -98,7 +98,7 @@ const struct CassetteFormat sc3000_bit_format =
"bit",
sc3000_bit_identify,
sc3000_bit_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START( sc3000_cassette_formats )
diff --git a/src/lib/formats/sol_cas.cpp b/src/lib/formats/sol_cas.cpp
index 26f1bdccf00..1f22cd68a9f 100644
--- a/src/lib/formats/sol_cas.cpp
+++ b/src/lib/formats/sol_cas.cpp
@@ -342,7 +342,7 @@ static int sol20_cassette_calculate_size_in_samples(const UINT8 *bytes, int leng
{
sol20_image_size = length;
- return sol20_handle_cassette(NULL, bytes);
+ return sol20_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller sol20_legacy_fill_wave =
@@ -371,7 +371,7 @@ static const struct CassetteFormat sol20_cassette_image_format =
"svt",
sol20_cassette_identify,
sol20_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(sol20_cassette_formats)
diff --git a/src/lib/formats/sorc_cas.cpp b/src/lib/formats/sorc_cas.cpp
index 6983dd0ba74..a900f77d5e5 100644
--- a/src/lib/formats/sorc_cas.cpp
+++ b/src/lib/formats/sorc_cas.cpp
@@ -121,7 +121,7 @@ static int sorcerer_cassette_calculate_size_in_samples(const UINT8 *bytes, int l
{
sorcerer_image_size = length;
- return sorcerer_handle_cassette(NULL, bytes);
+ return sorcerer_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller sorcerer_legacy_fill_wave =
@@ -150,7 +150,7 @@ static const struct CassetteFormat sorcerer_cassette_image_format =
"tape",
sorcerer_cassette_identify,
sorcerer_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(sorcerer_cassette_formats)
diff --git a/src/lib/formats/sorc_dsk.cpp b/src/lib/formats/sorc_dsk.cpp
index 5e59d30cdb1..27dc4270f05 100644
--- a/src/lib/formats/sorc_dsk.cpp
+++ b/src/lib/formats/sorc_dsk.cpp
@@ -107,7 +107,7 @@ static floperr_t sorc_write_indexed_sector(floppy_image_legacy *floppy, int head
static floperr_t sorc_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -156,5 +156,5 @@ static FLOPPY_CONSTRUCT(sorc_dsk_construct)
/* ----------------------------------------------------------------------- */
LEGACY_FLOPPY_OPTIONS_START( sorcerer )
- LEGACY_FLOPPY_OPTION( sorc_dsk, "dsk", "Exidy Sorcerer floppy disk image", sorc_dsk_identify, sorc_dsk_construct, NULL, NULL)
+ LEGACY_FLOPPY_OPTION( sorc_dsk, "dsk", "Exidy Sorcerer floppy disk image", sorc_dsk_identify, sorc_dsk_construct, nullptr, nullptr)
LEGACY_FLOPPY_OPTIONS_END
diff --git a/src/lib/formats/sord_cas.cpp b/src/lib/formats/sord_cas.cpp
index eb8a27bdba4..39de0fbca84 100644
--- a/src/lib/formats/sord_cas.cpp
+++ b/src/lib/formats/sord_cas.cpp
@@ -133,7 +133,7 @@ static const struct CassetteFormat sordm5_cas_format =
"cas",
sordm5_tap_identify,
sordm5_tap_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(sordm5_cassette_formats)
diff --git a/src/lib/formats/spc1000_cas.cpp b/src/lib/formats/spc1000_cas.cpp
index b05844b6ee7..3c86305e8a8 100644
--- a/src/lib/formats/spc1000_cas.cpp
+++ b/src/lib/formats/spc1000_cas.cpp
@@ -108,14 +108,14 @@ static int spc1000_tap_calculate_size_in_samples(const UINT8 *bytes, int length)
{
spc1000_image_size = length;
- return spc1000_handle_tap(NULL, bytes);
+ return spc1000_handle_tap(nullptr, bytes);
}
static int spc1000_cas_calculate_size_in_samples(const UINT8 *bytes, int length)
{
spc1000_image_size = length;
- return spc1000_handle_cas(NULL, bytes);
+ return spc1000_handle_cas(nullptr, bytes);
}
@@ -151,7 +151,7 @@ static const struct CassetteFormat spc1000_tap_cassette_image_format =
"tap",
spc1000_tap_cassette_identify,
spc1000_tap_cassette_load,
- NULL
+ nullptr
};
@@ -182,7 +182,7 @@ static const struct CassetteFormat spc1000_cas_cassette_image_format =
"cas",
spc1000_cas_cassette_identify,
spc1000_cas_cassette_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/svi_cas.cpp b/src/lib/formats/svi_cas.cpp
index dd2bde8d5a1..a95c3b97fb5 100644
--- a/src/lib/formats/svi_cas.cpp
+++ b/src/lib/formats/svi_cas.cpp
@@ -203,7 +203,7 @@ static const struct CassetteFormat svi_cas_format =
"cas",
svi_cas_identify,
svi_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/td0_dsk.cpp b/src/lib/formats/td0_dsk.cpp
index 185bb21cfed..600a6868a4e 100644
--- a/src/lib/formats/td0_dsk.cpp
+++ b/src/lib/formats/td0_dsk.cpp
@@ -298,7 +298,7 @@ static floperr_t td0_read_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t td0_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -699,7 +699,7 @@ FLOPPY_CONSTRUCT( td0_dsk_construct )
return FLOPPY_ERROR_OUTOFMEMORY;
tag->data = (UINT8*)malloc(floppy_image_size(floppy));
- if (tag->data==NULL) {
+ if (tag->data==nullptr) {
return FLOPPY_ERROR_OUTOFMEMORY;
}
floppy_image_read(floppy, tag->data, 0, floppy_image_size(floppy));
@@ -720,7 +720,7 @@ FLOPPY_CONSTRUCT( td0_dsk_construct )
memcpy(obuf,tag->data,12);
free(tag->data);
tag->data = (UINT8*)malloc(size+12);
- if (tag->data==NULL) {
+ if (tag->data==nullptr) {
return FLOPPY_ERROR_OUTOFMEMORY;
}
memcpy(tag->data,obuf,12);
@@ -786,7 +786,7 @@ FLOPPY_DESTRUCT( td0_dsk_destruct )
{
struct td0dsk_tag *tag = get_tag(floppy);
free(tag->data);
- tag->data = NULL;
+ tag->data = nullptr;
return FLOPPY_ERROR_SUCCESS;
}
@@ -999,7 +999,7 @@ bool td0_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
sdatapos += size;
}
else
- sects[i].data = NULL;
+ sects[i].data = nullptr;
}
track_count = track;
diff --git a/src/lib/formats/thom_cas.cpp b/src/lib/formats/thom_cas.cpp
index 9fd6d6f0208..799e96c38ca 100644
--- a/src/lib/formats/thom_cas.cpp
+++ b/src/lib/formats/thom_cas.cpp
@@ -119,7 +119,7 @@ static casserr_t to7_k7_load( cassette_image *cass )
if ( to7_k7_bits )
{
free( to7_k7_bits );
- to7_k7_bits = NULL;
+ to7_k7_bits = nullptr;
}
to7_k7_bitsize = 0;
@@ -366,7 +366,7 @@ static casserr_t to7_k7_load( cassette_image *cass )
static const struct CassetteFormat to7_k7 =
-{ "k7", to7_k7_identify, to7_k7_load, NULL /* no save */ };
+{ "k7", to7_k7_identify, to7_k7_load, nullptr /* no save */ };
@@ -392,7 +392,7 @@ static casserr_t to7_wav_load ( cassette_image *cass )
if ( to7_k7_bits )
{
free( to7_k7_bits );
- to7_k7_bits = NULL;
+ to7_k7_bits = nullptr;
}
if ( e != CASSETTE_ERROR_SUCCESS )
@@ -730,7 +730,7 @@ static casserr_t mo5_k5_load( cassette_image *cass )
static const struct CassetteFormat mo5_k5 =
-{ "k5,k7", mo5_k5_identify, mo5_k5_load, NULL /* no save */ };
+{ "k5,k7", mo5_k5_identify, mo5_k5_load, nullptr /* no save */ };
/********************* MO5 WAV format ************************/
@@ -781,8 +781,8 @@ static const struct CassetteFormat mo5_wav =
const struct CassetteFormat *const to7_cassette_formats[] =
-{ &to7_wav, &to7_k7, NULL };
+{ &to7_wav, &to7_k7, nullptr };
const struct CassetteFormat *const mo5_cassette_formats[] =
-{ &mo5_wav, &mo5_k5, NULL };
+{ &mo5_wav, &mo5_k5, nullptr };
diff --git a/src/lib/formats/thom_dsk.cpp b/src/lib/formats/thom_dsk.cpp
index ed9d977b723..da7187d65f8 100644
--- a/src/lib/formats/thom_dsk.cpp
+++ b/src/lib/formats/thom_dsk.cpp
@@ -175,7 +175,7 @@ static floperr_t sap_write_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -353,37 +353,37 @@ static FLOPPY_CONSTRUCT(qdd_dsk_construct)
LEGACY_FLOPPY_OPTIONS_START(thomson)
- LEGACY_FLOPPY_OPTION(fdmfm2, "fd", "Thomson FD (MFM) 80 tracks disk image (3\"1/2 DD)", basicdsk_identify_default, basicdsk_construct_default, NULL,
+ LEGACY_FLOPPY_OPTION(fdmfm2, "fd", "Thomson FD (MFM) 80 tracks disk image (3\"1/2 DD)", basicdsk_identify_default, basicdsk_construct_default, nullptr,
HEADS([1])
TRACKS([80])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(fdmfm, "fd", "Thomson FD (MFM) 40 tracks disk image (5\"1/4 DD)", basicdsk_identify_default, basicdsk_construct_default, NULL,
+ LEGACY_FLOPPY_OPTION(fdmfm, "fd", "Thomson FD (MFM) 40 tracks disk image (5\"1/4 DD)", basicdsk_identify_default, basicdsk_construct_default, nullptr,
HEADS([1])
TRACKS([40])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(fd2, "fd", "Thomson FD (FM) 80 tracks disk image (3\"1/2 SD)", basicdsk_identify_default, basicdsk_construct_default, NULL,
+ LEGACY_FLOPPY_OPTION(fd2, "fd", "Thomson FD (FM) 80 tracks disk image (3\"1/2 SD)", basicdsk_identify_default, basicdsk_construct_default, nullptr,
HEADS([1])
TRACKS([80])
SECTORS([16])
SECTOR_LENGTH([128])
FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(fd, "fd", "Thomson FD (FM) 40 tracks disk image (5\"1/4 SD)", basicdsk_identify_default, basicdsk_construct_default, NULL,
+ LEGACY_FLOPPY_OPTION(fd, "fd", "Thomson FD (FM) 40 tracks disk image (5\"1/4 SD)", basicdsk_identify_default, basicdsk_construct_default, nullptr,
HEADS([1])
TRACKS([40])
SECTORS([16])
SECTOR_LENGTH([128])
FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(sap,"sap", "Thomson SAP floppy disk image", sap_dsk_identify, sap_dsk_construct, NULL, NULL)
+ LEGACY_FLOPPY_OPTION(sap,"sap", "Thomson SAP floppy disk image", sap_dsk_identify, sap_dsk_construct, nullptr, nullptr)
- LEGACY_FLOPPY_OPTION(qdd,"qd", "Thomson QDD floppy disk image (2\"8 SD)", qdd_dsk_identify, qdd_dsk_construct, NULL,
+ LEGACY_FLOPPY_OPTION(qdd,"qd", "Thomson QDD floppy disk image (2\"8 SD)", qdd_dsk_identify, qdd_dsk_construct, nullptr,
HEADS([1])
TRACKS([1])
SECTORS([400])
diff --git a/src/lib/formats/trs_cas.cpp b/src/lib/formats/trs_cas.cpp
index a4f748dea05..5e205348768 100644
--- a/src/lib/formats/trs_cas.cpp
+++ b/src/lib/formats/trs_cas.cpp
@@ -96,7 +96,7 @@ static int trs80l2_cas_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return trs80l2_handle_cas( NULL, casdata );
+ return trs80l2_handle_cas( nullptr, casdata );
}
static const struct CassetteLegacyWaveFiller trs80l2_cas_legacy_fill_wave =
@@ -128,7 +128,7 @@ static const struct CassetteFormat trs80l2_cas_format =
"cas",
trs80l2_cas_identify,
trs80l2_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/tvc_cas.cpp b/src/lib/formats/tvc_cas.cpp
index a33fba687b9..7dad5dac819 100644
--- a/src/lib/formats/tvc_cas.cpp
+++ b/src/lib/formats/tvc_cas.cpp
@@ -221,7 +221,7 @@ static const struct CassetteFormat tvc64_cassette_image_format =
"cas",
tvc64_cassette_identify,
tvc64_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(tvc64_cassette_formats)
diff --git a/src/lib/formats/tzx_cas.cpp b/src/lib/formats/tzx_cas.cpp
index e210afff8b7..498de384e53 100644
--- a/src/lib/formats/tzx_cas.cpp
+++ b/src/lib/formats/tzx_cas.cpp
@@ -66,7 +66,7 @@ static const UINT8 TZX_HEADER[8] = { 'Z','X','T','a','p','e','!',0x1a };
static INT16 wave_data = 0;
static int block_count = 0;
-static UINT8** blocks = NULL;
+static UINT8** blocks = nullptr;
static float t_scale = 1; /* for scaling T-states to the 4MHz CPC */
static void toggle_wave_data(void)
@@ -219,7 +219,7 @@ INLINE int tcycles_to_samplecount( int tcycles )
static void tzx_output_wave( INT16 **buffer, int length )
{
- if (buffer == NULL)
+ if (buffer == nullptr)
{
return;
}
@@ -805,7 +805,7 @@ static int tzx_cas_to_wav_size( const UINT8 *casdata, int caslen )
goto cleanup;
}
- size = tzx_cas_do_work(NULL);
+ size = tzx_cas_do_work(nullptr);
return size;
@@ -843,7 +843,7 @@ static int tap_cas_to_wav_size( const UINT8 *casdata, int caslen )
// int pilot_length = (p[2] == 0x00) ? 8063 : 3223; /* worldofspectrum */
LOG_FORMATS("tap_cas_to_wav_size: Handling TAP block containing 0x%X bytes", data_size);
p += 2;
- size += tzx_cas_handle_block(NULL, p, 1000, data_size, 2168, pilot_length, 667, 735, 855, 1710, 8);
+ size += tzx_cas_handle_block(nullptr, p, 1000, data_size, 2168, pilot_length, 667, 735, 855, 1710, 8);
LOG_FORMATS(", total size is now: %d\n", size);
p += data_size;
}
@@ -936,7 +936,7 @@ static const struct CassetteFormat tzx_cassette_format =
"tzx",
tzx_cassette_identify,
tzx_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat tap_cassette_format =
@@ -944,7 +944,7 @@ static const struct CassetteFormat tap_cassette_format =
"tap,blk",
tap_cassette_identify,
tap_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat cdt_cassette_format =
@@ -952,7 +952,7 @@ static const struct CassetteFormat cdt_cassette_format =
"cdt",
cdt_cassette_identify,
cdt_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(tzx_cassette_formats)
diff --git a/src/lib/formats/uef_cas.cpp b/src/lib/formats/uef_cas.cpp
index f078ae776c4..6db1716348b 100644
--- a/src/lib/formats/uef_cas.cpp
+++ b/src/lib/formats/uef_cas.cpp
@@ -50,7 +50,7 @@ static const UINT8* skip_gz_header( const UINT8 *p ) {
method = *p; p++;
flags = *p; p++;
if ( method != Z_DEFLATED || ( flags & RESERVED ) != 0 ) {
- return NULL;
+ return nullptr;
}
/* Skip time, xflags and OS code */
p += 6;
@@ -75,7 +75,7 @@ static const UINT8* skip_gz_header( const UINT8 *p ) {
return p;
}
-static UINT8 *gz_ptr = NULL;
+static UINT8 *gz_ptr = nullptr;
static float get_uef_float( const UINT8 *Float)
{
@@ -114,14 +114,14 @@ static int uef_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
int inflate_size = ( casdata[ caslen - 1 ] << 24 ) | ( casdata[ caslen - 2 ] << 16 ) | ( casdata[ caslen - 3 ] << 8 ) | casdata[ caslen - 4 ];
const UINT8 *in_ptr = skip_gz_header( casdata );
- if ( in_ptr == NULL ) {
+ if ( in_ptr == nullptr ) {
goto cleanup;
}
gz_ptr = (UINT8 *)malloc( inflate_size );
- d_stream.zalloc = 0;
- d_stream.zfree = 0;
- d_stream.opaque = 0;
+ d_stream.zalloc = nullptr;
+ d_stream.zfree = nullptr;
+ d_stream.opaque = nullptr;
d_stream.next_in = (unsigned char *)in_ptr;
d_stream.avail_in = caslen - ( in_ptr - casdata );
d_stream.next_out = gz_ptr;
@@ -207,7 +207,7 @@ static int uef_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
cleanup:
if ( gz_ptr ) {
free( gz_ptr );
- gz_ptr = NULL;
+ gz_ptr = nullptr;
}
return -1;
}
@@ -232,7 +232,7 @@ static int uef_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) {
INT16 *p = buffer;
if ( bytes[0] == 0x1f && bytes[1] == 0x8b ) {
- if ( gz_ptr == NULL ) {
+ if ( gz_ptr == nullptr ) {
return 1;
}
bytes = gz_ptr;
@@ -327,7 +327,7 @@ const struct CassetteFormat uef_cassette_format = {
"uef",
uef_cassette_identify,
uef_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(uef_cassette_formats)
diff --git a/src/lib/formats/vg5k_cas.cpp b/src/lib/formats/vg5k_cas.cpp
index ef648707fd8..6c10112ab30 100644
--- a/src/lib/formats/vg5k_cas.cpp
+++ b/src/lib/formats/vg5k_cas.cpp
@@ -196,7 +196,7 @@ static int vg5k_k7_to_wav_size(const UINT8 *casdata, int caslen)
{
k7_size = caslen ;
- return vg5k_handle_tap( NULL, casdata );
+ return vg5k_handle_tap( nullptr, casdata );
}
@@ -228,7 +228,7 @@ static const struct CassetteFormat vg5k_k7_format =
"k7",
vg5k_k7_identify,
vg5k_k7_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/vt_cas.cpp b/src/lib/formats/vt_cas.cpp
index d0910efcc84..91e5f69ba64 100644
--- a/src/lib/formats/vt_cas.cpp
+++ b/src/lib/formats/vt_cas.cpp
@@ -102,7 +102,7 @@ static const struct CassetteLegacyWaveFiller vtech1_legacy_fill_wave =
vtech1_cassette_fill_wave, /* fill_wave */
1, /* chunk_size */
V1_BYTESAMPLES, /* chunk_samples */
- NULL, /* chunk_sample_calc */
+ nullptr, /* chunk_sample_calc */
600*V1_BITSAMPLES, /* sample_frequency */
600*V1_BITSAMPLES, /* header_samples */
600*V1_BITSAMPLES /* trailer_samples */
@@ -123,7 +123,7 @@ static const struct CassetteFormat vtech1_cas_format =
"cas",
vtech1_cas_identify,
vtech1_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(vtech1_cassette_formats)
@@ -197,7 +197,7 @@ static const struct CassetteLegacyWaveFiller vtech2_legacy_fill_wave =
vtech2_cassette_fill_wave, /* fill_wave */
1, /* chunk_size */
VT2_BYTESAMPLES, /* chunk_samples */
- NULL, /* chunk_sample_calc */
+ nullptr, /* chunk_sample_calc */
600*VT2_BITSAMPLES, /* sample_frequency */
600*VT2_BITSAMPLES, /* header_samples */
600*VT2_BITSAMPLES /* trailer_samples */
@@ -218,7 +218,7 @@ static const struct CassetteFormat vtech2_cas_format =
"cas",
vtech2_cas_identify,
vtech2_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(vtech2_cassette_formats)
diff --git a/src/lib/formats/x07_cas.cpp b/src/lib/formats/x07_cas.cpp
index 54f46acd488..0c36ad7c3e8 100644
--- a/src/lib/formats/x07_cas.cpp
+++ b/src/lib/formats/x07_cas.cpp
@@ -137,7 +137,7 @@ static int x07_cassette_calculate_size_in_samples(const UINT8 *bytes, int length
{
x07_image_size = length;
- return x07_handle_cassette(NULL, bytes);
+ return x07_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller x07_legacy_fill_wave =
@@ -166,7 +166,7 @@ static const struct CassetteFormat x07_cassette_image_format =
"k7,lst,cas",
x07_cassette_identify,
x07_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(x07_cassette_formats)
diff --git a/src/lib/formats/x1_tap.cpp b/src/lib/formats/x1_tap.cpp
index 5cf6f9fef94..f66ca7d4431 100644
--- a/src/lib/formats/x1_tap.cpp
+++ b/src/lib/formats/x1_tap.cpp
@@ -131,7 +131,7 @@ static const struct CassetteFormat x1_cassette_format = {
"tap",
x1_cas_identify,
x1_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(x1_cassette_formats)
diff --git a/src/lib/formats/zx81_p.cpp b/src/lib/formats/zx81_p.cpp
index 9a556f05ce5..5e6af375468 100644
--- a/src/lib/formats/zx81_p.cpp
+++ b/src/lib/formats/zx81_p.cpp
@@ -226,7 +226,7 @@ static const struct CassetteFormat zx81_p_image_format =
"p,81",
zx81_p_identify,
zx81_p_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(zx81_p_format)
@@ -289,7 +289,7 @@ static const struct CassetteFormat zx80_o_image_format =
"o,80",
zx80_o_identify,
zx80_o_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(zx80_o_format)