From 0825ce4f3b8eaab42e3682f7d01d97ce6ea0416d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 25 Nov 2015 08:22:24 +0100 Subject: Cleanups and version bump --- src/lib/formats/tzx_cas.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/lib/formats/tzx_cas.cpp') diff --git a/src/lib/formats/tzx_cas.cpp b/src/lib/formats/tzx_cas.cpp index 225184b7bd0..e210afff8b7 100644 --- a/src/lib/formats/tzx_cas.cpp +++ b/src/lib/formats/tzx_cas.cpp @@ -342,7 +342,7 @@ INLINE int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol UINT8 starttype = cursymb[0]; -// printf("start polarity %01x (max number of symbols is %d)\n", starttype, maxp); +// printf("start polarity %01x (max number of symbols is %d)\n", starttype, maxp); switch (starttype) { @@ -371,13 +371,11 @@ INLINE int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol for (int i = 0; i < maxp; i++) { UINT16 pulse_length = cursymb[1 + (i*2)] | (cursymb[2 + (i*2)] << 8); - // printf("pulse_length %04x\n", pulse_length); + // printf("pulse_length %04x\n", pulse_length); // shorter lists can be terminated with a pulse_length of 0 if (pulse_length != 0) { - - int samples = tcycles_to_samplecount(pulse_length); tzx_output_wave(buffer, samples); size += samples; @@ -425,7 +423,7 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause, if (totp > 0) { - // printf("pilot block table %04x\n", totp); + // printf("pilot block table %04x\n", totp); const UINT8 *symtable = bytes; const UINT8 *table2 = symtable + (2 * npp + 1)*asp; @@ -440,7 +438,7 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause, for (int j = 0; j < repetitions; j++) { size += tzx_handle_symbol(buffer, symtable, symbol, npp); - // toggle_wave_data(); + // toggle_wave_data(); } @@ -470,7 +468,7 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause, for (int i = 0; i < totd; i++) { UINT8 symbol = 0; - + for (int j = 0; j < NB; j++) { symbol |= stream_get_bit(table2, stream_bit, stream_byte) << j; @@ -750,12 +748,12 @@ static int tzx_cas_do_work( INT16 **buffer ) data_size = cur_block[1] + (cur_block[2] << 8) + (cur_block[3] << 16) + (cur_block[4] << 24); pause_time= cur_block[5] + (cur_block[6] << 8); - + UINT32 totp = cur_block[7] + (cur_block[8] << 8) + (cur_block[9] << 16) + (cur_block[10] << 24); int npp = cur_block[11]; int asp = cur_block[12]; if (asp == 0) asp = 256; - + UINT32 totd = cur_block[13] + (cur_block[14] << 8) + (cur_block[15] << 16) + (cur_block[16] << 24); int npd = cur_block[17]; int asd = cur_block[18]; -- cgit v1.2.3-70-g09d2 From 5a2f80dcde2e76356bf568f1e2d71b054a7db45b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 4 Dec 2015 07:06:18 +0100 Subject: clang-modernize part 5 --- src/emu/devdelegate.h | 2 +- src/emu/devfind.h | 2 +- src/emu/save.h | 2 +- src/emu/screen.h | 2 +- src/emu/sound/filter.cpp | 4 +- src/emu/sprite.h | 2 +- src/lib/formats/a26_cas.cpp | 4 +- src/lib/formats/ace_tap.cpp | 4 +- src/lib/formats/adam_cas.cpp | 2 +- src/lib/formats/ap2_dsk.cpp | 14 +- src/lib/formats/ap_dsk35.cpp | 18 +- src/lib/formats/apf_apt.cpp | 8 +- src/lib/formats/atari_dsk.cpp | 4 +- src/lib/formats/atom_tap.cpp | 2 +- src/lib/formats/basicdsk.cpp | 6 +- src/lib/formats/camplynx_cas.cpp | 6 +- src/lib/formats/cassimg.cpp | 20 +-- src/lib/formats/cbm_tap.cpp | 10 +- src/lib/formats/ccvf_dsk.cpp | 2 +- src/lib/formats/cgen_cas.cpp | 4 +- src/lib/formats/coco_cas.cpp | 4 +- src/lib/formats/cqm_dsk.cpp | 2 +- src/lib/formats/csw_cas.cpp | 14 +- src/lib/formats/d88_dsk.cpp | 4 +- src/lib/formats/dsk_dsk.cpp | 6 +- src/lib/formats/fc100_cas.cpp | 4 +- src/lib/formats/flopimg.cpp | 36 ++-- src/lib/formats/fm7_cas.cpp | 4 +- src/lib/formats/fmsx_cas.cpp | 2 +- src/lib/formats/gtp_cas.cpp | 8 +- src/lib/formats/hect_dsk.cpp | 6 +- src/lib/formats/hect_tap.cpp | 8 +- src/lib/formats/imageutl.cpp | 2 +- src/lib/formats/imd_dsk.cpp | 10 +- src/lib/formats/ioprocs.cpp | 4 +- src/lib/formats/ipf_dsk.cpp | 6 +- src/lib/formats/kc_cas.cpp | 12 +- src/lib/formats/kim1_cas.cpp | 4 +- src/lib/formats/lviv_lvt.cpp | 2 +- src/lib/formats/mbee_cas.cpp | 4 +- src/lib/formats/mfi_dsk.cpp | 4 +- src/lib/formats/mz_cas.cpp | 4 +- src/lib/formats/nes_dsk.cpp | 4 +- src/lib/formats/orao_cas.cpp | 8 +- src/lib/formats/oric_tap.cpp | 2 +- src/lib/formats/p6001_cas.cpp | 4 +- src/lib/formats/pasti_dsk.cpp | 6 +- src/lib/formats/pc_dsk.cpp | 2 +- src/lib/formats/phc25_cas.cpp | 4 +- src/lib/formats/pmd_cas.cpp | 4 +- src/lib/formats/primoptp.cpp | 2 +- src/lib/formats/rk_cas.cpp | 18 +- src/lib/formats/sc3000_bit.cpp | 2 +- src/lib/formats/sol_cas.cpp | 4 +- src/lib/formats/sorc_cas.cpp | 4 +- src/lib/formats/sorc_dsk.cpp | 4 +- src/lib/formats/sord_cas.cpp | 2 +- src/lib/formats/spc1000_cas.cpp | 8 +- src/lib/formats/svi_cas.cpp | 2 +- src/lib/formats/td0_dsk.cpp | 10 +- src/lib/formats/thom_cas.cpp | 12 +- src/lib/formats/thom_dsk.cpp | 14 +- src/lib/formats/trs_cas.cpp | 4 +- src/lib/formats/tvc_cas.cpp | 2 +- src/lib/formats/tzx_cas.cpp | 14 +- src/lib/formats/uef_cas.cpp | 18 +- src/lib/formats/vg5k_cas.cpp | 4 +- src/lib/formats/vt_cas.cpp | 8 +- src/lib/formats/x07_cas.cpp | 4 +- src/lib/formats/x1_tap.cpp | 2 +- src/lib/formats/zx81_p.cpp | 4 +- src/lib/util/chd.cpp | 2 +- src/lib/util/options.cpp | 2 +- src/lib/util/tagmap.h | 2 +- src/osd/modules/debugger/debugint.cpp | 104 +++++------ src/osd/modules/debugger/none.cpp | 2 +- src/osd/modules/debugger/win/debugbaseinfo.cpp | 4 +- src/osd/modules/debugger/win/debugwininfo.h | 2 +- src/osd/modules/debugger/win/disasmbasewininfo.cpp | 16 +- src/osd/modules/debugger/win/logwininfo.cpp | 4 +- src/osd/modules/lib/osdlib_win32.cpp | 4 +- src/osd/modules/lib/osdobj_common.h | 2 +- src/osd/modules/midi/portmidi.cpp | 6 +- src/osd/modules/osdmodule.cpp | 22 +-- src/osd/modules/render/d3d/d3d9intf.cpp | 28 +-- src/osd/modules/sync/sync_mini.cpp | 4 +- src/osd/modules/sync/sync_windows.cpp | 24 +-- src/osd/modules/sync/work_mini.cpp | 6 +- src/osd/osdcore.cpp | 2 +- src/osd/osdmini/minidir.cpp | 4 +- src/osd/osdmini/minifile.cpp | 18 +- src/osd/osdmini/minimain.cpp | 2 +- src/osd/osdmini/minimisc.cpp | 4 +- src/osd/osdnet.cpp | 6 +- src/osd/sdl/watchdog.cpp | 2 +- src/osd/windows/ledutil.cpp | 50 +++--- src/osd/windows/output.cpp | 26 +-- src/osd/windows/winsocket.cpp | 14 +- src/tools/castool.cpp | 8 +- src/tools/chdman.cpp | 194 ++++++++++---------- src/tools/floptool.cpp | 4 +- src/tools/imgtool/charconv.cpp | 8 +- src/tools/imgtool/filtbas.cpp | 88 ++++----- src/tools/imgtool/filteoln.cpp | 10 +- src/tools/imgtool/filter.cpp | 10 +- src/tools/imgtool/iflopimg.cpp | 12 +- src/tools/imgtool/imghd.cpp | 6 +- src/tools/imgtool/imgtool.cpp | 190 ++++++++++---------- src/tools/imgtool/library.cpp | 12 +- src/tools/imgtool/library.h | 6 +- src/tools/imgtool/main.cpp | 98 +++++----- src/tools/imgtool/modules.cpp | 12 +- src/tools/imgtool/stream.cpp | 44 ++--- src/tools/jedutil.cpp | 198 ++++++++++----------- src/tools/ldresample.cpp | 10 +- src/tools/ldverify.cpp | 14 +- src/tools/pngcmp.cpp | 12 +- src/tools/regrep.cpp | 86 ++++----- src/tools/romcmp.cpp | 24 +-- src/tools/split.cpp | 38 ++-- src/tools/src2html.cpp | 46 ++--- src/tools/srcclean.cpp | 6 +- src/tools/unidasm.cpp | 6 +- 123 files changed, 974 insertions(+), 974 deletions(-) (limited to 'src/lib/formats/tzx_cas.cpp') diff --git a/src/emu/devdelegate.h b/src/emu/devdelegate.h index ca4eae7b236..ee8a361ceb9 100644 --- a/src/emu/devdelegate.h +++ b/src/emu/devdelegate.h @@ -65,7 +65,7 @@ public: template device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)nullptr), device_delegate_helper(devname) { } #ifdef USE_STATIC_DELEGATE template device_delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { } - template device_delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { } + template device_delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)nullptr), device_delegate_helper(devname) { } device_delegate(typename basetype::template traits::static_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)nullptr), device_delegate_helper(NULL) { } device_delegate(typename basetype::template traits::static_ref_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)nullptr), device_delegate_helper(NULL) { } #endif diff --git a/src/emu/devfind.h b/src/emu/devfind.h index d16d7649e89..16dd1f34911 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -336,7 +336,7 @@ public: { if (isvalidation) return true; this->m_target = reinterpret_cast<_PointerType *>(this->find_memregion(sizeof(_PointerType), m_length, _Required)); - return this->report_missing(this->m_target != NULL, "memory region", _Required); + return this->report_missing(this->m_target != nullptr, "memory region", _Required); } protected: diff --git a/src/emu/save.h b/src/emu/save.h index b82b46ca32f..b4c2c3c2186 100644 --- a/src/emu/save.h +++ b/src/emu/save.h @@ -150,7 +150,7 @@ public: template void save_item(_ItemType &value, const char *valname, int index = 0) { save_item(nullptr, "global", nullptr, index, value, valname); } template - void save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { save_pointer(NULL, "global", NULL, index, value, valname, count); } + void save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { save_pointer(nullptr, "global", nullptr, index, value, valname, count); } // file processing static save_error check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...)); diff --git a/src/emu/screen.h b/src/emu/screen.h index 45caece012e..31487c7d4ea 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -457,7 +457,7 @@ typedef device_type_iterator<&device_creator, screen_device> scre template inline screen_update_ind16_delegate screen_update_delegate_smart(UINT32 (_FunctionClass::*callback)(screen_device &, bitmap_ind16 &, const rectangle &), const char *name, const char *devname) { - return screen_update_ind16_delegate(callback, name, devname, (_FunctionClass *)0); + return screen_update_ind16_delegate(callback, name, devname, (_FunctionClass *)nullptr); } template diff --git a/src/emu/sound/filter.cpp b/src/emu/sound/filter.cpp index 452dd8b3f1b..9473a8b720d 100644 --- a/src/emu/sound/filter.cpp +++ b/src/emu/sound/filter.cpp @@ -4,7 +4,7 @@ #include "filter.h" static filter* filter_alloc(void) { - auto f = global_alloc(filter); + auto f = global_alloc(filter); return f; } @@ -22,7 +22,7 @@ void filter_state_reset(filter* f, filter_state* s) { filter_state* filter_state_alloc(void) { int i; - auto s = global_alloc(filter_state); + auto s = global_alloc(filter_state); s->prev_mac = 0; for(i=0;ixprev[i] = 0; diff --git a/src/emu/sprite.h b/src/emu/sprite.h index eb8aaec71db..f10537f9900 100644 --- a/src/emu/sprite.h +++ b/src/emu/sprite.h @@ -89,7 +89,7 @@ protected: : device_t(mconfig, type, name, tag, owner, 0, shortname, file), m_xorigin(0), m_yorigin(0), - m_spriteram(NULL), + m_spriteram(nullptr), m_spriteram_bytes(0), m_dirty(dirty_granularity) { 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, §or_length, NULL); + err = fmt->get_indexed_sector_info(floppy, head, track, sector, nullptr, nullptr, nullptr, §or_length, nullptr); else err = fmt->get_sector_length(floppy, head, track, sector, §or_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 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> 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) diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp index 9f1b79081c5..38881cc8d81 100644 --- a/src/lib/util/chd.cpp +++ b/src/lib/util/chd.cpp @@ -1249,7 +1249,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex // read the metadata // TODO: how to properly allocate a dynamic char buffer? - auto metabuf = new char[metaentry.length+1]; + auto metabuf = new char[metaentry.length+1]; memset(metabuf, 0x00, metaentry.length+1); file_read(metaentry.offset + METADATA_HEADER_SIZE, metabuf, metaentry.length); output.assign(metabuf); diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp index c644fef9657..0a8ace7d9f3 100644 --- a/src/lib/util/options.cpp +++ b/src/lib/util/options.cpp @@ -255,7 +255,7 @@ bool core_options::operator!=(const core_options &rhs) void core_options::add_entry(const char *name, const char *description, UINT32 flags, const char *defvalue, bool override_existing) { // allocate a new entry - auto newentry = global_alloc(entry(name, description, flags, defvalue)); + auto newentry = global_alloc(entry(name, description, flags, defvalue)); if (newentry->name() != nullptr) { // see if we match an existing entry diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h index 600cc230985..75a67ac67ef 100644 --- a/src/lib/util/tagmap.h +++ b/src/lib/util/tagmap.h @@ -327,7 +327,7 @@ tagmap_error tagmap_t<_ElementType, _HashSize>::add_common(const char *tag, _Ele } // now allocate a new entry and add to the head of the list - auto entry = global_alloc(entry_t(tag, fullhash, object)); + auto entry = global_alloc(entry_t(tag, fullhash, object)); entry->m_next = m_table[hashindex]; m_table[hashindex] = entry; return TMERR_NONE; diff --git a/src/osd/modules/debugger/debugint.cpp b/src/osd/modules/debugger/debugint.cpp index 2598f481ca6..49ae108e881 100644 --- a/src/osd/modules/debugger/debugint.cpp +++ b/src/osd/modules/debugger/debugint.cpp @@ -28,7 +28,7 @@ class debug_internal : public osd_module, public debug_module public: debug_internal() : osd_module(OSD_DEBUG_PROVIDER, "internal"), debug_module(), - m_machine(NULL) + m_machine(nullptr) { } @@ -150,7 +150,7 @@ class DView_edit DISABLE_COPYING(DView_edit); public: - DView_edit(): active(0), container(NULL) { } + DView_edit(): active(0), container(nullptr) { } ~DView_edit() { } int active; render_container * container; @@ -170,7 +170,7 @@ class DView public: DView(render_target *target, running_machine &machine, debug_view_type type, int flags) - : next(NULL), + : next(nullptr), type(0), state(0), ofs_x(0), @@ -205,7 +205,7 @@ public: machine().debug_view().free_view(*this->view); } - running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } + running_machine &machine() const { assert(m_machine != nullptr); return *m_machine; } DView * next; @@ -259,11 +259,11 @@ INLINE void dview_set_state(DView *dv, int state, int onoff) LOCAL VARIABLES ***************************************************************************/ -static render_font * debug_font = NULL; +static render_font * debug_font = nullptr; static int debug_font_width; static int debug_font_height; static float debug_font_aspect; -static DView * list = NULL; +static DView * list = nullptr; static DView * focus_view; static ui_menu * menu; @@ -271,10 +271,10 @@ static DView_edit * cur_editor; static void set_focus_view(DView *dv) { - if (focus_view != NULL) + if (focus_view != nullptr) dview_set_state(focus_view, VIEW_STATE_NEEDS_UPDATE, TRUE); - if (dv != NULL) + if (dv != nullptr) dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE); if (focus_view != dv) @@ -863,16 +863,16 @@ static void dview_update(debug_view &dw, void *osdprivate) void debug_internal::exit() { - for (DView *ndv = list; ndv != NULL; ) + for (DView *ndv = list; ndv != nullptr; ) { DView *temp = ndv; ndv = ndv->next; dview_free(temp); } - if (debug_font != NULL) + if (debug_font != nullptr) { m_machine->render().font_free(debug_font); - debug_font = NULL; + debug_font = nullptr; } if (menu) global_free(menu); @@ -889,10 +889,10 @@ void debug_internal::init_debugger(running_machine &machine) debug_font_width = 0; debug_font_height = 15; - menu = NULL; - cur_editor = NULL; - list = NULL; - focus_view = NULL; + menu = nullptr; + cur_editor = nullptr; + list = nullptr; + focus_view = nullptr; debug_font_aspect = m_machine->render().ui_aspect(); @@ -980,7 +980,7 @@ static void on_disasm_cpu_activate(DView *dv, const ui_menu_event *event) if (event->iptkey == IPT_UI_RIGHT) { current = current->next(); - if (current == NULL) + if (current == nullptr) current = dv->view->first_source(); dv->view->set_source(*current); dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE); @@ -1111,7 +1111,7 @@ static void render_editor(DView_edit *editor) editor->container->empty(); /* get the size of the text */ editor->container->manager().machine().ui().draw_text_full(editor->container, editor->str.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, NULL); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(width, 0.5f); @@ -1131,7 +1131,7 @@ static void render_editor(DView_edit *editor) /* draw the text within it */ editor->container->manager().machine().ui().draw_text_full(editor->container, editor->str.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } @@ -1176,8 +1176,8 @@ static void CreateMainMenu(running_machine &machine) break; } - menu->item_append(title.append(focus_view->title).c_str(), NULL, MENU_FLAG_DISABLE, NULL); - menu->item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); + menu->item_append(title.append(focus_view->title).c_str(), nullptr, MENU_FLAG_DISABLE, nullptr); + menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); switch (focus_view->type) { @@ -1191,37 +1191,37 @@ static void CreateMainMenu(running_machine &machine) case DASM_RIGHTCOL_COMMENTS: subtext = "Comments"; break; } menu->item_append("View", subtext, MENU_FLAG_RIGHT_ARROW, (void *)on_view_opcodes_activate); - menu->item_append("Run to cursor", NULL, 0, (void *)on_run_to_cursor_activate); + menu->item_append("Run to cursor", nullptr, 0, (void *)on_run_to_cursor_activate); if (!dview_is_state(focus_view, VIEW_STATE_FOLLOW_CPU)) { menu->item_append("CPU", focus_view->view->source()->name(), MENU_FLAG_RIGHT_ARROW, (void *)on_disasm_cpu_activate); } - menu->item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); + menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); break; } } /* add input menu items */ - menu->item_append("New Memory Window", NULL, 0, (void *)on_memory_window_activate); - menu->item_append("New Disassembly Window", NULL, 0, (void *)on_disassembly_window_activate); - menu->item_append("New Error Log Window", NULL, 0, (void *)on_log_window_activate); - menu->item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); - menu->item_append("Run", NULL, 0, (void *)on_run_activate); - menu->item_append("Run to Next CPU", NULL, 0, (void *)on_run_cpu_activate); - menu->item_append("Run until Next Interrupt on This CPU", NULL, 0, (void *)on_run_irq_activate); - menu->item_append("Run until Next VBLANK", NULL, 0, (void *)on_run_vbl_activate); - menu->item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); - menu->item_append("Step Into", NULL, 0, (void *)on_step_into_activate); - menu->item_append("Step Over", NULL, 0, (void *)on_step_over_activate); - menu->item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); - menu->item_append("Soft Reset", NULL, 0, (void *)on_soft_reset_activate); - menu->item_append("Hard Reset", NULL, 0, (void *)on_hard_reset_activate); - menu->item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); + menu->item_append("New Memory Window", nullptr, 0, (void *)on_memory_window_activate); + menu->item_append("New Disassembly Window", nullptr, 0, (void *)on_disassembly_window_activate); + menu->item_append("New Error Log Window", nullptr, 0, (void *)on_log_window_activate); + menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); + menu->item_append("Run", nullptr, 0, (void *)on_run_activate); + menu->item_append("Run to Next CPU", nullptr, 0, (void *)on_run_cpu_activate); + menu->item_append("Run until Next Interrupt on This CPU", nullptr, 0, (void *)on_run_irq_activate); + menu->item_append("Run until Next VBLANK", nullptr, 0, (void *)on_run_vbl_activate); + menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); + menu->item_append("Step Into", nullptr, 0, (void *)on_step_into_activate); + menu->item_append("Step Over", nullptr, 0, (void *)on_step_over_activate); + menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); + menu->item_append("Soft Reset", nullptr, 0, (void *)on_soft_reset_activate); + menu->item_append("Hard Reset", nullptr, 0, (void *)on_hard_reset_activate); + menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); if (!dview_is_state(focus_view, VIEW_STATE_FOLLOW_CPU)) - menu->item_append("Close Window", NULL, 0, (void *)on_close_activate); - menu->item_append("Exit", NULL, 0, (void *)on_exit_activate); + menu->item_append("Close Window", nullptr, 0, (void *)on_close_activate); + menu->item_append("Exit", nullptr, 0, (void *)on_exit_activate); } static int map_point(DView *dv, INT32 target_x, INT32 target_y, INT32 *mapped_x, INT32 *mapped_y) @@ -1254,16 +1254,16 @@ static void handle_mouse(running_machine &machine) INT32 x,y; bool button; - if (menu != NULL) + if (menu != nullptr) return; mouse_target = ui_input_find_mouse(machine, &x, &y, &button); - if (mouse_target == NULL) + if (mouse_target == nullptr) return; //printf("mouse %d %d %d\n", x, y, button); - for (DView *dv = list; dv != NULL; dv = dv->next) + for (DView *dv = list; dv != nullptr; dv = dv->next) { if (mouse_target == dv->target) { @@ -1313,17 +1313,17 @@ static void handle_editor(running_machine &machine) break; } } - if (cur_editor != NULL) + if (cur_editor != nullptr) { render_editor(cur_editor); if (ui_input_pressed(machine, IPT_UI_SELECT)) { process_string(focus_view, focus_view->editor.str.c_str()); focus_view->editor.str = ""; - cur_editor = NULL; + cur_editor = nullptr; } if (ui_input_pressed(machine, IPT_UI_CANCEL)) - cur_editor = NULL; + cur_editor = nullptr; } } @@ -1340,11 +1340,11 @@ static void handle_menus(running_machine &machine) machine.render().ui_container().empty(); ui_input_frame_update(machine); - if (menu != NULL) + if (menu != nullptr) { /* process the menu */ event = menu->process(0); - if (event != NULL && (event->iptkey == IPT_UI_SELECT || (event->iptkey == IPT_UI_RIGHT))) + if (event != nullptr && (event->iptkey == IPT_UI_SELECT || (event->iptkey == IPT_UI_RIGHT))) { //global_free(menu); //menu = NULL; @@ -1355,7 +1355,7 @@ static void handle_menus(running_machine &machine) else if (ui_input_pressed(machine, IPT_UI_CONFIGURE)) { global_free(menu); - menu = NULL; + menu = nullptr; } } else @@ -1378,7 +1378,7 @@ static void followers_set_cpu(device_t *device) { std::string title; - for (DView *dv = list; dv != NULL; dv = dv->next) + for (DView *dv = list; dv != nullptr; dv = dv->next) { if (dview_is_state(dv, VIEW_STATE_FOLLOW_CPU)) { @@ -1420,7 +1420,7 @@ static void update_views(void) DView *dv, *prev; LIST_GET_LAST(list, dv); - while (dv != NULL) + while (dv != nullptr) { dview_update_view(dv); LIST_GET_PREVIOUS(list, dv, prev); @@ -1431,7 +1431,7 @@ static void update_views(void) void debug_internal::wait_for_debugger(device_t &device, bool firststop) { - if (firststop && list == NULL) + if (firststop && list == nullptr) { render_target *target = &device.machine().render().ui_target(); @@ -1463,7 +1463,7 @@ void debug_internal::wait_for_debugger(device_t &device, bool firststop) void debug_internal::debugger_update() { - if ((m_machine != NULL) && (!debug_cpu_is_stopped(*m_machine)) && (m_machine->phase() == MACHINE_PHASE_RUNNING)) + if ((m_machine != nullptr) && (!debug_cpu_is_stopped(*m_machine)) && (m_machine->phase() == MACHINE_PHASE_RUNNING)) { update_views(); } diff --git a/src/osd/modules/debugger/none.cpp b/src/osd/modules/debugger/none.cpp index 48085afd089..f6b22a1883a 100644 --- a/src/osd/modules/debugger/none.cpp +++ b/src/osd/modules/debugger/none.cpp @@ -16,7 +16,7 @@ class debug_none : public osd_module, public debug_module public: debug_none() : osd_module(OSD_DEBUG_PROVIDER, "none"), debug_module(), - m_machine(NULL) + m_machine(nullptr) { } diff --git a/src/osd/modules/debugger/win/debugbaseinfo.cpp b/src/osd/modules/debugger/win/debugbaseinfo.cpp index 66824b9f029..9f53899affd 100644 --- a/src/osd/modules/debugger/win/debugbaseinfo.cpp +++ b/src/osd/modules/debugger/win/debugbaseinfo.cpp @@ -25,7 +25,7 @@ void debugbase_info::smart_set_window_bounds(HWND wnd, HWND parent, RECT const & // first get the current bounds, relative to the parent GetWindowRect(wnd, &curbounds); - if (parent != NULL) + if (parent != nullptr) { RECT parentbounds; GetWindowRect(parent, &parentbounds); @@ -44,7 +44,7 @@ void debugbase_info::smart_set_window_bounds(HWND wnd, HWND parent, RECT const & // if we need to, reposition the window if (flags != (SWP_NOMOVE | SWP_NOSIZE)) - SetWindowPos(wnd, NULL, + SetWindowPos(wnd, nullptr, bounds.left, bounds.top, bounds.right - bounds.left, bounds.bottom - bounds.top, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | flags); diff --git a/src/osd/modules/debugger/win/debugwininfo.h b/src/osd/modules/debugger/win/debugwininfo.h index 78c088a5eef..08e08d79de9 100644 --- a/src/osd/modules/debugger/win/debugwininfo.h +++ b/src/osd/modules/debugger/win/debugwininfo.h @@ -24,7 +24,7 @@ public: debugwin_info(debugger_windows_interface &debugger, bool is_main_console, LPCSTR title, WNDPROC handler); virtual ~debugwin_info(); - bool is_valid() const { return m_wnd != NULL; } + bool is_valid() const { return m_wnd != nullptr; } debugwin_info *next() const { return m_next; } void set_ignore_char_lparam(LPARAM value) { m_ignore_char_lparam = value >> 16; } diff --git a/src/osd/modules/debugger/win/disasmbasewininfo.cpp b/src/osd/modules/debugger/win/disasmbasewininfo.cpp index 783cc8d75fa..f7f516ca24c 100644 --- a/src/osd/modules/debugger/win/disasmbasewininfo.cpp +++ b/src/osd/modules/debugger/win/disasmbasewininfo.cpp @@ -25,7 +25,7 @@ disasmbasewin_info::disasmbasewin_info(debugger_windows_interface &debugger, boo return; m_views[0].reset(global_alloc(disasmview_info(debugger, *this, window()))); - if ((m_views[0] == NULL) || !m_views[0]->is_valid()) + if ((m_views[0] == nullptr) || !m_views[0]->is_valid()) { m_views[0].reset(); return; @@ -115,10 +115,10 @@ void disasmbasewin_info::update_menu() // first find an existing breakpoint at this address device_debug::breakpoint *bp = debug->breakpoint_first(); - while ((bp != NULL) && (bp->address() != address)) + while ((bp != nullptr) && (bp->address() != address)) bp = bp->next(); - if (bp == NULL) + if (bp == nullptr) { ModifyMenu(menu, ID_TOGGLE_BREAKPOINT, MF_BYCOMMAND, ID_TOGGLE_BREAKPOINT, TEXT("Set breakpoint at cursor\tF9")); ModifyMenu(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND, ID_DISABLE_BREAKPOINT, TEXT("Disable breakpoint at cursor\tShift+F9")); @@ -131,7 +131,7 @@ void disasmbasewin_info::update_menu() else ModifyMenu(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND, ID_DISABLE_BREAKPOINT, TEXT("Enable breakpoint at cursor\tShift+F9")); } - bool const available = (bp != NULL) && (!is_main_console() || dasmview->source_is_visible_cpu()); + bool const available = (bp != nullptr) && (!is_main_console() || dasmview->source_is_visible_cpu()); EnableMenuItem(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND | (available ? MF_ENABLED : MF_GRAYED)); } else @@ -168,7 +168,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) INT32 bpindex = -1; // first find an existing breakpoint at this address - for (device_debug::breakpoint *bp = debug->breakpoint_first(); bp != NULL; bp = bp->next()) + for (device_debug::breakpoint *bp = debug->breakpoint_first(); bp != nullptr; bp = bp->next()) { if (address == bp->address()) { @@ -182,7 +182,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) { if (bpindex == -1) { - bpindex = debug->breakpoint_set(address, NULL, NULL); + bpindex = debug->breakpoint_set(address, nullptr, nullptr); debug_console_printf(machine(), "Breakpoint %X set\n", bpindex); } else @@ -213,11 +213,11 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam) // first find an existing breakpoint at this address device_debug::breakpoint *bp = debug->breakpoint_first(); - while ((bp != NULL) && (bp->address() != address)) + while ((bp != nullptr) && (bp->address() != address)) bp = bp->next(); // if it doesn't exist, add a new one - if (bp != NULL) + if (bp != nullptr) { if (!is_main_console()) { diff --git a/src/osd/modules/debugger/win/logwininfo.cpp b/src/osd/modules/debugger/win/logwininfo.cpp index 6610e8a296f..2f631e199d3 100644 --- a/src/osd/modules/debugger/win/logwininfo.cpp +++ b/src/osd/modules/debugger/win/logwininfo.cpp @@ -12,13 +12,13 @@ logwin_info::logwin_info(debugger_windows_interface &debugger) : - debugwin_info(debugger, false, std::string("Errorlog: ").append(debugger.machine().system().description).append(" [").append(debugger.machine().system().name).append("]").c_str(), NULL) + debugwin_info(debugger, false, std::string("Errorlog: ").append(debugger.machine().system().description).append(" [").append(debugger.machine().system().name).append("]").c_str(), nullptr) { if (!window()) return; m_views[0].reset(global_alloc(debugview_info(debugger, *this, window(), DVT_LOG))); - if ((m_views[0] == NULL) || !m_views[0]->is_valid()) + if ((m_views[0] == nullptr) || !m_views[0]->is_valid()) { m_views[0].reset(); return; diff --git a/src/osd/modules/lib/osdlib_win32.cpp b/src/osd/modules/lib/osdlib_win32.cpp index 85334fd8ddc..75218574aff 100644 --- a/src/osd/modules/lib/osdlib_win32.cpp +++ b/src/osd/modules/lib/osdlib_win32.cpp @@ -77,7 +77,7 @@ int osd_setenv(const char *name, const char *value, int overwrite) if (!overwrite) { - if (osd_getenv(name) != NULL) + if (osd_getenv(name) != nullptr) return 0; } buf = (char *) osd_malloc_array(strlen(name)+strlen(value)+2); @@ -217,7 +217,7 @@ void osd_free(void *ptr) void *osd_alloc_executable(size_t size) { - return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + return VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); } diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h index ddbc8c974d4..c3501ec84b6 100644 --- a/src/osd/modules/lib/osdobj_common.h +++ b/src/osd/modules/lib/osdobj_common.h @@ -200,7 +200,7 @@ public: // this INTERFACE but part of the osd IMPLEMENTATION // getters - running_machine &machine() { assert(m_machine != NULL); return *m_machine; } + running_machine &machine() { assert(m_machine != nullptr); return *m_machine; } virtual void debugger_update(); diff --git a/src/osd/modules/midi/portmidi.cpp b/src/osd/modules/midi/portmidi.cpp index dd75d58ff17..9aa02c63c5b 100644 --- a/src/osd/modules/midi/portmidi.cpp +++ b/src/osd/modules/midi/portmidi.cpp @@ -46,7 +46,7 @@ static const int RX_EVENT_BUF_SIZE = 512; class osd_midi_device_pm : public osd_midi_device { public: - osd_midi_device_pm(): pmStream(NULL), xmit_cnt(0), last_status(0), rx_sysex(false) { } + osd_midi_device_pm(): pmStream(nullptr), xmit_cnt(0), last_status(0), rx_sysex(false) { } virtual ~osd_midi_device_pm() { } virtual bool open_input(const char *devname); virtual bool open_output(const char *devname); @@ -147,7 +147,7 @@ bool osd_midi_device_pm::open_input(const char *devname) if (found_dev >= 0) { - if (Pm_OpenInput(&stm, found_dev, NULL, RX_EVENT_BUF_SIZE, NULL, NULL) == pmNoError) + if (Pm_OpenInput(&stm, found_dev, nullptr, RX_EVENT_BUF_SIZE, nullptr, nullptr) == pmNoError) { pmStream = stm; return true; @@ -194,7 +194,7 @@ bool osd_midi_device_pm::open_output(const char *devname) if (found_dev >= 0) { - if (Pm_OpenOutput(&stm, found_dev, NULL, 100, NULL, NULL, 0) == pmNoError) + if (Pm_OpenOutput(&stm, found_dev, nullptr, 100, nullptr, nullptr, 0) == pmNoError) { pmStream = stm; return true; diff --git a/src/osd/modules/osdmodule.cpp b/src/osd/modules/osdmodule.cpp index e0d7781ace0..1c745effc6c 100644 --- a/src/osd/modules/osdmodule.cpp +++ b/src/osd/modules/osdmodule.cpp @@ -11,13 +11,13 @@ osd_module_manager::osd_module_manager() { for (int i=0; i~osd_module(); osd_free(m_modules[i]); @@ -32,7 +32,7 @@ void osd_module_manager::register_module(const module_type &mod_type) osd_printf_verbose("===> registered module %s %s\n", module->name(), module->type()); int i; - for (i = 0; m_modules[i] != NULL; i++) + for (i = 0; m_modules[i] != nullptr; i++) ; m_modules[i] = module; } @@ -55,7 +55,7 @@ osd_module *osd_module_manager::get_module_generic(const char *type, const char if (i>=0) return m_modules[i]; else - return NULL; + return nullptr; } osd_module *osd_module_manager::select_module(const char *type, const char *name) @@ -64,7 +64,7 @@ osd_module *osd_module_manager::select_module(const char *type, const char *name // FIXME: check if already exists! int i; - for (i = 0; m_selected[i] != NULL; i++) + for (i = 0; m_selected[i] != nullptr; i++) ; m_selected[i] = m; return m; @@ -72,7 +72,7 @@ osd_module *osd_module_manager::select_module(const char *type, const char *name void osd_module_manager::init(const osd_options &options) { - for (int i = 0; m_selected[i] != NULL; i++) + for (int i = 0; m_selected[i] != nullptr; i++) { m_selected[i]->init(options); } @@ -82,18 +82,18 @@ void osd_module_manager::exit() { // Find count int cnt; - for (cnt = 0; m_selected[cnt] != NULL; cnt++) + for (cnt = 0; m_selected[cnt] != nullptr; cnt++) ; for (int i = cnt - 1; i >= 0; i--) { m_selected[i]->exit(); - m_selected[i] = NULL; + m_selected[i] = nullptr; } } int osd_module_manager::get_module_index(const char *type, const char *name) { - for (int i = 0; m_modules[i] != NULL; i++) + for (int i = 0; m_modules[i] != nullptr; i++) { if (strcmp(m_modules[i]->type(), type) == 0 && ((name[0] == 0) || (strcmp(name, m_modules[i]->name())==0))) return i; @@ -104,7 +104,7 @@ int osd_module_manager::get_module_index(const char *type, const char *name) void osd_module_manager::get_module_names(const char *type, const int max, int *num, const char *names[]) { *num = 0; - for (int i = 0; m_modules[i] != NULL; i++) + for (int i = 0; m_modules[i] != nullptr; i++) { if ((strcmp(m_modules[i]->type(), type) == 0) && (*num < max)) { diff --git a/src/osd/modules/render/d3d/d3d9intf.cpp b/src/osd/modules/render/d3d/d3d9intf.cpp index d6751b6ca21..cb8eb741f65 100644 --- a/src/osd/modules/render/d3d/d3d9intf.cpp +++ b/src/osd/modules/render/d3d/d3d9intf.cpp @@ -70,32 +70,32 @@ base *drawd3d9_init(void) // dynamically grab the create function from d3d9.dll HINSTANCE dllhandle = LoadLibrary(TEXT("d3d9.dll")); - if (dllhandle == NULL) + if (dllhandle == nullptr) { osd_printf_verbose("Direct3D: Unable to access d3d9.dll\n"); - return NULL; + return nullptr; } // import the create function direct3dcreate9_ptr direct3dcreate9 = (direct3dcreate9_ptr)GetProcAddress(dllhandle, "Direct3DCreate9"); - if (direct3dcreate9 == NULL) + if (direct3dcreate9 == nullptr) { osd_printf_verbose("Direct3D: Unable to find Direct3DCreate9\n"); FreeLibrary(dllhandle); - return NULL; + return nullptr; } // create our core direct 3d object IDirect3D9 *d3d9 = (*direct3dcreate9)(D3D_SDK_VERSION); - if (d3d9 == NULL) + if (d3d9 == nullptr) { osd_printf_verbose("Direct3D: Error attempting to initialize Direct3D9\n"); FreeLibrary(dllhandle); - return NULL; + return nullptr; } // dynamically grab the shader load function from d3dx9.dll - HINSTANCE fxhandle = NULL; + HINSTANCE fxhandle = nullptr; for (int idx = 99; idx >= 0; idx--) // a shameful moogle { #ifdef UNICODE @@ -107,19 +107,19 @@ base *drawd3d9_init(void) sprintf(dllbuf, "d3dx9_%d.dll", idx); fxhandle = LoadLibraryA(dllbuf); #endif - if (fxhandle != NULL) + if (fxhandle != nullptr) { break; } } - if (fxhandle == NULL) + if (fxhandle == nullptr) { osd_printf_verbose("Direct3D: Warning - Unable find any D3D9 DLLs; disabling post-effect rendering\n"); post_available = false; } // allocate an object to hold our data - base *d3dptr = global_alloc(base); + auto d3dptr = global_alloc(base); d3dptr->version = 9; d3dptr->d3dobj = d3d9; d3dptr->dllhandle = dllhandle; @@ -284,20 +284,20 @@ static HRESULT device_clear(device *dev, DWORD count, const D3DRECT *rects, DWOR static HRESULT device_create_offscreen_plain_surface(device *dev, UINT width, UINT height, D3DFORMAT format, D3DPOOL pool, surface **surface) { IDirect3DDevice9 *device = (IDirect3DDevice9 *)dev; - return IDirect3DDevice9_CreateOffscreenPlainSurface(device, width, height, format, pool, (IDirect3DSurface9 **)surface, NULL); + return IDirect3DDevice9_CreateOffscreenPlainSurface(device, width, height, format, pool, (IDirect3DSurface9 **)surface, nullptr); } static HRESULT device_create_texture(device *dev, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, texture **texture) { IDirect3DDevice9 *device = (IDirect3DDevice9 *)dev; - return IDirect3DDevice9_CreateTexture(device, width, height, levels, usage, format, pool, (IDirect3DTexture9 **)texture, NULL); + return IDirect3DDevice9_CreateTexture(device, width, height, levels, usage, format, pool, (IDirect3DTexture9 **)texture, nullptr); } static HRESULT device_create_vertex_buffer(device *dev, UINT length, DWORD usage, DWORD fvf, D3DPOOL pool, vertex_buffer **buf) { IDirect3DDevice9 *device = (IDirect3DDevice9 *)dev; - return IDirect3DDevice9_CreateVertexBuffer(device, length, usage, fvf, pool, (IDirect3DVertexBuffer9 **)buf, NULL); + return IDirect3DDevice9_CreateVertexBuffer(device, length, usage, fvf, pool, (IDirect3DVertexBuffer9 **)buf, nullptr); } @@ -395,7 +395,7 @@ static HRESULT device_set_render_target(device *dev, DWORD index, surface *surf) static HRESULT device_create_render_target(device *dev, UINT width, UINT height, D3DFORMAT format, surface **surface) { IDirect3DDevice9 *device = (IDirect3DDevice9 *)dev; - return IDirect3DDevice9_CreateRenderTarget(device, width, height, format, D3DMULTISAMPLE_NONE, 0, false, (IDirect3DSurface9 **)surface, NULL); + return IDirect3DDevice9_CreateRenderTarget(device, width, height, format, D3DMULTISAMPLE_NONE, 0, false, (IDirect3DSurface9 **)surface, nullptr); } diff --git a/src/osd/modules/sync/sync_mini.cpp b/src/osd/modules/sync/sync_mini.cpp index a09303aed80..f5e6accb0c7 100644 --- a/src/osd/modules/sync/sync_mini.cpp +++ b/src/osd/modules/sync/sync_mini.cpp @@ -82,7 +82,7 @@ void osd_lock_free(osd_lock *lock) osd_event *osd_event_alloc(int manualreset, int initialstate) { - return NULL; + return nullptr; } @@ -129,7 +129,7 @@ int osd_event_wait(osd_event *event, osd_ticks_t timeout) osd_thread *osd_thread_create(osd_thread_callback callback, void *cbparam) { - return NULL; + return nullptr; } diff --git a/src/osd/modules/sync/sync_windows.cpp b/src/osd/modules/sync/sync_windows.cpp index c3d93c75fc9..9439d68b72c 100644 --- a/src/osd/modules/sync/sync_windows.cpp +++ b/src/osd/modules/sync/sync_windows.cpp @@ -68,7 +68,7 @@ struct osd_scalable_lock // GLOBAL VARIABLES //============================================================ -static try_enter_critical_section_ptr try_enter_critical_section = NULL; +static try_enter_critical_section_ptr try_enter_critical_section = nullptr; static int checked_for_try_enter = FALSE; @@ -80,8 +80,8 @@ static int checked_for_try_enter = FALSE; osd_lock *osd_lock_alloc(void) { osd_lock *lock = (osd_lock *)malloc(sizeof(*lock)); - if (lock == NULL) - return NULL; + if (lock == nullptr) + return nullptr; InitializeCriticalSection(&lock->critsect); return lock; } @@ -121,13 +121,13 @@ int osd_lock_try(osd_lock *lock) { // see if we can use TryEnterCriticalSection HMODULE library = LoadLibrary(TEXT("kernel32.dll")); - if (library != NULL) + if (library != nullptr) try_enter_critical_section = (try_enter_critical_section_ptr)GetProcAddress(library, "TryEnterCriticalSection"); checked_for_try_enter = TRUE; } // if we have it, use it, otherwise just block - if (try_enter_critical_section != NULL) + if (try_enter_critical_section != nullptr) result = (*try_enter_critical_section)(&lock->critsect); else EnterCriticalSection(&lock->critsect); @@ -203,7 +203,7 @@ INT32 win_atomic_add32(INT32 volatile *ptr, INT32 delta) osd_event *osd_event_alloc(int manualreset, int initialstate) { - return (osd_event *) CreateEvent(NULL, manualreset, initialstate, NULL); + return (osd_event *) CreateEvent(nullptr, manualreset, initialstate, nullptr); } //============================================================ @@ -271,15 +271,15 @@ osd_thread *osd_thread_create(osd_thread_callback callback, void *cbparam) uintptr_t handle; thread = (osd_thread *)calloc(1, sizeof(osd_thread)); - if (thread == NULL) - return NULL; + if (thread == nullptr) + return nullptr; thread->callback = callback; thread->param = cbparam; - handle = _beginthreadex(NULL, 0, worker_thread_entry, thread, 0, NULL); + handle = _beginthreadex(nullptr, 0, worker_thread_entry, thread, 0, nullptr); if (handle == 0) { free(thread); - return NULL; + return nullptr; } thread->handle = (HANDLE) handle; return thread; @@ -327,8 +327,8 @@ osd_scalable_lock *osd_scalable_lock_alloc(void) osd_scalable_lock *lock; lock = (osd_scalable_lock *)calloc(1, sizeof(*lock)); - if (lock == NULL) - return NULL; + if (lock == nullptr) + return nullptr; memset(lock, 0, sizeof(*lock)); #if USE_SCALABLE_LOCKS diff --git a/src/osd/modules/sync/work_mini.cpp b/src/osd/modules/sync/work_mini.cpp index fd359c6ee40..3d4b10fc539 100644 --- a/src/osd/modules/sync/work_mini.cpp +++ b/src/osd/modules/sync/work_mini.cpp @@ -80,8 +80,8 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call // allocate memory to hold the result item = (osd_work_item *)malloc(sizeof(*item)); - if (item == NULL) - return NULL; + if (item == nullptr) + return nullptr; // loop over all requested items for (itemnum = 0; itemnum < numitems; itemnum++) @@ -97,7 +97,7 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call if (flags & WORK_ITEM_FLAG_AUTO_RELEASE) { free(item); - item = NULL; + item = nullptr; } return item; } diff --git a/src/osd/osdcore.cpp b/src/osd/osdcore.cpp index 82bbf1ee63b..91ba3fc4266 100644 --- a/src/osd/osdcore.cpp +++ b/src/osd/osdcore.cpp @@ -17,7 +17,7 @@ void osd_output::push(osd_output *delegate) { if (m_ptr < MAXSTACK) { - delegate->m_chain = (m_ptr >= 0 ? m_stack[m_ptr] : NULL); + delegate->m_chain = (m_ptr >= 0 ? m_stack[m_ptr] : nullptr); m_ptr++; m_stack[m_ptr] = delegate; } diff --git a/src/osd/osdmini/minidir.cpp b/src/osd/osdmini/minidir.cpp index 66b815daabb..e061b644cdf 100644 --- a/src/osd/osdmini/minidir.cpp +++ b/src/osd/osdmini/minidir.cpp @@ -17,7 +17,7 @@ osd_directory *osd_opendir(const char *dirname) { // since there are no standard C library routines for walking directories, // we always return an error here - return NULL; + return nullptr; } @@ -29,7 +29,7 @@ const osd_directory_entry *osd_readdir(osd_directory *dir) { // since there are no standard C library routines for walking directories, // we always return an error here - return NULL; + return nullptr; } diff --git a/src/osd/osdmini/minifile.cpp b/src/osd/osdmini/minifile.cpp index b55a3ad77e9..b30b566585c 100644 --- a/src/osd/osdmini/minifile.cpp +++ b/src/osd/osdmini/minifile.cpp @@ -35,7 +35,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64 // open the file fileptr = fopen(path, mode); - if (fileptr == NULL) + if (fileptr == nullptr) return FILERR_NOT_FOUND; // store the file pointer directly as an osd_file @@ -75,7 +75,7 @@ file_error osd_read(osd_file *file, void *buffer, UINT64 offset, UINT32 length, // perform the read count = fread(buffer, 1, length, (FILE *)file); - if (actual != NULL) + if (actual != nullptr) *actual = count; return FILERR_NONE; @@ -95,7 +95,7 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 l // perform the write count = fwrite(buffer, 1, length, (FILE *)file); - if (actual != NULL) + if (actual != nullptr) *actual = count; return FILERR_NONE; @@ -169,7 +169,7 @@ int osd_uchar_from_osdchar(UINT32 /* unicode_char */ *uchar, const char *osdchar osd_directory_entry *osd_stat(const char *path) { - osd_directory_entry *result = NULL; + osd_directory_entry *result = nullptr; // create an osd_directory_entry; be sure to make sure that the caller can // free all resources by just freeing the resulting osd_directory_entry @@ -180,7 +180,7 @@ osd_directory_entry *osd_stat(const char *path) result->size = 0; FILE *f = fopen(path, "rb"); - if (f != NULL) + if (f != nullptr) { fseek(f, 0, SEEK_END); result->type = ENTTYPE_FILE; @@ -199,11 +199,11 @@ file_error osd_get_full_path(char **dst, const char *path) { // derive the full path of the file in an allocated string // for now just fake it since we don't presume any underlying file system - *dst = NULL; - if (path != NULL) + *dst = nullptr; + if (path != nullptr) { *dst = (char *)osd_malloc_array(strlen(path) + 1); - if (*dst != NULL) + if (*dst != nullptr) strcpy(*dst, path); } @@ -218,5 +218,5 @@ file_error osd_get_full_path(char **dst, const char *path) const char *osd_get_volume_name(int idx) { // we don't expose volumes - return NULL; + return nullptr; } diff --git a/src/osd/osdmini/minimain.cpp b/src/osd/osdmini/minimain.cpp index c0598e65dfd..18fbba1bc37 100644 --- a/src/osd/osdmini/minimain.cpp +++ b/src/osd/osdmini/minimain.cpp @@ -117,7 +117,7 @@ void mini_osd_interface::init(running_machine &machine) // initialize the input system by adding devices // let's pretend like we have a keyboard device keyboard_device = machine.input().device_class(DEVICE_CLASS_KEYBOARD).add_device("Keyboard"); - if (keyboard_device == NULL) + if (keyboard_device == nullptr) fatalerror("Error creating keyboard device\n"); // our faux keyboard only has a couple of keys (corresponding to the diff --git a/src/osd/osdmini/minimisc.cpp b/src/osd/osdmini/minimisc.cpp index 21d658ace5b..c6bb413b292 100644 --- a/src/osd/osdmini/minimisc.cpp +++ b/src/osd/osdmini/minimisc.cpp @@ -79,7 +79,7 @@ void osd_break_into_debugger(const char *message) char *osd_get_clipboard_text(void) { // can't support clipboards generically - return NULL; + return nullptr; } //============================================================ @@ -88,7 +88,7 @@ char *osd_get_clipboard_text(void) const char *osd_getenv(const char *name) { - return NULL; + return nullptr; } //============================================================ diff --git a/src/osd/osdnet.cpp b/src/osd/osdnet.cpp index 4c167251cea..057a562ee76 100644 --- a/src/osd/osdnet.cpp +++ b/src/osd/osdnet.cpp @@ -7,11 +7,11 @@ static class simple_list netdev_list; void add_netdev(const char *name, const char *description, create_netdev func) { - osd_netdev::entry_t *entry = global_alloc_clear(osd_netdev::entry_t); + auto entry = global_alloc_clear(osd_netdev::entry_t); entry->id = netdev_list.count(); strncpy(entry->name, name, 255); entry->name[255] = '\0'; - strncpy(entry->description, (description != NULL) ? description : "(no name)", 255); + strncpy(entry->description, (description != nullptr) ? description : "(no name)", 255); entry->description[255] = '\0'; entry->func = func; netdev_list.append(*entry); @@ -35,7 +35,7 @@ class osd_netdev *open_netdev(int id, class device_network_interface *ifdev, int entry = entry->m_next; } - return NULL; + return nullptr; } osd_netdev::osd_netdev(class device_network_interface *ifdev, int rate) diff --git a/src/osd/sdl/watchdog.cpp b/src/osd/sdl/watchdog.cpp index c3fef7a7709..01d98f460dc 100644 --- a/src/osd/sdl/watchdog.cpp +++ b/src/osd/sdl/watchdog.cpp @@ -38,7 +38,7 @@ static void *watchdog_thread(void *param) osd_process_kill(); } } - return NULL; + return nullptr; } watchdog::watchdog(void) diff --git a/src/osd/windows/ledutil.cpp b/src/osd/windows/ledutil.cpp index 6788fdaf53e..6106005145e 100644 --- a/src/osd/windows/ledutil.cpp +++ b/src/osd/windows/ledutil.cpp @@ -180,13 +180,13 @@ int main(int argc, char *argv[]) // if the argument is "-kill", post a close message if (strcmp(arg, "-kill") == 0) { - if (otherwnd != NULL) + if (otherwnd != nullptr) PostMessage(otherwnd, WM_QUIT, 0, 0); - return (otherwnd != NULL) ? 1 : 0; + return (otherwnd != nullptr) ? 1 : 0; } // if we had another instance, defer to it - if (otherwnd != NULL) + if (otherwnd != nullptr) return 0; // call the startup code @@ -205,11 +205,11 @@ int main(int argc, char *argv[]) WINDOW_STYLE, 0, 0, 1, 1, - NULL, - NULL, - GetModuleHandle(NULL), - NULL); - if (listener_hwnd == NULL) + nullptr, + nullptr, + GetModuleHandle(nullptr), + nullptr); + if (listener_hwnd == nullptr) goto error; // allocate message ids @@ -235,18 +235,18 @@ int main(int argc, char *argv[]) // see if MAME is already running otherwnd = FindWindow(OUTPUT_WINDOW_CLASS, OUTPUT_WINDOW_NAME); - if (otherwnd != NULL) + if (otherwnd != nullptr) handle_mame_start((WPARAM)otherwnd, 0); // process messages - while (GetMessage(&message, NULL, 0, 0)) + while (GetMessage(&message, nullptr, 0, 0)) { TranslateMessage(&message); DispatchMessage(&message); } // reset on the way out if still live - if (mame_target != NULL) + if (mame_target != nullptr) handle_mame_stop((WPARAM)mame_target, 0); exitcode = 0; @@ -273,7 +273,7 @@ static int create_window_class(void) // initialize the description of the window class wc.lpszClassName = WINDOW_CLASS; - wc.hInstance = GetModuleHandle(NULL); + wc.hInstance = GetModuleHandle(nullptr); wc.lpfnWndProc = listener_window_proc; // register the class; fail if we can't @@ -351,7 +351,7 @@ static LRESULT handle_mame_stop(WPARAM wparam, LPARAM lparam) return 1; // clear our target out - mame_target = NULL; + mame_target = nullptr; reset_id_to_outname_cache(); // reset the LED states @@ -379,11 +379,11 @@ static LRESULT handle_copydata(WPARAM wparam, LPARAM lparam) // allocate memory entry = (id_map_entry *)malloc(sizeof(*entry)); - if (entry == NULL) + if (entry == nullptr) return 0; string = (char *)malloc(strlen(data->string) + 1); - if (string == NULL) + if (string == nullptr) { free(entry); return 0; @@ -411,7 +411,7 @@ static LRESULT handle_copydata(WPARAM wparam, LPARAM lparam) static void reset_id_to_outname_cache(void) { // free our ID list - while (idmaplist != NULL) + while (idmaplist != nullptr) { id_map_entry *temp = idmaplist; idmaplist = temp->next; @@ -430,7 +430,7 @@ static const char *map_id_to_outname(WPARAM id) id_map_entry *entry; // see if we have an entry in our map - for (entry = idmaplist; entry != NULL; entry = entry->next) + for (entry = idmaplist; entry != nullptr; entry = entry->next) if (entry->id == id) return entry->name; @@ -438,7 +438,7 @@ static const char *map_id_to_outname(WPARAM id) SendMessage(mame_target, om_mame_get_id_string, (WPARAM)listener_hwnd, id); // now see if we have the entry in our map - for (entry = idmaplist; entry != NULL; entry = entry->next) + for (entry = idmaplist; entry != nullptr; entry = entry->next) if (entry->id == id) return entry->name; @@ -476,7 +476,7 @@ static void output_startup(const char *commandline) { // default to PS/2, override if USB is specified as a parameter ledmethod = LED_METHOD_PS2; - if (commandline != NULL && strcmp(commandline, "-usb") == 0) + if (commandline != nullptr && strcmp(commandline, "-usb") == 0) ledmethod = LED_METHOD_USB; // output the method @@ -522,7 +522,7 @@ static void output_mame_start(void) return; } - hKbdDev = CreateFile(TEXT("\\\\.\\Kbd"), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); + hKbdDev = CreateFile(TEXT("\\\\.\\Kbd"), GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr); if (hKbdDev == INVALID_HANDLE_VALUE) { error_number = GetLastError(); @@ -551,7 +551,7 @@ static void output_mame_stop(void) switch (ledmethod) { case LED_METHOD_PS2: - if (!DefineDosDevice(DDD_REMOVE_DEFINITION, TEXT("Kbd"), NULL)) + if (!DefineDosDevice(DDD_REMOVE_DEFINITION, TEXT("Kbd"), nullptr)) { error_number = GetLastError(); fprintf(stderr, "Unable to close the keyboard device. (error %d)\n", error_number); @@ -632,9 +632,9 @@ static int led_get_state(void) OutputBuffer.UnitId = 0; DeviceIoControl(hKbdDev, IOCTL_KEYBOARD_QUERY_INDICATORS, - NULL, 0, + nullptr, 0, &OutputBuffer, DataLength, - &ReturnedLength, NULL); + &ReturnedLength, nullptr); // Demangle lights to match 95/98 if (OutputBuffer.LedFlags & KEYBOARD_NUM_LOCK_ON) result |= 0x1; @@ -702,8 +702,8 @@ static void led_set_state(int state) InputBuffer.LedFlags = LedFlags; DeviceIoControl(hKbdDev, IOCTL_KEYBOARD_SET_INDICATORS, &InputBuffer, DataLength, - NULL, 0, - &ReturnedLength, NULL); + nullptr, 0, + &ReturnedLength, nullptr); break; } } diff --git a/src/osd/windows/output.cpp b/src/osd/windows/output.cpp index 41f2fd26201..0419d9bc2a7 100644 --- a/src/osd/windows/output.cpp +++ b/src/osd/windows/output.cpp @@ -85,7 +85,7 @@ bool windows_osd_interface::output_init() int result; // reset globals - clientlist = NULL; + clientlist = nullptr; // create our window class result = create_window_class(); @@ -100,11 +100,11 @@ bool windows_osd_interface::output_init() WINDOW_STYLE, 0, 0, 1, 1, - NULL, - NULL, + nullptr, + nullptr, GetModuleHandleUni(), - NULL); - assert(output_hwnd != NULL); + nullptr); + assert(output_hwnd != nullptr); // set a pointer to the running machine SetWindowLongPtr(output_hwnd, GWLP_USERDATA, (LONG_PTR)&machine()); @@ -128,7 +128,7 @@ bool windows_osd_interface::output_init() PostMessage(HWND_BROADCAST, om_mame_start, (WPARAM)output_hwnd, 0); // register a notifier for output changes - output_set_notifier(NULL, notifier_callback, NULL); + output_set_notifier(nullptr, notifier_callback, nullptr); return true; } @@ -141,7 +141,7 @@ bool windows_osd_interface::output_init() void windows_osd_interface::output_exit() { // free all the clients - while (clientlist != NULL) + while (clientlist != nullptr) { registered_client *temp = clientlist; clientlist = temp->next; @@ -219,7 +219,7 @@ static LRESULT register_client(HWND hwnd, LPARAM id) // find the end of the list; if we find ourself already registered, // return 1 - for (client = &clientlist; *client != NULL; client = &(*client)->next) + for (client = &clientlist; *client != nullptr; client = &(*client)->next) if ((*client)->id == id) { (*client)->hwnd = hwnd; @@ -229,7 +229,7 @@ static LRESULT register_client(HWND hwnd, LPARAM id) // add us to the end *client = global_alloc(registered_client); - (*client)->next = NULL; + (*client)->next = nullptr; (*client)->id = id; (*client)->hwnd = hwnd; @@ -249,7 +249,7 @@ static LRESULT unregister_client(HWND hwnd, LPARAM id) int found = FALSE; // find any matching IDs in the list and remove them - for (client = &clientlist; *client != NULL; client = &(*client)->next) + for (client = &clientlist; *client != nullptr; client = &(*client)->next) if ((*client)->id == id) { registered_client *temp = *client; @@ -281,7 +281,7 @@ static LRESULT send_id_string(running_machine &machine, HWND hwnd, LPARAM id) name = output_id_to_name(id); // a NULL name is an empty string - if (name == NULL) + if (name == nullptr) name = ""; // allocate memory for the message @@ -310,7 +310,7 @@ static void notifier_callback(const char *outname, INT32 value, void *param) registered_client *client; // loop over clients and notify them - for (client = clientlist; client != NULL; client = client->next) - if (param == NULL || param == client) + for (client = clientlist; client != nullptr; client = client->next) + if (param == nullptr || param == client) PostMessage(client->hwnd, om_mame_update_state, output_name_to_id(outname), value); } diff --git a/src/osd/windows/winsocket.cpp b/src/osd/windows/winsocket.cpp index 78c3a6161d4..cfa22dbbcb1 100644 --- a/src/osd/windows/winsocket.cpp +++ b/src/osd/windows/winsocket.cpp @@ -59,7 +59,7 @@ bool win_check_socket_path(const char *path) { if (strlen(winfile_socket_identifier) > 0 && strncmp(path, winfile_socket_identifier, strlen(winfile_socket_identifier)) == 0 && - strchr(path, ':') != NULL) return true; + strchr(path, ':') != nullptr) return true; return false; } @@ -105,7 +105,7 @@ file_error win_open_socket(const char *path, UINT32 openflags, osd_file **file, } // mark socket as "listening" - (*file)->handle = 0; + (*file)->handle = nullptr; *filesize = 0; return FILERR_NONE; } @@ -131,7 +131,7 @@ file_error win_read_socket(osd_file *file, void *buffer, UINT64 offset, UINT32 c FD_SET(file->socket, &readfds); timeout.tv_sec = timeout.tv_usec = 0; - if (select(file->socket + 1, &readfds, NULL, NULL, &timeout) < 0) + if (select(file->socket + 1, &readfds, nullptr, nullptr, &timeout) < 0) { sprintf(line, "win_read_socket : %s : %d ", __FILE__, __LINE__); perror(line); @@ -148,7 +148,7 @@ file_error win_read_socket(osd_file *file, void *buffer, UINT64 offset, UINT32 c { // listening socket SOCKET AcceptSocket; - AcceptSocket = accept(file->socket, NULL, NULL); + AcceptSocket = accept(file->socket, nullptr, nullptr); if (AcceptSocket == INVALID_SOCKET) { return FILERR_FAILURE; @@ -156,7 +156,7 @@ file_error win_read_socket(osd_file *file, void *buffer, UINT64 offset, UINT32 c closesocket(file->socket); file->socket = AcceptSocket; file->handle = INVALID_HANDLE_VALUE; - if (actual != NULL ) + if (actual != nullptr ) { *actual = 0; } @@ -174,7 +174,7 @@ file_error win_read_socket(osd_file *file, void *buffer, UINT64 offset, UINT32 c return win_error_to_mame_file_error(GetLastError()); } - if (actual != NULL ) + if (actual != nullptr ) { *actual = result; } @@ -190,7 +190,7 @@ file_error win_write_socket(osd_file *file, const void *buffer, UINT64 offset, U return win_error_to_mame_file_error(GetLastError()); } - if (actual != NULL ) + if (actual != nullptr ) { *actual = result; } diff --git a/src/tools/castool.cpp b/src/tools/castool.cpp index 22564dcdf78..a6b5c190b72 100644 --- a/src/tools/castool.cpp +++ b/src/tools/castool.cpp @@ -121,7 +121,7 @@ const struct SupportedCassetteFormats formats[] = { - {NULL,NULL,NULL} + {nullptr,nullptr,nullptr} }; @@ -129,9 +129,9 @@ static const char *get_extension(const char *name) { const char *s; s = name; - if (s != NULL) + if (s != nullptr) s = strrchr(s, '.'); - return s ? s+1 : NULL; + return s ? s+1 : nullptr; } static void display_usage(void) @@ -156,7 +156,7 @@ int CLIB_DECL main(int argc, char *argv[]) { int i; int found =0; - const struct CassetteFormat * const *selected_formats = NULL; + const struct CassetteFormat * const *selected_formats = nullptr; cassette_image *cassette; FILE *f; diff --git a/src/tools/chdman.cpp b/src/tools/chdman.cpp index 3ea0a31f752..691fc71b47b 100644 --- a/src/tools/chdman.cpp +++ b/src/tools/chdman.cpp @@ -189,7 +189,7 @@ public: chd_rawfile_compressor(core_file *file, UINT64 offset = 0, UINT64 maxoffset = ~0) : m_file(file), m_offset(offset), - m_maxoffset(MIN(maxoffset, (file != NULL) ? core_fsize(file) : 0)) { } + m_maxoffset(MIN(maxoffset, (file != nullptr) ? core_fsize(file) : 0)) { } // read interface virtual UINT32 read_data(void *dest, UINT64 offset, UINT32 length) @@ -218,7 +218,7 @@ class chd_chdfile_compressor : public chd_file_compressor public: // construction/destruction chd_chdfile_compressor(chd_file &file, UINT64 offset = 0, UINT64 maxoffset = ~0) - : m_toc(NULL), + : m_toc(nullptr), m_file(file), m_offset(offset), m_maxoffset(MIN(maxoffset, file.logical_bytes())) { } @@ -289,13 +289,13 @@ class chd_cd_compressor : public chd_file_compressor public: // construction/destruction chd_cd_compressor(cdrom_toc &toc, chdcd_track_input_info &info) - : m_file(NULL), + : m_file(nullptr), m_toc(toc), m_info(info) { } ~chd_cd_compressor() { - if (m_file != NULL) + if (m_file != nullptr) core_fclose(m_file); } @@ -320,9 +320,9 @@ public: if (offset >= startoffs && offset < endoffs) { // if we don't already have this file open, open it now - if (m_file == NULL || m_lastfile.compare(m_info.track[tracknum].fname)!=0) + if (m_file == nullptr || m_lastfile.compare(m_info.track[tracknum].fname)!=0) { - if (m_file != NULL) + if (m_file != nullptr) core_fclose(m_file); m_lastfile = m_info.track[tracknum].fname; file_error filerr = core_fopen(m_lastfile.c_str(), OPEN_FLAG_READ, &m_file); @@ -764,10 +764,10 @@ static void ATTR_PRINTF(2,3) progress(bool forceit, const char *format, ...) // print_help - print help for all the commands //------------------------------------------------- -static int print_help(const char *argv0, const char *error = NULL) +static int print_help(const char *argv0, const char *error = nullptr) { // print the error message first - if (error != NULL) + if (error != nullptr) fprintf(stderr, "Error: %s\n\n", error); // print a summary of each command @@ -788,10 +788,10 @@ static int print_help(const char *argv0, const char *error = NULL) // command //------------------------------------------------- -static int print_help(const char *argv0, const command_description &desc, const char *error = NULL) +static int print_help(const char *argv0, const command_description &desc, const char *error = nullptr) { // print the error message first - if (error != NULL) + if (error != nullptr) fprintf(stderr, "Error: %s\n\n", error); // print usage for this command @@ -801,7 +801,7 @@ static int print_help(const char *argv0, const command_description &desc, const { // determine whether we are required const char *option = desc.valid_options[valid]; - if (option == NULL) + if (option == nullptr) break; bool required = (option[0] == REQUIRED[0]); if (required) @@ -813,7 +813,7 @@ static int print_help(const char *argv0, const command_description &desc, const { const option_description &odesc = s_options[optnum]; printf(" --%s", odesc.name); - if (odesc.shortname != NULL) + if (odesc.shortname != nullptr) printf(", -%s", odesc.shortname); printf("%s%s\n", odesc.description, required ? " (required)" : ""); } @@ -904,7 +904,7 @@ UINT64 parse_number(const char *string) static void guess_chs(std::string *filename, UINT64 filesize, int sectorsize, UINT32 &cylinders, UINT32 &heads, UINT32 §ors, UINT32 &bps) { // if this is a direct physical drive read, handle it specially - if (filename != NULL && osd_get_physical_drive_geometry(filename->c_str(), &cylinders, &heads, §ors, &bps)) + if (filename != nullptr && osd_get_physical_drive_geometry(filename->c_str(), &cylinders, &heads, §ors, &bps)) return; // if we have no length to work with, we can't guess @@ -941,7 +941,7 @@ static void parse_input_chd_parameters(const parameters_t ¶ms, chd_file &inp { // process input parent file std::string *input_chd_parent_str = params.find(OPTION_INPUT_PARENT); - if (input_chd_parent_str != NULL) + if (input_chd_parent_str != nullptr) { chd_error err = input_parent_chd.open(input_chd_parent_str->c_str()); if (err != CHDERR_NONE) @@ -950,9 +950,9 @@ static void parse_input_chd_parameters(const parameters_t ¶ms, chd_file &inp // process input file std::string *input_chd_str = params.find(OPTION_INPUT); - if (input_chd_str != NULL) + if (input_chd_str != nullptr) { - chd_error err = input_chd.open(input_chd_str->c_str(), writeable, input_parent_chd.opened() ? &input_parent_chd : NULL); + chd_error err = input_chd.open(input_chd_str->c_str(), writeable, input_parent_chd.opened() ? &input_parent_chd : nullptr); if (err != CHDERR_NONE) report_error(1, "Error opening CHD file (%s): %s", input_chd_str->c_str(), chd_file::error_string(err)); } @@ -974,11 +974,11 @@ static void parse_input_start_end(const parameters_t ¶ms, UINT64 logical_siz std::string *input_start_byte_str = params.find(OPTION_INPUT_START_BYTE); std::string *input_start_hunk_str = params.find(OPTION_INPUT_START_HUNK); std::string *input_start_frame_str = params.find(OPTION_INPUT_START_FRAME); - if (input_start_byte_str != NULL) + if (input_start_byte_str != nullptr) input_start = parse_number(input_start_byte_str->c_str()); - if (input_start_hunk_str != NULL) + if (input_start_hunk_str != nullptr) input_start = parse_number(input_start_hunk_str->c_str()) * hunkbytes; - if (input_start_frame_str != NULL) + if (input_start_frame_str != nullptr) input_start = parse_number(input_start_frame_str->c_str()) * framebytes; if (input_start >= input_end) report_error(1, "Input start offset greater than input file size"); @@ -988,11 +988,11 @@ static void parse_input_start_end(const parameters_t ¶ms, UINT64 logical_siz std::string *input_length_hunks_str = params.find(OPTION_INPUT_LENGTH_HUNKS); std::string *input_length_frames_str = params.find(OPTION_INPUT_LENGTH_FRAMES); UINT64 input_length = input_end; - if (input_length_bytes_str != NULL) + if (input_length_bytes_str != nullptr) input_length = parse_number(input_length_bytes_str->c_str()); - if (input_length_hunks_str != NULL) + if (input_length_hunks_str != nullptr) input_length = parse_number(input_length_hunks_str->c_str()) * hunkbytes; - if (input_length_frames_str != NULL) + if (input_length_frames_str != nullptr) input_length = parse_number(input_length_frames_str->c_str()) * framebytes; if (input_start + input_length < input_end) input_end = input_start + input_length; @@ -1007,7 +1007,7 @@ static void parse_input_start_end(const parameters_t ¶ms, UINT64 logical_siz static void check_existing_output_file(const parameters_t ¶ms, const char *filename) { - if (params.find(OPTION_OUTPUT_FORCE) == NULL) + if (params.find(OPTION_OUTPUT_FORCE) == nullptr) { core_file *file; file_error filerr = core_fopen(filename, OPEN_FLAG_READ, &file); @@ -1029,7 +1029,7 @@ static std::string *parse_output_chd_parameters(const parameters_t ¶ms, chd_ { // process output parent file std::string *output_chd_parent_str = params.find(OPTION_OUTPUT_PARENT); - if (output_chd_parent_str != NULL) + if (output_chd_parent_str != nullptr) { chd_error err = output_parent_chd.open(output_chd_parent_str->c_str()); if (err != CHDERR_NONE) @@ -1038,7 +1038,7 @@ static std::string *parse_output_chd_parameters(const parameters_t ¶ms, chd_ // process output file std::string *output_chd_str = params.find(OPTION_OUTPUT); - if (output_chd_str != NULL) + if (output_chd_str != nullptr) check_existing_output_file(params, output_chd_str->c_str()); return output_chd_str; } @@ -1052,7 +1052,7 @@ static std::string *parse_output_chd_parameters(const parameters_t ¶ms, chd_ static void parse_hunk_size(const parameters_t ¶ms, UINT32 required_granularity, UINT32 &hunk_size) { std::string *hunk_size_str = params.find(OPTION_HUNK_SIZE); - if (hunk_size_str != NULL) + if (hunk_size_str != nullptr) { hunk_size = parse_number(hunk_size_str->c_str()); if (hunk_size < 16 || hunk_size > 1024 * 1024) @@ -1072,7 +1072,7 @@ static void parse_compression(const parameters_t ¶ms, chd_codec_type compres { // see if anything was specified std::string *compression_str = params.find(OPTION_COMPRESSION); - if (compression_str == NULL) + if (compression_str == nullptr) return; // special case: 'none' @@ -1112,7 +1112,7 @@ static void parse_compression(const parameters_t ¶ms, chd_codec_type compres static void parse_numprocessors(const parameters_t ¶ms) { std::string *numprocessors_str = params.find(OPTION_NUMPROCESSORS); - if (numprocessors_str == NULL) + if (numprocessors_str == nullptr) return; int count = atoi(numprocessors_str->c_str()); @@ -1234,7 +1234,7 @@ void output_track_metadata(int mode, core_file *file, int tracknum, const cdrom_ size = 2352; break; } - bool needquote = strchr(filename, ' ') != NULL; + bool needquote = strchr(filename, ' ') != nullptr; core_fprintf(file, "%d %d %d %d %s%s%s %" I64FMT "d\n", tracknum+1, frameoffs, mode, size, needquote?"\"":"", filename, needquote?"\"":"", discoffs); } else if (mode == MODE_CUEBIN) @@ -1421,7 +1421,7 @@ static void do_info(parameters_t ¶ms) } // print compression stats if verbose - if (params.find(OPTION_VERBOSE) != NULL) + if (params.find(OPTION_VERBOSE) != nullptr) { UINT32 compression_types[10] = { 0 }; for (UINT32 hunknum = 0; hunknum < input_chd.hunk_count(); hunknum++) @@ -1528,7 +1528,7 @@ static void do_verify(parameters_t ¶ms) fprintf(stderr, " actual SHA1 = %s\n", computed_sha1.as_string(tempstr)); // fix it if requested; this also fixes the overall one so we don't need to do any more - if (params.find(OPTION_FIX) != NULL) + if (params.find(OPTION_FIX) != nullptr) { input_chd.set_raw_sha1(computed_sha1); printf("SHA-1 updated to correct value in input CHD\n"); @@ -1551,7 +1551,7 @@ static void do_verify(parameters_t ¶ms) fprintf(stderr, " actual SHA1 = %s\n", computed_overall_sha1.as_string(tempstr)); // fix it if requested - if (params.find(OPTION_FIX) != NULL) + if (params.find(OPTION_FIX) != nullptr) { input_chd.set_raw_sha1(computed_sha1); printf("SHA-1 updated to correct value in input CHD\n"); @@ -1570,9 +1570,9 @@ static void do_verify(parameters_t ¶ms) static void do_create_raw(parameters_t ¶ms) { // process input file - core_file *input_file = NULL; + core_file *input_file = nullptr; std::string *input_file_str = params.find(OPTION_INPUT); - if (input_file_str != NULL) + if (input_file_str != nullptr) { file_error filerr = core_fopen(input_file_str->c_str(), OPEN_FLAG_READ, &input_file); if (filerr != FILERR_NONE) @@ -1590,7 +1590,7 @@ static void do_create_raw(parameters_t ¶ms) // process unit size UINT32 unit_size = output_parent.opened() ? output_parent.unit_bytes() : 0; std::string *unit_size_str = params.find(OPTION_UNIT_SIZE); - if (unit_size_str != NULL) + if (unit_size_str != nullptr) { unit_size = parse_number(unit_size_str->c_str()); if (hunk_size % unit_size != 0) @@ -1626,7 +1626,7 @@ static void do_create_raw(parameters_t ¶ms) printf("Logical size: %s\n", big_int_string(tempstr, input_end - input_start)); // catch errors so we can close & delete the output file - chd_rawfile_compressor *chd = NULL; + chd_rawfile_compressor *chd = nullptr; try { // create the new CHD @@ -1652,7 +1652,7 @@ static void do_create_raw(parameters_t ¶ms) delete chd; // delete the output file std::string *output_chd_str = params.find(OPTION_OUTPUT); - if (output_chd_str != NULL) + if (output_chd_str != nullptr) osd_rmfile(output_chd_str->c_str()); throw; } @@ -1667,9 +1667,9 @@ static void do_create_raw(parameters_t ¶ms) static void do_create_hd(parameters_t ¶ms) { // process input file - core_file *input_file = NULL; + core_file *input_file = nullptr; std::string *input_file_str = params.find(OPTION_INPUT); - if (input_file_str != NULL) + if (input_file_str != nullptr) { file_error filerr = core_fopen(input_file_str->c_str(), OPEN_FLAG_READ, &input_file); if (filerr != FILERR_NONE) @@ -1683,7 +1683,7 @@ static void do_create_hd(parameters_t ¶ms) // process sectorsize UINT32 sector_size = output_parent.opened() ? output_parent.unit_bytes() : IDE_SECTOR_SIZE; std::string *sectorsize_str = params.find(OPTION_SECTOR_SIZE); - if (sectorsize_str != NULL) + if (sectorsize_str != nullptr) { if (output_parent.opened()) report_error(1, "Sector size does not apply when creating a diff from the parent"); @@ -1698,7 +1698,7 @@ static void do_create_hd(parameters_t ¶ms) UINT64 filesize = 0; UINT64 input_start = 0; UINT64 input_end = 0; - if (input_file != NULL) + if (input_file != nullptr) { parse_input_start_end(params, core_fsize(input_file), hunk_size, hunk_size, input_start, input_end); filesize = input_end - input_start; @@ -1706,7 +1706,7 @@ static void do_create_hd(parameters_t ¶ms) else { std::string *size_str = params.find(OPTION_SIZE); - if (size_str != NULL) + if (size_str != nullptr) { if (sscanf(size_str->c_str(), "%" I64FMT"d", &filesize) != 1) report_error(1, "Invalid size string"); @@ -1716,10 +1716,10 @@ static void do_create_hd(parameters_t ¶ms) // process compression chd_codec_type compression[4]; memcpy(compression, s_default_hd_compression, sizeof(compression)); - if (input_file == NULL) + if (input_file == nullptr) compression[0] = compression[1] = compression[2] = compression[3] = CHD_CODEC_NONE; parse_compression(params, compression); - if (input_file == NULL && compression[0] != CHD_CODEC_NONE) + if (input_file == nullptr && compression[0] != CHD_CODEC_NONE) report_error(1, "Blank hard disks must be uncompressed"); // process numprocessors @@ -1730,7 +1730,7 @@ static void do_create_hd(parameters_t ¶ms) UINT32 heads = 0; UINT32 sectors = 0; std::string *chs_str = params.find(OPTION_CHS); - if (chs_str != NULL) + if (chs_str != nullptr) { if (output_parent.opened()) report_error(1, "CHS does not apply when creating a diff from the parent"); @@ -1743,7 +1743,7 @@ static void do_create_hd(parameters_t ¶ms) if (output_parent.opened()) output_parent.read_metadata(HARD_DISK_IDENT_METADATA_TAG, 0, identdata); std::string *ident_str = params.find(OPTION_IDENT); - if (ident_str != NULL) + if (ident_str != nullptr) { // load the file file_error filerr = core_fload(ident_str->c_str(), identdata); @@ -1775,7 +1775,7 @@ static void do_create_hd(parameters_t ¶ms) // if no CHS values, try to guess them if (cylinders == 0) { - if (input_file == NULL && filesize == 0) + if (input_file == nullptr && filesize == 0) report_error(1, "Blank hard drives must specify either a length or a set of CHS values"); guess_chs(input_file_str, filesize, sector_size, cylinders, heads, sectors, sector_size); } @@ -1786,7 +1786,7 @@ static void do_create_hd(parameters_t ¶ms) printf("Output CHD: %s\n", output_chd_str->c_str()); if (output_parent.opened()) printf("Parent CHD: %s\n", params.find(OPTION_OUTPUT_PARENT)->c_str()); - if (input_file != NULL) + if (input_file != nullptr) { printf("Input file: %s\n", input_file_str->c_str()); if (input_start != 0 || input_end != core_fsize(input_file)) @@ -1804,7 +1804,7 @@ static void do_create_hd(parameters_t ¶ms) printf("Logical size: %s\n", big_int_string(tempstr, UINT64(totalsectors) * UINT64(sector_size))); // catch errors so we can close & delete the output file - chd_rawfile_compressor *chd = NULL; + chd_rawfile_compressor *chd = nullptr; try { // create the new hard drive @@ -1833,7 +1833,7 @@ static void do_create_hd(parameters_t ¶ms) } // compress it generically - if (input_file != NULL) + if (input_file != nullptr) compress_common(*chd); delete chd; } @@ -1842,7 +1842,7 @@ static void do_create_hd(parameters_t ¶ms) delete chd; // delete the output file std::string *output_chd_str = params.find(OPTION_OUTPUT); - if (output_chd_str != NULL) + if (output_chd_str != nullptr) osd_rmfile(output_chd_str->c_str()); throw; } @@ -1860,7 +1860,7 @@ static void do_create_cd(parameters_t ¶ms) chdcd_track_input_info track_info; cdrom_toc toc = { 0 }; std::string *input_file_str = params.find(OPTION_INPUT); - if (input_file_str != NULL) + if (input_file_str != nullptr) { chd_error err = chdcd_parse_toc(input_file_str->c_str(), toc, track_info); if (err != CHDERR_NONE) @@ -1907,7 +1907,7 @@ static void do_create_cd(parameters_t ¶ms) printf("Logical size: %s\n", big_int_string(tempstr, UINT64(totalsectors) * CD_FRAME_SIZE)); // catch errors so we can close & delete the output file - chd_cd_compressor *chd = NULL; + chd_cd_compressor *chd = nullptr; try { // create the new CD @@ -1934,7 +1934,7 @@ static void do_create_cd(parameters_t ¶ms) delete chd; // delete the output file std::string *output_chd_str = params.find(OPTION_OUTPUT); - if (output_chd_str != NULL) + if (output_chd_str != nullptr) osd_rmfile(output_chd_str->c_str()); throw; } @@ -1949,9 +1949,9 @@ static void do_create_cd(parameters_t ¶ms) static void do_create_ld(parameters_t ¶ms) { // process input file - avi_file *input_file = NULL; + avi_file *input_file = nullptr; std::string *input_file_str = params.find(OPTION_INPUT); - if (input_file_str != NULL) + if (input_file_str != nullptr) { avi_error avierr = avi_open(input_file_str->c_str(), &input_file); if (avierr != AVIERR_NONE) @@ -2025,7 +2025,7 @@ static void do_create_ld(parameters_t ¶ms) printf("Logical size: %s\n", big_int_string(tempstr, UINT64(input_end - input_start) * hunk_size)); // catch errors so we can close & delete the output file - chd_avi_compressor *chd = NULL; + chd_avi_compressor *chd = nullptr; try { // create the new CHD @@ -2062,7 +2062,7 @@ static void do_create_ld(parameters_t ¶ms) delete chd; // delete the output file std::string *output_chd_str = params.find(OPTION_OUTPUT); - if (output_chd_str != NULL) + if (output_chd_str != nullptr) osd_rmfile(output_chd_str->c_str()); throw; } @@ -2134,7 +2134,7 @@ static void do_copy(parameters_t ¶ms) printf("Logical size: %s\n", big_int_string(tempstr, input_end - input_start)); // catch errors so we can close & delete the output file - chd_chdfile_compressor *chd = NULL; + chd_chdfile_compressor *chd = nullptr; try { // create the new CHD @@ -2179,7 +2179,7 @@ static void do_copy(parameters_t ¶ms) if (redo_cd) { cdrom_file *cdrom = cdrom_open(&input_chd); - if (cdrom == NULL) + if (cdrom == nullptr) report_error(1, "Error upgrading CD metadata"); const cdrom_toc *toc = cdrom_get_toc(cdrom); err = cdrom_write_metadata(chd, toc); @@ -2198,7 +2198,7 @@ static void do_copy(parameters_t ¶ms) delete chd; // delete the output file std::string *output_chd_str = params.find(OPTION_OUTPUT); - if (output_chd_str != NULL) + if (output_chd_str != nullptr) osd_rmfile(output_chd_str->c_str()); throw; } @@ -2224,7 +2224,7 @@ static void do_extract_raw(parameters_t ¶ms) // verify output file doesn't exist std::string *output_file_str = params.find(OPTION_OUTPUT); - if (output_file_str != NULL) + if (output_file_str != nullptr) check_existing_output_file(params, output_file_str->c_str()); // print some info @@ -2238,7 +2238,7 @@ static void do_extract_raw(parameters_t ¶ms) } // catch errors so we can close & delete the output file - core_file *output_file = NULL; + core_file *output_file = nullptr; try { // process output file @@ -2274,7 +2274,7 @@ static void do_extract_raw(parameters_t ¶ms) catch (...) { // delete the output file - if (output_file != NULL) + if (output_file != nullptr) { core_fclose(output_file); osd_rmfile(output_file_str->c_str()); @@ -2298,13 +2298,13 @@ static void do_extract_cd(parameters_t ¶ms) // further process input file cdrom_file *cdrom = cdrom_open(&input_chd); - if (cdrom == NULL) + if (cdrom == nullptr) report_error(1, "Unable to recognize CHD file as a CD"); const cdrom_toc *toc = cdrom_get_toc(cdrom); // verify output file doesn't exist std::string *output_file_str = params.find(OPTION_OUTPUT); - if (output_file_str != NULL) + if (output_file_str != nullptr) check_existing_output_file(params, output_file_str->c_str()); // verify output BIN file doesn't exist @@ -2316,7 +2316,7 @@ static void do_extract_cd(parameters_t ¶ms) char basename[128]; strncpy(basename, default_name.c_str(), 127); default_name.append(".bin"); - if (output_bin_file_str == NULL) + if (output_bin_file_str == nullptr) output_bin_file_str = &default_name; check_existing_output_file(params, output_bin_file_str->c_str()); @@ -2327,8 +2327,8 @@ static void do_extract_cd(parameters_t ¶ms) printf("Input CHD: %s\n", params.find(OPTION_INPUT)->c_str()); // catch errors so we can close & delete the output file - core_file *output_bin_file = NULL; - core_file *output_toc_file = NULL; + core_file *output_bin_file = nullptr; + core_file *output_toc_file = nullptr; try { int mode = MODE_NORMAL; @@ -2387,7 +2387,7 @@ static void do_extract_cd(parameters_t ¶ms) if (output_bin_file) { core_fclose(output_bin_file); - output_bin_file = NULL; + output_bin_file = nullptr; } filerr = core_fopen(trackbin_name.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_bin_file); @@ -2474,9 +2474,9 @@ static void do_extract_cd(parameters_t ¶ms) catch (...) { // delete the output files - if (output_bin_file != NULL) + if (output_bin_file != nullptr) core_fclose(output_bin_file); - if (output_toc_file != NULL) + if (output_toc_file != nullptr) core_fclose(output_toc_file); osd_rmfile(output_bin_file_str->c_str()); osd_rmfile(output_file_str->c_str()); @@ -2551,7 +2551,7 @@ static void do_extract_ld(parameters_t ¶ms) // verify output file doesn't exist std::string *output_file_str = params.find(OPTION_OUTPUT); - if (output_file_str != NULL) + if (output_file_str != nullptr) check_existing_output_file(params, output_file_str->c_str()); // print some info @@ -2565,7 +2565,7 @@ static void do_extract_ld(parameters_t ¶ms) } // catch errors so we can close & delete the output file - avi_file *output_file = NULL; + avi_file *output_file = nullptr; try { // process output file @@ -2596,7 +2596,7 @@ static void do_extract_ld(parameters_t ¶ms) input_chd.codec_configure(CHD_CODEC_AVHUFF, AVHUFF_CODEC_DECOMPRESS_CONFIG, &avconfig); // read the hunk into the buffers - chd_error err = input_chd.read_hunk(framenum, NULL); + chd_error err = input_chd.read_hunk(framenum, nullptr); if (err != CHDERR_NONE) { UINT64 filepos = core_ftell(input_chd); @@ -2627,7 +2627,7 @@ static void do_extract_ld(parameters_t ¶ms) catch (...) { // delete the output file - if (output_file != NULL) + if (output_file != nullptr) avi_close(output_file); osd_rmfile(output_file_str->c_str()); throw; @@ -2650,7 +2650,7 @@ static void do_add_metadata(parameters_t ¶ms) // process tag chd_metadata_tag tag = CHD_MAKE_TAG('?','?','?','?'); std::string *tag_str = params.find(OPTION_TAG); - if (tag_str != NULL) + if (tag_str != nullptr) { tag_str->append(" "); tag = CHD_MAKE_TAG((*tag_str)[0], (*tag_str)[1], (*tag_str)[2], (*tag_str)[3]); @@ -2659,13 +2659,13 @@ static void do_add_metadata(parameters_t ¶ms) // process index UINT32 index = 0; std::string *index_str = params.find(OPTION_INDEX); - if (index_str != NULL) + if (index_str != nullptr) index = atoi(index_str->c_str()); // process text input std::string *text_str = params.find(OPTION_VALUE_TEXT); std::string text; - if (text_str != NULL) + if (text_str != nullptr) { text = *text_str; if (text[0] == '"' && text[text.length() - 1] == '"') @@ -2675,7 +2675,7 @@ static void do_add_metadata(parameters_t ¶ms) // process file input std::string *file_str = params.find(OPTION_VALUE_FILE); dynamic_buffer file; - if (file_str != NULL) + if (file_str != nullptr) { file_error filerr = core_fload(file_str->c_str(), file); if (filerr != FILERR_NONE) @@ -2683,14 +2683,14 @@ static void do_add_metadata(parameters_t ¶ms) } // make sure we have one or the other - if (text_str == NULL && file_str == NULL) + if (text_str == nullptr && file_str == nullptr) report_error(1, "Error: missing either --valuetext/-vt or --valuefile/-vf parameters"); - if (text_str != NULL && file_str != NULL) + if (text_str != nullptr && file_str != nullptr) report_error(1, "Error: both --valuetext/-vt or --valuefile/-vf parameters specified; only one permitted"); // process no checksum UINT8 flags = CHD_MDFLAGS_CHECKSUM; - if (params.find(OPTION_NO_CHECKSUM) != NULL) + if (params.find(OPTION_NO_CHECKSUM) != nullptr) flags &= ~CHD_MDFLAGS_CHECKSUM; // print some info @@ -2698,14 +2698,14 @@ static void do_add_metadata(parameters_t ¶ms) printf("Input file: %s\n", params.find(OPTION_INPUT)->c_str()); printf("Tag: %c%c%c%c\n", (tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff); printf("Index: %d\n", index); - if (text_str != NULL) + if (text_str != nullptr) printf("Text: %s\n", text.c_str()); else printf("Data: %s (%d bytes)\n", file_str->c_str(), int(file.size())); // write the metadata chd_error err; - if (text_str != NULL) + if (text_str != nullptr) err = input_chd.write_metadata(tag, index, text, flags); else err = input_chd.write_metadata(tag, index, &file[0], flags); @@ -2730,7 +2730,7 @@ static void do_del_metadata(parameters_t ¶ms) // process tag chd_metadata_tag tag = CHD_MAKE_TAG('?','?','?','?'); std::string *tag_str = params.find(OPTION_TAG); - if (tag_str != NULL) + if (tag_str != nullptr) { tag_str->append(" "); tag = CHD_MAKE_TAG((*tag_str)[0], (*tag_str)[1], (*tag_str)[2], (*tag_str)[3]); @@ -2739,7 +2739,7 @@ static void do_del_metadata(parameters_t ¶ms) // process index UINT32 index = 0; std::string *index_str = params.find(OPTION_INDEX); - if (index_str != NULL) + if (index_str != nullptr) index = atoi(index_str->c_str()); // print some info @@ -2770,13 +2770,13 @@ static void do_dump_metadata(parameters_t ¶ms) // verify output file doesn't exist std::string *output_file_str = params.find(OPTION_OUTPUT); - if (output_file_str != NULL) + if (output_file_str != nullptr) check_existing_output_file(params, output_file_str->c_str()); // process tag chd_metadata_tag tag = CHD_MAKE_TAG('?','?','?','?'); std::string *tag_str = params.find(OPTION_TAG); - if (tag_str != NULL) + if (tag_str != nullptr) { tag_str->append(" "); tag = CHD_MAKE_TAG((*tag_str)[0], (*tag_str)[1], (*tag_str)[2], (*tag_str)[3]); @@ -2785,7 +2785,7 @@ static void do_dump_metadata(parameters_t ¶ms) // process index UINT32 index = 0; std::string *index_str = params.find(OPTION_INDEX); - if (index_str != NULL) + if (index_str != nullptr) index = atoi(index_str->c_str()); // write the metadata @@ -2795,11 +2795,11 @@ static void do_dump_metadata(parameters_t ¶ms) report_error(1, "Error reading metadata: %s", chd_file::error_string(err)); // catch errors so we can close & delete the output file - core_file *output_file = NULL; + core_file *output_file = nullptr; try { // create the file - if (output_file_str != NULL) + if (output_file_str != nullptr) { file_error filerr = core_fopen(output_file_str->c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &output_file); if (filerr != FILERR_NONE) @@ -2826,7 +2826,7 @@ static void do_dump_metadata(parameters_t ¶ms) catch (...) { // delete the output file - if (output_file != NULL) + if (output_file != nullptr) core_fclose(output_file); osd_rmfile(output_file_str->c_str()); throw; @@ -2882,7 +2882,7 @@ int CLIB_DECL main(int argc, char *argv[]) { // reduce to the option name const char *validname = desc.valid_options[valid]; - if (validname == NULL) + if (validname == nullptr) break; if (*validname == REQUIRED[0]) validname++; @@ -2897,7 +2897,7 @@ int CLIB_DECL main(int argc, char *argv[]) // do we match? const option_description &odesc = s_options[optnum]; if ((arg[1] == '-' && strcmp(odesc.name, &arg[2]) == 0) || - (arg[1] != '-' && odesc.shortname != NULL && strcmp(odesc.shortname, &arg[1]) == 0)) + (arg[1] != '-' && odesc.shortname != nullptr && strcmp(odesc.shortname, &arg[1]) == 0)) { // if we need a parameter, consume it const char *param = ""; @@ -2924,9 +2924,9 @@ int CLIB_DECL main(int argc, char *argv[]) for (int valid = 0; valid < ARRAY_LENGTH(desc.valid_options); valid++) { const char *validname = desc.valid_options[valid]; - if (validname == NULL) + if (validname == nullptr) break; - if (*validname == REQUIRED[0] && parameters.find(++validname) == NULL) + if (*validname == REQUIRED[0] && parameters.find(++validname) == nullptr) return print_help(argv[0], desc, "Required parameters missing"); } diff --git a/src/tools/floptool.cpp b/src/tools/floptool.cpp index 2cb36f3a873..190e2004ea6 100644 --- a/src/tools/floptool.cpp +++ b/src/tools/floptool.cpp @@ -100,13 +100,13 @@ static floppy_image_format_t *find_format_by_name(const char *name) for(int i=0; i != FORMAT_COUNT; i++) if(!core_stricmp(name, formats[i]->name())) return formats[i]; - return 0; + return nullptr; } static floppy_image_format_t *find_format_by_identify(io_generic *image) { int best = 0; - floppy_image_format_t *best_fif = 0; + floppy_image_format_t *best_fif = nullptr; for(int i = 0; i != FORMAT_COUNT; i++) { floppy_image_format_t *fif = formats[i]; diff --git a/src/tools/imgtool/charconv.cpp b/src/tools/imgtool/charconv.cpp index 39b5953d799..34a912dcb89 100644 --- a/src/tools/imgtool/charconv.cpp +++ b/src/tools/imgtool/charconv.cpp @@ -24,7 +24,7 @@ static char *utf8_from_latin1(const char *src) /* validate input */ if (!src) { - return NULL; + return nullptr; } /* allocate space for result, twice the source len to be safe */ @@ -69,7 +69,7 @@ static char *latin1_from_utf8(const char *src) /* validate input */ if (!src) { - return NULL; + return nullptr; } /* allocate space for result */ @@ -128,7 +128,7 @@ char *utf8_from_native(imgtool_charset charset, const char *src) break; default: - result = NULL; + result = nullptr; break; } return result; @@ -155,7 +155,7 @@ char *native_from_utf8(imgtool_charset charset, const char *src) break; default: - result = NULL; + result = nullptr; break; } return result; diff --git a/src/tools/imgtool/filtbas.cpp b/src/tools/imgtool/filtbas.cpp index bff1bda121e..a83d7a80108 100644 --- a/src/tools/imgtool/filtbas.cpp +++ b/src/tools/imgtool/filtbas.cpp @@ -83,15 +83,15 @@ static imgtoolerr_t basic_readfile(const basictokens *tokens, const char *token; /* open a memory stream */ - mem_stream = stream_open_mem(NULL, 0); - if (mem_stream == NULL) + mem_stream = stream_open_mem(nullptr, 0); + if (mem_stream == nullptr) { err = IMGTOOLERR_OUTOFMEMORY; goto done; } /* read actual file */ - err = imgtool_partition_read_file(partition, filename, fork, mem_stream, NULL); + err = imgtool_partition_read_file(partition, filename, fork, mem_stream, nullptr); if (err) goto done; @@ -126,7 +126,7 @@ static imgtoolerr_t basic_readfile(const basictokens *tokens, if ((b & 0x80) && (!in_string)) { - token = NULL; + token = nullptr; for (i = 0; i < tokens->num_entries; i++) { @@ -161,7 +161,7 @@ static imgtoolerr_t basic_readfile(const basictokens *tokens, } done: - if (mem_stream != NULL) + if (mem_stream != nullptr) stream_close(mem_stream); return err; } @@ -193,8 +193,8 @@ static imgtoolerr_t basic_writefile(const basictokens *tokens, UINT16 address; /* open a memory stream */ - mem_stream = stream_open_mem(NULL, 0); - if (mem_stream == NULL) + mem_stream = stream_open_mem(nullptr, 0); + if (mem_stream == nullptr) { err = IMGTOOLERR_OUTOFMEMORY; goto done; @@ -272,7 +272,7 @@ static imgtoolerr_t basic_writefile(const basictokens *tokens, /* read until end of line */ while(buf[pos] != '\0') { - token = NULL; + token = nullptr; token_shift = 0; token_value = 0; @@ -283,10 +283,10 @@ static imgtoolerr_t basic_writefile(const basictokens *tokens, } else if (!in_quotes) { - for (i = 0; (token == NULL) && (i < tokens->num_entries); i++) + for (i = 0; (token == nullptr) && (i < tokens->num_entries); i++) { token_table = &tokens->entries[i]; - for (j = 0; (token == NULL) && (j < token_table->num_tokens); j++) + for (j = 0; (token == nullptr) && (j < token_table->num_tokens); j++) { if (!strncmp(&buf[pos], token_table->tokens[j], strlen(token_table->tokens[j]))) { @@ -300,7 +300,7 @@ static imgtoolerr_t basic_writefile(const basictokens *tokens, } /* did we find a token? */ - if (token != NULL) + if (token != nullptr) { /* emit the token */ if (token_shift != 0) @@ -343,12 +343,12 @@ static imgtoolerr_t basic_writefile(const basictokens *tokens, } /* write actual file */ - err = imgtool_partition_write_file(partition, filename, fork, mem_stream, opts, NULL); + err = imgtool_partition_write_file(partition, filename, fork, mem_stream, opts, nullptr); if (err) goto done; done: - if (mem_stream != NULL) + if (mem_stream != nullptr) stream_close(mem_stream); return err; } @@ -684,7 +684,7 @@ static const char *const vzbas[] = "RESET", /* 0x82 */ "SET", /* 0x83 */ "CLS", /* 0x84 */ - NULL, /* 0x85 */ + nullptr, /* 0x85 */ "RANDOM", /* 0x86 */ "NEXT", /* 0x87 */ "DATA", /* 0x88 */ @@ -713,21 +713,21 @@ static const char *const vzbas[] = "RESUME", /* 0x9f */ "OUT", /* 0xa0 */ "IN", /* 0xa1 */ - NULL, /* 0xa2 */ - NULL, /* 0xa3 */ - NULL, /* 0xa4 */ - NULL, /* 0xa5 */ - NULL, /* 0xa6 */ - NULL, /* 0xa7 */ - NULL, /* 0xa8 */ - NULL, /* 0xa9 */ - NULL, /* 0xaa */ - NULL, /* 0xab */ - NULL, /* 0xac */ - NULL, /* 0xad */ + nullptr, /* 0xa2 */ + nullptr, /* 0xa3 */ + nullptr, /* 0xa4 */ + nullptr, /* 0xa5 */ + nullptr, /* 0xa6 */ + nullptr, /* 0xa7 */ + nullptr, /* 0xa8 */ + nullptr, /* 0xa9 */ + nullptr, /* 0xaa */ + nullptr, /* 0xab */ + nullptr, /* 0xac */ + nullptr, /* 0xad */ "(RESET)", /* 0xae */ "LPRINT", /* 0xaf */ - NULL, /* 0xb0 */ + nullptr, /* 0xb0 */ "POKE", /* 0xb1 */ "PRINT", /* 0xb2 */ "CONT", /* 0xb3 */ @@ -741,16 +741,16 @@ static const char *const vzbas[] = "NEW", /* 0xbb */ "TAB(", /* 0xbc */ "TO", /* 0xbd */ - NULL, /* 0xbe */ + nullptr, /* 0xbe */ "USING", /* 0xbf */ "VARPTR", /* 0xc0 */ "USR", /* 0xc1 */ "ERL", /* 0xc2 */ "ERR", /* 0xc3 */ "STRING$", /* 0xc4 */ - NULL, /* 0xc5 */ + nullptr, /* 0xc5 */ "POINT", /* 0xc6 */ - NULL, /* 0xc7 */ + nullptr, /* 0xc7 */ "MEM", /* 0xc8 */ "INKEY$", /* 0xc9 */ "THEN", /* 0xca */ @@ -781,15 +781,15 @@ static const char *const vzbas[] = "TAN", /* 0xe3 */ "ATN", /* 0xe4 */ "PEEK", /* 0xe5 */ - NULL, /* 0xe6 */ - NULL, /* 0xe7 */ - NULL, /* 0xe8 */ - NULL, /* 0xe9 */ - NULL, /* 0xea */ - NULL, /* 0xeb */ - NULL, /* 0xec */ - NULL, /* 0xed */ - NULL, /* 0xee */ + nullptr, /* 0xe6 */ + nullptr, /* 0xe7 */ + nullptr, /* 0xe8 */ + nullptr, /* 0xe9 */ + nullptr, /* 0xea */ + nullptr, /* 0xeb */ + nullptr, /* 0xec */ + nullptr, /* 0xed */ + nullptr, /* 0xee */ "CINT", /* 0xef */ "CSNG", /* 0xf0 */ "CDBL", /* 0xf1 */ @@ -802,11 +802,11 @@ static const char *const vzbas[] = "LEFT$", /* 0xf8 */ "RIGHT$", /* 0xf9 */ "MID$", /* 0xfa */ - NULL, /* 0xfb */ - NULL, /* 0xfc */ - NULL, /* 0xfd */ - NULL, /* 0xfe */ - NULL /* 0xff */ + nullptr, /* 0xfb */ + nullptr, /* 0xfc */ + nullptr, /* 0xfd */ + nullptr, /* 0xfe */ + nullptr /* 0xff */ }; static const char *const bml3bas_statements[] = diff --git a/src/tools/imgtool/filteoln.cpp b/src/tools/imgtool/filteoln.cpp index 30fb52ed429..457ac89aee6 100644 --- a/src/tools/imgtool/filteoln.cpp +++ b/src/tools/imgtool/filteoln.cpp @@ -58,14 +58,14 @@ static imgtoolerr_t ascii_readfile(imgtool_partition *partition, const char *fil imgtoolerr_t err; imgtool_stream *mem_stream; - mem_stream = stream_open_mem(NULL, 0); + mem_stream = stream_open_mem(nullptr, 0); if (!mem_stream) { err = IMGTOOLERR_OUTOFMEMORY; goto done; } - err = imgtool_partition_read_file(partition, filename, fork, mem_stream, NULL); + err = imgtool_partition_read_file(partition, filename, fork, mem_stream, nullptr); if (err) goto done; @@ -85,11 +85,11 @@ done: static imgtoolerr_t ascii_writefile(imgtool_partition *partition, const char *filename, const char *fork, imgtool_stream *sourcef, option_resolution *opts) { imgtoolerr_t err; - imgtool_stream *mem_stream = NULL; + imgtool_stream *mem_stream = nullptr; const char *eoln; /* create a stream */ - mem_stream = stream_open_mem(NULL, 0); + mem_stream = stream_open_mem(nullptr, 0); if (!mem_stream) { err = IMGTOOLERR_OUTOFMEMORY; @@ -103,7 +103,7 @@ static imgtoolerr_t ascii_writefile(imgtool_partition *partition, const char *fi goto done; stream_seek(mem_stream, SEEK_SET, 0); - err = imgtool_partition_write_file(partition, filename, fork, mem_stream, opts, NULL); + err = imgtool_partition_write_file(partition, filename, fork, mem_stream, opts, nullptr); if (err) goto done; diff --git a/src/tools/imgtool/filter.cpp b/src/tools/imgtool/filter.cpp index 5887d6b501d..cd90026b6f7 100644 --- a/src/tools/imgtool/filter.cpp +++ b/src/tools/imgtool/filter.cpp @@ -25,7 +25,7 @@ INT64 filter_get_info_int(filter_getinfoproc get_info, UINT32 state) void *filter_get_info_ptr(filter_getinfoproc get_info, UINT32 state) { union filterinfo info; - info.p = NULL; + info.p = nullptr; get_info(state, &info); return info.p; } @@ -33,7 +33,7 @@ void *filter_get_info_ptr(filter_getinfoproc get_info, UINT32 state) void *filter_get_info_fct(filter_getinfoproc get_info, UINT32 state) { union filterinfo info; - info.f = NULL; + info.f = nullptr; get_info(state, &info); return info.f; } @@ -41,7 +41,7 @@ void *filter_get_info_fct(filter_getinfoproc get_info, UINT32 state) const char *filter_get_info_string(filter_getinfoproc get_info, UINT32 state) { union filterinfo info; - info.s = NULL; + info.s = nullptr; get_info(state, &info); return info.s; } @@ -61,7 +61,7 @@ const filter_getinfoproc filters[] = filter_thombas128_getinfo, filter_thomcrypt_getinfo, filter_bml3bas_getinfo, - NULL + nullptr }; @@ -78,5 +78,5 @@ filter_getinfoproc filter_lookup(const char *name) return filters[i]; } - return NULL; + return nullptr; } diff --git a/src/tools/imgtool/iflopimg.cpp b/src/tools/imgtool/iflopimg.cpp index 9e8493f9477..3bf05aacd35 100644 --- a/src/tools/imgtool/iflopimg.cpp +++ b/src/tools/imgtool/iflopimg.cpp @@ -81,7 +81,7 @@ static const struct io_procs imgtool_ioprocs = static const struct io_procs imgtool_noclose_ioprocs = { - NULL, + nullptr, imgtool_floppy_seekproc, imgtool_floppy_readproc, imgtool_floppy_writeproc, @@ -118,7 +118,7 @@ static imgtoolerr_t imgtool_floppy_open_internal(imgtool_image *image, imgtool_s /* open up the floppy */ ferr = floppy_open(f, noclose ? &imgtool_noclose_ioprocs : &imgtool_ioprocs, - NULL, format, FLOPPY_FLAGS_READWRITE, &fimg->floppy); + nullptr, format, FLOPPY_FLAGS_READWRITE, &fimg->floppy); if (ferr) { err = imgtool_floppy_error(ferr); @@ -127,7 +127,7 @@ static imgtoolerr_t imgtool_floppy_open_internal(imgtool_image *image, imgtool_s if (open) { - err = open(image, NULL); + err = open(image, nullptr); if (err) return err; } @@ -171,7 +171,7 @@ static imgtoolerr_t imgtool_floppy_create(imgtool_image *image, imgtool_stream * /* do we have to do extra stuff when creating the image? */ if (create) { - err = create(image, NULL, opts); + err = create(image, nullptr, opts); if (err) goto done; } @@ -179,7 +179,7 @@ static imgtoolerr_t imgtool_floppy_create(imgtool_image *image, imgtool_stream * /* do we have to do extra stuff when opening the image? */ if (open) { - err = open(image, NULL); + err = open(image, nullptr); if (err) goto done; } @@ -269,7 +269,7 @@ static void imgtool_floppy_get_info(const imgtool_class *imgclass, UINT32 state, case IMGTOOLINFO_PTR_OPEN: info->open = imgtool_floppy_open; break; case IMGTOOLINFO_PTR_CREATE: info->create = imgtool_floppy_create; break; case IMGTOOLINFO_PTR_CLOSE: info->close = imgtool_floppy_close; break; - case IMGTOOLINFO_PTR_CREATEIMAGE_OPTGUIDE: info->createimage_optguide = format->param_guidelines ? floppy_option_guide : NULL; break; + case IMGTOOLINFO_PTR_CREATEIMAGE_OPTGUIDE: info->createimage_optguide = format->param_guidelines ? floppy_option_guide : nullptr; break; case IMGTOOLINFO_PTR_GET_SECTOR_SIZE: info->get_sector_size = imgtool_floppy_get_sector_size; break; case IMGTOOLINFO_PTR_READ_SECTOR: info->read_sector = imgtool_floppy_read_sector; break; case IMGTOOLINFO_PTR_WRITE_SECTOR: info->write_sector = imgtool_floppy_write_sector; break; diff --git a/src/tools/imgtool/imghd.cpp b/src/tools/imgtool/imghd.cpp index 8ac129751f9..b3161ae2caf 100644 --- a/src/tools/imgtool/imghd.cpp +++ b/src/tools/imgtool/imghd.cpp @@ -134,8 +134,8 @@ imgtoolerr_t imghd_open(imgtool_stream *stream, struct mess_hard_disk_file *hard chd_error chderr; imgtoolerr_t err = IMGTOOLERR_SUCCESS; - hard_disk->hard_disk = NULL; - hard_disk->chd = NULL; + hard_disk->hard_disk = nullptr; + hard_disk->chd = nullptr; chderr = hard_disk->chd->open(*stream_core_file(stream), stream_isreadonly(stream)); if (chderr) @@ -170,7 +170,7 @@ void imghd_close(struct mess_hard_disk_file *disk) if (disk->hard_disk) { hard_disk_close(disk->hard_disk); - disk->hard_disk = NULL; + disk->hard_disk = nullptr; } if (disk->stream) stream_close(disk->stream); diff --git a/src/tools/imgtool/imgtool.cpp b/src/tools/imgtool/imgtool.cpp index df44a9bbff2..c2c07e4ee23 100644 --- a/src/tools/imgtool/imgtool.cpp +++ b/src/tools/imgtool/imgtool.cpp @@ -170,7 +170,7 @@ char *imgtool_basename(char *filename) // NULL begets NULL if (!filename) - return NULL; + return nullptr; // start at the end and return when we hit a slash or colon for (c = filename + strlen(filename) - 1; c >= filename; c--) @@ -240,9 +240,9 @@ void imgtool_exit(void) if (global_imgtool_library) { imgtool_library_close(global_imgtool_library); - global_imgtool_library = NULL; + global_imgtool_library = nullptr; } - global_warn = NULL; + global_warn = nullptr; } @@ -311,9 +311,9 @@ static imgtoolerr_t evaluate_module(const char *fname, const imgtool_module *module, float *result) { imgtoolerr_t err; - imgtool_image *image = NULL; - imgtool_partition *partition = NULL; - imgtool_directory *imageenum = NULL; + imgtool_image *image = nullptr; + imgtool_partition *partition = nullptr; + imgtool_directory *imageenum = nullptr; imgtool_dirent ent; float current_result; @@ -331,7 +331,7 @@ static imgtoolerr_t evaluate_module(const char *fname, if (err) goto done; - err = imgtool_directory_open(partition, NULL, &imageenum); + err = imgtool_directory_open(partition, nullptr, &imageenum); if (err) goto done; @@ -387,12 +387,12 @@ imgtoolerr_t imgtool_identify_file(const char *fname, imgtool_module **modules, { imgtoolerr_t err = IMGTOOLERR_SUCCESS; imgtool_library *library = global_imgtool_library; - imgtool_module *module = NULL; + imgtool_module *module = nullptr; imgtool_module *insert_module; imgtool_module *temp_module; size_t i = 0; const char *extension; - float val, temp_val, *values = NULL; + float val, temp_val, *values = nullptr; if (count <= 0) { @@ -401,7 +401,7 @@ imgtoolerr_t imgtool_identify_file(const char *fname, imgtool_module **modules, } for (i = 0; i < count; i++) - modules[i] = NULL; + modules[i] = nullptr; if (count > 1) count--; /* null terminate */ @@ -420,7 +420,7 @@ imgtoolerr_t imgtool_identify_file(const char *fname, imgtool_module **modules, extension++; /* iterate through all modules */ - while((module = imgtool_library_iterate(library, module)) != NULL) + while((module = imgtool_library_iterate(library, module)) != nullptr) { if (!extension || image_find_extension(module->extensions, extension)) { @@ -592,7 +592,7 @@ imgtoolerr_t imgtool_image_write_block(imgtool_image *image, UINT64 block, const imgtoolerr_t imgtool_image_clear_block(imgtool_image *image, UINT64 block, UINT8 data) { imgtoolerr_t err; - UINT8 *block_data = NULL; + UINT8 *block_data = nullptr; UINT32 length; err = imgtool_image_get_block_size(image, &length); @@ -666,7 +666,7 @@ const imgtool_module *imgtool_image_module(imgtool_image *img) void *imgtool_image_extra_bytes(imgtool_image *image) { - void *ptr = NULL; + void *ptr = nullptr; if (image->module->image_extra_bytes > 0) ptr = ((UINT8 *) image) + sizeof(*image); assert(ptr); @@ -699,7 +699,7 @@ UINT64 imgtool_image_rand(imgtool_image *image) static char *pool_strdup_allow_null(object_pool *pool, char *s) { - return s ? pool_strdup_lib(pool, s) : NULL; + return s ? pool_strdup_lib(pool, s) : nullptr; } @@ -707,7 +707,7 @@ static char *pool_strdup_allow_null(object_pool *pool, char *s) imgtoolerr_t imgtool_partition_open(imgtool_image *image, int partition_index, imgtool_partition **partition) { imgtoolerr_t err = (imgtoolerr_t)IMGTOOLERR_SUCCESS; - imgtool_partition *p = NULL; + imgtool_partition *p = nullptr; imgtool_class imgclass; imgtool_partition_info partition_info[32]; UINT64 base_block, block_count; @@ -753,7 +753,7 @@ imgtoolerr_t imgtool_partition_open(imgtool_image *image, int partition_index, i partition_extra_bytes = imgtool_get_info_int(&imgclass, IMGTOOLINFO_INT_PARTITION_EXTRA_BYTES); /* allocate the new memory pool */ - pool = pool_alloc_lib(NULL); + pool = pool_alloc_lib(nullptr); if (!pool) { err = (imgtoolerr_t)IMGTOOLERR_OUTOFMEMORY; @@ -806,12 +806,12 @@ imgtoolerr_t imgtool_partition_open(imgtool_image *image, int partition_index, i /* mask out if writing is untested */ if (global_omit_untested && imgtool_get_info_int(&imgclass, IMGTOOLINFO_INT_WRITING_UNTESTED)) { - p->write_file = NULL; - p->delete_file = NULL; - p->create_dir = NULL; - p->delete_dir = NULL; - p->writefile_optguide = NULL; - p->writefile_optspec = NULL; + p->write_file = nullptr; + p->delete_file = nullptr; + p->create_dir = nullptr; + p->delete_dir = nullptr; + p->writefile_optguide = nullptr; + p->writefile_optspec = nullptr; } /* call the partition open function, if present */ @@ -825,7 +825,7 @@ imgtoolerr_t imgtool_partition_open(imgtool_image *image, int partition_index, i } done: - *partition = err ? NULL : p; + *partition = err ? nullptr : p; return err; } @@ -930,18 +930,18 @@ int imgtool_validitychecks(void) int error = 0; int val; imgtoolerr_t err = (imgtoolerr_t)IMGTOOLERR_SUCCESS; - const imgtool_module *module = NULL; + const imgtool_module *module = nullptr; const option_guide *guide_entry; imgtool_module_features features; int created_library = FALSE; if (!global_imgtool_library) { - imgtool_init(FALSE, NULL); + imgtool_init(FALSE, nullptr); created_library = TRUE; } - while((module = imgtool_library_iterate(global_imgtool_library, module)) != NULL) + while((module = imgtool_library_iterate(global_imgtool_library, module)) != nullptr) { features = imgtool_get_module_features(module); @@ -1091,13 +1091,13 @@ static imgtoolerr_t internal_open(const imgtool_module *module, const char *fnam int read_or_write, option_resolution *createopts, imgtool_image **outimg) { imgtoolerr_t err; - imgtool_stream *f = NULL; - imgtool_image *image = NULL; - object_pool *pool = NULL; + imgtool_stream *f = nullptr; + imgtool_image *image = nullptr; + object_pool *pool = nullptr; size_t size; if (outimg) - *outimg = NULL; + *outimg = nullptr; /* is the requested functionality implemented? */ if ((read_or_write == OSD_FOPEN_RW_CREATE) ? !module->create : !module->open) @@ -1107,7 +1107,7 @@ static imgtoolerr_t internal_open(const imgtool_module *module, const char *fnam } /* create a memory pool */ - pool = pool_alloc_lib(NULL); + pool = pool_alloc_lib(nullptr); if (!pool) { err = (imgtoolerr_t)(IMGTOOLERR_OUTOFMEMORY); @@ -1152,7 +1152,7 @@ done: stream_close(f); if (pool) pool_free_lib(pool); - image = NULL; + image = nullptr; } if (outimg) @@ -1171,7 +1171,7 @@ done: imgtoolerr_t imgtool_image_open(const imgtool_module *module, const char *fname, int read_or_write, imgtool_image **outimg) { read_or_write = read_or_write ? OSD_FOPEN_RW : OSD_FOPEN_READ; - return internal_open(module, fname, read_or_write, NULL, outimg); + return internal_open(module, fname, read_or_write, nullptr, outimg); } @@ -1214,7 +1214,7 @@ imgtoolerr_t imgtool_image_create(const imgtool_module *module, const char *fnam option_resolution *opts, imgtool_image **image) { imgtoolerr_t err; - option_resolution *alloc_resolution = NULL; + option_resolution *alloc_resolution = nullptr; /* allocate dummy options if necessary */ if (!opts && module->createimage_optguide) @@ -1291,7 +1291,7 @@ static imgtoolerr_t cannonicalize_path(imgtool_partition *partition, UINT32 flag const char **path, char **alloc_path) { imgtoolerr_t err = (imgtoolerr_t)IMGTOOLERR_SUCCESS; - char *new_path = NULL; + char *new_path = nullptr; char path_separator, alt_path_separator; const char *s; int in_path_separator, i, j; @@ -1323,7 +1323,7 @@ static imgtoolerr_t cannonicalize_path(imgtool_partition *partition, UINT32 flag err = (imgtoolerr_t)(IMGTOOLERR_CANNOTUSEPATH | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; } - *path = NULL; /* normalize empty path */ + *path = nullptr; /* normalize empty path */ } } else @@ -1395,7 +1395,7 @@ static imgtoolerr_t cannonicalize_fork(imgtool_partition *partition, const char imgtoolerr_t imgtool_partition_get_directory_entry(imgtool_partition *partition, const char *path, int index, imgtool_dirent *ent) { imgtoolerr_t err; - imgtool_directory *imgenum = NULL; + imgtool_directory *imgenum = nullptr; if (index < 0) { @@ -1443,7 +1443,7 @@ imgtoolerr_t imgtool_partition_get_file_size(imgtool_partition *partition, const imgtool_dirent ent; const char *path; - path = NULL; /* TODO: Need to parse off the path */ + path = nullptr; /* TODO: Need to parse off the path */ *filesize = -1; memset(&ent, 0, sizeof(ent)); @@ -1484,8 +1484,8 @@ done: imgtoolerr_t imgtool_partition_list_file_attributes(imgtool_partition *partition, const char *path, UINT32 *attrs, size_t len) { imgtoolerr_t err; - char *alloc_path = NULL; - char *new_fname = NULL; + char *alloc_path = nullptr; + char *new_fname = nullptr; memset(attrs, 0, sizeof(*attrs) * len); @@ -1496,7 +1496,7 @@ imgtoolerr_t imgtool_partition_list_file_attributes(imgtool_partition *partition } new_fname = normalize_filename(partition, path); - if (new_fname == NULL) + if (new_fname == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; @@ -1514,9 +1514,9 @@ imgtoolerr_t imgtool_partition_list_file_attributes(imgtool_partition *partition goto done; done: - if (alloc_path != NULL) + if (alloc_path != nullptr) free(alloc_path); - if (new_fname != NULL) + if (new_fname != nullptr) osd_free(new_fname); return err; } @@ -1531,8 +1531,8 @@ done: imgtoolerr_t imgtool_partition_get_file_attributes(imgtool_partition *partition, const char *path, const UINT32 *attrs, imgtool_attribute *values) { imgtoolerr_t err; - char *alloc_path = NULL; - char *new_fname = NULL; + char *alloc_path = nullptr; + char *new_fname = nullptr; if (!partition->get_attrs) { @@ -1541,7 +1541,7 @@ imgtoolerr_t imgtool_partition_get_file_attributes(imgtool_partition *partition, } new_fname = normalize_filename(partition, path); - if (new_fname == NULL) + if (new_fname == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; @@ -1559,9 +1559,9 @@ imgtoolerr_t imgtool_partition_get_file_attributes(imgtool_partition *partition, goto done; done: - if (alloc_path != NULL) + if (alloc_path != nullptr) free(alloc_path); - if (new_fname != NULL) + if (new_fname != nullptr) osd_free(new_fname); return err; } @@ -1576,7 +1576,7 @@ done: imgtoolerr_t imgtool_partition_put_file_attributes(imgtool_partition *partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values) { imgtoolerr_t err; - char *alloc_path = NULL; + char *alloc_path = nullptr; if (!partition->set_attrs) { @@ -1639,8 +1639,8 @@ imgtoolerr_t imgtool_partition_put_file_attribute(imgtool_partition *partition, imgtoolerr_t imgtool_partition_get_icon_info(imgtool_partition *partition, const char *path, imgtool_iconinfo *iconinfo) { imgtoolerr_t err; - char *alloc_path = NULL; - char *new_fname = NULL; + char *alloc_path = nullptr; + char *new_fname = nullptr; if (!partition->get_iconinfo) { @@ -1649,7 +1649,7 @@ imgtoolerr_t imgtool_partition_get_icon_info(imgtool_partition *partition, const } new_fname = normalize_filename(partition, path); - if (new_fname == NULL) + if (new_fname == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; @@ -1688,7 +1688,7 @@ imgtoolerr_t imgtool_partition_suggest_file_filters(imgtool_partition *partition { imgtoolerr_t err; int i, j; - char *alloc_path = NULL; + char *alloc_path = nullptr; imgtoolerr_t (*check_stream)(imgtool_stream *stream, imgtool_suggestion_viability_t *viability); size_t position; @@ -1890,7 +1890,7 @@ imgtoolerr_t imgtool_partition_get_free_space(imgtool_partition *partition, UINT imgtoolerr_t imgtool_partition_read_file(imgtool_partition *partition, const char *filename, const char *fork, imgtool_stream *destf, filter_getinfoproc filter) { imgtoolerr_t err; - char *alloc_path = NULL; + char *alloc_path = nullptr; union filterinfo u; if (!partition->read_file) @@ -1952,10 +1952,10 @@ done: imgtoolerr_t imgtool_partition_write_file(imgtool_partition *partition, const char *filename, const char *fork, imgtool_stream *sourcef, option_resolution *opts, filter_getinfoproc filter) { imgtoolerr_t err; - char *buf = NULL; + char *buf = nullptr; char *s; - option_resolution *alloc_resolution = NULL; - char *alloc_path = NULL; + option_resolution *alloc_resolution = nullptr; + char *alloc_path = nullptr; UINT64 free_space; UINT64 file_size; union filterinfo u; @@ -2073,17 +2073,17 @@ imgtoolerr_t imgtool_partition_get_file(imgtool_partition *partition, const char { imgtoolerr_t err; imgtool_stream *f; - char *new_fname = NULL; - char *alloc_dest = NULL; - const char *filter_extension = NULL; + char *new_fname = nullptr; + char *alloc_dest = nullptr; + const char *filter_extension = nullptr; if (!dest) { /* determine the filter extension, if appropriate */ - if (filter != NULL) + if (filter != nullptr) filter_extension = filter_get_info_string(filter, FILTINFO_STR_EXTENSION); - if (filter_extension != NULL) + if (filter_extension != nullptr) { alloc_dest = (char*)malloc(strlen(filename) + 1 + strlen(filter_extension) + 1); if (!alloc_dest) @@ -2109,7 +2109,7 @@ imgtoolerr_t imgtool_partition_get_file(imgtool_partition *partition, const char } new_fname = normalize_filename(partition, filename); - if (new_fname == NULL) + if (new_fname == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; @@ -2120,11 +2120,11 @@ imgtoolerr_t imgtool_partition_get_file(imgtool_partition *partition, const char goto done; done: - if (f != NULL) + if (f != nullptr) stream_close(f); - if (alloc_dest != NULL) + if (alloc_dest != nullptr) free(alloc_dest); - if (new_fname != NULL) + if (new_fname != nullptr) osd_free(new_fname); return err; } @@ -2140,9 +2140,9 @@ imgtoolerr_t imgtool_partition_put_file(imgtool_partition *partition, const char const char *source, option_resolution *opts, filter_getinfoproc filter) { imgtoolerr_t err; - imgtool_stream *f = NULL; + imgtool_stream *f = nullptr; imgtool_charset charset; - char *alloc_newfname = NULL; + char *alloc_newfname = nullptr; if (!newfname) newfname = (const char *) imgtool_basename((char *) source); @@ -2152,7 +2152,7 @@ imgtoolerr_t imgtool_partition_put_file(imgtool_partition *partition, const char { /* convert to native format */ alloc_newfname = native_from_utf8(charset, newfname); - if (alloc_newfname == NULL) + if (alloc_newfname == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_NATIVEFILE); goto done; @@ -2169,9 +2169,9 @@ imgtoolerr_t imgtool_partition_put_file(imgtool_partition *partition, const char done: /* clean up */ - if (f != NULL) + if (f != nullptr) stream_close(f); - if (alloc_newfname != NULL) + if (alloc_newfname != nullptr) osd_free(alloc_newfname); return err; } @@ -2186,8 +2186,8 @@ done: imgtoolerr_t imgtool_partition_delete_file(imgtool_partition *partition, const char *fname) { imgtoolerr_t err; - char *alloc_path = NULL; - char *new_fname = NULL; + char *alloc_path = nullptr; + char *new_fname = nullptr; if (!partition->delete_file) { @@ -2196,7 +2196,7 @@ imgtoolerr_t imgtool_partition_delete_file(imgtool_partition *partition, const c } new_fname = normalize_filename(partition, fname); - if (new_fname == NULL) + if (new_fname == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; @@ -2234,8 +2234,8 @@ done: imgtoolerr_t imgtool_partition_list_file_forks(imgtool_partition *partition, const char *path, imgtool_forkent *ents, size_t len) { imgtoolerr_t err; - char *alloc_path = NULL; - char *new_fname = NULL; + char *alloc_path = nullptr; + char *new_fname = nullptr; if (!partition->list_forks) { @@ -2244,7 +2244,7 @@ imgtoolerr_t imgtool_partition_list_file_forks(imgtool_partition *partition, con } new_fname = normalize_filename(partition, path); - if (new_fname == NULL) + if (new_fname == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; @@ -2279,8 +2279,8 @@ done: imgtoolerr_t imgtool_partition_create_directory(imgtool_partition *partition, const char *path) { imgtoolerr_t err; - char *alloc_path = NULL; - char *new_path = NULL; + char *alloc_path = nullptr; + char *new_path = nullptr; /* implemented? */ if (!partition->create_dir) @@ -2290,7 +2290,7 @@ imgtoolerr_t imgtool_partition_create_directory(imgtool_partition *partition, co } new_path = normalize_filename(partition, path); - if (new_path == NULL) + if (new_path == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; @@ -2325,8 +2325,8 @@ done: imgtoolerr_t imgtool_partition_delete_directory(imgtool_partition *partition, const char *path) { imgtoolerr_t err; - char *alloc_path = NULL; - char *new_path = NULL; + char *alloc_path = nullptr; + char *new_path = nullptr; /* implemented? */ if (!partition->delete_dir) @@ -2336,7 +2336,7 @@ imgtoolerr_t imgtool_partition_delete_directory(imgtool_partition *partition, co } new_path = normalize_filename(partition, path); - if (new_path == NULL) + if (new_path == nullptr) { err = (imgtoolerr_t)(IMGTOOLERR_BADFILENAME | IMGTOOLERR_SRC_FUNCTIONALITY); goto done; @@ -2482,7 +2482,7 @@ UINT64 imgtool_partition_get_info_int(imgtool_partition *partition, UINT32 state void *imgtool_partition_extra_bytes(imgtool_partition *partition) { - void *ptr = NULL; + void *ptr = nullptr; if (partition->partition_extra_bytes > 0) ptr = ((UINT8 *) partition) + sizeof(*partition); assert(ptr); @@ -2618,16 +2618,16 @@ const char *imgtool_partition_get_base_name(imgtool_partition *partition, const imgtoolerr_t imgtool_directory_open(imgtool_partition *partition, const char *path, imgtool_directory **outenum) { imgtoolerr_t err = (imgtoolerr_t)IMGTOOLERR_SUCCESS; - imgtool_directory *enumeration = NULL; - char *alloc_path = NULL; - char *new_path = NULL; + imgtool_directory *enumeration = nullptr; + char *alloc_path = nullptr; + char *new_path = nullptr; size_t size; /* sanity checks */ assert(partition); assert(outenum); - *outenum = NULL; + *outenum = nullptr; if (!partition->next_enum) { @@ -2663,14 +2663,14 @@ imgtoolerr_t imgtool_directory_open(imgtool_partition *partition, const char *pa } done: - if (alloc_path != NULL) + if (alloc_path != nullptr) free(alloc_path); - if (new_path != NULL) + if (new_path != nullptr) osd_free(new_path); - if (err && (enumeration != NULL)) + if (err && (enumeration != nullptr)) { free(enumeration); - enumeration = NULL; + enumeration = nullptr; } *outenum = enumeration; return err; @@ -2731,17 +2731,17 @@ imgtoolerr_t imgtool_directory_get_next(imgtool_directory *directory, imgtool_di /* don't trust the module! */ if (!partition->supports_creation_time && (ent->creation_time != 0)) { - internal_error(NULL, "next_enum() specified creation_time, which is marked as unsupported by this module"); + internal_error(nullptr, "next_enum() specified creation_time, which is marked as unsupported by this module"); return IMGTOOLERR_UNEXPECTED; } if (!partition->supports_lastmodified_time && (ent->lastmodified_time != 0)) { - internal_error(NULL, "next_enum() specified lastmodified_time, which is marked as unsupported by this module"); + internal_error(nullptr, "next_enum() specified lastmodified_time, which is marked as unsupported by this module"); return IMGTOOLERR_UNEXPECTED; } if (!partition->path_separator && ent->directory) { - internal_error(NULL, "next_enum() returned a directory, which is marked as unsupported by this module"); + internal_error(nullptr, "next_enum() returned a directory, which is marked as unsupported by this module"); return IMGTOOLERR_UNEXPECTED; } return IMGTOOLERR_SUCCESS; diff --git a/src/tools/imgtool/library.cpp b/src/tools/imgtool/library.cpp index e2ce14d4461..88c1119a85a 100644 --- a/src/tools/imgtool/library.cpp +++ b/src/tools/imgtool/library.cpp @@ -30,7 +30,7 @@ imgtool_library *imgtool_library_create(void) object_pool *pool; /* create a memory pool */ - pool = pool_alloc_lib(NULL); + pool = pool_alloc_lib(nullptr); if (!pool) goto error; @@ -48,7 +48,7 @@ imgtool_library *imgtool_library_create(void) error: if (pool) pool_free_lib(pool); - return NULL; + return nullptr; } @@ -162,12 +162,12 @@ const imgtool_module *imgtool_library_unlink(imgtool_library *library, next = m->next ? &m->next->previous : &library->last; *previous = m->next; *next = m->previous; - m->previous = NULL; - m->next = NULL; + m->previous = nullptr; + m->next = nullptr; return m; } } - return NULL; + return nullptr; } @@ -278,5 +278,5 @@ char *imgtool_library_strdup(imgtool_library *library, const char *s) char *imgtool_library_strdup_allow_null(imgtool_library *library, const char *s) { - return s ? imgtool_library_strdup(library, s) : NULL; + return s ? imgtool_library_strdup(library, s) : nullptr; } diff --git a/src/tools/imgtool/library.h b/src/tools/imgtool/library.h index 25c923c1f4d..0ea52a68e44 100644 --- a/src/tools/imgtool/library.h +++ b/src/tools/imgtool/library.h @@ -308,7 +308,7 @@ INLINE INT64 imgtool_get_info_int(const imgtool_class *imgclass, UINT32 state) INLINE void *imgtool_get_info_ptr(const imgtool_class *imgclass, UINT32 state) { union imgtoolinfo info; - info.p = NULL; + info.p = nullptr; imgclass->get_info(imgclass, state, &info); return info.p; } @@ -316,7 +316,7 @@ INLINE void *imgtool_get_info_ptr(const imgtool_class *imgclass, UINT32 state) INLINE void *imgtool_get_info_fct(const imgtool_class *imgclass, UINT32 state) { union imgtoolinfo info; - info.f = NULL; + info.f = nullptr; imgclass->get_info(imgclass, state, &info); return info.f; } @@ -324,7 +324,7 @@ INLINE void *imgtool_get_info_fct(const imgtool_class *imgclass, UINT32 state) INLINE char *imgtool_get_info_string(const imgtool_class *imgclass, UINT32 state) { union imgtoolinfo info; - info.s = NULL; + info.s = nullptr; imgclass->get_info(imgclass, state, &info); return info.s; } diff --git a/src/tools/imgtool/main.cpp b/src/tools/imgtool/main.cpp index 6825b71fa81..fb34403f51a 100644 --- a/src/tools/imgtool/main.cpp +++ b/src/tools/imgtool/main.cpp @@ -38,15 +38,15 @@ static int parse_options(int argc, char *argv[], int minunnamed, int maxunnamed, int i; int lastunnamed = 0; char *s; - char *name = NULL; - char *value = NULL; + char *name = nullptr; + char *value = nullptr; optreserr_t oerr; static char buf[256]; if (filter) - *filter = NULL; + *filter = nullptr; if (fork) - *fork = NULL; + *fork = nullptr; for (i = 0; i < argc; i++) { @@ -177,9 +177,9 @@ static int cmd_dir(const struct command *c, int argc, char *argv[]) imgtoolerr_t err; int total_count, total_size, freespace_err; UINT64 freespace; - imgtool_image *image = NULL; - imgtool_partition *partition = NULL; - imgtool_directory *imgenum = NULL; + imgtool_image *image = nullptr; + imgtool_partition *partition = nullptr; + imgtool_directory *imgenum = nullptr; imgtool_dirent ent; char buf[512]; char last_modified[19]; @@ -196,7 +196,7 @@ static int cmd_dir(const struct command *c, int argc, char *argv[]) if (err) goto done; - path = argc > 2 ? argv[2] : NULL; + path = argc > 2 ? argv[2] : nullptr; err = imgtool_directory_open(partition, path, &imgenum); if (err) @@ -260,7 +260,7 @@ done: if (image) imgtool_image_close(image); if (err) - reporterror(err, c, argv[0], argv[1], NULL, NULL, NULL); + reporterror(err, c, argv[0], argv[1], nullptr, nullptr, nullptr); return err ? -1 : 0; } @@ -269,8 +269,8 @@ done: static int cmd_get(const struct command *c, int argc, char *argv[]) { imgtoolerr_t err; - imgtool_image *image = NULL; - imgtool_partition *partition = NULL; + imgtool_image *image = nullptr; + imgtool_partition *partition = nullptr; const char *filename; char *new_filename; int unnamedargs = 0; @@ -288,11 +288,11 @@ static int cmd_get(const struct command *c, int argc, char *argv[]) filename = interpret_filename(argv[2]); - unnamedargs = parse_options(argc, argv, 3, 4, NULL, &filter, &fork); + unnamedargs = parse_options(argc, argv, 3, 4, nullptr, &filter, &fork); if (unnamedargs < 0) goto done; - new_filename = (unnamedargs == 4) ? argv[3] : NULL; + new_filename = (unnamedargs == 4) ? argv[3] : nullptr; err = imgtool_partition_get_file(partition, filename, fork, new_filename, filter); if (err) @@ -302,7 +302,7 @@ static int cmd_get(const struct command *c, int argc, char *argv[]) done: if (err) - reporterror(err, c, argv[0], argv[1], argv[2], argv[3], NULL); + reporterror(err, c, argv[0], argv[1], argv[2], argv[3], nullptr); if (partition) imgtool_partition_close(partition); if (image) @@ -316,13 +316,13 @@ static int cmd_put(const struct command *c, int argc, char *argv[]) { imgtoolerr_t err = IMGTOOLERR_SUCCESS; int i; - imgtool_image *image = NULL; - imgtool_partition *partition = NULL; - const char *filename = NULL; + imgtool_image *image = nullptr; + imgtool_partition *partition = nullptr; + const char *filename = nullptr; int unnamedargs; filter_getinfoproc filter; const imgtool_module *module; - option_resolution *resolution = NULL; + option_resolution *resolution = nullptr; const char *fork; const char *new_filename; char **filename_list; @@ -394,7 +394,7 @@ done: if (resolution) option_resolution_close(resolution); if (err) - reporterror(err, c, argv[0], argv[1], filename, NULL, resolution); + reporterror(err, c, argv[0], argv[1], filename, nullptr, resolution); return err ? -1 : 0; } @@ -403,13 +403,13 @@ done: static int cmd_getall(const struct command *c, int argc, char *argv[]) { imgtoolerr_t err; - imgtool_image *image = NULL; - imgtool_partition *partition = NULL; - imgtool_directory *imgenum = NULL; + imgtool_image *image = nullptr; + imgtool_partition *partition = nullptr; + imgtool_directory *imgenum = nullptr; imgtool_dirent ent; filter_getinfoproc filter; int unnamedargs; - const char *path = NULL; + const char *path = nullptr; int arg; int partition_index = 0; @@ -427,7 +427,7 @@ static int cmd_getall(const struct command *c, int argc, char *argv[]) path = argv[arg++]; } - unnamedargs = parse_options(argc, argv, arg, arg, NULL, &filter, NULL); + unnamedargs = parse_options(argc, argv, arg, arg, nullptr, &filter, nullptr); if (unnamedargs < 0) goto done; @@ -441,7 +441,7 @@ static int cmd_getall(const struct command *c, int argc, char *argv[]) { fprintf(stdout, "Retrieving %s (%u bytes)\n", ent.filename, (unsigned int) ent.filesize); - err = imgtool_partition_get_file(partition, ent.filename, NULL, NULL, filter); + err = imgtool_partition_get_file(partition, ent.filename, nullptr, nullptr, filter); if (err) goto done; } @@ -454,7 +454,7 @@ done: if (image) imgtool_image_close(image); if (err) - reporterror(err, c, argv[0], argv[1], NULL, NULL, NULL); + reporterror(err, c, argv[0], argv[1], nullptr, nullptr, nullptr); return err ? -1 : 0; } @@ -463,8 +463,8 @@ done: static int cmd_del(const struct command *c, int argc, char *argv[]) { imgtoolerr_t err; - imgtool_image *image = NULL; - imgtool_partition *partition = NULL; + imgtool_image *image = nullptr; + imgtool_partition *partition = nullptr; int partition_index = 0; err = imgtool_image_open_byname(argv[0], argv[1], OSD_FOPEN_RW, &image); @@ -485,7 +485,7 @@ done: if (image) imgtool_image_close(image); if (err) - reporterror(err, c, argv[0], argv[1], argv[2], NULL, NULL); + reporterror(err, c, argv[0], argv[1], argv[2], nullptr, nullptr); return err ? -1 : 0; } @@ -494,8 +494,8 @@ done: static int cmd_mkdir(const struct command *c, int argc, char *argv[]) { imgtoolerr_t err; - imgtool_image *image = NULL; - imgtool_partition *partition = NULL; + imgtool_image *image = nullptr; + imgtool_partition *partition = nullptr; int partition_index = 0; err = imgtool_image_open_byname(argv[0], argv[1], OSD_FOPEN_RW, &image); @@ -516,7 +516,7 @@ done: if (image) imgtool_image_close(image); if (err) - reporterror(err, c, argv[0], argv[1], argv[2], NULL, NULL); + reporterror(err, c, argv[0], argv[1], argv[2], nullptr, nullptr); return err ? -1 : 0; } @@ -525,8 +525,8 @@ done: static int cmd_rmdir(const struct command *c, int argc, char *argv[]) { imgtoolerr_t err; - imgtool_image *image = NULL; - imgtool_partition *partition = NULL; + imgtool_image *image = nullptr; + imgtool_partition *partition = nullptr; int partition_index = 0; err = imgtool_image_open_byname(argv[0], argv[1], OSD_FOPEN_RW, &image); @@ -547,7 +547,7 @@ done: if (image) imgtool_image_close(image); if (err) - reporterror(err, c, argv[0], argv[1], argv[2], NULL, NULL); + reporterror(err, c, argv[0], argv[1], argv[2], nullptr, nullptr); return err ? -1 : 0; } @@ -571,7 +571,7 @@ static int cmd_identify(const struct command *c, int argc, char *argv[]) return 0; error: - reporterror(err, c, NULL, argv[0], NULL, NULL, 0); + reporterror(err, c, nullptr, argv[0], nullptr, nullptr, nullptr); return -1; } @@ -582,7 +582,7 @@ static int cmd_create(const struct command *c, int argc, char *argv[]) imgtoolerr_t err; int unnamedargs; const imgtool_module *module; - option_resolution *resolution = NULL; + option_resolution *resolution = nullptr; module = imgtool_find_module(argv[0]); if (!module) @@ -601,11 +601,11 @@ static int cmd_create(const struct command *c, int argc, char *argv[]) } } - unnamedargs = parse_options(argc, argv, 2, 3, resolution, NULL, NULL); + unnamedargs = parse_options(argc, argv, 2, 3, resolution, nullptr, nullptr); if (unnamedargs < 0) return -1; - err = imgtool_image_create(module, argv[1], resolution, NULL); + err = imgtool_image_create(module, argv[1], resolution, nullptr); if (err) goto error; @@ -616,7 +616,7 @@ static int cmd_create(const struct command *c, int argc, char *argv[]) error: if (resolution) option_resolution_close(resolution); - reporterror(err, c, argv[0], argv[1], NULL, NULL, 0); + reporterror(err, c, argv[0], argv[1], nullptr, nullptr, nullptr); return -1; } @@ -626,7 +626,7 @@ static int cmd_readsector(const struct command *c, int argc, char *argv[]) { imgtoolerr_t err; imgtool_image *img; - imgtool_stream *stream = NULL; + imgtool_stream *stream = nullptr; dynamic_buffer buffer; UINT32 size, track, head, sector; @@ -663,7 +663,7 @@ done: if (stream) stream_close(stream); if (err) - reporterror(err, c, argv[0], argv[1], NULL, NULL, 0); + reporterror(err, c, argv[0], argv[1], nullptr, nullptr, nullptr); return err ? -1 : 0; } @@ -673,7 +673,7 @@ static int cmd_writesector(const struct command *c, int argc, char *argv[]) { imgtoolerr_t err; imgtool_image *img; - imgtool_stream *stream = NULL; + imgtool_stream *stream = nullptr; dynamic_buffer buffer; UINT32 size, track, head, sector; @@ -707,7 +707,7 @@ done: if (stream) stream_close(stream); if (err) - reporterror(err, c, argv[0], argv[1], NULL, NULL, 0); + reporterror(err, c, argv[0], argv[1], nullptr, nullptr, nullptr); return err ? -1 : 0; } @@ -719,7 +719,7 @@ static int cmd_listformats(const struct command *c, int argc, char *argv[]) fprintf(stdout, "Image formats supported by imgtool:\n\n"); - mod = imgtool_find_module(NULL); + mod = imgtool_find_module(nullptr); while(mod) { fprintf(stdout, " %-25s%s\n", mod->name, mod->description); @@ -865,7 +865,7 @@ static int cmd_listdriveroptions(const struct command *c, int argc, char *argv[] return 0; error: - reporterror((imgtoolerr_t)(IMGTOOLERR_MODULENOTFOUND|IMGTOOLERR_SRC_MODULE), c, argv[0], NULL, NULL, NULL, NULL); + reporterror((imgtoolerr_t)(IMGTOOLERR_MODULENOTFOUND|IMGTOOLERR_SRC_MODULE), c, argv[0], nullptr, nullptr, nullptr, nullptr); return -1; } @@ -886,8 +886,8 @@ static const struct command cmds[] = { "readsector", cmd_readsector, " ", 6, 6, 0 }, { "writesector", cmd_writesector, " ", 6, 6, 0 }, { "identify", cmd_identify, "", 1, 1 }, - { "listformats", cmd_listformats, NULL, 0, 0, 0 }, - { "listfilters", cmd_listfilters, NULL, 0, 0, 0 }, + { "listformats", cmd_listformats, nullptr, 0, 0, 0 }, + { "listfilters", cmd_listfilters, nullptr, 0, 0, 0 }, { "listdriveroptions", cmd_listdriveroptions, "", 1, 1, 0 } }; @@ -918,7 +918,7 @@ int CLIB_DECL main(int argc, char *argv[]) goto cmderror; /* initialize the imgtool core */ - imgtool_init(TRUE, NULL); + imgtool_init(TRUE, nullptr); if (c->lastargrepeats && (argc > c->maxargs)) { diff --git a/src/tools/imgtool/modules.cpp b/src/tools/imgtool/modules.cpp index 982fec1972c..72f81b862b9 100644 --- a/src/tools/imgtool/modules.cpp +++ b/src/tools/imgtool/modules.cpp @@ -60,18 +60,18 @@ imgtoolerr_t imgtool_create_cannonical_library(int omit_untested, imgtool_librar /* if we are omitting untested, go through and block out the functionality in question */ if (omit_untested) { - module = NULL; - while((module = imgtool_library_iterate(lib, module)) != NULL) + module = nullptr; + while((module = imgtool_library_iterate(lib, module)) != nullptr) { if (module->writing_untested) { - module->write_sector = NULL; + module->write_sector = nullptr; } if (module->creation_untested) { - module->create = NULL; - module->createimage_optguide = NULL; - module->createimage_optspec = NULL; + module->create = nullptr; + module->createimage_optguide = nullptr; + module->createimage_optspec = nullptr; } } } diff --git a/src/tools/imgtool/stream.cpp b/src/tools/imgtool/stream.cpp index 5c9cf4050c6..461d2fd99bd 100644 --- a/src/tools/imgtool/stream.cpp +++ b/src/tools/imgtool/stream.cpp @@ -41,9 +41,9 @@ struct imgtool_stream static imgtool_stream *stream_open_zip(const char *zipname, const char *subname, int read_or_write) { - imgtool_stream *imgfile = NULL; + imgtool_stream *imgfile = nullptr; // zip_error ziperr; - zip_file *z = NULL; + zip_file *z = nullptr; const zip_file_header *zipent; FILE *f; @@ -96,7 +96,7 @@ error: free(imgfile->u.buffer); free(imgfile); } - return NULL; + return nullptr; } @@ -105,7 +105,7 @@ imgtool_stream *stream_open(const char *fname, int read_or_write) { file_error filerr; const char *ext; - imgtool_stream *imgfile = NULL; + imgtool_stream *imgfile = nullptr; static const UINT32 write_modes[] = { OPEN_FLAG_READ, @@ -113,16 +113,16 @@ imgtool_stream *stream_open(const char *fname, int read_or_write) OPEN_FLAG_READ | OPEN_FLAG_WRITE, OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE }; - core_file *f = NULL; - char *buf = NULL; + core_file *f = nullptr; + char *buf = nullptr; int len, i; - imgtool_stream *s = NULL; + imgtool_stream *s = nullptr; char c; /* maybe we are just a ZIP? */ ext = strrchr(fname, '.'); if (ext && !core_stricmp(ext, ".zip")) - return stream_open_zip(fname, NULL, read_or_write); + return stream_open_zip(fname, nullptr, read_or_write); filerr = core_fopen(fname, write_modes[read_or_write], &f); if (filerr != FILERR_NONE) @@ -148,7 +148,7 @@ imgtool_stream *stream_open(const char *fname, int read_or_write) } } free(buf); - buf = NULL; + buf = nullptr; if (s) return s; @@ -173,13 +173,13 @@ imgtool_stream *stream_open(const char *fname, int read_or_write) return imgfile; error: - if (imgfile != NULL) + if (imgfile != nullptr) free((void *) imgfile); - if (f != NULL) + if (f != nullptr) core_fclose(f); if (buf) free(buf); - return (imgtool_stream *) NULL; + return (imgtool_stream *) nullptr; } @@ -190,7 +190,7 @@ imgtool_stream *stream_open_write_stream(int size) imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream)); if (!imgfile) - return NULL; + return nullptr; imgfile->imgtype = IMG_MEM; imgfile->write_protect = 0; @@ -201,7 +201,7 @@ imgtool_stream *stream_open_write_stream(int size) if (!imgfile->u.buffer) { free(imgfile); - return NULL; + return nullptr; } return imgfile; @@ -215,7 +215,7 @@ imgtool_stream *stream_open_mem(void *buf, size_t sz) imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream)); if (!imgfile) - return NULL; + return nullptr; memset(imgfile, 0, sizeof(*imgfile)); imgfile->imgtype = IMG_MEM; @@ -231,23 +231,23 @@ imgtool_stream *stream_open_mem(void *buf, size_t sz) void stream_close(imgtool_stream *s) { - assert(s != NULL); + assert(s != nullptr); switch(s->imgtype) { case IMG_FILE: - if (s->u.file != NULL) + if (s->u.file != nullptr) { core_fclose(s->u.file); - s->u.file = NULL; + s->u.file = nullptr; } break; case IMG_MEM: - if (s->u.buffer != NULL) + if (s->u.buffer != nullptr) { free(s->u.buffer); - s->u.buffer = NULL; + s->u.buffer = nullptr; } break; @@ -262,7 +262,7 @@ void stream_close(imgtool_stream *s) core_file *stream_core_file(imgtool_stream *stream) { - return (stream->imgtype == IMG_FILE) ? stream->u.file : NULL; + return (stream->imgtype == IMG_FILE) ? stream->u.file : nullptr; } @@ -369,7 +369,7 @@ void *stream_getptr(imgtool_stream *f) break; default: - ptr = NULL; + ptr = nullptr; break; } return ptr; diff --git a/src/tools/jedutil.cpp b/src/tools/jedutil.cpp index 7e4fe826c8a..284b77ae217 100644 --- a/src/tools/jedutil.cpp +++ b/src/tools/jedutil.cpp @@ -1875,93 +1875,93 @@ static pal_data paldata[] = { pal10l8pinfusecolumns, ARRAY_LENGTH(pal10l8pinfusecolumns), print_pal10l8_product_terms, config_pal10l8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL10H8", 320, pal10h8pinfuserows, ARRAY_LENGTH(pal10h8pinfuserows), pal10h8pinfusecolumns, ARRAY_LENGTH(pal10h8pinfusecolumns), print_pal10h8_product_terms, config_pal10h8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL12H6", 384, pal12h6pinfuserows, ARRAY_LENGTH(pal12h6pinfuserows), pal12h6pinfusecolumns, ARRAY_LENGTH(pal12h6pinfusecolumns), print_pal12h6_product_terms, config_pal12h6_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL14H4", 448, pal14h4pinfuserows, ARRAY_LENGTH(pal14h4pinfuserows), pal14h4pinfusecolumns, ARRAY_LENGTH(pal14h4pinfusecolumns), print_pal14h4_product_terms, config_pal14h4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16H2", 512, pal16h2pinfuserows, ARRAY_LENGTH(pal16h2pinfuserows), pal16h2pinfusecolumns, ARRAY_LENGTH(pal16h2pinfusecolumns), print_pal16h2_product_terms, config_pal16h2_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16C1", 512, pal16c1pinfuserows, ARRAY_LENGTH(pal16c1pinfuserows), pal16c1pinfusecolumns, ARRAY_LENGTH(pal16c1pinfusecolumns), print_pal16c1_product_terms, config_pal16c1_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL12L6", 384, pal12l6pinfuserows, ARRAY_LENGTH(pal12l6pinfuserows), pal12l6pinfusecolumns, ARRAY_LENGTH(pal12l6pinfusecolumns), print_pal12l6_product_terms, config_pal12l6_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL14L4", 448, pal14l4pinfuserows, ARRAY_LENGTH(pal14l4pinfuserows), pal14l4pinfusecolumns, ARRAY_LENGTH(pal14l4pinfusecolumns), print_pal14l4_product_terms, config_pal14l4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16L2", 512, pal16l2pinfuserows, ARRAY_LENGTH(pal16l2pinfuserows), pal16l2pinfusecolumns, ARRAY_LENGTH(pal16l2pinfusecolumns), print_pal16l2_product_terms, config_pal16l2_pins, - NULL, - NULL}, + nullptr, + nullptr}, /*{"15S8", 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},*/ {"PAL16L8", 2048, pal16l8pinfuserows, ARRAY_LENGTH(pal16l8pinfuserows), pal16l8pinfusecolumns, ARRAY_LENGTH(pal16l8pinfusecolumns), print_pal16l8_product_terms, config_pal16l8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16R4", 2048, pal16r4pinfuserows, ARRAY_LENGTH(pal16r4pinfuserows), pal16r4pinfusecolumns, ARRAY_LENGTH(pal16r4pinfusecolumns), print_pal16r4_product_terms, config_pal16r4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16R6", 2048, pal16r6pinfuserows, ARRAY_LENGTH(pal16r6pinfuserows), pal16r6pinfusecolumns, ARRAY_LENGTH(pal16r6pinfusecolumns), print_pal16r6_product_terms, config_pal16r6_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16R8", 2048, pal16r8pinfuserows, ARRAY_LENGTH(pal16r8pinfuserows), pal16r8pinfusecolumns, ARRAY_LENGTH(pal16r8pinfusecolumns), print_pal16r8_product_terms, config_pal16r8_pins, - NULL, - NULL}, + nullptr, + nullptr}, /*{"PAL16RA8", 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}, {"PAL16V8R", 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},*/ {"PALCE16V8", 2194, @@ -1969,85 +1969,85 @@ static pal_data paldata[] = { palce16v8pinfusecolumns, ARRAY_LENGTH(palce16v8pinfusecolumns), print_palce16v8_product_terms, config_palce16v8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"GAL16V8", 2194, gal16v8pinfuserows, ARRAY_LENGTH(gal16v8pinfuserows), gal16v8pinfusecolumns, ARRAY_LENGTH(gal16v8pinfusecolumns), print_gal16v8_product_terms, config_gal16v8_pins, is_gal16v8_product_term_enabled, - NULL}, + nullptr}, {"18CV8", 2696, peel18cv8pinfuserows, ARRAY_LENGTH(peel18cv8pinfuserows), peel18cv8pinfusecolumns, ARRAY_LENGTH(peel18cv8pinfusecolumns), print_peel18cv8_product_terms, config_peel18cv8_pins, - NULL, + nullptr, get_peel18cv8_pin_fuse_state}, {"GAL18V10", 3540, gal18v10pinfuserows, ARRAY_LENGTH(gal18v10pinfuserows), gal18v10pinfusecolumns, ARRAY_LENGTH(gal18v10pinfusecolumns), print_gal18v10_product_terms, config_gal18v10_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20L8", 2560, pal20l8pinfuserows, ARRAY_LENGTH(pal20l8pinfuserows), pal20l8pinfusecolumns, ARRAY_LENGTH(pal20l8pinfusecolumns), print_pal20l8_product_terms, config_pal20l8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20L10", 1600, pal20l10pinfuserows, ARRAY_LENGTH(pal20l10pinfuserows), pal20l10pinfusecolumns, ARRAY_LENGTH(pal20l10pinfusecolumns), print_pal20l10_product_terms, config_pal20l10_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20R4", 2560, pal20r4pinfuserows, ARRAY_LENGTH(pal20r4pinfuserows), pal20r4pinfusecolumns, ARRAY_LENGTH(pal20r4pinfusecolumns), print_pal20r4_product_terms, config_pal20r4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20R6", 2560, pal20r6pinfuserows, ARRAY_LENGTH(pal20r6pinfuserows), pal20r6pinfusecolumns, ARRAY_LENGTH(pal20r6pinfusecolumns), print_pal20r6_product_terms, config_pal20r6_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20R8", 2560, pal20r8pinfuserows, ARRAY_LENGTH(pal20r8pinfuserows), pal20r8pinfusecolumns, ARRAY_LENGTH(pal20r8pinfusecolumns), print_pal20r8_product_terms, config_pal20r8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20X4", 1600, pal20x4pinfuserows, ARRAY_LENGTH(pal20x4pinfuserows), pal20x4pinfusecolumns, ARRAY_LENGTH(pal20x4pinfusecolumns), print_pal20x4_product_terms, config_pal20x4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20X8", 1600, pal20x8pinfuserows, ARRAY_LENGTH(pal20x8pinfuserows), pal20x8pinfusecolumns, ARRAY_LENGTH(pal20x8pinfusecolumns), print_pal20x8_product_terms, config_pal20x8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20X10", 1600, pal20x10pinfuserows, ARRAY_LENGTH(pal20x10pinfuserows), pal20x10pinfusecolumns, ARRAY_LENGTH(pal20x10pinfusecolumns), print_pal20x10_product_terms, config_pal20x10_pins, - NULL, - NULL}, + nullptr, + nullptr}, /*{"PAL22V10", 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}, {"GAL20V8A", 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}, {"GAL22V10", 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}, @@ -2057,22 +2057,22 @@ static pal_data paldata[] = { _82s153_pls153pinfusecolumns, ARRAY_LENGTH(_82s153_pls153pinfusecolumns), print_82s153_pls153_product_terms, config_82s153_pls153_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PLS153", 1842, _82s153_pls153pinfuserows, ARRAY_LENGTH(_82s153_pls153pinfuserows), _82s153_pls153pinfusecolumns, ARRAY_LENGTH(_82s153_pls153pinfusecolumns), print_82s153_pls153_product_terms, config_82s153_pls153_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"CK2605", 1106, ck2605pinfuserows, ARRAY_LENGTH(ck2605pinfuserows), ck2605pinfusecolumns, ARRAY_LENGTH(ck2605pinfusecolumns), print_ck2605_product_terms, config_ck2605_pins, - NULL, - NULL}, + nullptr, + nullptr}, #if defined(ricoh_pals) {"EPL10P8", 664, epl10p8pinfuserows, ARRAY_LENGTH(epl10p8pinfuserows), @@ -2136,141 +2136,141 @@ static pal_data paldata[] = { pal10p8pinfusecolumns, ARRAY_LENGTH(pal10p8pinfusecolumns), print_pal10p8_product_terms, config_pal10p8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL12P6", 390, pal12p6pinfuserows, ARRAY_LENGTH(pal12p6pinfuserows), pal12p6pinfusecolumns, ARRAY_LENGTH(pal12p6pinfusecolumns), print_pal12p6_product_terms, config_pal12p6_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL14P4", 452, pal14p4pinfuserows, ARRAY_LENGTH(pal14p4pinfuserows), pal14p4pinfusecolumns, ARRAY_LENGTH(pal14p4pinfusecolumns), print_pal14p4_product_terms, config_pal14p4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16P2", 514, pal16p2pinfuserows, ARRAY_LENGTH(pal16p2pinfuserows), pal16p2pinfusecolumns, ARRAY_LENGTH(pal16p2pinfusecolumns), print_pal16p2_product_terms, config_pal16p2_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16P8", 2056, pal16p8pinfuserows, ARRAY_LENGTH(pal16p8pinfuserows), pal16p8pinfusecolumns, ARRAY_LENGTH(pal16p8pinfusecolumns), print_pal16p8_product_terms, config_pal16p8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16RP4", 2056, pal16rp4pinfuserows, ARRAY_LENGTH(pal16rp4pinfuserows), pal16rp4pinfusecolumns, ARRAY_LENGTH(pal16rp4pinfusecolumns), print_pal16rp4_product_terms, config_pal16rp4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16RP6", 2056, pal16rp6pinfuserows, ARRAY_LENGTH(pal16rp6pinfuserows), pal16rp6pinfusecolumns, ARRAY_LENGTH(pal16rp6pinfusecolumns), print_pal16rp6_product_terms, config_pal16rp6_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16RP8", 2056, pal16rp8pinfuserows, ARRAY_LENGTH(pal16rp8pinfuserows), pal16rp8pinfusecolumns, ARRAY_LENGTH(pal16rp8pinfusecolumns), print_pal16rp8_product_terms, config_pal16rp8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL6L16", 192, pal6l16pinfuserows, ARRAY_LENGTH(pal6l16pinfuserows), pal6l16pinfusecolumns, ARRAY_LENGTH(pal6l16pinfusecolumns), print_pal6l16_product_terms, config_pal6l16_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL8L14", 224, pal8l14pinfuserows, ARRAY_LENGTH(pal8l14pinfuserows), pal8l14pinfusecolumns, ARRAY_LENGTH(pal8l14pinfusecolumns), print_pal8l14_product_terms, config_pal8l14_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL12H10", 480, pal12h10pinfuserows, ARRAY_LENGTH(pal12h10pinfuserows), pal12h10pinfusecolumns, ARRAY_LENGTH(pal12h10pinfusecolumns), print_pal12h10_product_terms, config_pal12h10_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL12L10", 480, pal12l10pinfuserows, ARRAY_LENGTH(pal12l10pinfuserows), pal12l10pinfusecolumns, ARRAY_LENGTH(pal12l10pinfusecolumns), print_pal12l10_product_terms, config_pal12l10_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL14H8", 560, pal14h8pinfuserows, ARRAY_LENGTH(pal14h8pinfuserows), pal14h8pinfusecolumns, ARRAY_LENGTH(pal14h8pinfusecolumns), print_pal14h8_product_terms, config_pal14h8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL14L8", 560, pal14l8pinfuserows, ARRAY_LENGTH(pal14l8pinfuserows), pal14l8pinfusecolumns, ARRAY_LENGTH(pal14l8pinfusecolumns), print_pal14l8_product_terms, config_pal14l8_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16H6", 640, pal16h6pinfuserows, ARRAY_LENGTH(pal16h6pinfuserows), pal16h6pinfusecolumns, ARRAY_LENGTH(pal16h6pinfusecolumns), print_pal16h6_product_terms, config_pal16h6_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL16L6", 640, pal16l6pinfuserows, ARRAY_LENGTH(pal16l6pinfuserows), pal16l6pinfusecolumns, ARRAY_LENGTH(pal16l6pinfusecolumns), print_pal16l6_product_terms, config_pal16l6_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL18H4", 720, pal18h4pinfuserows, ARRAY_LENGTH(pal18h4pinfuserows), pal18h4pinfusecolumns, ARRAY_LENGTH(pal18h4pinfusecolumns), print_pal18h4_product_terms, config_pal18h4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL18L4", 720, pal18l4pinfuserows, ARRAY_LENGTH(pal18l4pinfuserows), pal18l4pinfusecolumns, ARRAY_LENGTH(pal18l4pinfusecolumns), print_pal18l4_product_terms, config_pal18l4_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20C1", 640, pal20c1pinfuserows, ARRAY_LENGTH(pal20c1pinfuserows), pal20c1pinfusecolumns, ARRAY_LENGTH(pal20c1pinfusecolumns), print_pal20c1_product_terms, config_pal20c1_pins, - NULL, - NULL}, + nullptr, + nullptr}, {"PAL20L2", 640, pal20l2pinfuserows, ARRAY_LENGTH(pal20l2pinfuserows), pal20l2pinfusecolumns, ARRAY_LENGTH(pal20l2pinfusecolumns), print_pal20l2_product_terms, config_pal20l2_pins, - NULL, - NULL}}; + nullptr, + nullptr}}; /*************************************************************************** CORE IMPLEMENTATION @@ -2333,7 +2333,7 @@ static const pal_data* find_pal_data(const char *name) } } - return NULL; + return nullptr; } @@ -2355,7 +2355,7 @@ static const pin_fuse_rows* find_fuse_rows(const pal_data* pal, UINT16 pin) } } - return NULL; + return nullptr; } @@ -2377,7 +2377,7 @@ static const pin_fuse_columns* find_fuse_columns(const pal_data* pal, UINT16 pin } } - return NULL; + return nullptr; } @@ -7054,7 +7054,7 @@ static int command_convert(int argc, char *argv[]) printf(" Total fuses = %d\n", jed.numfuses); /* generate the output */ - dstbuflen = jedbin_output(&jed, NULL, 0); + dstbuflen = jedbin_output(&jed, nullptr, 0); dstbuf = (UINT8 *)malloc(dstbuflen); if (!dstbuf) { @@ -7082,7 +7082,7 @@ static int command_convert(int argc, char *argv[]) printf(" Total fuses = %d\n", jed.numfuses); /* generate the output */ - dstbuflen = jed_output(&jed, NULL, 0); + dstbuflen = jed_output(&jed, nullptr, 0); dstbuf = (UINT8 *)malloc(dstbuflen); if (!dstbuf) { diff --git a/src/tools/ldresample.cpp b/src/tools/ldresample.cpp index d22fcd7a4a9..771c4e94676 100644 --- a/src/tools/ldresample.cpp +++ b/src/tools/ldresample.cpp @@ -248,7 +248,7 @@ static bool read_chd(chd_file &file, UINT32 field, movie_info &info, UINT32 soun file.codec_configure(CHD_CODEC_AVHUFF, AVHUFF_CODEC_DECOMPRESS_CONFIG, &avconfig); // read the field - chd_error chderr = file.read_hunk(field, NULL); + chd_error chderr = file.read_hunk(field, nullptr); return (chderr == CHDERR_NONE); } @@ -508,13 +508,13 @@ int main(int argc, char *argv[]) if (argc < 2) return usage(); const char *srcfilename = argv[1]; - const char *dstfilename = (argc < 3) ? NULL : argv[2]; + const char *dstfilename = (argc < 3) ? nullptr : argv[2]; double offset = (argc < 4) ? 0.0 : atof(argv[3]); double slope = (argc < 5) ? 1.0 : atof(argv[4]); // print basic information printf("Input file: %s\n", srcfilename); - if (dstfilename != NULL) + if (dstfilename != nullptr) { printf("Output file: %s\n", dstfilename); printf("Offset: %f\n", offset); @@ -538,7 +538,7 @@ int main(int argc, char *argv[]) printf("Total fields: %d\n", info.numfields); // if we don't have a destination file, scan for edges - if (dstfilename == NULL) + if (dstfilename == nullptr) { for (UINT32 fieldnum = 60; fieldnum < info.numfields - 60; fieldnum += 30) { @@ -554,7 +554,7 @@ int main(int argc, char *argv[]) // open the destination file chd_resample_compressor dstfile(srcfile, info, INT64(offset * 65536.0 * 256.0), INT64(slope * 65536.0 * 256.0)); err = create_chd(dstfile, dstfilename, srcfile, info); - if (dstfile == NULL) + if (dstfile == nullptr) { fprintf(stderr, "Unable to create file '%s'\n", dstfilename); return 1; diff --git a/src/tools/ldverify.cpp b/src/tools/ldverify.cpp index 020e611181c..ab3947dfaea 100644 --- a/src/tools/ldverify.cpp +++ b/src/tools/ldverify.cpp @@ -107,7 +107,7 @@ static void *open_avi(const char *filename, movie_info &info) if (avierr != AVIERR_NONE) { fprintf(stderr, "Error opening AVI file: %s\n", avi_error_string(avierr)); - return NULL; + return nullptr; } // extract movie info @@ -171,7 +171,7 @@ static void close_avi(void *file) static void *open_chd(const char *filename, movie_info &info) { - chd_file *chd = new chd_file; + auto chd = new chd_file; // open the file chd_error chderr = chd->open(filename); @@ -179,7 +179,7 @@ static void *open_chd(const char *filename, movie_info &info) { fprintf(stderr, "Error opening CHD file: %s\n", chd_file::error_string(chderr)); delete chd; - return NULL; + return nullptr; } // get the metadata @@ -189,7 +189,7 @@ static void *open_chd(const char *filename, movie_info &info) { fprintf(stderr, "Error getting A/V metadata: %s\n", chd_file::error_string(chderr)); delete chd; - return NULL; + return nullptr; } // extract the info @@ -198,7 +198,7 @@ static void *open_chd(const char *filename, movie_info &info) { fprintf(stderr, "Improperly formatted metadata\n"); delete chd; - return NULL; + return nullptr; } // extract movie info @@ -249,7 +249,7 @@ static int read_chd(void *file, int frame, bitmap_yuy16 &bitmap, INT16 *lsound, chdfile->codec_configure(CHD_CODEC_AVHUFF, AVHUFF_CODEC_DECOMPRESS_CONFIG, &avconfig); // read the frame - chd_error chderr = chdfile->read_hunk(frame * interlace_factor + fieldnum, NULL); + chd_error chderr = chdfile->read_hunk(frame * interlace_factor + fieldnum, nullptr); if (chderr != CHDERR_NONE) return false; @@ -735,7 +735,7 @@ int main(int argc, char *argv[]) printf("Processing file: %s\n", srcfile); movie_info info = { 0 }; void *file = isavi ? open_avi(srcfile, info) : open_chd(srcfile, info); - if (file == NULL) + if (file == nullptr) { fprintf(stderr, "Unable to open file '%s'\n", srcfile); return 1; diff --git a/src/tools/pngcmp.cpp b/src/tools/pngcmp.cpp index 4b0974d824f..dda54ed7730 100644 --- a/src/tools/pngcmp.cpp +++ b/src/tools/pngcmp.cpp @@ -72,7 +72,7 @@ static int generate_png_diff(const std::string& imgfile1, const std::string& img bitmap_argb32 bitmap2; bitmap_argb32 finalbitmap; int width, height, maxwidth; - core_file *file = NULL; + core_file *file = nullptr; file_error filerr; png_error pngerr; int error = 100; @@ -150,8 +150,8 @@ static int generate_png_diff(const std::string& imgfile1, const std::string& img /* iterate over rows in these bitmaps */ for (y = 0; y < curheight; y++) { - UINT32 *src1 = (y < bitmap1.height()) ? &bitmap1.pix32(y) : NULL; - UINT32 *src2 = (y < bitmap2.height()) ? &bitmap2.pix32(y) : NULL; + UINT32 *src1 = (y < bitmap1.height()) ? &bitmap1.pix32(y) : nullptr; + UINT32 *src2 = (y < bitmap2.height()) ? &bitmap2.pix32(y) : nullptr; UINT32 *dst1 = &finalbitmap.pix32(y); UINT32 *dst2 = &finalbitmap.pix32(y, bitmap1.width() + BITMAP_SPACE); UINT32 *dstdiff = &finalbitmap.pix32(y, bitmap1.width() + BITMAP_SPACE + maxwidth + BITMAP_SPACE); @@ -161,9 +161,9 @@ static int generate_png_diff(const std::string& imgfile1, const std::string& img { int pix1 = -1, pix2 = -2; - if (src1 != NULL && x < bitmap1.width()) + if (src1 != nullptr && x < bitmap1.width()) pix1 = dst1[x] = src1[x]; - if (src2 != NULL && x < bitmap2.width()) + if (src2 != nullptr && x < bitmap2.width()) pix2 = dst2[x] = src2[x]; dstdiff[x] = (pix1 != pix2) ? 0xffffffff : 0xff000000; } @@ -176,7 +176,7 @@ static int generate_png_diff(const std::string& imgfile1, const std::string& img printf("Could not open %s (%d)\n", outfilename.c_str(), filerr); goto error; } - pngerr = png_write_bitmap(file, NULL, finalbitmap, 0, NULL); + pngerr = png_write_bitmap(file, nullptr, finalbitmap, 0, nullptr); core_fclose(file); if (pngerr != PNGERR_NONE) { diff --git a/src/tools/regrep.cpp b/src/tools/regrep.cpp index 8c2beddf0ed..6f5adbf8f22 100644 --- a/src/tools/regrep.cpp +++ b/src/tools/regrep.cpp @@ -287,14 +287,14 @@ static summary_file *get_file(const char *filename) summary_file *file; /* use the first two characters as a lookup */ - for (file = filehash[filename[0] & 0x7f][filename[1] & 0x7f]; file != NULL; file = file->next) + for (file = filehash[filename[0] & 0x7f][filename[1] & 0x7f]; file != nullptr; file = file->next) if (strcmp(filename, file->name) == 0) return file; /* didn't find one -- allocate */ file = (summary_file *)malloc(sizeof(*file)); - if (file == NULL) - return NULL; + if (file == nullptr) + return nullptr; memset(file, 0, sizeof(*file)); /* set the name so we find it in the future */ @@ -314,7 +314,7 @@ static summary_file *get_file(const char *filename) static int read_summary_log(const char *filename, int index) { - summary_file *curfile = NULL; + summary_file *curfile = nullptr; char linebuffer[1024]; char *linestart; int drivers = 0; @@ -322,14 +322,14 @@ static int read_summary_log(const char *filename, int index) /* open the logfile */ file = fopen(filename, "r"); - if (file == NULL) + if (file == nullptr) { fprintf(stderr, "Error: file '%s' not found\n", filename); return 1; } /* parse it */ - while (fgets(linebuffer, sizeof(linebuffer), file) != NULL) + while (fgets(linebuffer, sizeof(linebuffer), file) != nullptr) { /* trim the leading/trailing spaces */ linestart = trim_string(linebuffer); @@ -344,7 +344,7 @@ static int read_summary_log(const char *filename, int index) if (strncmp(linestart, "driver=", 7) == 0) { curfile = parse_driver_tag(linestart + 7, index); - if (curfile == NULL) + if (curfile == nullptr) goto error; drivers++; } @@ -353,7 +353,7 @@ static int read_summary_log(const char *filename, int index) else if (strncmp(linestart, "source=", 7) == 0) { /* error if no driver yet */ - if (curfile == NULL) + if (curfile == nullptr) { fprintf(stderr, "Unexpected @@@@@source= tag\n"); goto error; @@ -370,7 +370,7 @@ static int read_summary_log(const char *filename, int index) /* allocate a copy of the string */ lists[index].dir = (char *)malloc(strlen(dirname) + 1); - if (lists[index].dir == NULL) + if (lists[index].dir == nullptr) goto error; strcpy(lists[index].dir, dirname); fprintf(stderr, "Directory %s\n", lists[index].dir); @@ -378,7 +378,7 @@ static int read_summary_log(const char *filename, int index) } /* if not, consider other options */ - else if (curfile != NULL) + else if (curfile != nullptr) { int foundchars = 0; char *curptr; @@ -443,19 +443,19 @@ static summary_file *parse_driver_tag(char *linestart, int index) /* find the colon separating name from status */ colon = strchr(linestart, ':'); - if (colon == NULL) + if (colon == nullptr) { fprintf(stderr, "Unexpected text after @@@@@driver=\n"); - return NULL; + return nullptr; } /* NULL terminate at the colon and look up the file */ *colon = 0; curfile = get_file(trim_string(linestart)); - if (curfile == NULL) + if (curfile == nullptr) { fprintf(stderr, "Unable to allocate memory for driver\n"); - return NULL; + return nullptr; } /* clear out any old status for this file */ @@ -514,36 +514,36 @@ static summary_file *sort_file_list(void) numfiles = 0; for (c0 = 0; c0 < 128; c0++) for (c1 = 0; c1 < 128; c1++) - for (curfile = filehash[c0][c1]; curfile != NULL; curfile = curfile->next) + for (curfile = filehash[c0][c1]; curfile != nullptr; curfile = curfile->next) numfiles++; /* allocate an array of files */ filearray = (summary_file **)malloc(numfiles * sizeof(*filearray)); - if (filearray == NULL) + if (filearray == nullptr) { fprintf(stderr, "Out of memory!\n"); - return NULL; + return nullptr; } /* populate the array */ numfiles = 0; for (c0 = 0; c0 < 128; c0++) for (c1 = 0; c1 < 128; c1++) - for (curfile = filehash[c0][c1]; curfile != NULL; curfile = curfile->next) + for (curfile = filehash[c0][c1]; curfile != nullptr; curfile = curfile->next) filearray[numfiles++] = curfile; /* sort the array */ qsort(filearray, numfiles, sizeof(filearray[0]), compare_file); /* now regenerate a single list */ - listhead = NULL; + listhead = nullptr; tailptr = &listhead; for (filenum = 0; filenum < numfiles; filenum++) { *tailptr = filearray[filenum]; tailptr = &(*tailptr)->next; } - *tailptr = NULL; + *tailptr = nullptr; free(filearray); return listhead; @@ -566,7 +566,7 @@ static core_file *create_file_and_output_header(std::string &filename, std::stri /* create the indexfile */ if (core_fopen(filename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS | OPEN_FLAG_NO_BOM, &file) != FILERR_NONE) - return NULL; + return nullptr; /* print a header */ std::string modified(templatefile); @@ -615,17 +615,17 @@ static void output_report(std::string &dirname, std::string &tempheader, std::st /* initialize the lists */ for (bucknum = 0; bucknum < BUCKET_COUNT; bucknum++) { - buckethead[bucknum] = NULL; + buckethead[bucknum] = nullptr; buckettailptr[bucknum] = &buckethead[bucknum]; } /* compute the total number of files */ total = 0; - for (curfile = filelist; curfile != NULL; curfile = curfile->next) + for (curfile = filelist; curfile != nullptr; curfile = curfile->next) total++; /* first bucketize the games */ - for (curfile = filelist; curfile != NULL; curfile = curfile->next) + for (curfile = filelist; curfile != nullptr; curfile = curfile->next) { int statcount[STATUS_COUNT] = { 0 }; int bucket = BUCKET_UNKNOWN; @@ -683,12 +683,12 @@ static void output_report(std::string &dirname, std::string &tempheader, std::st /* terminate all the lists */ for (bucknum = 0; bucknum < BUCKET_COUNT; bucknum++) - *buckettailptr[bucknum] = NULL; + *buckettailptr[bucknum] = nullptr; /* output header */ strprintf(tempname,"%s" PATH_SEPARATOR "%s", dirname.c_str(), "index.html"); indexfile = create_file_and_output_header(tempname, tempheader, title); - if (indexfile == NULL) + if (indexfile == nullptr) { fprintf(stderr, "Error creating file '%s'\n", tempname.c_str()); return; @@ -699,7 +699,7 @@ static void output_report(std::string &dirname, std::string &tempheader, std::st { int curbucket = bucket_output_order[bucknum]; - if (buckethead[curbucket] != NULL) + if (buckethead[curbucket] != nullptr) { fprintf(stderr, "Outputting bucket: %s\n", bucket_name[curbucket]); append_driver_list_table(bucket_name[curbucket], dirname, indexfile, buckethead[curbucket], tempheader, tempfooter); @@ -836,7 +836,7 @@ static int generate_png_diff(const summary_file *curfile, std::string &destdir, int width, height, maxwidth; int bitmapcount = 0; int listnum, bmnum; - core_file *file = NULL; + core_file *file = nullptr; file_error filerr; png_error pngerr; int error = -1; @@ -901,8 +901,8 @@ static int generate_png_diff(const summary_file *curfile, std::string &destdir, /* iterate over rows in these bitmaps */ for (y = 0; y < curheight; y++) { - UINT32 *src1 = (y < bitmap1.height()) ? &bitmap1.pix32(y) : NULL; - UINT32 *src2 = (y < bitmap2.height()) ? &bitmap2.pix32(y) : NULL; + UINT32 *src1 = (y < bitmap1.height()) ? &bitmap1.pix32(y) : nullptr; + UINT32 *src2 = (y < bitmap2.height()) ? &bitmap2.pix32(y) : nullptr; UINT32 *dst1 = &finalbitmap.pix32(starty + y, 0); UINT32 *dst2 = &finalbitmap.pix32(starty + y, bitmap1.width() + BITMAP_SPACE); UINT32 *dstdiff = &finalbitmap.pix32(starty + y, bitmap1.width() + BITMAP_SPACE + maxwidth + BITMAP_SPACE); @@ -912,9 +912,9 @@ static int generate_png_diff(const summary_file *curfile, std::string &destdir, { int pix1 = -1, pix2 = -2; - if (src1 != NULL && x < bitmap1.width()) + if (src1 != nullptr && x < bitmap1.width()) pix1 = dst1[x] = src1[x]; - if (src2 != NULL && x < bitmap2.width()) + if (src2 != nullptr && x < bitmap2.width()) pix2 = dst2[x] = src2[x]; dstdiff[x] = (pix1 != pix2) ? 0xffffffff : 0xff000000; } @@ -928,7 +928,7 @@ static int generate_png_diff(const summary_file *curfile, std::string &destdir, filerr = core_fopen(dstfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &file); if (filerr != FILERR_NONE) goto error; - pngerr = png_write_bitmap(file, NULL, finalbitmap, 0, NULL); + pngerr = png_write_bitmap(file, nullptr, finalbitmap, 0, nullptr); core_fclose(file); if (pngerr != PNGERR_NONE) goto error; @@ -963,7 +963,7 @@ static void create_linked_file(std::string &dirname, const summary_file *curfile strprintf(title, "%s Regressions (%s)", curfile->name, curfile->source); strprintf(linkname,"%s" PATH_SEPARATOR "%s", dirname.c_str(), filename.c_str()); linkfile = create_file_and_output_header(linkname, tempheader, title); - if (linkfile == NULL) + if (linkfile == nullptr) { fprintf(stderr, "Error creating file '%s'\n", filename.c_str()); return; @@ -973,12 +973,12 @@ static void create_linked_file(std::string &dirname, const summary_file *curfile core_fprintf(linkfile, "\t

\n"); core_fprintf(linkfile, "\t\n"); core_fprintf(linkfile, "\t\t\n"); core_fprintf(linkfile, "\t\t\n"); core_fprintf(linkfile, "\t\t\n"); core_fprintf(linkfile, "\t
"); - if (prevfile != NULL) + if (prevfile != nullptr) core_fprintf(linkfile, "<< %s (%s)", prevfile->name, prevfile->name, prevfile->source); core_fprintf(linkfile, "Home"); - if (nextfile != NULL) + if (nextfile != nullptr) core_fprintf(linkfile, "%s (%s) >>", nextfile->name, nextfile->name, nextfile->source); core_fprintf(linkfile, "
\n"); @@ -993,7 +993,7 @@ static void create_linked_file(std::string &dirname, const summary_file *curfile core_fprintf(linkfile, "\n\t

%s

\n", lists[listnum].version); core_fprintf(linkfile, "\t

\n"); core_fprintf(linkfile, "\tStatus: %s\n", status_text[curfile->status[listnum]]); - if (pngfile != NULL) + if (pngfile != nullptr) imageindex = get_unique_index(curfile, listnum); if (imageindex != -1) core_fprintf(linkfile, " [%d]", imageindex); @@ -1008,7 +1008,7 @@ static void create_linked_file(std::string &dirname, const summary_file *curfile } /* output link to the image */ - if (pngfile != NULL) + if (pngfile != nullptr) { core_fprintf(linkfile, "\n\t

Screenshot Comparisons

\n"); core_fprintf(linkfile, "\t

\n"); @@ -1043,7 +1043,7 @@ static void append_driver_list_table(const char *header, std::string &dirname, c core_fprintf(indexfile, "\n\t\t\n"); /* if nothing, print a default message */ - if (listhead == NULL) + if (listhead == nullptr) { core_fprintf(indexfile, "\t\t\n\t\t\t"); core_fprintf(indexfile, "(No regressions detected)", list_count + 2); @@ -1051,16 +1051,16 @@ static void append_driver_list_table(const char *header, std::string &dirname, c } /* iterate over files */ - for (prevfile = NULL, curfile = listhead; curfile != NULL; prevfile = curfile, curfile = curfile->next) + for (prevfile = nullptr, curfile = listhead; curfile != nullptr; prevfile = curfile, curfile = curfile->next) { int rowspan = 0, uniqueshots = 0; char pngdiffname[40]; /* if this is the first entry in this source file, count how many rows we need to span */ - if (prevfile == NULL || strcmp(prevfile->source, curfile->source) != 0) + if (prevfile == nullptr || strcmp(prevfile->source, curfile->source) != 0) { const summary_file *cur; - for (cur = curfile; cur != NULL; cur = cur->next) + for (cur = curfile; cur != nullptr; cur = cur->next) if (strcmp(cur->source, curfile->source) == 0) rowspan++; else @@ -1080,7 +1080,7 @@ static void append_driver_list_table(const char *header, std::string &dirname, c } /* create a linked file */ - create_linked_file(dirname, curfile, prevfile, curfile->next, (pngdiffname[0] == 0) ? NULL : pngdiffname, tempheader, tempfooter); + create_linked_file(dirname, curfile, prevfile, curfile->next, (pngdiffname[0] == 0) ? nullptr : pngdiffname, tempheader, tempfooter); /* create a row */ core_fprintf(indexfile, "\t\t\n\t\t\t"); diff --git a/src/tools/romcmp.cpp b/src/tools/romcmp.cpp index 97cdfa47ab3..4d89718abe9 100644 --- a/src/tools/romcmp.cpp +++ b/src/tools/romcmp.cpp @@ -120,7 +120,7 @@ static void checkintegrity(const fileinfo *file,int side) int mask0,mask1; int addrbit; - if (file->buf == 0) return; + if (file->buf == nullptr) return; /* check for bad data lines */ mask0 = 0x0000; @@ -351,7 +351,7 @@ static float filecompare(const fileinfo *file1,const fileinfo *file2,int mode1,i int base1=0,base2=0,mult1=0,mult2=0,mask1=0,mask2=0; - if (file1->buf == 0 || file2->buf == 0) return 0.0; + if (file1->buf == nullptr || file2->buf == nullptr) return 0.0; size1 = usedbytes(file1,mode1); size2 = usedbytes(file2,mode2); @@ -397,7 +397,7 @@ static void readfile(const char *path,fileinfo *file) UINT64 filesize; UINT32 actual; char fullname[256]; - osd_file *f = 0; + osd_file *f = nullptr; if (path) { @@ -408,7 +408,7 @@ static void readfile(const char *path,fileinfo *file) else fullname[0] = 0; strcat(fullname,file->name); - if ((file->buf = (unsigned char *)malloc(file->size)) == 0) + if ((file->buf = (unsigned char *)malloc(file->size)) == nullptr) { printf("%s: out of memory!\n",file->name); return; @@ -436,7 +436,7 @@ static void readfile(const char *path,fileinfo *file) static void freefile(fileinfo *file) { free(file->buf); - file->buf = 0; + file->buf = nullptr; } @@ -455,12 +455,12 @@ static int load_files(int i, int *found, const char *path) /* attempt to open as a directory first */ dir = osd_opendir(path); - if (dir != NULL) + if (dir != nullptr) { const osd_directory_entry *d; /* load all files in directory */ - while ((d = osd_readdir(dir)) != NULL) + while ((d = osd_readdir(dir)) != nullptr) { const char *d_name = d->name; char buf[255+1]; @@ -506,7 +506,7 @@ static int load_files(int i, int *found, const char *path) } /* load all files in zip file */ - for (zipent = zip_file_first_file(zip); zipent != NULL; zipent = zip_file_next_file(zip)) + for (zipent = zip_file_first_file(zip); zipent != nullptr; zipent = zip_file_next_file(zip)) { int size; @@ -525,14 +525,14 @@ static int load_files(int i, int *found, const char *path) else strcpy(file->name,zipent->filename); file->size = zipent->uncompressed_length; - if ((file->buf = (unsigned char *)malloc(file->size)) == 0) + if ((file->buf = (unsigned char *)malloc(file->size)) == nullptr) printf("%s: out of memory!\n",file->name); else { if (zip_file_decompress(zip, (char *)file->buf, file->size) != ZIPERR_NONE) { free(file->buf); - file->buf = 0; + file->buf = nullptr; } } @@ -728,11 +728,11 @@ int CLIB_DECL main(int argc,char *argv[]) for (i = 0;i < found[0];i++) { - if (files[0][i].listed == 0) printname(&files[0][i],0,0.0,0,0); + if (files[0][i].listed == 0) printname(&files[0][i],nullptr,0.0,0,0); } for (i = 0;i < found[1];i++) { - if (files[1][i].listed == 0) printname(0,&files[1][i],0.0,0,0); + if (files[1][i].listed == 0) printname(nullptr,&files[1][i],0.0,0,0); } } diff --git a/src/tools/split.cpp b/src/tools/split.cpp index 302bc6d8d7f..043d93b3a78 100644 --- a/src/tools/split.cpp +++ b/src/tools/split.cpp @@ -64,9 +64,9 @@ static void compute_hash_as_string(std::string &buffer, void *data, UINT32 lengt static int split_file(const char *filename, const char *basename, UINT32 splitsize) { std::string outfilename, basefilename, splitfilename; - core_file *outfile = NULL, *infile = NULL, *splitfile = NULL; + core_file *outfile = nullptr, *infile = nullptr, *splitfile = nullptr; std::string computedhash; - void *splitbuffer = NULL; + void *splitbuffer = nullptr; int index, partnum; UINT64 totallength; file_error filerr; @@ -103,7 +103,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi // allocate a buffer for reading splitbuffer = malloc(splitsize); - if (splitbuffer == NULL) + if (splitbuffer == nullptr) { fprintf(stderr, "Fatal error: unable to allocate memory for the split\n"); goto cleanup; @@ -174,7 +174,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi goto cleanup; } core_fclose(outfile); - outfile = NULL; + outfile = nullptr; printf(" done\n"); @@ -188,21 +188,21 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi error = 0; cleanup: - if (splitfile != NULL) + if (splitfile != nullptr) { core_fclose(splitfile); if (error != 0) remove(splitfilename.c_str()); } - if (infile != NULL) + if (infile != nullptr) core_fclose(infile); - if (outfile != NULL) + if (outfile != nullptr) { core_fclose(outfile); if (error != 0) remove(outfilename.c_str()); } - if (splitbuffer != NULL) + if (splitbuffer != nullptr) free(splitbuffer); return error; } @@ -218,8 +218,8 @@ static int join_file(const char *filename, const char *outname, int write_output std::string expectedhash, computedhash; std::string outfilename, infilename; std::string basepath; - core_file *outfile = NULL, *infile = NULL, *splitfile = NULL; - void *splitbuffer = NULL; + core_file *outfile = nullptr, *infile = nullptr, *splitfile = nullptr; + void *splitbuffer = nullptr; file_error filerr; UINT32 splitsize; char buffer[256]; @@ -252,7 +252,7 @@ static int join_file(const char *filename, const char *outname, int write_output basepath.clear(); // override the output filename if specified, otherwise prepend the path - if (outname != NULL) + if (outname != nullptr) outfilename.assign(outname); else outfilename.insert(0, basepath); @@ -272,7 +272,7 @@ static int join_file(const char *filename, const char *outname, int write_output if (filerr == FILERR_NONE) { core_fclose(outfile); - outfile = NULL; + outfile = nullptr; fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.c_str()); goto cleanup; } @@ -346,7 +346,7 @@ static int join_file(const char *filename, const char *outname, int write_output // release allocated memory osd_free(splitbuffer); - splitbuffer = NULL; + splitbuffer = nullptr; } if (write_output) printf("File re-created successfully\n"); @@ -357,17 +357,17 @@ static int join_file(const char *filename, const char *outname, int write_output error = 0; cleanup: - if (splitfile != NULL) + if (splitfile != nullptr) core_fclose(splitfile); - if (infile != NULL) + if (infile != nullptr) core_fclose(infile); - if (outfile != NULL) + if (outfile != nullptr) { core_fclose(outfile); if (error != 0) remove(outfilename.c_str()); } - if (splitbuffer != NULL) + if (splitbuffer != nullptr) osd_free(splitbuffer); return error; } @@ -398,7 +398,7 @@ int main(int argc, char *argv[]) { if (argc != 3 && argc != 4) goto usage; - result = join_file(argv[2], (argc >= 4) ? argv[3] : NULL, TRUE); + result = join_file(argv[2], (argc >= 4) ? argv[3] : nullptr, TRUE); } /* verify command */ @@ -406,7 +406,7 @@ int main(int argc, char *argv[]) { if (argc != 3) goto usage; - result = join_file(argv[2], NULL, FALSE); + result = join_file(argv[2], nullptr, FALSE); } else goto usage; diff --git a/src/tools/src2html.cpp b/src/tools/src2html.cpp index 91780cd2fc6..62eefb4da56 100644 --- a/src/tools/src2html.cpp +++ b/src/tools/src2html.cpp @@ -99,7 +99,7 @@ static const ext_to_type extension_lookup[] = static const token_entry dummy_token_table[] = { - { NULL, KEYWORD_CLASS } + { nullptr, KEYWORD_CLASS } }; @@ -192,7 +192,7 @@ static const token_entry c_token_table[] = { "UINT64", CUSTOM_CLASS }, { "ARRAY_LENGTH", CUSTOM_CLASS }, */ - { NULL, KEYWORD_CLASS } + { nullptr, KEYWORD_CLASS } }; @@ -244,9 +244,9 @@ int main(int argc, char *argv[]) if (arg[0] == '-' && arg[1] == 'I') { *incpathhead = new include_path; - if (*incpathhead != NULL) + if (*incpathhead != nullptr) { - (*incpathhead)->next = NULL; + (*incpathhead)->next = nullptr; strreplacechr((*incpathhead)->path.assign(&arg[2]), '/', PATH_SEPARATOR[0]); incpathhead = &(*incpathhead)->next; } @@ -348,7 +348,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, std::string &srcdir, std: // open the directory and iterate through it osd_directory *dir = osd_opendir(srcdir.c_str()); - if (dir == NULL) + if (dir == nullptr) { result = 1; break; @@ -357,11 +357,11 @@ static int recurse_dir(int srcrootlen, int dstrootlen, std::string &srcdir, std: // build up the list of files const osd_directory_entry *entry; int found = 0; - list_entry *list = NULL; - while ((entry = osd_readdir(dir)) != NULL) + list_entry *list = nullptr; + while ((entry = osd_readdir(dir)) != nullptr) if (entry->type == entry_type && entry->name[0] != '.') { - list_entry *lentry = new list_entry; + auto lentry = new list_entry; lentry->name.assign(entry->name); lentry->next = list; list = lentry; @@ -376,16 +376,16 @@ static int recurse_dir(int srcrootlen, int dstrootlen, std::string &srcdir, std: continue; // allocate memory for sorting - list_entry **listarray = new list_entry *[found]; + auto listarray = new list_entry *[found]; found = 0; - for (list_entry *curlist = list; curlist != NULL; curlist = curlist->next) + for (list_entry *curlist = list; curlist != nullptr; curlist = curlist->next) listarray[found++] = curlist; // sort the list qsort(listarray, found, sizeof(listarray[0]), compare_list_entries); // rebuild the list - list = NULL; + list = nullptr; while (--found >= 0) { listarray[found]->next = list; @@ -394,7 +394,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, std::string &srcdir, std: delete[] listarray; // iterate through each file - for (list_entry *curlist = list; curlist != NULL && result == 0; curlist = curlist->next) + for (list_entry *curlist = list; curlist != nullptr && result == 0; curlist = curlist->next) { // add a header if (curlist == list) @@ -421,7 +421,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, std::string &srcdir, std: if (type != FILE_TYPE_INVALID) { strprintf(dstfile, "%s%c%s.html", dstdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str()); - if (indexfile != NULL) + if (indexfile != nullptr) core_fprintf(indexfile, "\t

  • %s
  • \n", curlist->name.c_str(), curlist->name.c_str()); result = output_file(type, srcrootlen, dstrootlen, srcfile, dstfile, srcdir.compare(dstdir) == 0, tempheader, tempfooter); } @@ -431,18 +431,18 @@ static int recurse_dir(int srcrootlen, int dstrootlen, std::string &srcdir, std: else { strprintf(dstfile, "%s%c%s", dstdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str()); - if (indexfile != NULL) + if (indexfile != nullptr) core_fprintf(indexfile, "\t
  • %s/
  • \n", curlist->name.c_str(), curlist->name.c_str()); result = recurse_dir(srcrootlen, dstrootlen, srcfile, dstfile, tempheader, tempfooter); } } // close the list if we found some stuff - if (list != NULL) + if (list != nullptr) core_fprintf(indexfile, "\t\n"); // free all the allocated entries - while (list != NULL) + while (list != nullptr) { list_entry *next = list->next; delete list; @@ -450,7 +450,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, std::string &srcdir, std: } } - if (indexfile != NULL) + if (indexfile != nullptr) output_footer_and_close_file(indexfile, tempfooter, srcdir_subpath); return result; } @@ -525,7 +525,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri // open the output file core_file *dst = create_file_and_output_header(dstfile, tempheader, srcfile_subpath); - if (dst == NULL) + if (dst == nullptr) { fprintf(stderr, "Unable to write file '%s'\n", dstfile.c_str()); core_fclose(src); @@ -544,7 +544,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri int linenum = 1; bool in_comment = false; char srcline[4096]; - while (core_fgets(srcline, ARRAY_LENGTH(srcline), src) != NULL) + while (core_fgets(srcline, ARRAY_LENGTH(srcline), src) != nullptr) { // start with the line number std::string dstline; @@ -608,7 +608,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri // scan the token table last_token_was_include = false; - for (curtoken = token_table; curtoken->token != NULL; curtoken++) + for (curtoken = token_table; curtoken->token != nullptr; curtoken++) if (strncmp(srcptr - 1, curtoken->token, toklength) == 0 && strlen(curtoken->token) == toklength) { strcatprintf(dstline, "%s", curtoken->color, curtoken->token); @@ -653,7 +653,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri if (last_token_was_include) { char *endquote = strchr(srcptr, ch); - if (endquote != NULL) + if (endquote != nullptr) { std::string filename(srcptr, endquote - srcptr); std::string target; @@ -734,7 +734,7 @@ static core_file *create_file_and_output_header(std::string &filename, std::stri // create the indexfile core_file *file; if (core_fopen(filename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS | OPEN_FLAG_NO_BOM, &file) != FILERR_NONE) - return NULL; + return nullptr; // print a header std::string modified(templatefile); @@ -831,7 +831,7 @@ static void output_path_as_links(core_file *file, std::string &path, bool end_is static bool find_include_file(std::string &srcincpath, int srcrootlen, int dstrootlen, std::string &srcfile, std::string &dstfile, std::string &filename) { // iterate over include paths and find the file - for (include_path *curpath = incpaths; curpath != NULL; curpath = curpath->next) + for (include_path *curpath = incpaths; curpath != nullptr; curpath = curpath->next) { // a '.' include path is specially treated if (curpath->path.compare(".") == 0) diff --git a/src/tools/srcclean.cpp b/src/tools/srcclean.cpp index 24db9bca880..0af298a4441 100644 --- a/src/tools/srcclean.cpp +++ b/src/tools/srcclean.cpp @@ -39,7 +39,7 @@ static int le_convert(char *buffer, int size) /* brute force */ *end = 0; pos = strchr(buffer, 0x0d); - while (pos != NULL) + while (pos != nullptr) { memmove(pos, pos+1,end - pos + 1); size--; @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) /* read the file */ file = fopen(argv[1], "rb"); - if (file == NULL) + if (file == nullptr) { fprintf(stderr, "Can't open %s\n", argv[1]); return 1; @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) fclose(file); /* check whether we have dos line endings and are in unix mode */ - if (unix_le && (strchr((char *) original, 0x0d) != NULL)) + if (unix_le && (strchr((char *) original, 0x0d) != nullptr)) fixed_dos_style = 1; /* determine if we are a C file */ diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp index 7a245886d6a..13eabe31c59 100644 --- a/src/tools/unidasm.cpp +++ b/src/tools/unidasm.cpp @@ -454,7 +454,7 @@ static int parse_options(int argc, char *argv[], options *opts) } // filename - else if (opts->filename == NULL) + else if (opts->filename == nullptr) opts->filename = curarg; // fail @@ -467,7 +467,7 @@ static int parse_options(int argc, char *argv[], options *opts) goto usage; // if no file or no architecture, fail - if (opts->filename == NULL || opts->dasm == NULL) + if (opts->filename == nullptr || opts->dasm == nullptr) goto usage; return 0; @@ -545,7 +545,7 @@ int main(int argc, char *argv[]) int numchunks; // disassemble - pcdelta = (*opts.dasm->func)(NULL, buffer, curpc, oprom, oprom, opts.mode) & DASMFLAG_LENGTHMASK; + pcdelta = (*opts.dasm->func)(nullptr, buffer, curpc, oprom, oprom, opts.mode) & DASMFLAG_LENGTHMASK; if (opts.dasm->pcshift < 0) numbytes = pcdelta << -opts.dasm->pcshift; -- cgit v1.2.3-70-g09d2 From 379581fb3690d92f7e3815534a479823aee8ddcc Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Dec 2015 08:58:57 +0100 Subject: macro removal INLINE -> static inline (nw) --- 3rdparty/softfloat/mamesf.h | 2 +- scripts/genie.lua | 21 -- src/devices/bus/gba/gba_slot.cpp | 4 +- src/devices/bus/isa/cga.cpp | 4 +- src/devices/bus/megadrive/svp.cpp | 4 +- src/devices/bus/ti99x/990_hd.cpp | 4 +- src/devices/cpu/8x300/8x300dasm.cpp | 4 +- src/devices/cpu/arm7/arm7drc.inc | 4 +- src/devices/cpu/asap/asapdasm.cpp | 2 +- src/devices/cpu/avr8/avr8.cpp | 2 +- src/devices/cpu/dsp32/dsp32dis.cpp | 8 +- src/devices/cpu/es5510/es5510.cpp | 2 +- src/devices/cpu/g65816/g65816cm.h | 2 +- src/devices/cpu/g65816/g65816ds.cpp | 10 +- src/devices/cpu/i386/i386dasm.cpp | 12 +- src/devices/cpu/i386/pentops.inc | 24 +- src/devices/cpu/i386/x87ops.inc | 14 +- src/devices/cpu/i860/i860dec.inc | 2 +- src/devices/cpu/jaguar/jagdasm.cpp | 2 +- src/devices/cpu/m37710/m37710cm.h | 2 +- src/devices/cpu/m37710/m7700ds.cpp | 10 +- src/devices/cpu/m68000/m68kcpu.h | 404 ++++++++++++++++---------------- src/devices/cpu/m68000/m68kfpu.inc | 16 +- src/devices/cpu/m68000/m68kmmu.h | 12 +- src/devices/cpu/mips/mips3com.cpp | 4 +- src/devices/cpu/mips/mips3drc.cpp | 4 +- src/devices/cpu/mips/mips3dsm.cpp | 2 +- src/devices/cpu/mips/r3kdasm.cpp | 2 +- src/devices/cpu/nec/necdasm.cpp | 8 +- src/devices/cpu/pdp1/pdp1dasm.cpp | 2 +- src/devices/cpu/powerpc/ppccom.cpp | 16 +- src/devices/cpu/psx/dma.cpp | 2 +- src/devices/cpu/psx/gte.cpp | 6 +- src/devices/cpu/psx/irq.cpp | 2 +- src/devices/cpu/psx/mdec.cpp | 18 +- src/devices/cpu/psx/rcnt.cpp | 2 +- src/devices/cpu/psx/sio.cpp | 2 +- src/devices/cpu/rsp/rsp_dasm.cpp | 2 +- src/devices/cpu/rsp/rspdrc.cpp | 4 +- src/devices/cpu/sh4/sh4tmu.cpp | 2 +- src/devices/cpu/spc700/spc700.cpp | 2 +- src/devices/cpu/spc700/spc700ds.cpp | 4 +- src/devices/cpu/ssem/ssem.cpp | 2 +- src/devices/cpu/ssem/ssemdasm.cpp | 2 +- src/devices/cpu/tms32031/dis32031.cpp | 2 +- src/devices/cpu/tms9900/9900dasm.cpp | 2 +- src/devices/cpu/tms9900/99xxcore.h | 46 ++-- src/devices/machine/adc083x.cpp | 2 +- src/devices/machine/i2cmem.cpp | 2 +- src/devices/machine/mc68328.cpp | 2 +- src/devices/machine/mm58167.cpp | 2 +- src/devices/machine/rtc4543.cpp | 2 +- src/devices/machine/s3c2400.cpp | 2 +- src/devices/machine/s3c2410.cpp | 2 +- src/devices/machine/s3c2440.cpp | 2 +- src/devices/machine/s3c44b0.cpp | 2 +- src/devices/machine/timekpr.cpp | 4 +- src/devices/sound/ay8910.cpp | 6 +- src/devices/sound/c140.cpp | 2 +- src/devices/sound/disc_wav.inc | 2 +- src/devices/sound/fm.cpp | 58 ++--- src/devices/sound/fm2612.cpp | 56 ++--- src/devices/sound/fmopl.cpp | 38 +-- src/devices/sound/k053260.cpp | 2 +- src/devices/sound/nes_apu.cpp | 2 +- src/devices/sound/sid.cpp | 2 +- src/devices/sound/sidenvel.cpp | 72 +++--- src/devices/sound/sidvoice.cpp | 10 +- src/devices/sound/sn76477.cpp | 4 +- src/devices/sound/sp0256.cpp | 10 +- src/devices/sound/spu.cpp | 8 +- src/devices/sound/ym2151.cpp | 20 +- src/devices/sound/ym2413.cpp | 32 +-- src/devices/sound/ymdeltat.cpp | 4 +- src/devices/sound/ymf262.cpp | 36 +-- src/devices/video/gf4500.cpp | 2 +- src/devices/video/polylgcy.cpp | 10 +- src/devices/video/psx.cpp | 4 +- src/devices/video/stvvdp1.cpp | 2 +- src/devices/video/stvvdp2.cpp | 2 +- src/devices/video/vooddefs.h | 58 ++--- src/devices/video/voodoo.cpp | 4 +- src/emu/debug/debugcmd.cpp | 8 +- src/emu/debug/dvmemory.cpp | 4 +- src/emu/debug/textbuf.cpp | 4 +- src/emu/debugger.h | 14 +- src/emu/output.cpp | 6 +- src/emu/output.h | 12 +- src/emu/rendutil.h | 22 +- src/emu/sound/filter.h | 2 +- src/emu/ui/ui.cpp | 2 +- src/emu/uiinput.h | 12 +- src/lib/formats/ace_tap.cpp | 6 +- src/lib/formats/cbm_tap.cpp | 2 +- src/lib/formats/fdi_dsk.cpp | 2 +- src/lib/formats/hect_tap.cpp | 6 +- src/lib/formats/imageutl.h | 8 +- src/lib/formats/kc_cas.cpp | 6 +- src/lib/formats/kim1_cas.cpp | 4 +- src/lib/formats/trs_cas.cpp | 2 +- src/lib/formats/tzx_cas.cpp | 8 +- src/lib/formats/vg5k_cas.cpp | 10 +- src/lib/util/aviio.cpp | 52 ++-- src/lib/util/cdrom.cpp | 8 +- src/lib/util/cdrom.h | 6 +- src/lib/util/corefile.cpp | 2 +- src/lib/util/jedparse.h | 4 +- src/lib/util/png.cpp | 16 +- src/lib/util/pool.cpp | 4 +- src/lib/util/unzip.cpp | 8 +- src/mame/audio/beezer.cpp | 2 +- src/mame/audio/exidy.cpp | 2 +- src/mame/audio/micro3d.cpp | 6 +- src/mame/audio/segasnd.cpp | 8 +- src/mame/audio/tx1.cpp | 2 +- src/mame/audio/vboy.cpp | 4 +- src/mame/drivers/39in1.cpp | 2 +- src/mame/drivers/atarisy4.cpp | 2 +- src/mame/drivers/cdi.cpp | 2 +- src/mame/drivers/cxhumax.cpp | 6 +- src/mame/drivers/ddenlovr.cpp | 4 +- src/mame/drivers/dm7000.cpp | 2 +- src/mame/drivers/gba.cpp | 4 +- src/mame/drivers/gp32.cpp | 2 +- src/mame/drivers/multfish.cpp | 8 +- src/mame/drivers/namcoic.cpp | 6 +- src/mame/drivers/namcos23.cpp | 2 +- src/mame/drivers/photon2.cpp | 4 +- src/mame/drivers/subsino2.cpp | 2 +- src/mame/drivers/taitotz.cpp | 12 +- src/mame/drivers/viper.cpp | 8 +- src/mame/drivers/zaurus.cpp | 2 +- src/mame/etc/jrcrypt.cpp | 4 +- src/mame/includes/model2.h | 2 +- src/mame/machine/appldriv.cpp | 2 +- src/mame/machine/cdi070.cpp | 2 +- src/mame/machine/cdicdic.cpp | 10 +- src/mame/machine/cdislave.cpp | 2 +- src/mame/machine/docg3.cpp | 2 +- src/mame/machine/fddebug.cpp | 20 +- src/mame/machine/gaelco3d.cpp | 4 +- src/mame/machine/micro3d.cpp | 4 +- src/mame/machine/midwayic.cpp | 2 +- src/mame/machine/n64.cpp | 2 +- src/mame/machine/psxcd.cpp | 2 +- src/mame/machine/sgi.cpp | 2 +- src/mame/machine/smartmed.cpp | 4 +- src/mame/machine/tx1.cpp | 6 +- src/mame/video/amiga.cpp | 12 +- src/mame/video/amigaaga.cpp | 12 +- src/mame/video/gba.cpp | 14 +- src/mame/video/hng64.cpp | 2 +- src/mame/video/k053936.cpp | 2 +- src/mame/video/konamigx.cpp | 4 +- src/mame/video/mcd212.cpp | 6 +- src/mame/video/midzeus.cpp | 32 +-- src/mame/video/midzeus2.cpp | 18 +- src/mame/video/model2.cpp | 10 +- src/mame/video/model3.cpp | 2 +- src/mame/video/namcofl.cpp | 4 +- src/mame/video/namconb1.cpp | 4 +- src/mame/video/namcos2.cpp | 2 +- src/mame/video/newport.cpp | 2 +- src/mame/video/rdpfiltr.inc | 34 +-- src/mame/video/tatsumi.cpp | 2 +- src/mame/video/victory.cpp | 2 +- src/mame/video/vrender0.cpp | 4 +- src/mame/video/wgp.cpp | 2 +- src/osd/eigccppc.h | 28 +-- src/osd/eigccx86.h | 52 ++-- src/osd/eivc.h | 16 +- src/osd/eivcx86.h | 38 +-- src/osd/eminline.h | 58 ++--- src/osd/modules/debugger/debugint.cpp | 8 +- src/osd/modules/render/d3d/d3d9intf.cpp | 2 +- src/osd/modules/render/draw13.cpp | 8 +- src/osd/modules/render/drawd3d.cpp | 18 +- src/osd/modules/render/drawdd.cpp | 2 +- src/osd/modules/render/drawogl.cpp | 16 +- src/osd/modules/sync/sync_ntc.cpp | 4 +- src/osd/modules/sync/sync_os2.cpp | 4 +- src/osd/osdcore.h | 2 +- src/osd/sdl/input.cpp | 4 +- src/osd/sdl/window.cpp | 8 +- src/osd/windows/input.cpp | 6 +- src/osd/windows/window.h | 4 +- src/osd/windows/winfile.cpp | 2 +- src/tools/imgtool/library.h | 8 +- src/tools/imgtool/modules/concept.cpp | 4 +- src/tools/imgtool/modules/mac.cpp | 16 +- src/tools/imgtool/modules/ti99.cpp | 34 +-- src/tools/imgtool/modules/ti990hd.cpp | 8 +- src/tools/regrep.cpp | 4 +- 193 files changed, 1041 insertions(+), 1062 deletions(-) (limited to 'src/lib/formats/tzx_cas.cpp') diff --git a/3rdparty/softfloat/mamesf.h b/3rdparty/softfloat/mamesf.h index cc6b9998a53..c66931698a3 100644 --- a/3rdparty/softfloat/mamesf.h +++ b/3rdparty/softfloat/mamesf.h @@ -64,4 +64,4 @@ typedef INT64 sbits64; | a compiler does not support explicit inlining, this macro should be defined | to be `static'. *----------------------------------------------------------------------------*/ -// MAME defines INLINE +#define INLINE static inline diff --git a/scripts/genie.lua b/scripts/genie.lua index 088636a7e5e..5ca87cf7c16 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -554,24 +554,6 @@ if (_ACTION == nil) then return false end configuration { "x64" } defines { "PTR64=1" } --- map the INLINE to something digestible by GCC -configuration { "gmake" } - buildoptions_cpp { - "-DINLINE=\"static inline\"", - } - buildoptions_objc { - "-DINLINE=\"static inline\"", - } -configuration { "xcode4*" } - buildoptions { - "-DINLINE=\"static inline\"", - } - -configuration { "vs*" } - defines { - "INLINE=static inline", - } - -- define MAME_DEBUG if we are a debugging build configuration { "Debug" } defines { @@ -1002,7 +984,6 @@ end "-Wno-tautological-compare", "-Wno-dynamic-class-memaccess", "-Wno-unused-value", --- "-Wno-c++11-narrowing", "-Wno-inline-new-delete", "-Wno-constant-logical-operand", "-Wno-deprecated-register", @@ -1026,8 +1007,6 @@ end end buildoptions { "-Wno-unused-result", -- needed for fgets,fread on linux --- "-Wno-narrowing", --- "-Wno-attributes", -- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds) "-Wno-array-bounds", } diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp index fc8f09f30a0..4e7c9f62060 100644 --- a/src/devices/bus/gba/gba_slot.cpp +++ b/src/devices/bus/gba/gba_slot.cpp @@ -256,7 +256,7 @@ bool gba_cart_slot_device::call_softlist_load(software_list_device &swlist, cons fullpath -------------------------------------------------*/ -INLINE std::string gba_chip_string( UINT32 chip ) +static inline std::string gba_chip_string( UINT32 chip ) { std::string str; if (chip == 0) str += "NONE "; @@ -273,7 +273,7 @@ INLINE std::string gba_chip_string( UINT32 chip ) } -INLINE int gba_chip_has_conflict( UINT32 chip ) +static inline int gba_chip_has_conflict( UINT32 chip ) { int count1 = 0, count2 = 0; if (chip & GBA_CHIP_EEPROM) count1++; diff --git a/src/devices/bus/isa/cga.cpp b/src/devices/bus/isa/cga.cpp index 8f99ddc0792..888318f65d7 100644 --- a/src/devices/bus/isa/cga.cpp +++ b/src/devices/bus/isa/cga.cpp @@ -1191,7 +1191,7 @@ WRITE8_MEMBER( isa8_cga_device::io_write ) // proc = cga_pgfx_4bpp; // -//INLINE void pgfx_plot_unit_4bpp(bitmap_ind16 &bitmap, +//static inline void pgfx_plot_unit_4bpp(bitmap_ind16 &bitmap, // int x, int y, int offs) //{ // int color, values[2]; @@ -1259,7 +1259,7 @@ WRITE8_MEMBER( isa8_cga_device::io_write ) // // // -//INLINE void pgfx_plot_unit_2bpp(bitmap_ind16 &bitmap, +//static inline void pgfx_plot_unit_2bpp(bitmap_ind16 &bitmap, // int x, int y, const UINT16 *palette, int offs) //{ // int i; diff --git a/src/devices/bus/megadrive/svp.cpp b/src/devices/bus/megadrive/svp.cpp index 51f6a1ea8de..9aa905b7a66 100644 --- a/src/devices/bus/megadrive/svp.cpp +++ b/src/devices/bus/megadrive/svp.cpp @@ -60,7 +60,7 @@ md_rom_svp_device::md_rom_svp_device(const machine_config &mconfig, const char * // HELPERS -INLINE int get_inc(int mode) +static inline int get_inc(int mode) { int inc = (mode >> 11) & 7; if (inc != 0) { @@ -71,7 +71,7 @@ INLINE int get_inc(int mode) return inc; } -INLINE void overwrite_write(UINT16 *dst, UINT16 d) +static inline void overwrite_write(UINT16 *dst, UINT16 d) { if (d & 0xf000) { *dst &= ~0xf000; *dst |= d & 0xf000; } if (d & 0x0f00) { *dst &= ~0x0f00; *dst |= d & 0x0f00; } diff --git a/src/devices/bus/ti99x/990_hd.cpp b/src/devices/bus/ti99x/990_hd.cpp index 99ad509d39f..b884f8be444 100644 --- a/src/devices/bus/ti99x/990_hd.cpp +++ b/src/devices/bus/ti99x/990_hd.cpp @@ -41,13 +41,13 @@ struct UINT32BE UINT8 bytes[4]; }; -INLINE UINT32 get_UINT32BE(UINT32BE word) +static inline UINT32 get_UINT32BE(UINT32BE word) { return (word.bytes[0] << 24) | (word.bytes[1] << 16) | (word.bytes[2] << 8) | word.bytes[3]; } #ifdef UNUSED_FUNCTION -INLINE void set_UINT32BE(UINT32BE *word, UINT32 data) +static inline void set_UINT32BE(UINT32BE *word, UINT32 data) { word->bytes[0] = (data >> 24) & 0xff; word->bytes[1] = (data >> 16) & 0xff; diff --git a/src/devices/cpu/8x300/8x300dasm.cpp b/src/devices/cpu/8x300/8x300dasm.cpp index e35b2b7cb41..eb65e735162 100644 --- a/src/devices/cpu/8x300/8x300dasm.cpp +++ b/src/devices/cpu/8x300/8x300dasm.cpp @@ -25,7 +25,7 @@ static const char *reg_names[32] = }; // determines if right rotate or I/O field length is to be used -INLINE bool is_rot(UINT16 opcode) +static inline bool is_rot(UINT16 opcode) { if((opcode & 0x1000) || (opcode & 0x0010)) return false; @@ -33,7 +33,7 @@ INLINE bool is_rot(UINT16 opcode) return true; } -INLINE bool is_src_rot(UINT16 opcode) +static inline bool is_src_rot(UINT16 opcode) { if((opcode & 0x1000)) return false; diff --git a/src/devices/cpu/arm7/arm7drc.inc b/src/devices/cpu/arm7/arm7drc.inc index 46c3aba570b..54ef46aa0fa 100644 --- a/src/devices/cpu/arm7/arm7drc.inc +++ b/src/devices/cpu/arm7/arm7drc.inc @@ -68,7 +68,7 @@ descriptor -------------------------------------------------*/ -INLINE UINT32 epc(const opcode_desc *desc) +static inline UINT32 epc(const opcode_desc *desc) { return desc->pc; } @@ -79,7 +79,7 @@ INLINE UINT32 epc(const opcode_desc *desc) already allocated -------------------------------------------------*/ -INLINE void alloc_handle(drcuml_state *drcuml, uml::code_handle **handleptr, const char *name) +static inline void alloc_handle(drcuml_state *drcuml, uml::code_handle **handleptr, const char *name) { if (*handleptr == nullptr) *handleptr = drcuml->handle_alloc(name); diff --git a/src/devices/cpu/asap/asapdasm.cpp b/src/devices/cpu/asap/asapdasm.cpp index eb16985da1b..676ba850228 100644 --- a/src/devices/cpu/asap/asapdasm.cpp +++ b/src/devices/cpu/asap/asapdasm.cpp @@ -35,7 +35,7 @@ static const char *const condition[16] = CODE CODE ***************************************************************************/ -INLINE char *src2(UINT32 op, int scale) +static inline char *src2(UINT32 op, int scale) { static char temp[20]; if ((op & 0xffe0) == 0xffe0) diff --git a/src/devices/cpu/avr8/avr8.cpp b/src/devices/cpu/avr8/avr8.cpp index a1e755a29b8..d043e466876 100644 --- a/src/devices/cpu/avr8/avr8.cpp +++ b/src/devices/cpu/avr8/avr8.cpp @@ -66,7 +66,7 @@ #define ENABLE_VERBOSE_LOG (0) #if ENABLE_VERBOSE_LOG -INLINE void ATTR_PRINTF(3,4) verboselog(UINT16 pc, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(UINT16 pc, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/devices/cpu/dsp32/dsp32dis.cpp b/src/devices/cpu/dsp32/dsp32dis.cpp index 25f43e30761..18c06f01e9d 100644 --- a/src/devices/cpu/dsp32/dsp32dis.cpp +++ b/src/devices/cpu/dsp32/dsp32dis.cpp @@ -85,7 +85,7 @@ static const char *const regnamee[] = static char tempbuf[10][40]; -INLINE char *signed_16bit_unary(INT16 val) +static inline char *signed_16bit_unary(INT16 val) { static char temp[10]; if (val < 0) @@ -95,7 +95,7 @@ INLINE char *signed_16bit_unary(INT16 val) return temp; } -INLINE char *signed_16bit_sep(INT16 val) +static inline char *signed_16bit_sep(INT16 val) { static char temp[10]; if (val < 0) @@ -105,7 +105,7 @@ INLINE char *signed_16bit_sep(INT16 val) return temp; } -INLINE char *signed_16bit_sep_nospace(INT16 val) +static inline char *signed_16bit_sep_nospace(INT16 val) { static char temp[10]; if (val < 0) @@ -115,7 +115,7 @@ INLINE char *signed_16bit_sep_nospace(INT16 val) return temp; } -INLINE char *unsigned_16bit_size(INT16 val, UINT8 size) +static inline char *unsigned_16bit_size(INT16 val, UINT8 size) { static char temp[10]; if (size) diff --git a/src/devices/cpu/es5510/es5510.cpp b/src/devices/cpu/es5510/es5510.cpp index 16a1396f77a..17a73204f09 100644 --- a/src/devices/cpu/es5510/es5510.cpp +++ b/src/devices/cpu/es5510/es5510.cpp @@ -34,7 +34,7 @@ static inline INT64 SX64(INT64 x) { return (x & S64(0x0000800000000000)) ? x | S #define VERBOSE_EXEC 0 #if VERBOSE -INLINE void ATTR_PRINTF(1,2) log_to_stderr(const char *format, ...) { +static inline void ATTR_PRINTF(1,2) log_to_stderr(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); diff --git a/src/devices/cpu/g65816/g65816cm.h b/src/devices/cpu/g65816/g65816cm.h index 7cfbcdf2cfb..649b2500653 100644 --- a/src/devices/cpu/g65816/g65816cm.h +++ b/src/devices/cpu/g65816/g65816cm.h @@ -46,7 +46,7 @@ #define MAKE_INT_8(A) (int8)((A)&0xff) #else #define int8 int -INLINE int MAKE_INT_8(int A) {return (A & 0x80) ? A | ~0xff : A & 0xff;} +static inline int MAKE_INT_8(int A) {return (A & 0x80) ? A | ~0xff : A & 0xff;} #endif /* UCHAR_MAX == 0xff */ #define MAKE_UINT_8(A) ((A)&0xff) diff --git a/src/devices/cpu/g65816/g65816ds.cpp b/src/devices/cpu/g65816/g65816ds.cpp index 17af208a822..5965da2e3eb 100644 --- a/src/devices/cpu/g65816/g65816ds.cpp +++ b/src/devices/cpu/g65816/g65816ds.cpp @@ -141,26 +141,26 @@ static const g65816_opcode_struct g_opcodes[256] = static const UINT8 *base_oprom; static UINT32 base_pc; -INLINE unsigned int read_8(unsigned int address) +static inline unsigned int read_8(unsigned int address) { address = ADDRESS_65816(address); return base_oprom[address - base_pc]; } -INLINE unsigned int read_16(unsigned int address) +static inline unsigned int read_16(unsigned int address) { unsigned int val = read_8(address); return val | (read_8(address+1)<<8); } -INLINE unsigned int read_24(unsigned int address) +static inline unsigned int read_24(unsigned int address) { unsigned int val = read_8(address); val |= (read_8(address+1)<<8); return val | (read_8(address+2)<<16); } -INLINE char* int_8_str(unsigned int val) +static inline char* int_8_str(unsigned int val) { static char str[20]; @@ -174,7 +174,7 @@ INLINE char* int_8_str(unsigned int val) return str; } -INLINE char* int_16_str(unsigned int val) +static inline char* int_16_str(unsigned int val) { static char str[20]; diff --git a/src/devices/cpu/i386/i386dasm.cpp b/src/devices/cpu/i386/i386dasm.cpp index 18e5557b4b5..780cda0ba1d 100644 --- a/src/devices/cpu/i386/i386dasm.cpp +++ b/src/devices/cpu/i386/i386dasm.cpp @@ -1993,7 +1993,7 @@ static UINT8 curmode; #define MODRM_REG2 (modrm & 0x7) #define MODRM_MOD ((modrm >> 6) & 0x3) -INLINE UINT8 FETCH(void) +static inline UINT8 FETCH(void) { if ((opcode_ptr - opcode_ptr_base) + 1 > max_length) return 0xff; @@ -2002,7 +2002,7 @@ INLINE UINT8 FETCH(void) } #if 0 -INLINE UINT16 FETCH16(void) +static inline UINT16 FETCH16(void) { UINT16 d; if ((opcode_ptr - opcode_ptr_base) + 2 > max_length) @@ -2014,7 +2014,7 @@ INLINE UINT16 FETCH16(void) } #endif -INLINE UINT32 FETCH32(void) +static inline UINT32 FETCH32(void) { UINT32 d; if ((opcode_ptr - opcode_ptr_base) + 4 > max_length) @@ -2025,7 +2025,7 @@ INLINE UINT32 FETCH32(void) return d; } -INLINE UINT8 FETCHD(void) +static inline UINT8 FETCHD(void) { if ((opcode_ptr - opcode_ptr_base) + 1 > max_length) return 0xff; @@ -2033,7 +2033,7 @@ INLINE UINT8 FETCHD(void) return *opcode_ptr++; } -INLINE UINT16 FETCHD16(void) +static inline UINT16 FETCHD16(void) { UINT16 d; if ((opcode_ptr - opcode_ptr_base) + 2 > max_length) @@ -2044,7 +2044,7 @@ INLINE UINT16 FETCHD16(void) return d; } -INLINE UINT32 FETCHD32(void) +static inline UINT32 FETCHD32(void) { UINT32 d; if ((opcode_ptr - opcode_ptr_base) + 4 > max_length) diff --git a/src/devices/cpu/i386/pentops.inc b/src/devices/cpu/i386/pentops.inc index ab89208314d..3b8eec56499 100644 --- a/src/devices/cpu/i386/pentops.inc +++ b/src/devices/cpu/i386/pentops.inc @@ -1200,7 +1200,7 @@ void i386_device::pentium_tzcnt_r32_rm32() // TODO: actually implement TZCNT } -INLINE INT8 SaturatedSignedWordToSignedByte(INT16 word) +static inline INT8 SaturatedSignedWordToSignedByte(INT16 word) { if (word > 127) return 127; @@ -1209,7 +1209,7 @@ INLINE INT8 SaturatedSignedWordToSignedByte(INT16 word) return (INT8)word; } -INLINE UINT8 SaturatedSignedWordToUnsignedByte(INT16 word) +static inline UINT8 SaturatedSignedWordToUnsignedByte(INT16 word) { if (word > 255) return 255; @@ -1218,7 +1218,7 @@ INLINE UINT8 SaturatedSignedWordToUnsignedByte(INT16 word) return (UINT8)word; } -INLINE INT16 SaturatedSignedDwordToSignedWord(INT32 dword) +static inline INT16 SaturatedSignedDwordToSignedWord(INT32 dword) { if (dword > 32767) return 32767; @@ -1227,7 +1227,7 @@ INLINE INT16 SaturatedSignedDwordToSignedWord(INT32 dword) return (INT16)dword; } -INLINE UINT16 SaturatedSignedDwordToUnsignedWord(INT32 dword) +static inline UINT16 SaturatedSignedDwordToUnsignedWord(INT32 dword) { if (dword > 65535) return 65535; @@ -3786,7 +3786,7 @@ void i386_device::sse_subps() // Opcode 0f 5c CYCLES(1); // TODO: correct cycle count } -INLINE float sse_min_single(float src1, float src2) +static inline float sse_min_single(float src1, float src2) { /*if ((src1 == 0) && (src2 == 0)) return src2; @@ -3799,7 +3799,7 @@ INLINE float sse_min_single(float src1, float src2) return src2; } -INLINE double sse_min_double(double src1, double src2) +static inline double sse_min_double(double src1, double src2) { /*if ((src1 == 0) && (src2 == 0)) return src2; @@ -3852,7 +3852,7 @@ void i386_device::sse_divps() // Opcode 0f 5e CYCLES(1); // TODO: correct cycle count } -INLINE float sse_max_single(float src1, float src2) +static inline float sse_max_single(float src1, float src2) { /*if ((src1 == 0) && (src2 == 0)) return src2; @@ -3865,7 +3865,7 @@ INLINE float sse_max_single(float src1, float src2) return src2; } -INLINE double sse_max_double(double src1, double src2) +static inline double sse_max_double(double src1, double src2) { /*if ((src1 == 0) && (src2 == 0)) return src2; @@ -4333,25 +4333,25 @@ void i386_device::sse_unpckhpd_r128_rm128() // Opcode 66 0f 15 CYCLES(1); // TODO: correct cycle count } -INLINE bool sse_issingleordered(float op1, float op2) +static inline bool sse_issingleordered(float op1, float op2) { // TODO: true when at least one of the two source operands being compared is a NaN return (op1 != op1) || (op1 != op2); } -INLINE bool sse_issingleunordered(float op1, float op2) +static inline bool sse_issingleunordered(float op1, float op2) { // TODO: true when neither source operand is a NaN return !((op1 != op1) || (op1 != op2)); } -INLINE bool sse_isdoubleordered(double op1, double op2) +static inline bool sse_isdoubleordered(double op1, double op2) { // TODO: true when at least one of the two source operands being compared is a NaN return (op1 != op1) || (op1 != op2); } -INLINE bool sse_isdoubleunordered(double op1, double op2) +static inline bool sse_isdoubleunordered(double op1, double op2) { // TODO: true when neither source operand is a NaN return !((op1 != op1) || (op1 != op2)); diff --git a/src/devices/cpu/i386/x87ops.inc b/src/devices/cpu/i386/x87ops.inc index 9306a7a5727..1cc44e7b92f 100644 --- a/src/devices/cpu/i386/x87ops.inc +++ b/src/devices/cpu/i386/x87ops.inc @@ -117,7 +117,7 @@ extern flag floatx80_is_nan( floatx80 a ); extern flag floatx80_is_signaling_nan(floatx80 a); -INLINE flag floatx80_is_quiet_nan(floatx80 a) +static inline flag floatx80_is_quiet_nan(floatx80 a) { bits64 aLow; @@ -128,36 +128,36 @@ INLINE flag floatx80_is_quiet_nan(floatx80 a) && (a.low != aLow); } -INLINE int floatx80_is_zero(floatx80 fx) +static inline int floatx80_is_zero(floatx80 fx) { return (((fx.high & 0x7fff) == 0) && ((fx.low << 1) == 0)); } -INLINE int floatx80_is_inf(floatx80 fx) +static inline int floatx80_is_inf(floatx80 fx) { return (((fx.high & 0x7fff) == 0x7fff) && ((fx.low << 1) == 0)); } -INLINE int floatx80_is_denormal(floatx80 fx) +static inline int floatx80_is_denormal(floatx80 fx) { return (((fx.high & 0x7fff) == 0) && ((fx.low & U64(0x8000000000000000)) == 0) && ((fx.low << 1) != 0)); } -INLINE floatx80 floatx80_abs(floatx80 fx) +static inline floatx80 floatx80_abs(floatx80 fx) { fx.high &= 0x7fff; return fx; } -INLINE double fx80_to_double(floatx80 fx) +static inline double fx80_to_double(floatx80 fx) { UINT64 d = floatx80_to_float64(fx); return *(double*)&d; } -INLINE floatx80 double_to_fx80(double in) +static inline floatx80 double_to_fx80(double in) { return float64_to_floatx80(*(UINT64*)&in); } diff --git a/src/devices/cpu/i860/i860dec.inc b/src/devices/cpu/i860/i860dec.inc index 216d96a8a93..4600af7a0b8 100644 --- a/src/devices/cpu/i860/i860dec.inc +++ b/src/devices/cpu/i860/i860dec.inc @@ -896,7 +896,7 @@ void i860_cpu_device::dump_state (i860s *cpustate) #endif /* Sign extend N-bit number. */ -INLINE INT32 sign_ext (UINT32 x, int n) +static inline INT32 sign_ext (UINT32 x, int n) { INT32 t; t = x >> (n - 1); diff --git a/src/devices/cpu/jaguar/jagdasm.cpp b/src/devices/cpu/jaguar/jagdasm.cpp index e5e9cd70882..a12145c23c8 100644 --- a/src/devices/cpu/jaguar/jagdasm.cpp +++ b/src/devices/cpu/jaguar/jagdasm.cpp @@ -69,7 +69,7 @@ static const char *const condition[32] = CODE CODE ***************************************************************************/ -INLINE char *signed_16bit(INT16 val) +static inline char *signed_16bit(INT16 val) { static char temp[10]; if (val < 0) diff --git a/src/devices/cpu/m37710/m37710cm.h b/src/devices/cpu/m37710/m37710cm.h index aa691b2e9aa..5595230124c 100644 --- a/src/devices/cpu/m37710/m37710cm.h +++ b/src/devices/cpu/m37710/m37710cm.h @@ -41,7 +41,7 @@ #define MAKE_INT_8(A) (int8)((A)&0xff) #else #define int8 int -INLINE int MAKE_INT_8(int A) {return (A & 0x80) ? A | ~0xff : A & 0xff;} +static inline int MAKE_INT_8(int A) {return (A & 0x80) ? A | ~0xff : A & 0xff;} #endif /* UCHAR_MAX == 0xff */ #define MAKE_UINT_8(A) ((A)&0xff) diff --git a/src/devices/cpu/m37710/m7700ds.cpp b/src/devices/cpu/m37710/m7700ds.cpp index f6b77932b1e..8ccf269dc46 100644 --- a/src/devices/cpu/m37710/m7700ds.cpp +++ b/src/devices/cpu/m37710/m7700ds.cpp @@ -321,25 +321,25 @@ static const m7700_opcode_struct g_opcodes_prefix89[256] = {JSR, I, AXI }, {SBC, M, AX }, {INC, M, AX }, {SBC, M, ALX } }; -INLINE unsigned int read_8(const UINT8 *oprom, unsigned int offset) +static inline unsigned int read_8(const UINT8 *oprom, unsigned int offset) { return oprom[offset]; } -INLINE unsigned int read_16(const UINT8 *oprom, unsigned int offset) +static inline unsigned int read_16(const UINT8 *oprom, unsigned int offset) { unsigned int val = read_8(oprom, offset); return val | (read_8(oprom, offset+1)<<8); } -INLINE unsigned int read_24(const UINT8 *oprom, unsigned int offset) +static inline unsigned int read_24(const UINT8 *oprom, unsigned int offset) { unsigned int val = read_8(oprom, offset); val |= (read_8(oprom, offset+1)<<8); return val | (read_8(oprom, offset+2)<<16); } -INLINE char* int_8_str(unsigned int val) +static inline char* int_8_str(unsigned int val) { static char str[20]; @@ -353,7 +353,7 @@ INLINE char* int_8_str(unsigned int val) return str; } -INLINE char* int_16_str(unsigned int val) +static inline char* int_16_str(unsigned int val) { static char str[20]; diff --git a/src/devices/cpu/m68000/m68kcpu.h b/src/devices/cpu/m68000/m68kcpu.h index 2c30bf78a98..5cec889e002 100644 --- a/src/devices/cpu/m68000/m68kcpu.h +++ b/src/devices/cpu/m68000/m68kcpu.h @@ -496,119 +496,119 @@ extern const UINT8 m68ki_exception_cycle_table[][256]; extern const UINT8 m68ki_ea_idx_cycle_table[]; /* Read data immediately after the program counter */ -INLINE UINT32 m68ki_read_imm_16(m68000_base_device *m68k); -INLINE UINT32 m68ki_read_imm_32(m68000_base_device *m68k); +static inline UINT32 m68ki_read_imm_16(m68000_base_device *m68k); +static inline UINT32 m68ki_read_imm_32(m68000_base_device *m68k); /* Read data with specific function code */ -INLINE UINT32 m68ki_read_8_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); -INLINE UINT32 m68ki_read_16_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); -INLINE UINT32 m68ki_read_32_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); +static inline UINT32 m68ki_read_8_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); +static inline UINT32 m68ki_read_16_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); +static inline UINT32 m68ki_read_32_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); /* Write data with specific function code */ -INLINE void m68ki_write_8_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); -INLINE void m68ki_write_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); -INLINE void m68ki_write_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); -INLINE void m68ki_write_32_pd_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); +static inline void m68ki_write_8_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); +static inline void m68ki_write_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); +static inline void m68ki_write_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); +static inline void m68ki_write_32_pd_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); /* Indexed and PC-relative ea fetching */ -INLINE UINT32 m68ki_get_ea_pcdi(m68000_base_device *m68k); -INLINE UINT32 m68ki_get_ea_pcix(m68000_base_device *m68k); -INLINE UINT32 m68ki_get_ea_ix(m68000_base_device *m68k, UINT32 An); +static inline UINT32 m68ki_get_ea_pcdi(m68000_base_device *m68k); +static inline UINT32 m68ki_get_ea_pcix(m68000_base_device *m68k); +static inline UINT32 m68ki_get_ea_ix(m68000_base_device *m68k, UINT32 An); /* Operand fetching */ -INLINE UINT32 OPER_AY_AI_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_AI_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_AI_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_PI_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_PI_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_PI_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_PD_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_PD_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_PD_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_DI_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_DI_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_DI_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_IX_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_IX_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AY_IX_32(m68000_base_device *m68k); - -INLINE UINT32 OPER_AX_AI_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_AI_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_AI_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_PI_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_PI_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_PI_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_PD_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_PD_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_PD_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_DI_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_DI_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_DI_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_IX_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_IX_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AX_IX_32(m68000_base_device *m68k); - -INLINE UINT32 OPER_A7_PI_8(m68000_base_device *m68k); -INLINE UINT32 OPER_A7_PD_8(m68000_base_device *m68k); - -INLINE UINT32 OPER_AW_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AW_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AW_32(m68000_base_device *m68k); -INLINE UINT32 OPER_AL_8(m68000_base_device *m68k); -INLINE UINT32 OPER_AL_16(m68000_base_device *m68k); -INLINE UINT32 OPER_AL_32(m68000_base_device *m68k); -INLINE UINT32 OPER_PCDI_8(m68000_base_device *m68k); -INLINE UINT32 OPER_PCDI_16(m68000_base_device *m68k); -INLINE UINT32 OPER_PCDI_32(m68000_base_device *m68k); -INLINE UINT32 OPER_PCIX_8(m68000_base_device *m68k); -INLINE UINT32 OPER_PCIX_16(m68000_base_device *m68k); -INLINE UINT32 OPER_PCIX_32(m68000_base_device *m68k); +static inline UINT32 OPER_AY_AI_8(m68000_base_device *m68k); +static inline UINT32 OPER_AY_AI_16(m68000_base_device *m68k); +static inline UINT32 OPER_AY_AI_32(m68000_base_device *m68k); +static inline UINT32 OPER_AY_PI_8(m68000_base_device *m68k); +static inline UINT32 OPER_AY_PI_16(m68000_base_device *m68k); +static inline UINT32 OPER_AY_PI_32(m68000_base_device *m68k); +static inline UINT32 OPER_AY_PD_8(m68000_base_device *m68k); +static inline UINT32 OPER_AY_PD_16(m68000_base_device *m68k); +static inline UINT32 OPER_AY_PD_32(m68000_base_device *m68k); +static inline UINT32 OPER_AY_DI_8(m68000_base_device *m68k); +static inline UINT32 OPER_AY_DI_16(m68000_base_device *m68k); +static inline UINT32 OPER_AY_DI_32(m68000_base_device *m68k); +static inline UINT32 OPER_AY_IX_8(m68000_base_device *m68k); +static inline UINT32 OPER_AY_IX_16(m68000_base_device *m68k); +static inline UINT32 OPER_AY_IX_32(m68000_base_device *m68k); + +static inline UINT32 OPER_AX_AI_8(m68000_base_device *m68k); +static inline UINT32 OPER_AX_AI_16(m68000_base_device *m68k); +static inline UINT32 OPER_AX_AI_32(m68000_base_device *m68k); +static inline UINT32 OPER_AX_PI_8(m68000_base_device *m68k); +static inline UINT32 OPER_AX_PI_16(m68000_base_device *m68k); +static inline UINT32 OPER_AX_PI_32(m68000_base_device *m68k); +static inline UINT32 OPER_AX_PD_8(m68000_base_device *m68k); +static inline UINT32 OPER_AX_PD_16(m68000_base_device *m68k); +static inline UINT32 OPER_AX_PD_32(m68000_base_device *m68k); +static inline UINT32 OPER_AX_DI_8(m68000_base_device *m68k); +static inline UINT32 OPER_AX_DI_16(m68000_base_device *m68k); +static inline UINT32 OPER_AX_DI_32(m68000_base_device *m68k); +static inline UINT32 OPER_AX_IX_8(m68000_base_device *m68k); +static inline UINT32 OPER_AX_IX_16(m68000_base_device *m68k); +static inline UINT32 OPER_AX_IX_32(m68000_base_device *m68k); + +static inline UINT32 OPER_A7_PI_8(m68000_base_device *m68k); +static inline UINT32 OPER_A7_PD_8(m68000_base_device *m68k); + +static inline UINT32 OPER_AW_8(m68000_base_device *m68k); +static inline UINT32 OPER_AW_16(m68000_base_device *m68k); +static inline UINT32 OPER_AW_32(m68000_base_device *m68k); +static inline UINT32 OPER_AL_8(m68000_base_device *m68k); +static inline UINT32 OPER_AL_16(m68000_base_device *m68k); +static inline UINT32 OPER_AL_32(m68000_base_device *m68k); +static inline UINT32 OPER_PCDI_8(m68000_base_device *m68k); +static inline UINT32 OPER_PCDI_16(m68000_base_device *m68k); +static inline UINT32 OPER_PCDI_32(m68000_base_device *m68k); +static inline UINT32 OPER_PCIX_8(m68000_base_device *m68k); +static inline UINT32 OPER_PCIX_16(m68000_base_device *m68k); +static inline UINT32 OPER_PCIX_32(m68000_base_device *m68k); /* Stack operations */ -INLINE void m68ki_push_16(m68000_base_device *m68k, UINT32 value); -INLINE void m68ki_push_32(m68000_base_device *m68k, UINT32 value); -INLINE UINT32 m68ki_pull_16(m68000_base_device *m68k); -INLINE UINT32 m68ki_pull_32(m68000_base_device *m68k); +static inline void m68ki_push_16(m68000_base_device *m68k, UINT32 value); +static inline void m68ki_push_32(m68000_base_device *m68k, UINT32 value); +static inline UINT32 m68ki_pull_16(m68000_base_device *m68k); +static inline UINT32 m68ki_pull_32(m68000_base_device *m68k); /* Program flow operations */ -INLINE void m68ki_jump(m68000_base_device *m68k, UINT32 new_pc); -INLINE void m68ki_jump_vector(m68000_base_device *m68k, UINT32 vector); -INLINE void m68ki_branch_8(m68000_base_device *m68k, UINT32 offset); -INLINE void m68ki_branch_16(m68000_base_device *m68k, UINT32 offset); -INLINE void m68ki_branch_32(m68000_base_device *m68k, UINT32 offset); +static inline void m68ki_jump(m68000_base_device *m68k, UINT32 new_pc); +static inline void m68ki_jump_vector(m68000_base_device *m68k, UINT32 vector); +static inline void m68ki_branch_8(m68000_base_device *m68k, UINT32 offset); +static inline void m68ki_branch_16(m68000_base_device *m68k, UINT32 offset); +static inline void m68ki_branch_32(m68000_base_device *m68k, UINT32 offset); /* Status register operations. */ -INLINE void m68ki_set_s_flag(m68000_base_device *m68k, UINT32 value); /* Only bit 2 of value should be set (i.e. 4 or 0) */ -INLINE void m68ki_set_sm_flag(m68000_base_device *m68k, UINT32 value); /* only bits 1 and 2 of value should be set */ -INLINE void m68ki_set_ccr(m68000_base_device *m68k, UINT32 value); /* set the condition code register */ -INLINE void m68ki_set_sr(m68000_base_device *m68k, UINT32 value); /* set the status register */ -INLINE void m68ki_set_sr_noint(m68000_base_device *m68k, UINT32 value); /* set the status register */ +static inline void m68ki_set_s_flag(m68000_base_device *m68k, UINT32 value); /* Only bit 2 of value should be set (i.e. 4 or 0) */ +static inline void m68ki_set_sm_flag(m68000_base_device *m68k, UINT32 value); /* only bits 1 and 2 of value should be set */ +static inline void m68ki_set_ccr(m68000_base_device *m68k, UINT32 value); /* set the condition code register */ +static inline void m68ki_set_sr(m68000_base_device *m68k, UINT32 value); /* set the status register */ +static inline void m68ki_set_sr_noint(m68000_base_device *m68k, UINT32 value); /* set the status register */ /* Exception processing */ -INLINE UINT32 m68ki_init_exception(m68000_base_device *m68k); /* Initial exception processing */ - -INLINE void m68ki_stack_frame_3word(m68000_base_device *m68k, UINT32 pc, UINT32 sr); /* Stack various frame types */ -INLINE void m68ki_stack_frame_buserr(m68000_base_device *m68k, UINT32 sr); - -INLINE void m68ki_stack_frame_0000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); -INLINE void m68ki_stack_frame_0001(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); -INLINE void m68ki_stack_frame_0010(m68000_base_device *m68k, UINT32 sr, UINT32 vector); -INLINE void m68ki_stack_frame_1000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); -INLINE void m68ki_stack_frame_1010(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address); -INLINE void m68ki_stack_frame_1011(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address); -INLINE void m68ki_stack_frame_0111(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address, bool in_mmu); - -INLINE void m68ki_exception_trap(m68000_base_device *m68k, UINT32 vector); -INLINE void m68ki_exception_trapN(m68000_base_device *m68k, UINT32 vector); -INLINE void m68ki_exception_trace(m68000_base_device *m68k); -INLINE void m68ki_exception_privilege_violation(m68000_base_device *m68k); -INLINE void m68ki_exception_1010(m68000_base_device *m68k); -INLINE void m68ki_exception_1111(m68000_base_device *m68k); -INLINE void m68ki_exception_illegal(m68000_base_device *m68k); -INLINE void m68ki_exception_format_error(m68000_base_device *m68k); -INLINE void m68ki_exception_address_error(m68000_base_device *m68k); - -INLINE void m68ki_check_interrupts(m68000_base_device *m68k); /* ASG: check for interrupts */ +static inline UINT32 m68ki_init_exception(m68000_base_device *m68k); /* Initial exception processing */ + +static inline void m68ki_stack_frame_3word(m68000_base_device *m68k, UINT32 pc, UINT32 sr); /* Stack various frame types */ +static inline void m68ki_stack_frame_buserr(m68000_base_device *m68k, UINT32 sr); + +static inline void m68ki_stack_frame_0000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); +static inline void m68ki_stack_frame_0001(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); +static inline void m68ki_stack_frame_0010(m68000_base_device *m68k, UINT32 sr, UINT32 vector); +static inline void m68ki_stack_frame_1000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); +static inline void m68ki_stack_frame_1010(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address); +static inline void m68ki_stack_frame_1011(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address); +static inline void m68ki_stack_frame_0111(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address, bool in_mmu); + +static inline void m68ki_exception_trap(m68000_base_device *m68k, UINT32 vector); +static inline void m68ki_exception_trapN(m68000_base_device *m68k, UINT32 vector); +static inline void m68ki_exception_trace(m68000_base_device *m68k); +static inline void m68ki_exception_privilege_violation(m68000_base_device *m68k); +static inline void m68ki_exception_1010(m68000_base_device *m68k); +static inline void m68ki_exception_1111(m68000_base_device *m68k); +static inline void m68ki_exception_illegal(m68000_base_device *m68k); +static inline void m68ki_exception_format_error(m68000_base_device *m68k); +static inline void m68ki_exception_address_error(m68000_base_device *m68k); + +static inline void m68ki_check_interrupts(m68000_base_device *m68k); /* ASG: check for interrupts */ /* quick disassembly (used for logging) */ char* m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type); @@ -619,12 +619,12 @@ char* m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type); /* ======================================================================== */ -INLINE unsigned int m68k_read_pcrelative_8(m68000_base_device *m68k, unsigned int address) +static inline unsigned int m68k_read_pcrelative_8(m68000_base_device *m68k, unsigned int address) { return ((m68k->readimm16(address&~1)>>(8*(1-(address & 1))))&0xff); } -INLINE unsigned int m68k_read_pcrelative_16(m68000_base_device *m68k, unsigned int address) +static inline unsigned int m68k_read_pcrelative_16(m68000_base_device *m68k, unsigned int address) { if(address & 1) return @@ -636,7 +636,7 @@ INLINE unsigned int m68k_read_pcrelative_16(m68000_base_device *m68k, unsigned i (m68k->readimm16(address ) ); } -INLINE unsigned int m68k_read_pcrelative_32(m68000_base_device *m68k, unsigned int address) +static inline unsigned int m68k_read_pcrelative_32(m68000_base_device *m68k, unsigned int address) { if(address & 1) return @@ -656,7 +656,7 @@ INLINE unsigned int m68k_read_pcrelative_32(m68000_base_device *m68k, unsigned i * A real 68k first writes the high word to [address+2], and then writes the * low word to [address]. */ -INLINE void m68kx_write_memory_32_pd(m68000_base_device *m68k, unsigned int address, unsigned int value) +static inline void m68kx_write_memory_32_pd(m68000_base_device *m68k, unsigned int address, unsigned int value) { m68k->/*memory.*/write16(address+2, value>>16); m68k->/*memory.*/write16(address, value&0xffff); @@ -666,7 +666,7 @@ INLINE void m68kx_write_memory_32_pd(m68000_base_device *m68k, unsigned int addr /* ---------------------------- Read Immediate ---------------------------- */ // clear the instruction cache -INLINE void m68ki_ic_clear(m68000_base_device *m68k) +static inline void m68ki_ic_clear(m68000_base_device *m68k) { int i; for (i=0; i< M68K_IC_SIZE; i++) { @@ -676,7 +676,7 @@ INLINE void m68ki_ic_clear(m68000_base_device *m68k) // read immediate word using the instruction cache -INLINE UINT32 m68ki_ic_readimm16(m68000_base_device *m68k, UINT32 address) +static inline UINT32 m68ki_ic_readimm16(m68000_base_device *m68k, UINT32 address) { if (m68k->cacr & M68K_CACR_EI) { @@ -725,7 +725,7 @@ INLINE UINT32 m68ki_ic_readimm16(m68000_base_device *m68k, UINT32 address) /* Handles all immediate reads, does address error check, function code setting, * and prefetching if they are enabled in m68kconf.h */ -INLINE UINT32 m68ki_read_imm_16(m68000_base_device *m68k) +static inline UINT32 m68ki_read_imm_16(m68000_base_device *m68k) { UINT32 result; @@ -752,7 +752,7 @@ INLINE UINT32 m68ki_read_imm_16(m68000_base_device *m68k) return result; } -INLINE UINT32 m68ki_read_imm_32(m68000_base_device *m68k) +static inline UINT32 m68ki_read_imm_32(m68000_base_device *m68k) { UINT32 temp_val; @@ -789,13 +789,13 @@ INLINE UINT32 m68ki_read_imm_32(m68000_base_device *m68k) * These functions will also check for address error and set the function * code if they are enabled in m68kconf.h. */ -INLINE UINT32 m68ki_read_8_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) +static inline UINT32 m68ki_read_8_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) { m68k->mmu_tmp_fc = fc; m68k->mmu_tmp_rw = 1; return m68k->/*memory.*/read8(address); } -INLINE UINT32 m68ki_read_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) +static inline UINT32 m68ki_read_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -805,7 +805,7 @@ INLINE UINT32 m68ki_read_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 m68k->mmu_tmp_rw = 1; return m68k->/*memory.*/read16(address); } -INLINE UINT32 m68ki_read_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) +static inline UINT32 m68ki_read_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -816,13 +816,13 @@ INLINE UINT32 m68ki_read_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 return m68k->/*memory.*/read32(address); } -INLINE void m68ki_write_8_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) +static inline void m68ki_write_8_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) { m68k->mmu_tmp_fc = fc; m68k->mmu_tmp_rw = 0; m68k->/*memory.*/write8(address, value); } -INLINE void m68ki_write_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) +static inline void m68ki_write_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -832,7 +832,7 @@ INLINE void m68ki_write_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 f m68k->mmu_tmp_rw = 0; m68k->/*memory.*/write16(address, value); } -INLINE void m68ki_write_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) +static inline void m68ki_write_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -848,7 +848,7 @@ INLINE void m68ki_write_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 f * A real 68k first writes the high word to [address+2], and then writes the * low word to [address]. */ -INLINE void m68ki_write_32_pd_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) +static inline void m68ki_write_32_pd_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -866,14 +866,14 @@ INLINE void m68ki_write_32_pd_fc(m68000_base_device *m68k, UINT32 address, UINT3 /* The program counter relative addressing modes cause operands to be * retrieved from program space, not data space. */ -INLINE UINT32 m68ki_get_ea_pcdi(m68000_base_device *m68k) +static inline UINT32 m68ki_get_ea_pcdi(m68000_base_device *m68k) { UINT32 old_pc = REG_PC(m68k); return old_pc + MAKE_INT_16(m68ki_read_imm_16(m68k)); } -INLINE UINT32 m68ki_get_ea_pcix(m68000_base_device *m68k) +static inline UINT32 m68ki_get_ea_pcix(m68000_base_device *m68k) { return m68ki_get_ea_ix(m68k, REG_PC(m68k)); } @@ -920,7 +920,7 @@ INLINE UINT32 m68ki_get_ea_pcix(m68000_base_device *m68k) * 1 011 mem indir with long outer * 1 100-111 reserved */ -INLINE UINT32 m68ki_get_ea_ix(m68000_base_device *m68k, UINT32 An) +static inline UINT32 m68ki_get_ea_ix(m68000_base_device *m68k, UINT32 An) { /* An = base register */ UINT32 extension = m68ki_read_imm_16(m68k); @@ -993,78 +993,78 @@ INLINE UINT32 m68ki_get_ea_ix(m68000_base_device *m68k, UINT32 An) /* Fetch operands */ -INLINE UINT32 OPER_AY_AI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AY_AI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AY_AI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AY_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AY_PI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AY_PI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AY_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AY_PD_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AY_PD_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AY_DI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AY_DI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AY_DI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AY_IX_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AY_IX_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AY_IX_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_32(m68k); return m68ki_read_32(m68k, ea);} - -INLINE UINT32 OPER_AX_AI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AX_AI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AX_AI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AX_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AX_PI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AX_PI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AX_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AX_PD_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AX_PD_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AX_DI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AX_DI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AX_DI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AX_IX_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AX_IX_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AX_IX_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_32(m68k); return m68ki_read_32(m68k, ea);} - -INLINE UINT32 OPER_A7_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_A7_PI_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_A7_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_A7_PD_8(m68k); return m68ki_read_8(m68k, ea); } - -INLINE UINT32 OPER_AW_8(m68000_base_device *m68k) {UINT32 ea = EA_AW_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AW_16(m68000_base_device *m68k) {UINT32 ea = EA_AW_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AW_32(m68000_base_device *m68k) {UINT32 ea = EA_AW_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_AL_8(m68000_base_device *m68k) {UINT32 ea = EA_AL_8(m68k); return m68ki_read_8(m68k, ea); } -INLINE UINT32 OPER_AL_16(m68000_base_device *m68k) {UINT32 ea = EA_AL_16(m68k); return m68ki_read_16(m68k, ea);} -INLINE UINT32 OPER_AL_32(m68000_base_device *m68k) {UINT32 ea = EA_AL_32(m68k); return m68ki_read_32(m68k, ea);} -INLINE UINT32 OPER_PCDI_8(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_8(m68k); return m68ki_read_pcrel_8(m68k, ea); } -INLINE UINT32 OPER_PCDI_16(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_16(m68k); return m68ki_read_pcrel_16(m68k, ea);} -INLINE UINT32 OPER_PCDI_32(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_32(m68k); return m68ki_read_pcrel_32(m68k, ea);} -INLINE UINT32 OPER_PCIX_8(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_8(m68k); return m68ki_read_pcrel_8(m68k, ea); } -INLINE UINT32 OPER_PCIX_16(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_16(m68k); return m68ki_read_pcrel_16(m68k, ea);} -INLINE UINT32 OPER_PCIX_32(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_32(m68k); return m68ki_read_pcrel_32(m68k, ea);} +static inline UINT32 OPER_AY_AI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AY_AI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AY_AI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AY_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AY_PI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AY_PI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AY_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AY_PD_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AY_PD_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AY_DI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AY_DI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AY_DI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AY_IX_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AY_IX_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AY_IX_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_32(m68k); return m68ki_read_32(m68k, ea);} + +static inline UINT32 OPER_AX_AI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AX_AI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AX_AI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AX_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AX_PI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AX_PI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AX_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AX_PD_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AX_PD_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AX_DI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AX_DI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AX_DI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AX_IX_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AX_IX_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AX_IX_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_32(m68k); return m68ki_read_32(m68k, ea);} + +static inline UINT32 OPER_A7_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_A7_PI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_A7_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_A7_PD_8(m68k); return m68ki_read_8(m68k, ea); } + +static inline UINT32 OPER_AW_8(m68000_base_device *m68k) {UINT32 ea = EA_AW_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AW_16(m68000_base_device *m68k) {UINT32 ea = EA_AW_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AW_32(m68000_base_device *m68k) {UINT32 ea = EA_AW_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_AL_8(m68000_base_device *m68k) {UINT32 ea = EA_AL_8(m68k); return m68ki_read_8(m68k, ea); } +static inline UINT32 OPER_AL_16(m68000_base_device *m68k) {UINT32 ea = EA_AL_16(m68k); return m68ki_read_16(m68k, ea);} +static inline UINT32 OPER_AL_32(m68000_base_device *m68k) {UINT32 ea = EA_AL_32(m68k); return m68ki_read_32(m68k, ea);} +static inline UINT32 OPER_PCDI_8(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_8(m68k); return m68ki_read_pcrel_8(m68k, ea); } +static inline UINT32 OPER_PCDI_16(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_16(m68k); return m68ki_read_pcrel_16(m68k, ea);} +static inline UINT32 OPER_PCDI_32(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_32(m68k); return m68ki_read_pcrel_32(m68k, ea);} +static inline UINT32 OPER_PCIX_8(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_8(m68k); return m68ki_read_pcrel_8(m68k, ea); } +static inline UINT32 OPER_PCIX_16(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_16(m68k); return m68ki_read_pcrel_16(m68k, ea);} +static inline UINT32 OPER_PCIX_32(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_32(m68k); return m68ki_read_pcrel_32(m68k, ea);} /* ---------------------------- Stack Functions --------------------------- */ /* Push/pull data from the stack */ -INLINE void m68ki_push_16(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_push_16(m68000_base_device *m68k, UINT32 value) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) - 2); m68ki_write_16(m68k, REG_SP(m68k), value); } -INLINE void m68ki_push_32(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_push_32(m68000_base_device *m68k, UINT32 value) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) - 4); m68ki_write_32(m68k, REG_SP(m68k), value); } -INLINE UINT32 m68ki_pull_16(m68000_base_device *m68k) +static inline UINT32 m68ki_pull_16(m68000_base_device *m68k) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) + 2); return m68ki_read_16(m68k, REG_SP(m68k)-2); } -INLINE UINT32 m68ki_pull_32(m68000_base_device *m68k) +static inline UINT32 m68ki_pull_32(m68000_base_device *m68k) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) + 4); return m68ki_read_32(m68k, REG_SP(m68k)-4); @@ -1074,22 +1074,22 @@ INLINE UINT32 m68ki_pull_32(m68000_base_device *m68k) /* Increment/decrement the stack as if doing a push/pull but * don't do any memory access. */ -INLINE void m68ki_fake_push_16(m68000_base_device *m68k) +static inline void m68ki_fake_push_16(m68000_base_device *m68k) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) - 2); } -INLINE void m68ki_fake_push_32(m68000_base_device *m68k) +static inline void m68ki_fake_push_32(m68000_base_device *m68k) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) - 4); } -INLINE void m68ki_fake_pull_16(m68000_base_device *m68k) +static inline void m68ki_fake_pull_16(m68000_base_device *m68k) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) + 2); } -INLINE void m68ki_fake_pull_32(m68000_base_device *m68k) +static inline void m68ki_fake_pull_32(m68000_base_device *m68k) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) + 4); } @@ -1101,12 +1101,12 @@ INLINE void m68ki_fake_pull_32(m68000_base_device *m68k) * These functions will also call the pc_changed callback if it was enabled * in m68kconf.h. */ -INLINE void m68ki_jump(m68000_base_device *m68k, UINT32 new_pc) +static inline void m68ki_jump(m68000_base_device *m68k, UINT32 new_pc) { REG_PC(m68k) = new_pc; } -INLINE void m68ki_jump_vector(m68000_base_device *m68k, UINT32 vector) +static inline void m68ki_jump_vector(m68000_base_device *m68k, UINT32 vector) { REG_PC(m68k) = (vector<<2) + m68k->vbr; REG_PC(m68k) = m68ki_read_data_32(m68k, REG_PC(m68k)); @@ -1118,17 +1118,17 @@ INLINE void m68ki_jump_vector(m68000_base_device *m68k, UINT32 vector) * So far I've found no problems with not calling pc_changed for 8 or 16 * bit branches. */ -INLINE void m68ki_branch_8(m68000_base_device *m68k, UINT32 offset) +static inline void m68ki_branch_8(m68000_base_device *m68k, UINT32 offset) { REG_PC(m68k) += MAKE_INT_8(offset); } -INLINE void m68ki_branch_16(m68000_base_device *m68k, UINT32 offset) +static inline void m68ki_branch_16(m68000_base_device *m68k, UINT32 offset) { REG_PC(m68k) += MAKE_INT_16(offset); } -INLINE void m68ki_branch_32(m68000_base_device *m68k, UINT32 offset) +static inline void m68ki_branch_32(m68000_base_device *m68k, UINT32 offset) { REG_PC(m68k) += offset; } @@ -1140,7 +1140,7 @@ INLINE void m68ki_branch_32(m68000_base_device *m68k, UINT32 offset) /* Set the S flag and change the active stack pointer. * Note that value MUST be 4 or 0. */ -INLINE void m68ki_set_s_flag(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_s_flag(m68000_base_device *m68k, UINT32 value) { /* Backup the old stack pointer */ REG_SP_BASE(m68k)[m68k->s_flag | ((m68k->s_flag>>1) & m68k->m_flag)] = REG_SP(m68k); @@ -1153,7 +1153,7 @@ INLINE void m68ki_set_s_flag(m68000_base_device *m68k, UINT32 value) /* Set the S and M flags and change the active stack pointer. * Note that value MUST be 0, 2, 4, or 6 (bit2 = S, bit1 = M). */ -INLINE void m68ki_set_sm_flag(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sm_flag(m68000_base_device *m68k, UINT32 value) { /* Backup the old stack pointer */ REG_SP_BASE(m68k)[m68k->s_flag | ((m68k->s_flag>>1) & m68k->m_flag)] = REG_SP(m68k); @@ -1165,7 +1165,7 @@ INLINE void m68ki_set_sm_flag(m68000_base_device *m68k, UINT32 value) } /* Set the S and M flags. Don't touch the stack pointer. */ -INLINE void m68ki_set_sm_flag_nosp(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sm_flag_nosp(m68000_base_device *m68k, UINT32 value) { /* Set the S and M flags */ m68k->s_flag = value & SFLAG_SET; @@ -1174,7 +1174,7 @@ INLINE void m68ki_set_sm_flag_nosp(m68000_base_device *m68k, UINT32 value) /* Set the condition code register */ -INLINE void m68ki_set_ccr(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_ccr(m68000_base_device *m68k, UINT32 value) { m68k->x_flag = BIT_4(value) << 4; m68k->n_flag = BIT_3(value) << 4; @@ -1184,7 +1184,7 @@ INLINE void m68ki_set_ccr(m68000_base_device *m68k, UINT32 value) } /* Set the status register but don't check for interrupts */ -INLINE void m68ki_set_sr_noint(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sr_noint(m68000_base_device *m68k, UINT32 value) { /* Mask out the "unimplemented" bits */ value &= m68k->sr_mask; @@ -1200,7 +1200,7 @@ INLINE void m68ki_set_sr_noint(m68000_base_device *m68k, UINT32 value) /* Set the status register but don't check for interrupts nor * change the stack pointer */ -INLINE void m68ki_set_sr_noint_nosp(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sr_noint_nosp(m68000_base_device *m68k, UINT32 value) { /* Mask out the "unimplemented" bits */ value &= m68k->sr_mask; @@ -1214,7 +1214,7 @@ INLINE void m68ki_set_sr_noint_nosp(m68000_base_device *m68k, UINT32 value) } /* Set the status register and check for interrupts */ -INLINE void m68ki_set_sr(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sr(m68000_base_device *m68k, UINT32 value) { m68ki_set_sr_noint(m68k, value); m68ki_check_interrupts(m68k); @@ -1224,7 +1224,7 @@ INLINE void m68ki_set_sr(m68000_base_device *m68k, UINT32 value) /* ------------------------- Exception Processing ------------------------- */ /* Initiate exception processing */ -INLINE UINT32 m68ki_init_exception(m68000_base_device *m68k) +static inline UINT32 m68ki_init_exception(m68000_base_device *m68k) { /* Save the old status register */ UINT32 sr = m68ki_get_sr(m68k); @@ -1239,7 +1239,7 @@ INLINE UINT32 m68ki_init_exception(m68000_base_device *m68k) } /* 3 word stack frame (68000 only) */ -INLINE void m68ki_stack_frame_3word(m68000_base_device *m68k, UINT32 pc, UINT32 sr) +static inline void m68ki_stack_frame_3word(m68000_base_device *m68k, UINT32 pc, UINT32 sr) { m68ki_push_32(m68k, pc); m68ki_push_16(m68k, sr); @@ -1248,7 +1248,7 @@ INLINE void m68ki_stack_frame_3word(m68000_base_device *m68k, UINT32 pc, UINT32 /* Format 0 stack frame. * This is the standard stack frame for 68010+. */ -INLINE void m68ki_stack_frame_0000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) +static inline void m68ki_stack_frame_0000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) { /* Stack a 3-word frame if we are 68000 */ if(m68k->cpu_type == CPU_TYPE_000 || m68k->cpu_type == CPU_TYPE_008) @@ -1264,7 +1264,7 @@ INLINE void m68ki_stack_frame_0000(m68000_base_device *m68k, UINT32 pc, UINT32 s /* Format 1 stack frame (68020). * For 68020, this is the 4 word throwaway frame. */ -INLINE void m68ki_stack_frame_0001(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) +static inline void m68ki_stack_frame_0001(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) { m68ki_push_16(m68k, 0x1000 | (vector<<2)); m68ki_push_32(m68k, pc); @@ -1274,7 +1274,7 @@ INLINE void m68ki_stack_frame_0001(m68000_base_device *m68k, UINT32 pc, UINT32 s /* Format 2 stack frame. * This is used only by 68020 for trap exceptions. */ -INLINE void m68ki_stack_frame_0010(m68000_base_device *m68k, UINT32 sr, UINT32 vector) +static inline void m68ki_stack_frame_0010(m68000_base_device *m68k, UINT32 sr, UINT32 vector) { m68ki_push_32(m68k, REG_PPC(m68k)); m68ki_push_16(m68k, 0x2000 | (vector<<2)); @@ -1285,7 +1285,7 @@ INLINE void m68ki_stack_frame_0010(m68000_base_device *m68k, UINT32 sr, UINT32 v /* Bus error stack frame (68000 only). */ -INLINE void m68ki_stack_frame_buserr(m68000_base_device *m68k, UINT32 sr) +static inline void m68ki_stack_frame_buserr(m68000_base_device *m68k, UINT32 sr) { m68ki_push_32(m68k, REG_PC(m68k)); m68ki_push_16(m68k, sr); @@ -1302,7 +1302,7 @@ INLINE void m68ki_stack_frame_buserr(m68000_base_device *m68k, UINT32 sr) /* Format 8 stack frame (68010). * 68010 only. This is the 29 word bus/address error frame. */ -INLINE void m68ki_stack_frame_1000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) +static inline void m68ki_stack_frame_1000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) { /* VERSION * NUMBER @@ -1356,7 +1356,7 @@ INLINE void m68ki_stack_frame_1000(m68000_base_device *m68k, UINT32 pc, UINT32 s * if the error happens at an instruction boundary. * PC stacked is address of next instruction. */ -INLINE void m68ki_stack_frame_1010(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address) +static inline void m68ki_stack_frame_1010(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address) { int orig_rw = m68k->mmu_tmp_buserror_rw; // this gets splatted by the following pushes, so save it now int orig_fc = m68k->mmu_tmp_buserror_fc; @@ -1408,7 +1408,7 @@ INLINE void m68ki_stack_frame_1010(m68000_base_device *m68k, UINT32 sr, UINT32 v * if the error happens during instruction execution. * PC stacked is address of instruction in progress. */ -INLINE void m68ki_stack_frame_1011(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address) +static inline void m68ki_stack_frame_1011(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address) { int orig_rw = m68k->mmu_tmp_buserror_rw; // this gets splatted by the following pushes, so save it now int orig_fc = m68k->mmu_tmp_buserror_fc; @@ -1482,7 +1482,7 @@ INLINE void m68ki_stack_frame_1011(m68000_base_device *m68k, UINT32 sr, UINT32 v * This is used by the 68040 for bus fault and mmu trap * 30 words */ -INLINE void m68ki_stack_frame_0111(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address, bool in_mmu) +static inline void m68ki_stack_frame_0111(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address, bool in_mmu) { int orig_rw = m68k->mmu_tmp_buserror_rw; // this gets splatted by the following pushes, so save it now int orig_fc = m68k->mmu_tmp_buserror_fc; @@ -1525,7 +1525,7 @@ INLINE void m68ki_stack_frame_0111(m68000_base_device *m68k, UINT32 sr, UINT32 v /* Used for Group 2 exceptions. * These stack a type 2 frame on the 020. */ -INLINE void m68ki_exception_trap(m68000_base_device *m68k, UINT32 vector) +static inline void m68ki_exception_trap(m68000_base_device *m68k, UINT32 vector) { UINT32 sr = m68ki_init_exception(m68k); @@ -1541,7 +1541,7 @@ INLINE void m68ki_exception_trap(m68000_base_device *m68k, UINT32 vector) } /* Trap#n stacks a 0 frame but behaves like group2 otherwise */ -INLINE void m68ki_exception_trapN(m68000_base_device *m68k, UINT32 vector) +static inline void m68ki_exception_trapN(m68000_base_device *m68k, UINT32 vector) { UINT32 sr = m68ki_init_exception(m68k); m68ki_stack_frame_0000(m68k, REG_PC(m68k), sr, vector); @@ -1552,7 +1552,7 @@ INLINE void m68ki_exception_trapN(m68000_base_device *m68k, UINT32 vector) } /* Exception for trace mode */ -INLINE void m68ki_exception_trace(m68000_base_device *m68k) +static inline void m68ki_exception_trace(m68000_base_device *m68k) { UINT32 sr = m68ki_init_exception(m68k); @@ -1577,7 +1577,7 @@ INLINE void m68ki_exception_trace(m68000_base_device *m68k) } /* Exception for privilege violation */ -INLINE void m68ki_exception_privilege_violation(m68000_base_device *m68k) +static inline void m68ki_exception_privilege_violation(m68000_base_device *m68k) { UINT32 sr = m68ki_init_exception(m68k); @@ -1594,7 +1594,7 @@ INLINE void m68ki_exception_privilege_violation(m68000_base_device *m68k) } /* Exception for A-Line instructions */ -INLINE void m68ki_exception_1010(m68000_base_device *m68k) +static inline void m68ki_exception_1010(m68000_base_device *m68k) { UINT32 sr; @@ -1607,7 +1607,7 @@ INLINE void m68ki_exception_1010(m68000_base_device *m68k) } /* Exception for F-Line instructions */ -INLINE void m68ki_exception_1111(m68000_base_device *m68k) +static inline void m68ki_exception_1111(m68000_base_device *m68k) { UINT32 sr; @@ -1620,7 +1620,7 @@ INLINE void m68ki_exception_1111(m68000_base_device *m68k) } /* Exception for illegal instructions */ -INLINE void m68ki_exception_illegal(m68000_base_device *m68k) +static inline void m68ki_exception_illegal(m68000_base_device *m68k) { UINT32 sr; @@ -1639,7 +1639,7 @@ INLINE void m68ki_exception_illegal(m68000_base_device *m68k) } /* Exception for format errror in RTE */ -INLINE void m68ki_exception_format_error(m68000_base_device *m68k) +static inline void m68ki_exception_format_error(m68000_base_device *m68k) { UINT32 sr = m68ki_init_exception(m68k); m68ki_stack_frame_0000(m68k, REG_PC(m68k), sr, EXCEPTION_FORMAT_ERROR); @@ -1650,7 +1650,7 @@ INLINE void m68ki_exception_format_error(m68000_base_device *m68k) } /* Exception for address error */ -INLINE void m68ki_exception_address_error(m68000_base_device *m68k) +static inline void m68ki_exception_address_error(m68000_base_device *m68k) { UINT32 sr = m68ki_init_exception(m68k); @@ -1678,7 +1678,7 @@ INLINE void m68ki_exception_address_error(m68000_base_device *m68k) /* ASG: Check for interrupts */ -INLINE void m68ki_check_interrupts(m68000_base_device *m68k) +static inline void m68ki_check_interrupts(m68000_base_device *m68k) { if(m68k->nmi_pending) { diff --git a/src/devices/cpu/m68000/m68kfpu.inc b/src/devices/cpu/m68000/m68kfpu.inc index d922e774b2f..6493bc1f614 100644 --- a/src/devices/cpu/m68000/m68kfpu.inc +++ b/src/devices/cpu/m68000/m68kfpu.inc @@ -32,7 +32,7 @@ static const UINT32 pkmask3[18] = 0xfffff000, 0xffffff00, 0xfffffff0, 0xffffffff, }; -INLINE double fx80_to_double(floatx80 fx) +static inline double fx80_to_double(floatx80 fx) { UINT64 d; double *foo; @@ -44,7 +44,7 @@ INLINE double fx80_to_double(floatx80 fx) return *foo; } -INLINE floatx80 double_to_fx80(double in) +static inline floatx80 double_to_fx80(double in) { UINT64 *d; @@ -53,7 +53,7 @@ INLINE floatx80 double_to_fx80(double in) return float64_to_floatx80(*d); } -INLINE floatx80 load_extended_float80(m68000_base_device *m68k, UINT32 ea) +static inline floatx80 load_extended_float80(m68000_base_device *m68k, UINT32 ea) { UINT32 d1,d2; UINT16 d3; @@ -69,7 +69,7 @@ INLINE floatx80 load_extended_float80(m68000_base_device *m68k, UINT32 ea) return fp; } -INLINE void store_extended_float80(m68000_base_device *m68k, UINT32 ea, floatx80 fpr) +static inline void store_extended_float80(m68000_base_device *m68k, UINT32 ea, floatx80 fpr) { m68ki_write_16(m68k, ea+0, fpr.high); m68ki_write_16(m68k, ea+2, 0); @@ -77,7 +77,7 @@ INLINE void store_extended_float80(m68000_base_device *m68k, UINT32 ea, floatx80 m68ki_write_32(m68k, ea+8, fpr.low&0xffffffff); } -INLINE floatx80 load_pack_float80(m68000_base_device *m68k, UINT32 ea) +static inline floatx80 load_pack_float80(m68000_base_device *m68k, UINT32 ea) { UINT32 dw1, dw2, dw3; floatx80 result; @@ -128,7 +128,7 @@ INLINE floatx80 load_pack_float80(m68000_base_device *m68k, UINT32 ea) return result; } -INLINE void store_pack_float80(m68000_base_device *m68k, UINT32 ea, int k, floatx80 fpr) +static inline void store_pack_float80(m68000_base_device *m68k, UINT32 ea, int k, floatx80 fpr) { UINT32 dw1, dw2, dw3; char str[128], *ch; @@ -260,7 +260,7 @@ INLINE void store_pack_float80(m68000_base_device *m68k, UINT32 ea, int k, float m68ki_write_32(m68k, ea+8, dw3); } -INLINE void SET_CONDITION_CODES(m68000_base_device *m68k, floatx80 reg) +static inline void SET_CONDITION_CODES(m68000_base_device *m68k, floatx80 reg) { // UINT64 *regi; @@ -293,7 +293,7 @@ INLINE void SET_CONDITION_CODES(m68000_base_device *m68k, floatx80 reg) } } -INLINE int TEST_CONDITION(m68000_base_device *m68k, int condition) +static inline int TEST_CONDITION(m68000_base_device *m68k, int condition) { int n = (REG_FPSR(m68k) & FPCC_N) != 0; int z = (REG_FPSR(m68k) & FPCC_Z) != 0; diff --git a/src/devices/cpu/m68000/m68kmmu.h b/src/devices/cpu/m68000/m68kmmu.h index 342fc8ea981..7c3649c134b 100644 --- a/src/devices/cpu/m68000/m68kmmu.h +++ b/src/devices/cpu/m68000/m68kmmu.h @@ -176,7 +176,7 @@ void pmmu_atc_flush(m68000_base_device *m68k) } -INLINE UINT32 get_dt2_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 ptest) +static inline UINT32 get_dt2_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 ptest) { UINT32 tbl_entry = m68k->program->read_dword(tptr); UINT32 dt = tbl_entry & M68K_MMU_DF_DT; @@ -198,7 +198,7 @@ INLINE UINT32 get_dt2_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 p return tbl_entry; } -INLINE UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 fc, UINT8 ptest) +static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 fc, UINT8 ptest) { UINT32 tbl_entry2 = m68k->program->read_dword(tptr); UINT32 tbl_entry = m68k->program->read_dword(tptr + 4); @@ -226,7 +226,7 @@ INLINE UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 f /* pmmu_translate_addr_with_fc: perform 68851/68030-style PMMU address translation */ -/*INLINE*/ static UINT32 pmmu_translate_addr_with_fc(m68000_base_device *m68k, UINT32 addr_in, UINT8 fc, UINT8 ptest) +/*static inline*/ static UINT32 pmmu_translate_addr_with_fc(m68000_base_device *m68k, UINT32 addr_in, UINT8 fc, UINT8 ptest) { UINT32 addr_out, tbl_entry = 0, tamode = 0, tbmode = 0, tcmode = 0; UINT32 root_aptr, root_limit, tofs, ps, is, abits, bbits, cbits; @@ -525,7 +525,7 @@ INLINE UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 f // FC bits: 2 = supervisor, 1 = program, 0 = data // the 68040 is a subset of the 68851 and 68030 PMMUs - the page table sizes are fixed, there is no early termination, etc, etc. -/*INLINE*/ static UINT32 pmmu_translate_addr_with_fc_040(m68000_base_device *m68k, UINT32 addr_in, UINT8 fc, UINT8 ptest) +/*static inline*/ static UINT32 pmmu_translate_addr_with_fc_040(m68000_base_device *m68k, UINT32 addr_in, UINT8 fc, UINT8 ptest) { UINT32 addr_out, tt0, tt1; @@ -809,7 +809,7 @@ INLINE UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 f /* pmmu_translate_addr: perform 68851/68030-style PMMU address translation */ -/*INLINE*/ static UINT32 pmmu_translate_addr(m68000_base_device *m68k, UINT32 addr_in) +/*static inline*/ static UINT32 pmmu_translate_addr(m68000_base_device *m68k, UINT32 addr_in) { UINT32 addr_out; @@ -1111,7 +1111,7 @@ void m68881_mmu_ops(m68000_base_device *m68k) /* Apple HMMU translation is much simpler */ -INLINE UINT32 hmmu_translate_addr(m68000_base_device *m68k, UINT32 addr_in) +static inline UINT32 hmmu_translate_addr(m68000_base_device *m68k, UINT32 addr_in) { UINT32 addr_out; diff --git a/src/devices/cpu/mips/mips3com.cpp b/src/devices/cpu/mips/mips3com.cpp index 0409014eeba..bcd6f6f349a 100644 --- a/src/devices/cpu/mips/mips3com.cpp +++ b/src/devices/cpu/mips/mips3com.cpp @@ -29,7 +29,7 @@ static void tlb_entry_log_half(mips3_tlb_entry *entry, int tlbindex, int which); TLB entry matches the provided ASID -------------------------------------------------*/ -INLINE int tlb_entry_matches_asid(const mips3_tlb_entry *entry, UINT8 asid) +static inline int tlb_entry_matches_asid(const mips3_tlb_entry *entry, UINT8 asid) { return (entry->entry_hi & 0xff) == asid; } @@ -40,7 +40,7 @@ INLINE int tlb_entry_matches_asid(const mips3_tlb_entry *entry, UINT8 asid) TLB entry is global -------------------------------------------------*/ -INLINE int tlb_entry_is_global(const mips3_tlb_entry *entry) +static inline int tlb_entry_is_global(const mips3_tlb_entry *entry) { return (entry->entry_lo[0] & entry->entry_lo[1] & TLB_GLOBAL); } diff --git a/src/devices/cpu/mips/mips3drc.cpp b/src/devices/cpu/mips/mips3drc.cpp index 3c7d3bbba2d..02d73de3b14 100644 --- a/src/devices/cpu/mips/mips3drc.cpp +++ b/src/devices/cpu/mips/mips3drc.cpp @@ -91,7 +91,7 @@ static const UINT8 fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 }; descriptor -------------------------------------------------*/ -INLINE UINT32 epc(const opcode_desc *desc) +static inline UINT32 epc(const opcode_desc *desc) { return (desc->flags & OPFLAG_IN_DELAY_SLOT) ? (desc->pc - 3) : desc->pc; } @@ -102,7 +102,7 @@ INLINE UINT32 epc(const opcode_desc *desc) already allocated -------------------------------------------------*/ -INLINE void alloc_handle(drcuml_state *drcuml, code_handle **handleptr, const char *name) +static inline void alloc_handle(drcuml_state *drcuml, code_handle **handleptr, const char *name) { if (*handleptr == nullptr) *handleptr = drcuml->handle_alloc(name); diff --git a/src/devices/cpu/mips/mips3dsm.cpp b/src/devices/cpu/mips/mips3dsm.cpp index d453a17f1c0..1b0d6e52286 100644 --- a/src/devices/cpu/mips/mips3dsm.cpp +++ b/src/devices/cpu/mips/mips3dsm.cpp @@ -101,7 +101,7 @@ static const char *const ccreg[4][32] = CODE CODE ***************************************************************************/ -INLINE char *signed_16bit(INT16 val) +static inline char *signed_16bit(INT16 val) { static char temp[10]; if (val < 0) diff --git a/src/devices/cpu/mips/r3kdasm.cpp b/src/devices/cpu/mips/r3kdasm.cpp index 78521a9679f..ed0da525a98 100644 --- a/src/devices/cpu/mips/r3kdasm.cpp +++ b/src/devices/cpu/mips/r3kdasm.cpp @@ -82,7 +82,7 @@ static const char *const ccreg[4][32] = CODE CODE ***************************************************************************/ -INLINE char *signed_16bit(INT16 val) +static inline char *signed_16bit(INT16 val) { static char temp[10]; if (val < 0) diff --git a/src/devices/cpu/nec/necdasm.cpp b/src/devices/cpu/nec/necdasm.cpp index 594bef384ed..cd326436fd4 100644 --- a/src/devices/cpu/nec/necdasm.cpp +++ b/src/devices/cpu/nec/necdasm.cpp @@ -875,7 +875,7 @@ static char modrm_string[256]; #define MAX_LENGTH 8 -INLINE UINT8 FETCH(void) +static inline UINT8 FETCH(void) { if ((opcode_ptr - opcode_ptr_base) + 1 > MAX_LENGTH) return 0xff; @@ -884,7 +884,7 @@ INLINE UINT8 FETCH(void) } #if 0 -INLINE UINT16 FETCH16(void) +static inline UINT16 FETCH16(void) { UINT16 d; if ((opcode_ptr - opcode_ptr_base) + 2 > MAX_LENGTH) @@ -896,7 +896,7 @@ INLINE UINT16 FETCH16(void) } #endif -INLINE UINT8 FETCHD(void) +static inline UINT8 FETCHD(void) { if ((opcode_ptr - opcode_ptr_base) + 1 > MAX_LENGTH) return 0xff; @@ -904,7 +904,7 @@ INLINE UINT8 FETCHD(void) return *opcode_ptr++; } -INLINE UINT16 FETCHD16(void) +static inline UINT16 FETCHD16(void) { UINT16 d; if ((opcode_ptr - opcode_ptr_base) + 2 > MAX_LENGTH) diff --git a/src/devices/cpu/pdp1/pdp1dasm.cpp b/src/devices/cpu/pdp1/pdp1dasm.cpp index c8682ca1491..ec58c6e2e38 100644 --- a/src/devices/cpu/pdp1/pdp1dasm.cpp +++ b/src/devices/cpu/pdp1/pdp1dasm.cpp @@ -7,7 +7,7 @@ static int ib; static int y; -INLINE void ea (void) +static inline void ea (void) { /* while (1) { diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp index bd95e60fc2a..6c8d4397206 100644 --- a/src/devices/cpu/powerpc/ppccom.cpp +++ b/src/devices/cpu/powerpc/ppccom.cpp @@ -306,7 +306,7 @@ ppc405gp_device::ppc405gp_device(const machine_config &mconfig, const char *tag, of access and the protection bits -------------------------------------------------*/ -INLINE int page_access_allowed(int transtype, UINT8 key, UINT8 protbits) +static inline int page_access_allowed(int transtype, UINT8 key, UINT8 protbits) { if (key == 0) return (transtype == TRANSLATE_WRITE) ? (protbits != 3) : TRUE; @@ -450,7 +450,7 @@ inline void ppc_device::set_decrementer(UINT32 newdec) is_nan_double - is a double value a NaN -------------------------------------------------*/ -INLINE int is_nan_double(double x) +static inline int is_nan_double(double x) { UINT64 xi = *(UINT64*)&x; return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) && @@ -464,7 +464,7 @@ INLINE int is_nan_double(double x) quiet NaN -------------------------------------------------*/ -INLINE int is_qnan_double(double x) +static inline int is_qnan_double(double x) { UINT64 xi = *(UINT64*)&x; return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) && @@ -479,7 +479,7 @@ INLINE int is_qnan_double(double x) signaling NaN -------------------------------------------------*/ -INLINE int is_snan_double(double x) +static inline int is_snan_double(double x) { UINT64 xi = *(UINT64*)&x; return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) && @@ -494,7 +494,7 @@ INLINE int is_snan_double(double x) infinity -------------------------------------------------*/ -INLINE int is_infinity_double(double x) +static inline int is_infinity_double(double x) { UINT64 xi = *(UINT64*)&x; return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) && @@ -507,7 +507,7 @@ INLINE int is_infinity_double(double x) normalized -------------------------------------------------*/ -INLINE int is_normalized_double(double x) +static inline int is_normalized_double(double x) { UINT64 exp; UINT64 xi = *(UINT64*)&x; @@ -522,7 +522,7 @@ INLINE int is_normalized_double(double x) denormalized -------------------------------------------------*/ -INLINE int is_denormalized_double(double x) +static inline int is_denormalized_double(double x) { UINT64 xi = *(UINT64*)&x; return( ((xi & DOUBLE_EXP) == 0) && @@ -534,7 +534,7 @@ INLINE int is_denormalized_double(double x) sign_double - return sign of a double value -------------------------------------------------*/ -INLINE int sign_double(double x) +static inline int sign_double(double x) { UINT64 xi = *(UINT64*)&x; return ((xi & DOUBLE_SIGN) != 0); diff --git a/src/devices/cpu/psx/dma.cpp b/src/devices/cpu/psx/dma.cpp index b77c6e9d8e5..f2f048c39ff 100644 --- a/src/devices/cpu/psx/dma.cpp +++ b/src/devices/cpu/psx/dma.cpp @@ -12,7 +12,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/devices/cpu/psx/gte.cpp b/src/devices/cpu/psx/gte.cpp index 7b33804b289..fb3352737db 100644 --- a/src/devices/cpu/psx/gte.cpp +++ b/src/devices/cpu/psx/gte.cpp @@ -21,7 +21,7 @@ void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a, ...) logerror( "%08x: GTE: %s\n", pc, s_text ); } #else -INLINE void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a, ...) {} +static inline void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a, ...) {} #endif @@ -278,7 +278,7 @@ void gte::setcp2cr( UINT32 pc, int reg, UINT32 value ) m_cp2cr[ reg ].d = value; } -INLINE INT64 gte_shift( INT64 a, int sf ) +static inline INT64 gte_shift( INT64 a, int sf ) { if( sf > 0 ) { @@ -307,7 +307,7 @@ INT32 gte::BOUNDS( int44 value, int max_flag, int min_flag ) return gte_shift( value.value(), m_sf ); } -INLINE UINT32 gte_divide( UINT16 numerator, UINT16 denominator ) +static inline UINT32 gte_divide( UINT16 numerator, UINT16 denominator ) { if( numerator < ( denominator * 2 ) ) { diff --git a/src/devices/cpu/psx/irq.cpp b/src/devices/cpu/psx/irq.cpp index a15b091d23f..4a2293d758c 100644 --- a/src/devices/cpu/psx/irq.cpp +++ b/src/devices/cpu/psx/irq.cpp @@ -14,7 +14,7 @@ #define PSX_IRQ_MASK ( 0x7fd ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/devices/cpu/psx/mdec.cpp b/src/devices/cpu/psx/mdec.cpp index 0ad4ec3e2c3..3c0148525d5 100644 --- a/src/devices/cpu/psx/mdec.cpp +++ b/src/devices/cpu/psx/mdec.cpp @@ -15,7 +15,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { @@ -83,13 +83,13 @@ void psxmdec_device::device_start() } #ifdef UNUSED_FUNCTION -INLINE void psxwriteword( UINT32 *p_n_psxram, UINT32 n_address, UINT16 n_data ) +static inline void psxwriteword( UINT32 *p_n_psxram, UINT32 n_address, UINT16 n_data ) { *( (UINT16 *)( (UINT8 *)p_n_psxram + WORD_XOR_LE( n_address ) ) ) = n_data; } #endif -INLINE UINT16 psxreadword( UINT32 *p_n_psxram, UINT32 n_address ) +static inline UINT16 psxreadword( UINT32 *p_n_psxram, UINT32 n_address ) { return *( (UINT16 *)( (UINT8 *)p_n_psxram + WORD_XOR_LE( n_address ) ) ); } @@ -161,12 +161,12 @@ void psxmdec_device::mdec_idct( INT32 *p_n_src, INT32 *p_n_dst ) } } -INLINE UINT16 mdec_unpack_run( UINT16 n_packed ) +static inline UINT16 mdec_unpack_run( UINT16 n_packed ) { return n_packed >> 10; } -INLINE INT32 mdec_unpack_val( UINT16 n_packed ) +static inline INT32 mdec_unpack_val( UINT16 n_packed ) { return ( ( (INT32)n_packed ) << 22 ) >> 22; } @@ -224,22 +224,22 @@ UINT32 psxmdec_device::mdec_unpack( UINT32 *p_n_psxram, UINT32 n_address ) return n_address; } -INLINE INT32 mdec_cr_to_r( INT32 n_cr ) +static inline INT32 mdec_cr_to_r( INT32 n_cr ) { return ( 1435 * n_cr ) >> 10; } -INLINE INT32 mdec_cr_to_g( INT32 n_cr ) +static inline INT32 mdec_cr_to_g( INT32 n_cr ) { return ( -731 * n_cr ) >> 10; } -INLINE INT32 mdec_cb_to_g( INT32 n_cb ) +static inline INT32 mdec_cb_to_g( INT32 n_cb ) { return ( -351 * n_cb ) >> 10; } -INLINE INT32 mdec_cb_to_b( INT32 n_cb ) +static inline INT32 mdec_cb_to_b( INT32 n_cb ) { return ( 1814 * n_cb ) >> 10; } diff --git a/src/devices/cpu/psx/rcnt.cpp b/src/devices/cpu/psx/rcnt.cpp index fa7473e0453..f3e34a7cff8 100644 --- a/src/devices/cpu/psx/rcnt.cpp +++ b/src/devices/cpu/psx/rcnt.cpp @@ -11,7 +11,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/devices/cpu/psx/sio.cpp b/src/devices/cpu/psx/sio.cpp index b801d3e7bc5..ba057dd01e1 100644 --- a/src/devices/cpu/psx/sio.cpp +++ b/src/devices/cpu/psx/sio.cpp @@ -11,7 +11,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/devices/cpu/rsp/rsp_dasm.cpp b/src/devices/cpu/rsp/rsp_dasm.cpp index bf56b240652..d4ade625904 100644 --- a/src/devices/cpu/rsp/rsp_dasm.cpp +++ b/src/devices/cpu/rsp/rsp_dasm.cpp @@ -57,7 +57,7 @@ static const char *const element2[16] = "00000000", "11111111", "22222222", "33333333", "44444444", "55555555", "66666666", "77777777" }; -INLINE char *signed_imm16(UINT32 op) +static inline char *signed_imm16(UINT32 op) { static char temp[10]; INT16 value = op & 0xffff; diff --git a/src/devices/cpu/rsp/rspdrc.cpp b/src/devices/cpu/rsp/rspdrc.cpp index b89d6ca1d7e..097a8c39507 100644 --- a/src/devices/cpu/rsp/rspdrc.cpp +++ b/src/devices/cpu/rsp/rspdrc.cpp @@ -64,7 +64,7 @@ extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); descriptor -------------------------------------------------*/ -INLINE UINT32 epc(const opcode_desc *desc) +static inline UINT32 epc(const opcode_desc *desc) { return ((desc->flags & OPFLAG_IN_DELAY_SLOT) ? (desc->pc - 3) : desc->pc) | 0x1000; } @@ -75,7 +75,7 @@ INLINE UINT32 epc(const opcode_desc *desc) already allocated -------------------------------------------------*/ -INLINE void alloc_handle(drcuml_state *drcuml, code_handle **handleptr, const char *name) +static inline void alloc_handle(drcuml_state *drcuml, code_handle **handleptr, const char *name) { if (*handleptr == nullptr) *handleptr = drcuml->handle_alloc(name); diff --git a/src/devices/cpu/sh4/sh4tmu.cpp b/src/devices/cpu/sh4/sh4tmu.cpp index 89b59ac42ee..46044de0f09 100644 --- a/src/devices/cpu/sh4/sh4tmu.cpp +++ b/src/devices/cpu/sh4/sh4tmu.cpp @@ -16,7 +16,7 @@ static const int tcnt_div[8] = { 4, 16, 64, 256, 1024, 1, 1, 1 }; a (constant+1) where 0 <= constant < 2^32 -------------------------------------------------*/ -INLINE attotime sh4_scale_up_mame_time(const attotime &_time1, UINT32 factor1) +static inline attotime sh4_scale_up_mame_time(const attotime &_time1, UINT32 factor1) { return _time1 * factor1 + _time1; } diff --git a/src/devices/cpu/spc700/spc700.cpp b/src/devices/cpu/spc700/spc700.cpp index a21ab8bc27f..968aad0f10c 100644 --- a/src/devices/cpu/spc700/spc700.cpp +++ b/src/devices/cpu/spc700/spc700.cpp @@ -80,7 +80,7 @@ Address Function Register R/W When Reset Remarks #define MAKE_INT_8(A) (int8)((A)&0xff) #else #define int8 int -INLINE int MAKE_INT_8(int A) {return (A & 0x80) ? A | ~0xff : A & 0xff;} +static inline int MAKE_INT_8(int A) {return (A & 0x80) ? A | ~0xff : A & 0xff;} #endif /* UCHAR_MAX == 0xff */ #define MAKE_UINT_8(A) ((A)&0xff) diff --git a/src/devices/cpu/spc700/spc700ds.cpp b/src/devices/cpu/spc700/spc700ds.cpp index ef5fbd4fe91..867ddd56210 100644 --- a/src/devices/cpu/spc700/spc700ds.cpp +++ b/src/devices/cpu/spc700/spc700ds.cpp @@ -323,13 +323,13 @@ static const spc700_opcode_struct g_opcodes[256] = static unsigned int g_pc; static const UINT8 *rombase; -INLINE unsigned int read_8_immediate(void) +static inline unsigned int read_8_immediate(void) { g_pc++; return *rombase++; } -INLINE unsigned int read_16_immediate(void) +static inline unsigned int read_16_immediate(void) { unsigned int result; g_pc += 2; diff --git a/src/devices/cpu/ssem/ssem.cpp b/src/devices/cpu/ssem/ssem.cpp index 10ac5471e4d..0dfec9b9cfb 100644 --- a/src/devices/cpu/ssem/ssem.cpp +++ b/src/devices/cpu/ssem/ssem.cpp @@ -25,7 +25,7 @@ CPU_DISASSEMBLE( ssem ); // The de facto snapshot format for other SSEM simulators stores the data physically in that format as well. // Therefore, in MESS, every 32-bit word has its bits reversed, too, and as a result the values must be // un-reversed before being used. -INLINE UINT32 reverse(UINT32 v) +static inline UINT32 reverse(UINT32 v) { // Taken from http://www-graphics.stanford.edu/~seander/bithacks.html#ReverseParallel // swap odd and even bits diff --git a/src/devices/cpu/ssem/ssemdasm.cpp b/src/devices/cpu/ssem/ssemdasm.cpp index 7b8a6a47a7b..a38ac00903a 100644 --- a/src/devices/cpu/ssem/ssemdasm.cpp +++ b/src/devices/cpu/ssem/ssemdasm.cpp @@ -19,7 +19,7 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) va_end(vl); } -INLINE UINT32 reverse(UINT32 v) +static inline UINT32 reverse(UINT32 v) { // Taken from http://www-graphics.stanford.edu/~seander/bithacks.html#ReverseParallel // swap odd and even bits diff --git a/src/devices/cpu/tms32031/dis32031.cpp b/src/devices/cpu/tms32031/dis32031.cpp index bc2bd737318..4ab75192704 100644 --- a/src/devices/cpu/tms32031/dis32031.cpp +++ b/src/devices/cpu/tms32031/dis32031.cpp @@ -31,7 +31,7 @@ ***************************************************************************/ #if 0 -INLINE char *signed_16bit(INT16 val) +static inline char *signed_16bit(INT16 val) { static char temp[10]; if (val < 0) diff --git a/src/devices/cpu/tms9900/9900dasm.cpp b/src/devices/cpu/tms9900/9900dasm.cpp index 2e2883611c2..daa4d8cb540 100644 --- a/src/devices/cpu/tms9900/9900dasm.cpp +++ b/src/devices/cpu/tms9900/9900dasm.cpp @@ -314,7 +314,7 @@ static const enum opcodes ops_001c_002f_s0[20]= static int PC; -INLINE UINT16 readop_arg(const UINT8 *opram, unsigned pc) +static inline UINT16 readop_arg(const UINT8 *opram, unsigned pc) { UINT16 result = opram[PC++ - pc] << 8; return result | opram[PC++ - pc]; diff --git a/src/devices/cpu/tms9900/99xxcore.h b/src/devices/cpu/tms9900/99xxcore.h index cb94fac286f..9bc68f30c26 100644 --- a/src/devices/cpu/tms9900/99xxcore.h +++ b/src/devices/cpu/tms9900/99xxcore.h @@ -283,7 +283,7 @@ Other references can be found on spies.com: struct tms99xx_state; -INLINE void execute(tms99xx_state *cpustate, UINT16 opcode); +static inline void execute(tms99xx_state *cpustate, UINT16 opcode); #if EXTERNAL_INSTRUCTION_DECODING static void external_instruction_notify(tms99xx_state *cpustate, int ext_op_ID); @@ -533,7 +533,7 @@ struct tms99xx_state int extra_byte; /* buffer holding the unused byte in a word read */ }; -INLINE tms99xx_state *get_safe_token(device_t *device) +static inline tms99xx_state *get_safe_token(device_t *device) { assert(device != NULL); // assert(device->type() == TMS99XX_GET_INFO); @@ -803,7 +803,7 @@ WRITE8_HANDLER(tms9995_internal2_w) makes memory access slower, I have emulated this feature, because if I did otherwise, there would be some implementation problems in some driver sooner or later.*/ - INLINE int readword(tms99xx_state *cpustate, int addr) + static inline int readword(tms99xx_state *cpustate, int addr) { int val; @@ -1082,7 +1082,7 @@ WRITE8_HANDLER(tms9995_internal2_w) #define READREG(reg) readword(cpustate, (cpustate->WP+(reg)) & 0xffff) #define WRITEREG(reg, data) writeword(cpustate, (cpustate->WP+(reg)) & 0xffff, (data)) -INLINE UINT16 READREG_DEBUG(tms99xx_state *cpustate, int reg) +static inline UINT16 READREG_DEBUG(tms99xx_state *cpustate, int reg) { int temp = cpustate->icount; UINT16 result = READREG(reg); @@ -1090,7 +1090,7 @@ INLINE UINT16 READREG_DEBUG(tms99xx_state *cpustate, int reg) return result; } -INLINE void WRITEREG_DEBUG(tms99xx_state *cpustate, int reg, UINT16 data) +static inline void WRITEREG_DEBUG(tms99xx_state *cpustate, int reg, UINT16 data) { int temp = cpustate->icount; WRITEREG(reg, data); @@ -1173,7 +1173,7 @@ INLINE void WRITEREG_DEBUG(tms99xx_state *cpustate, int reg, UINT16 data) } } - INLINE void handle_error_interrupt(tms99xx_state *cpustate) + static inline void handle_error_interrupt(tms99xx_state *cpustate) { if (cpustate->error_interrupt_callback) (*cpustate->error_interrupt_callback)(cpustate->device, cpustate->error_interrupt_register ? 1 : 0); @@ -1339,12 +1339,12 @@ static const UINT16 inverted_right_shift_mask_table[17] = 0xFFFF }; -INLINE UINT16 logical_right_shift(UINT16 val, int c) +static inline UINT16 logical_right_shift(UINT16 val, int c) { return((val>>c) & right_shift_mask_table[c]); } -INLINE INT16 arithmetic_right_shift(INT16 val, int c) +static inline INT16 arithmetic_right_shift(INT16 val, int c) { if (val < 0) return((val>>c) | inverted_right_shift_mask_table[c]); @@ -1359,7 +1359,7 @@ INLINE INT16 arithmetic_right_shift(INT16 val, int c) /* Set lae */ -INLINE void setst_lae(tms99xx_state *cpustate, INT16 val) +static inline void setst_lae(tms99xx_state *cpustate, INT16 val) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ); @@ -1375,7 +1375,7 @@ INLINE void setst_lae(tms99xx_state *cpustate, INT16 val) /* Set laep (BYTE) */ -INLINE void setst_byte_laep(tms99xx_state *cpustate, INT8 val) +static inline void setst_byte_laep(tms99xx_state *cpustate, INT8 val) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ); @@ -1392,7 +1392,7 @@ INLINE void setst_byte_laep(tms99xx_state *cpustate, INT8 val) /* For COC, CZC, and TB */ -INLINE void setst_e(tms99xx_state *cpustate, UINT16 val, UINT16 to) +static inline void setst_e(tms99xx_state *cpustate, UINT16 val, UINT16 to) { if (val == to) cpustate->STATUS |= ST_EQ; @@ -1403,7 +1403,7 @@ INLINE void setst_e(tms99xx_state *cpustate, UINT16 val, UINT16 to) /* For CI, C, CB */ -INLINE void setst_c_lae(tms99xx_state *cpustate, UINT16 to, UINT16 val) +static inline void setst_c_lae(tms99xx_state *cpustate, UINT16 to, UINT16 val) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ); @@ -1421,7 +1421,7 @@ INLINE void setst_c_lae(tms99xx_state *cpustate, UINT16 to, UINT16 val) /* Set laeco for add */ -INLINE INT16 setst_add_laeco(tms99xx_state *cpustate, int a, int b) +static inline INT16 setst_add_laeco(tms99xx_state *cpustate, int a, int b) { UINT32 res; INT16 res2; @@ -1457,7 +1457,7 @@ INLINE INT16 setst_add_laeco(tms99xx_state *cpustate, int a, int b) /* Set laeco for subtract */ -INLINE INT16 setst_sub_laeco(tms99xx_state *cpustate, int a, int b) +static inline INT16 setst_sub_laeco(tms99xx_state *cpustate, int a, int b) { UINT32 res; INT16 res2; @@ -1493,7 +1493,7 @@ INLINE INT16 setst_sub_laeco(tms99xx_state *cpustate, int a, int b) /* Set laecop for add (BYTE) */ -INLINE INT8 setst_addbyte_laecop(tms99xx_state *cpustate, int a, int b) +static inline INT8 setst_addbyte_laecop(tms99xx_state *cpustate, int a, int b) { unsigned int res; INT8 res2; @@ -1531,7 +1531,7 @@ INLINE INT8 setst_addbyte_laecop(tms99xx_state *cpustate, int a, int b) /* Set laecop for subtract (BYTE) */ -INLINE INT8 setst_subbyte_laecop(tms99xx_state *cpustate, int a, int b) +static inline INT8 setst_subbyte_laecop(tms99xx_state *cpustate, int a, int b) { unsigned int res; INT8 res2; @@ -1570,7 +1570,7 @@ INLINE INT8 setst_subbyte_laecop(tms99xx_state *cpustate, int a, int b) /* For NEG */ -INLINE void setst_laeo(tms99xx_state *cpustate, INT16 val) +static inline void setst_laeo(tms99xx_state *cpustate, INT16 val) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_OV); @@ -1591,7 +1591,7 @@ INLINE void setst_laeo(tms99xx_state *cpustate, INT16 val) /* Meat of SRA */ -INLINE UINT16 setst_sra_laec(tms99xx_state *cpustate, INT16 a, UINT16 c) +static inline UINT16 setst_sra_laec(tms99xx_state *cpustate, INT16 a, UINT16 c) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C); @@ -1617,7 +1617,7 @@ INLINE UINT16 setst_sra_laec(tms99xx_state *cpustate, INT16 a, UINT16 c) /* Meat of SRL. Same algorithm as SRA, except that we fills in with 0s. */ -INLINE UINT16 setst_srl_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) +static inline UINT16 setst_srl_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C); @@ -1643,7 +1643,7 @@ INLINE UINT16 setst_srl_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) // // Meat of SRC // -INLINE UINT16 setst_src_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) +static inline UINT16 setst_src_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C); @@ -1668,7 +1668,7 @@ INLINE UINT16 setst_src_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) // // Meat of SLA // -INLINE UINT16 setst_sla_laeco(tms99xx_state *cpustate, UINT16 a, UINT16 c) +static inline UINT16 setst_sla_laeco(tms99xx_state *cpustate, UINT16 a, UINT16 c) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C | ST_OV); @@ -1889,7 +1889,7 @@ static CPU_EXIT( tms99xx ) } /* fetch : read one word at * PC, and increment PC. */ -INLINE UINT16 fetch(tms99xx_state *cpustate) +static inline UINT16 fetch(tms99xx_state *cpustate) { UINT16 value = readword(cpustate, cpustate->PC); cpustate->PC += 2; @@ -4971,7 +4971,7 @@ static void h4000b(tms99xx_state *cpustate, UINT16 opcode) } -INLINE void execute(tms99xx_state *cpustate, UINT16 opcode) +static inline void execute(tms99xx_state *cpustate, UINT16 opcode) { #if (! HAS_9995_OPCODES) diff --git a/src/devices/machine/adc083x.cpp b/src/devices/machine/adc083x.cpp index 40259e595f1..690c2d0e1fd 100644 --- a/src/devices/machine/adc083x.cpp +++ b/src/devices/machine/adc083x.cpp @@ -13,7 +13,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, device_t &device, const char *s_fmt, ... ) +static inline void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, device_t &device, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/devices/machine/i2cmem.cpp b/src/devices/machine/i2cmem.cpp index 17da9d40e2e..d77e12ef4be 100644 --- a/src/devices/machine/i2cmem.cpp +++ b/src/devices/machine/i2cmem.cpp @@ -40,7 +40,7 @@ Up to 4096 bytes can be addressed. #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/devices/machine/mc68328.cpp b/src/devices/machine/mc68328.cpp index 3e2101dddf2..4cd578d6a4c 100644 --- a/src/devices/machine/mc68328.cpp +++ b/src/devices/machine/mc68328.cpp @@ -15,7 +15,7 @@ #define VERBOSE_LEVEL (0) -INLINE void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { diff --git a/src/devices/machine/mm58167.cpp b/src/devices/machine/mm58167.cpp index 74572770710..ed66df7603f 100644 --- a/src/devices/machine/mm58167.cpp +++ b/src/devices/machine/mm58167.cpp @@ -93,7 +93,7 @@ void mm58167_device::device_reset() } -INLINE UINT8 make_bcd(UINT8 data) +static inline UINT8 make_bcd(UINT8 data) { return ((data / 10) << 4) | (data % 10); } diff --git a/src/devices/machine/rtc4543.cpp b/src/devices/machine/rtc4543.cpp index 0d0211304cb..ac1eba33e79 100644 --- a/src/devices/machine/rtc4543.cpp +++ b/src/devices/machine/rtc4543.cpp @@ -88,7 +88,7 @@ void rtc4543_device::device_timer(emu_timer &timer, device_timer_id id, int para } -INLINE UINT8 make_bcd(UINT8 data) +static inline UINT8 make_bcd(UINT8 data) { return ((data / 10) << 4) | (data % 10); } diff --git a/src/devices/machine/s3c2400.cpp b/src/devices/machine/s3c2400.cpp index d1b185d453e..a1ef609a1ac 100644 --- a/src/devices/machine/s3c2400.cpp +++ b/src/devices/machine/s3c2400.cpp @@ -16,7 +16,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { diff --git a/src/devices/machine/s3c2410.cpp b/src/devices/machine/s3c2410.cpp index 8c2ba31049e..c89a67ef47b 100644 --- a/src/devices/machine/s3c2410.cpp +++ b/src/devices/machine/s3c2410.cpp @@ -16,7 +16,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { diff --git a/src/devices/machine/s3c2440.cpp b/src/devices/machine/s3c2440.cpp index 15795ef3448..7cc5e0a6247 100644 --- a/src/devices/machine/s3c2440.cpp +++ b/src/devices/machine/s3c2440.cpp @@ -16,7 +16,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index 56e9ee32e3b..37402f900b0 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -17,7 +17,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp index 177cd5fef55..ccd849ef21d 100644 --- a/src/devices/machine/timekpr.cpp +++ b/src/devices/machine/timekpr.cpp @@ -61,12 +61,12 @@ const device_type MK48T08 = &device_creator; INLINE FUNCTIONS ***************************************************************************/ -INLINE UINT8 make_bcd(UINT8 data) +static inline UINT8 make_bcd(UINT8 data) { return ( ( ( data / 10 ) % 10 ) << 4 ) + ( data % 10 ); } -INLINE UINT8 from_bcd( UINT8 data ) +static inline UINT8 from_bcd( UINT8 data ) { return ( ( ( data >> 4 ) & 15 ) * 10 ) + ( data & 15 ); } diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp index ccef69d17d3..cb1e1c98bcb 100644 --- a/src/devices/sound/ay8910.cpp +++ b/src/devices/sound/ay8910.cpp @@ -431,7 +431,7 @@ static const ay8910_device::mosfet_param ay8910_mosfet_param = * *************************************/ -INLINE void build_3D_table(double rl, const ay8910_device::ay_ym_param *par, const ay8910_device::ay_ym_param *par_env, int normalize, double factor, int zero_is_off, INT32 *tab) +static inline void build_3D_table(double rl, const ay8910_device::ay_ym_param *par, const ay8910_device::ay_ym_param *par_env, int normalize, double factor, int zero_is_off, INT32 *tab) { double min = 10.0, max = 0.0; @@ -490,7 +490,7 @@ INLINE void build_3D_table(double rl, const ay8910_device::ay_ym_param *par, con /* for (e=0;e<16;e++) printf("%d %d\n",e<<10, tab[e<<10]); */ } -INLINE void build_single_table(double rl, const ay8910_device::ay_ym_param *par, int normalize, INT32 *tab, int zero_is_off) +static inline void build_single_table(double rl, const ay8910_device::ay_ym_param *par, int normalize, INT32 *tab, int zero_is_off) { int j; double rt; @@ -529,7 +529,7 @@ INLINE void build_single_table(double rl, const ay8910_device::ay_ym_param *par, } -INLINE void build_mosfet_resistor_table(const ay8910_device::mosfet_param &par, const double rd, INT32 *tab) +static inline void build_mosfet_resistor_table(const ay8910_device::mosfet_param &par, const double rd, INT32 *tab) { int j; diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp index 2156efd27fc..6e5ff8321bf 100644 --- a/src/devices/sound/c140.cpp +++ b/src/devices/sound/c140.cpp @@ -74,7 +74,7 @@ const device_type C140 = &device_creator; // LIVE DEVICE //************************************************************************** -INLINE int limit(INT32 in) +static inline int limit(INT32 in) { if(in>0x7fff) return 0x7fff; else if(in<-0x8000) return -0x8000; diff --git a/src/devices/sound/disc_wav.inc b/src/devices/sound/disc_wav.inc index 8d3b8d330a7..8087ea86627 100644 --- a/src/devices/sound/disc_wav.inc +++ b/src/devices/sound/disc_wav.inc @@ -218,7 +218,7 @@ DISCRETE_RESET(dss_counter) #define DSS_LFSR_NOISE__FEED DISCRETE_INPUT(4) #define DSS_LFSR_NOISE__BIAS DISCRETE_INPUT(5) -INLINE int dss_lfsr_function(discrete_device *dev, int myfunc, int in0, int in1, int bitmask) +static inline int dss_lfsr_function(discrete_device *dev, int myfunc, int in0, int in1, int bitmask) { int retval; diff --git a/src/devices/sound/fm.cpp b/src/devices/sound/fm.cpp index 4e21a4e5c7b..8aa9f157f91 100644 --- a/src/devices/sound/fm.cpp +++ b/src/devices/sound/fm.cpp @@ -694,7 +694,7 @@ struct FM_OPN /* status set and IRQ handling */ -INLINE void FM_STATUS_SET(FM_ST *ST,int flag) +static inline void FM_STATUS_SET(FM_ST *ST,int flag) { /* set status flag */ ST->status |= flag; @@ -707,7 +707,7 @@ INLINE void FM_STATUS_SET(FM_ST *ST,int flag) } /* status reset and IRQ handling */ -INLINE void FM_STATUS_RESET(FM_ST *ST,int flag) +static inline void FM_STATUS_RESET(FM_ST *ST,int flag) { /* reset status flag */ ST->status &=~flag; @@ -720,7 +720,7 @@ INLINE void FM_STATUS_RESET(FM_ST *ST,int flag) } /* IRQ mask set */ -INLINE void FM_IRQMASK_SET(FM_ST *ST,int flag) +static inline void FM_IRQMASK_SET(FM_ST *ST,int flag) { ST->irqmask = flag; /* IRQ handling check */ @@ -729,7 +729,7 @@ INLINE void FM_IRQMASK_SET(FM_ST *ST,int flag) } /* OPN Mode Register Write */ -INLINE void set_timers( FM_ST *ST, void *n, int v ) +static inline void set_timers( FM_ST *ST, void *n, int v ) { /* b7 = CSM MODE */ /* b6 = 3 slot mode */ @@ -787,7 +787,7 @@ INLINE void set_timers( FM_ST *ST, void *n, int v ) /* Timer A Overflow */ -INLINE void TimerAOver(FM_ST *ST) +static inline void TimerAOver(FM_ST *ST) { /* set status (if enabled) */ if(ST->mode & 0x04) FM_STATUS_SET(ST,0x01); @@ -796,7 +796,7 @@ INLINE void TimerAOver(FM_ST *ST) if (ST->timer_handler) (ST->timer_handler)(ST->param,0,ST->TAC * ST->timer_prescaler,ST->clock); } /* Timer B Overflow */ -INLINE void TimerBOver(FM_ST *ST) +static inline void TimerBOver(FM_ST *ST) { /* set status (if enabled) */ if(ST->mode & 0x08) FM_STATUS_SET(ST,0x02); @@ -838,7 +838,7 @@ INLINE void TimerBOver(FM_ST *ST) #if FM_BUSY_FLAG_SUPPORT #define FM_BUSY_CLEAR(ST) ((ST)->busy_expiry_time = UNDEFINED_TIME) -INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST) +static inline UINT8 FM_STATUS_FLAG(FM_ST *ST) { if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 ) { @@ -849,7 +849,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST) } return ST->status; } -INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock ) +static inline void FM_BUSY_SET(FM_ST *ST,int busyclock ) { TIME_TYPE expiry_period = MULTIPLY_TIME_BY_INT(attotime::from_hz(ST->clock), busyclock * ST->timer_prescaler); ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(&ST->device->machine()), expiry_period); @@ -863,7 +863,7 @@ INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock ) -INLINE void FM_KEYON(UINT8 type, FM_CH *CH , int s ) +static inline void FM_KEYON(UINT8 type, FM_CH *CH , int s ) { FM_SLOT *SLOT = &CH->SLOT[s]; if( !SLOT->key ) @@ -875,7 +875,7 @@ INLINE void FM_KEYON(UINT8 type, FM_CH *CH , int s ) } } -INLINE void FM_KEYOFF(FM_CH *CH , int s ) +static inline void FM_KEYOFF(FM_CH *CH , int s ) { FM_SLOT *SLOT = &CH->SLOT[s]; if( SLOT->key ) @@ -975,7 +975,7 @@ static void setup_connection( FM_OPN *OPN, FM_CH *CH, int ch ) } /* set detune & multiple */ -INLINE void set_det_mul(FM_ST *ST,FM_CH *CH,FM_SLOT *SLOT,int v) +static inline void set_det_mul(FM_ST *ST,FM_CH *CH,FM_SLOT *SLOT,int v) { SLOT->mul = (v&0x0f)? (v&0x0f)*2 : 1; SLOT->DT = ST->dt_tab[(v>>4)&7]; @@ -983,13 +983,13 @@ INLINE void set_det_mul(FM_ST *ST,FM_CH *CH,FM_SLOT *SLOT,int v) } /* set total level */ -INLINE void set_tl(FM_CH *CH,FM_SLOT *SLOT , int v) +static inline void set_tl(FM_CH *CH,FM_SLOT *SLOT , int v) { SLOT->tl = (v&0x7f)<<(ENV_BITS-7); /* 7bit TL */ } /* set attack rate & key scale */ -INLINE void set_ar_ksr(UINT8 type, FM_CH *CH,FM_SLOT *SLOT,int v) +static inline void set_ar_ksr(UINT8 type, FM_CH *CH,FM_SLOT *SLOT,int v) { UINT8 old_KSR = SLOT->KSR; @@ -1015,7 +1015,7 @@ INLINE void set_ar_ksr(UINT8 type, FM_CH *CH,FM_SLOT *SLOT,int v) } /* set decay rate */ -INLINE void set_dr(UINT8 type, FM_SLOT *SLOT,int v) +static inline void set_dr(UINT8 type, FM_SLOT *SLOT,int v) { SLOT->d1r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1024,7 +1024,7 @@ INLINE void set_dr(UINT8 type, FM_SLOT *SLOT,int v) } /* set sustain rate */ -INLINE void set_sr(UINT8 type, FM_SLOT *SLOT,int v) +static inline void set_sr(UINT8 type, FM_SLOT *SLOT,int v) { SLOT->d2r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1033,7 +1033,7 @@ INLINE void set_sr(UINT8 type, FM_SLOT *SLOT,int v) } /* set release rate */ -INLINE void set_sl_rr(UINT8 type, FM_SLOT *SLOT,int v) +static inline void set_sl_rr(UINT8 type, FM_SLOT *SLOT,int v) { SLOT->sl = sl_table[ v>>4 ]; @@ -1045,7 +1045,7 @@ INLINE void set_sl_rr(UINT8 type, FM_SLOT *SLOT,int v) -INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) +static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm) { UINT32 p; @@ -1056,7 +1056,7 @@ INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) return tl_tab[p]; } -INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) +static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) { UINT32 p; @@ -1068,7 +1068,7 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) } /* advance LFO to next sample */ -INLINE void advance_lfo(FM_OPN *OPN) +static inline void advance_lfo(FM_OPN *OPN) { UINT8 pos; @@ -1108,7 +1108,7 @@ INLINE void advance_lfo(FM_OPN *OPN) } } -/* changed from INLINE to static here to work around gcc 4.2.1 codegen bug */ +/* changed from static inline to static here to work around gcc 4.2.1 codegen bug */ static void advance_eg_channel(FM_OPN *OPN, FM_SLOT *SLOT) { unsigned int out; @@ -1259,7 +1259,7 @@ static void advance_eg_channel(FM_OPN *OPN, FM_SLOT *SLOT) #define volume_calc(OP) ((OP)->vol_out + (AM & (OP)->AMmask)) -INLINE void update_phase_lfo_slot(FM_OPN *OPN, FM_SLOT *SLOT, INT32 pms, UINT32 block_fnum) +static inline void update_phase_lfo_slot(FM_OPN *OPN, FM_SLOT *SLOT, INT32 pms, UINT32 block_fnum) { UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + pms + OPN->LFO_PM ]; @@ -1293,7 +1293,7 @@ INLINE void update_phase_lfo_slot(FM_OPN *OPN, FM_SLOT *SLOT, INT32 pms, UINT32 } } -INLINE void update_phase_lfo_channel(FM_OPN *OPN, FM_CH *CH) +static inline void update_phase_lfo_channel(FM_OPN *OPN, FM_CH *CH) { UINT32 block_fnum = CH->block_fnum; @@ -1344,7 +1344,7 @@ INLINE void update_phase_lfo_channel(FM_OPN *OPN, FM_CH *CH) } } -INLINE void chan_calc(FM_OPN *OPN, FM_CH *CH, int chnum) +static inline void chan_calc(FM_OPN *OPN, FM_CH *CH, int chnum) { unsigned int eg_out; @@ -1420,7 +1420,7 @@ INLINE void chan_calc(FM_OPN *OPN, FM_CH *CH, int chnum) } /* update phase increment and envelope generator */ -INLINE void refresh_fc_eg_slot(FM_OPN *OPN, FM_SLOT *SLOT , int fc , int kc ) +static inline void refresh_fc_eg_slot(FM_OPN *OPN, FM_SLOT *SLOT , int fc , int kc ) { int ksr = kc >> SLOT->KSR; @@ -1459,7 +1459,7 @@ INLINE void refresh_fc_eg_slot(FM_OPN *OPN, FM_SLOT *SLOT , int fc , int kc ) } /* update phase increment counters */ -/* Changed from INLINE to static to work around gcc 4.2.1 codegen bug */ +/* Changed from static inline to static to work around gcc 4.2.1 codegen bug */ static void refresh_fc_eg_chan(FM_OPN *OPN, FM_CH *CH ) { if( CH->SLOT[SLOT1].Incr==-1) @@ -1653,7 +1653,7 @@ static void FMCloseTable( void ) /* CSM Key Controll */ -INLINE void CSMKeyControll(UINT8 type, FM_CH *CH) +static inline void CSMKeyControll(UINT8 type, FM_CH *CH) { /* all key on then off (only for operators which were OFF!) */ if (!CH->SLOT[SLOT1].key) @@ -2471,7 +2471,7 @@ static void Init_ADPCMATable(void) } /* ADPCM A (Non control type) : calculate one channel output */ -INLINE void ADPCMA_calc_chan( YM2610 *F2610, ADPCM_CH *ch ) +static inline void ADPCMA_calc_chan( YM2610 *F2610, ADPCM_CH *ch ) { UINT32 step; UINT8 data; @@ -2691,7 +2691,7 @@ static const unsigned int YM2608_ADPCM_ROM_addr[2*6] = { /* flag enable control 0x110 */ -INLINE void YM2608IRQFlagWrite(FM_OPN *OPN, YM2608 *F2608, int v) +static inline void YM2608IRQFlagWrite(FM_OPN *OPN, YM2608 *F2608, int v) { if( v & 0x80 ) { /* Reset IRQ flag */ @@ -2705,7 +2705,7 @@ INLINE void YM2608IRQFlagWrite(FM_OPN *OPN, YM2608 *F2608, int v) } /* compatible mode & IRQ enable control 0x29 */ -INLINE void YM2608IRQMaskWrite(FM_OPN *OPN, YM2608 *F2608, int v) +static inline void YM2608IRQMaskWrite(FM_OPN *OPN, YM2608 *F2608, int v) { /* SCH,xx,xxx,EN_ZERO,EN_BRDY,EN_EOS,EN_TB,EN_TA */ diff --git a/src/devices/sound/fm2612.cpp b/src/devices/sound/fm2612.cpp index 2154e393735..086198a9ec4 100644 --- a/src/devices/sound/fm2612.cpp +++ b/src/devices/sound/fm2612.cpp @@ -714,7 +714,7 @@ struct YM2612 /* status set and IRQ handling */ -INLINE void FM_STATUS_SET(fm2612_FM_ST *ST,int flag) +static inline void FM_STATUS_SET(fm2612_FM_ST *ST,int flag) { /* set status flag */ ST->status |= flag; @@ -727,7 +727,7 @@ INLINE void FM_STATUS_SET(fm2612_FM_ST *ST,int flag) } /* status reset and IRQ handling */ -INLINE void FM_STATUS_RESET(fm2612_FM_ST *ST,int flag) +static inline void FM_STATUS_RESET(fm2612_FM_ST *ST,int flag) { /* reset status flag */ ST->status &=~flag; @@ -740,7 +740,7 @@ INLINE void FM_STATUS_RESET(fm2612_FM_ST *ST,int flag) } /* IRQ mask set */ -INLINE void FM_IRQMASK_SET(fm2612_FM_ST *ST,int flag) +static inline void FM_IRQMASK_SET(fm2612_FM_ST *ST,int flag) { ST->irqmask = flag; /* IRQ handling check */ @@ -748,7 +748,7 @@ INLINE void FM_IRQMASK_SET(fm2612_FM_ST *ST,int flag) FM_STATUS_RESET(ST,0); } -INLINE void FM_KEYON(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) +static inline void FM_KEYON(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) { fm2612_FM_SLOT *SLOT = &CH->SLOT[s]; @@ -783,7 +783,7 @@ INLINE void FM_KEYON(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) SLOT->key = 1; } -INLINE void FM_KEYOFF(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) +static inline void FM_KEYOFF(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) { fm2612_FM_SLOT *SLOT = &CH->SLOT[s]; @@ -816,7 +816,7 @@ INLINE void FM_KEYOFF(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) SLOT->key = 0; } -INLINE void FM_KEYON_CSM(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) +static inline void FM_KEYON_CSM(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) { fm2612_FM_SLOT *SLOT = &CH->SLOT[s]; @@ -849,7 +849,7 @@ INLINE void FM_KEYON_CSM(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) } } -INLINE void FM_KEYOFF_CSM(fm2612_FM_CH *CH , int s ) +static inline void FM_KEYOFF_CSM(fm2612_FM_CH *CH , int s ) { fm2612_FM_SLOT *SLOT = &CH->SLOT[s]; if (!SLOT->key) @@ -880,7 +880,7 @@ INLINE void FM_KEYOFF_CSM(fm2612_FM_CH *CH , int s ) } /* OPN Mode Register Write */ -INLINE void set_timers(fm2612_FM_OPN *OPN, fm2612_FM_ST *ST, void *n, int v) +static inline void set_timers(fm2612_FM_OPN *OPN, fm2612_FM_ST *ST, void *n, int v) { /* b7 = CSM MODE */ /* b6 = 3 slot mode */ @@ -954,7 +954,7 @@ INLINE void set_timers(fm2612_FM_OPN *OPN, fm2612_FM_ST *ST, void *n, int v) /* Timer A Overflow */ -INLINE void TimerAOver(fm2612_FM_ST *ST) +static inline void TimerAOver(fm2612_FM_ST *ST) { /* set status (if enabled) */ if(ST->mode & 0x04) FM_STATUS_SET(ST,0x01); @@ -963,7 +963,7 @@ INLINE void TimerAOver(fm2612_FM_ST *ST) if (ST->timer_handler) (ST->timer_handler)(ST->param,0,ST->TAC * ST->timer_prescaler,ST->clock); } /* Timer B Overflow */ -INLINE void TimerBOver(fm2612_FM_ST *ST) +static inline void TimerBOver(fm2612_FM_ST *ST) { /* set status (if enabled) */ if(ST->mode & 0x08) FM_STATUS_SET(ST,0x02); @@ -1005,7 +1005,7 @@ INLINE void TimerBOver(fm2612_FM_ST *ST) #if FM_BUSY_FLAG_SUPPORT #define FM_BUSY_CLEAR(ST) ((ST)->busy_expiry_time = UNDEFINED_TIME) -INLINE UINT8 FM_STATUS_FLAG(fm2612_FM_ST *ST) +static inline UINT8 FM_STATUS_FLAG(fm2612_FM_ST *ST) { if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 ) { @@ -1017,7 +1017,7 @@ INLINE UINT8 FM_STATUS_FLAG(fm2612_FM_ST *ST) return ST->status; } #if 0 -INLINE void FM_BUSY_SET(fm2612_FM_ST *ST,int busyclock ) +static inline void FM_BUSY_SET(fm2612_FM_ST *ST,int busyclock ) { TIME_TYPE expiry_period = MULTIPLY_TIME_BY_INT(attotime::from_hz(ST->clock), busyclock * ST->timer_prescaler); ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(&ST->device->machine()), expiry_period); @@ -1119,7 +1119,7 @@ static void setup_connection(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH, int ch) } /* set detune & multiple */ -INLINE void set_det_mul(fm2612_FM_ST *ST,fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT,int v) +static inline void set_det_mul(fm2612_FM_ST *ST,fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT,int v) { SLOT->mul = (v&0x0f)? (v&0x0f)*2 : 1; SLOT->DT = ST->dt_tab[(v>>4)&7]; @@ -1127,7 +1127,7 @@ INLINE void set_det_mul(fm2612_FM_ST *ST,fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT,i } /* set total level */ -INLINE void set_tl(fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT , int v) +static inline void set_tl(fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT , int v) { SLOT->tl = (v&0x7f)<<(ENV_BITS-7); /* 7bit TL */ @@ -1139,7 +1139,7 @@ INLINE void set_tl(fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT , int v) } /* set attack rate & key scale */ -INLINE void set_ar_ksr(UINT8 type, fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT,int v) +static inline void set_ar_ksr(UINT8 type, fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT,int v) { UINT8 old_KSR = SLOT->KSR; @@ -1168,7 +1168,7 @@ INLINE void set_ar_ksr(UINT8 type, fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT,int v) } /* set decay rate */ -INLINE void set_dr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) +static inline void set_dr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) { SLOT->d1r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1177,7 +1177,7 @@ INLINE void set_dr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) } /* set sustain rate */ -INLINE void set_sr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) +static inline void set_sr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) { SLOT->d2r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1186,7 +1186,7 @@ INLINE void set_sr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) } /* set release rate */ -INLINE void set_sl_rr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) +static inline void set_sl_rr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) { SLOT->sl = sl_table[ v>>4 ]; @@ -1201,7 +1201,7 @@ INLINE void set_sl_rr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) } /* advance LFO to next sample */ -INLINE void advance_lfo(fm2612_FM_OPN *OPN) +static inline void advance_lfo(fm2612_FM_OPN *OPN) { if (OPN->lfo_timer_overflow) /* LFO enabled ? */ { @@ -1229,7 +1229,7 @@ INLINE void advance_lfo(fm2612_FM_OPN *OPN) } } -/* changed from INLINE to static here to work around gcc 4.2.1 codegen bug */ +/* changed from static inline to static here to work around gcc 4.2.1 codegen bug */ static void advance_eg_channel(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT) { unsigned int out; @@ -1442,7 +1442,7 @@ static void update_ssg_eg_channel(fm2612_FM_SLOT *SLOT) } -INLINE void update_phase_lfo_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT, INT32 pms, UINT32 block_fnum) +static inline void update_phase_lfo_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT, INT32 pms, UINT32 block_fnum) { UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + pms + OPN->LFO_PM ]; @@ -1472,7 +1472,7 @@ INLINE void update_phase_lfo_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT, INT3 } } -INLINE void update_phase_lfo_channel(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) +static inline void update_phase_lfo_channel(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) { UINT32 block_fnum = CH->block_fnum; @@ -1519,7 +1519,7 @@ INLINE void update_phase_lfo_channel(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) } /* update phase increment and envelope generator */ -INLINE void refresh_fc_eg_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT , int fc , int kc ) +static inline void refresh_fc_eg_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT , int fc , int kc ) { int ksr = kc >> SLOT->KSR; @@ -1558,7 +1558,7 @@ INLINE void refresh_fc_eg_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT , int fc } /* update phase increment counters */ -/* Changed from INLINE to static to work around gcc 4.2.1 codegen bug */ +/* Changed from static inline to static to work around gcc 4.2.1 codegen bug */ static void refresh_fc_eg_chan(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH ) { if( CH->SLOT[SLOT1].Incr==-1) @@ -1574,7 +1574,7 @@ static void refresh_fc_eg_chan(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH ) #define volume_calc(OP) ((OP)->vol_out + (AM & (OP)->AMmask)) -INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) +static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm) { UINT32 p; @@ -1585,7 +1585,7 @@ INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) return tl_tab[p]; } -INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) +static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) { UINT32 p; @@ -1596,7 +1596,7 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) return tl_tab[p]; } -INLINE void chan_calc(YM2612 *F2612, fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) +static inline void chan_calc(YM2612 *F2612, fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) { UINT32 AM = OPN->LFO_AM >> CH->ams; unsigned int eg_out = volume_calc(&CH->SLOT[SLOT1]); @@ -1679,7 +1679,7 @@ static void FMCloseTable( void ) /* CSM Key Controll */ -INLINE void CSMKeyControll(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) +static inline void CSMKeyControll(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) { /* all key ON (verified by Nemesis on real hardware) */ FM_KEYON_CSM(OPN,CH,SLOT1); diff --git a/src/devices/sound/fmopl.cpp b/src/devices/sound/fmopl.cpp index adec411d20b..d8592ea3afb 100644 --- a/src/devices/sound/fmopl.cpp +++ b/src/devices/sound/fmopl.cpp @@ -129,7 +129,7 @@ Revision History: /*#define SAVE_SAMPLE*/ #ifdef SAVE_SAMPLE -INLINE signed int acc_calc(signed int value) +static inline signed int acc_calc(signed int value) { if (value>=0) { @@ -651,7 +651,7 @@ static int num_lock = 0; -INLINE int limit( int val, int max, int min ) { +static inline int limit( int val, int max, int min ) { if ( val > max ) val = max; else if ( val < min ) @@ -662,7 +662,7 @@ INLINE int limit( int val, int max, int min ) { /* status set and IRQ handling */ -INLINE void OPL_STATUS_SET(FM_OPL *OPL,int flag) +static inline void OPL_STATUS_SET(FM_OPL *OPL,int flag) { /* set status flag */ OPL->status |= flag; @@ -678,7 +678,7 @@ INLINE void OPL_STATUS_SET(FM_OPL *OPL,int flag) } /* status reset and IRQ handling */ -INLINE void OPL_STATUS_RESET(FM_OPL *OPL,int flag) +static inline void OPL_STATUS_RESET(FM_OPL *OPL,int flag) { /* reset status flag */ OPL->status &=~flag; @@ -694,7 +694,7 @@ INLINE void OPL_STATUS_RESET(FM_OPL *OPL,int flag) } /* IRQ mask set */ -INLINE void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag) +static inline void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag) { OPL->statusmask = flag; /* IRQ handling check */ @@ -704,7 +704,7 @@ INLINE void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag) /* advance LFO to next sample */ -INLINE void advance_lfo(FM_OPL *OPL) +static inline void advance_lfo(FM_OPL *OPL) { UINT8 tmp; @@ -725,7 +725,7 @@ INLINE void advance_lfo(FM_OPL *OPL) } /* advance to next sample */ -INLINE void advance(FM_OPL *OPL) +static inline void advance(FM_OPL *OPL) { OPL_CH *CH; OPL_SLOT *op; @@ -888,7 +888,7 @@ INLINE void advance(FM_OPL *OPL) } -INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) { UINT32 p; @@ -899,7 +899,7 @@ INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigne return tl_tab[p]; } -INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) { UINT32 p; @@ -914,7 +914,7 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsign #define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (OPL->LFO_AM & (OP)->AMmask)) /* calculate output */ -INLINE void OPL_CALC_CH( FM_OPL *OPL, OPL_CH *CH ) +static inline void OPL_CALC_CH( FM_OPL *OPL, OPL_CH *CH ) { OPL_SLOT *SLOT; unsigned int env; @@ -980,7 +980,7 @@ number number BLK/FNUM2 FNUM Drum Hat Drum Tom Cymbal /* calculate rhythm */ -INLINE void OPL_CALC_RH( FM_OPL *OPL, OPL_CH *CH, unsigned int noise ) +static inline void OPL_CALC_RH( FM_OPL *OPL, OPL_CH *CH, unsigned int noise ) { OPL_SLOT *SLOT; signed int out; @@ -1324,7 +1324,7 @@ static void OPL_initalize(FM_OPL *OPL) } -INLINE void FM_KEYON(OPL_SLOT *SLOT, UINT32 key_set) +static inline void FM_KEYON(OPL_SLOT *SLOT, UINT32 key_set) { if( !SLOT->key ) { @@ -1336,7 +1336,7 @@ INLINE void FM_KEYON(OPL_SLOT *SLOT, UINT32 key_set) SLOT->key |= key_set; } -INLINE void FM_KEYOFF(OPL_SLOT *SLOT, UINT32 key_clr) +static inline void FM_KEYOFF(OPL_SLOT *SLOT, UINT32 key_clr) { if( SLOT->key ) { @@ -1352,7 +1352,7 @@ INLINE void FM_KEYOFF(OPL_SLOT *SLOT, UINT32 key_clr) } /* update phase increment counter of operator (also update the EG rates if necessary) */ -INLINE void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT) +static inline void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT) { int ksr; @@ -1383,7 +1383,7 @@ INLINE void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT) } /* set multi,am,vib,EG-TYP,KSR,mul */ -INLINE void set_mul(FM_OPL *OPL,int slot,int v) +static inline void set_mul(FM_OPL *OPL,int slot,int v) { OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -1397,7 +1397,7 @@ INLINE void set_mul(FM_OPL *OPL,int slot,int v) } /* set ksl & tl */ -INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v) +static inline void set_ksl_tl(FM_OPL *OPL,int slot,int v) { OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -1409,7 +1409,7 @@ INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v) } /* set attack rate & decay rate */ -INLINE void set_ar_dr(FM_OPL *OPL,int slot,int v) +static inline void set_ar_dr(FM_OPL *OPL,int slot,int v) { OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -1433,7 +1433,7 @@ INLINE void set_ar_dr(FM_OPL *OPL,int slot,int v) } /* set sustain level & release rate */ -INLINE void set_sl_rr(FM_OPL *OPL,int slot,int v) +static inline void set_sl_rr(FM_OPL *OPL,int slot,int v) { OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -2112,7 +2112,7 @@ static unsigned char OPLRead(FM_OPL *OPL,int a) } /* CSM Key Controll */ -INLINE void CSMKeyControll(OPL_CH *CH) +static inline void CSMKeyControll(OPL_CH *CH) { FM_KEYON (&CH->SLOT[SLOT1], 4); FM_KEYON (&CH->SLOT[SLOT2], 4); diff --git a/src/devices/sound/k053260.cpp b/src/devices/sound/k053260.cpp index 434d352635c..134598a1f7c 100644 --- a/src/devices/sound/k053260.cpp +++ b/src/devices/sound/k053260.cpp @@ -247,7 +247,7 @@ WRITE8_MEMBER( k053260_device::write ) } -INLINE int limit( int val, int max, int min ) +static inline int limit( int val, int max, int min ) { if ( val > max ) val = max; diff --git a/src/devices/sound/nes_apu.cpp b/src/devices/sound/nes_apu.cpp index 0c42deb0fca..3792311c77e 100644 --- a/src/devices/sound/nes_apu.cpp +++ b/src/devices/sound/nes_apu.cpp @@ -427,7 +427,7 @@ int8 nesapu_device::apu_noise(noise_t *chan) } /* RESET DPCM PARAMETERS */ -INLINE void apu_dpcmreset(dpcm_t *chan) +static inline void apu_dpcmreset(dpcm_t *chan) { chan->address = 0xC000 + (uint16) (chan->regs[2] << 6); chan->length = (uint16) (chan->regs[3] << 4) + 1; diff --git a/src/devices/sound/sid.cpp b/src/devices/sound/sid.cpp index 375095e7401..d040702eeae 100644 --- a/src/devices/sound/sid.cpp +++ b/src/devices/sound/sid.cpp @@ -55,7 +55,7 @@ static void MixerInit(int threeVoiceAmplify) } -INLINE void syncEm(SID6581_t *This) +static inline void syncEm(SID6581_t *This) { int sync1 = (This->optr1.modulator->cycleLenCount <= 0); int sync2 = (This->optr2.modulator->cycleLenCount <= 0); diff --git a/src/devices/sound/sidenvel.cpp b/src/devices/sound/sidenvel.cpp index 9b375c37b1f..2fa17166638 100644 --- a/src/devices/sound/sidenvel.cpp +++ b/src/devices/sound/sidenvel.cpp @@ -195,24 +195,24 @@ void enveEmuResetOperator(sidOperator* pVoice) pVoice->enveShortAttackCount = 0; } -INLINE UINT16 enveEmuStartAttack(sidOperator*); -INLINE UINT16 enveEmuStartDecay(sidOperator*); -INLINE UINT16 enveEmuStartRelease(sidOperator*); -INLINE UINT16 enveEmuAlterAttack(sidOperator*); -INLINE UINT16 enveEmuAlterDecay(sidOperator*); -INLINE UINT16 enveEmuAlterSustain(sidOperator*); -INLINE UINT16 enveEmuAlterSustainDecay(sidOperator*); -INLINE UINT16 enveEmuAlterRelease(sidOperator*); -INLINE UINT16 enveEmuAttack(sidOperator*); -INLINE UINT16 enveEmuDecay(sidOperator*); -INLINE UINT16 enveEmuSustain(sidOperator*); -INLINE UINT16 enveEmuSustainDecay(sidOperator*); -INLINE UINT16 enveEmuRelease(sidOperator*); -INLINE UINT16 enveEmuMute(sidOperator*); - -INLINE UINT16 enveEmuStartShortAttack(sidOperator*); -INLINE UINT16 enveEmuAlterShortAttack(sidOperator*); -INLINE UINT16 enveEmuShortAttack(sidOperator*); +static inline UINT16 enveEmuStartAttack(sidOperator*); +static inline UINT16 enveEmuStartDecay(sidOperator*); +static inline UINT16 enveEmuStartRelease(sidOperator*); +static inline UINT16 enveEmuAlterAttack(sidOperator*); +static inline UINT16 enveEmuAlterDecay(sidOperator*); +static inline UINT16 enveEmuAlterSustain(sidOperator*); +static inline UINT16 enveEmuAlterSustainDecay(sidOperator*); +static inline UINT16 enveEmuAlterRelease(sidOperator*); +static inline UINT16 enveEmuAttack(sidOperator*); +static inline UINT16 enveEmuDecay(sidOperator*); +static inline UINT16 enveEmuSustain(sidOperator*); +static inline UINT16 enveEmuSustainDecay(sidOperator*); +static inline UINT16 enveEmuRelease(sidOperator*); +static inline UINT16 enveEmuMute(sidOperator*); + +static inline UINT16 enveEmuStartShortAttack(sidOperator*); +static inline UINT16 enveEmuAlterShortAttack(sidOperator*); +static inline UINT16 enveEmuShortAttack(sidOperator*); const ptr2sidUwordFunc enveModeTable[] = @@ -240,7 +240,7 @@ const ptr2sidUwordFunc enveModeTable[] = /* */ /* ADSRctrl is (index*2) to enveModeTable[], because of KEY-bit. */ -INLINE void enveEmuEnveAdvance(sidOperator* pVoice) +static inline void enveEmuEnveAdvance(sidOperator* pVoice) { #ifdef SID_FPUENVE pVoice->fenveStep += pVoice->fenveStepAdd; @@ -258,7 +258,7 @@ INLINE void enveEmuEnveAdvance(sidOperator* pVoice) /* */ /* Only used in the beginning. */ -INLINE UINT16 enveEmuMute(sidOperator* pVoice) +static inline UINT16 enveEmuMute(sidOperator* pVoice) { return 0; } @@ -267,7 +267,7 @@ INLINE UINT16 enveEmuMute(sidOperator* pVoice) /* Release */ /* */ -INLINE UINT16 enveEmuRelease(sidOperator* pVoice) +static inline UINT16 enveEmuRelease(sidOperator* pVoice) { #ifdef SID_FPUENVE pVoice->enveStep = (UINT16)pVoice->fenveStep; @@ -293,7 +293,7 @@ INLINE UINT16 enveEmuRelease(sidOperator* pVoice) } } -INLINE UINT16 enveEmuAlterRelease(sidOperator* pVoice) +static inline UINT16 enveEmuAlterRelease(sidOperator* pVoice) { UINT8 release = pVoice->SIDSR & 0x0F; #ifdef SID_FPUENVE @@ -308,7 +308,7 @@ INLINE UINT16 enveEmuAlterRelease(sidOperator* pVoice) return enveEmuRelease(pVoice); } -INLINE UINT16 enveEmuStartRelease(sidOperator* pVoice) +static inline UINT16 enveEmuStartRelease(sidOperator* pVoice) { pVoice->ADSRctrl = ENVE_RELEASE; #ifdef SID_FPUENVE @@ -327,12 +327,12 @@ INLINE UINT16 enveEmuStartRelease(sidOperator* pVoice) /* Sustain */ /* */ -INLINE UINT16 enveEmuSustain(sidOperator* pVoice) +static inline UINT16 enveEmuSustain(sidOperator* pVoice) { return masterAmplModTable[pVoice->sid->masterVolumeAmplIndex+pVoice->enveVol]; } -INLINE UINT16 enveEmuSustainDecay(sidOperator* pVoice) +static inline UINT16 enveEmuSustainDecay(sidOperator* pVoice) { #ifdef SID_FPUENVE pVoice->enveStep = (UINT16)pVoice->fenveStep; @@ -368,7 +368,7 @@ INLINE UINT16 enveEmuSustainDecay(sidOperator* pVoice) } /* This is the same as enveEmuStartSustainDecay(). */ -INLINE UINT16 enveEmuAlterSustainDecay(sidOperator* pVoice) +static inline UINT16 enveEmuAlterSustainDecay(sidOperator* pVoice) { UINT8 decay = pVoice->SIDAD & 0x0F ; #ifdef SID_FPUENVE @@ -384,7 +384,7 @@ INLINE UINT16 enveEmuAlterSustainDecay(sidOperator* pVoice) } /* This is the same as enveEmuStartSustain(). */ -INLINE UINT16 enveEmuAlterSustain(sidOperator* pVoice) +static inline UINT16 enveEmuAlterSustain(sidOperator* pVoice) { if ( pVoice->enveVol > pVoice->enveSusVol ) { @@ -404,7 +404,7 @@ INLINE UINT16 enveEmuAlterSustain(sidOperator* pVoice) /* Decay */ /* */ -INLINE UINT16 enveEmuDecay(sidOperator* pVoice) +static inline UINT16 enveEmuDecay(sidOperator* pVoice) { #ifdef SID_FPUENVE pVoice->enveStep = (UINT16)pVoice->fenveStep; @@ -439,7 +439,7 @@ INLINE UINT16 enveEmuDecay(sidOperator* pVoice) } } -INLINE UINT16 enveEmuAlterDecay(sidOperator* pVoice) +static inline UINT16 enveEmuAlterDecay(sidOperator* pVoice) { UINT8 decay = pVoice->SIDAD & 0x0F ; #ifdef SID_FPUENVE @@ -454,7 +454,7 @@ INLINE UINT16 enveEmuAlterDecay(sidOperator* pVoice) return enveEmuDecay(pVoice); } -INLINE UINT16 enveEmuStartDecay(sidOperator* pVoice) +static inline UINT16 enveEmuStartDecay(sidOperator* pVoice) { pVoice->ADSRctrl = ENVE_DECAY; #ifdef SID_FPUENVE @@ -471,7 +471,7 @@ INLINE UINT16 enveEmuStartDecay(sidOperator* pVoice) /* Attack */ /* */ -INLINE UINT16 enveEmuAttack(sidOperator* pVoice) +static inline UINT16 enveEmuAttack(sidOperator* pVoice) { #ifdef SID_FPUENVE pVoice->enveStep = (UINT16)pVoice->fenveStep; @@ -494,7 +494,7 @@ INLINE UINT16 enveEmuAttack(sidOperator* pVoice) } } -INLINE UINT16 enveEmuAlterAttack(sidOperator* pVoice) +static inline UINT16 enveEmuAlterAttack(sidOperator* pVoice) { UINT8 attack = pVoice->SIDAD >> 4; #ifdef SID_FPUENVE @@ -509,7 +509,7 @@ INLINE UINT16 enveEmuAlterAttack(sidOperator* pVoice) return enveEmuAttack(pVoice); } -INLINE UINT16 enveEmuStartAttack(sidOperator* pVoice) +static inline UINT16 enveEmuStartAttack(sidOperator* pVoice) { pVoice->ADSRctrl = ENVE_ATTACK; #ifdef SID_FPUENVE @@ -531,7 +531,7 @@ INLINE UINT16 enveEmuStartAttack(sidOperator* pVoice) /*#include */ /*#include */ -INLINE UINT16 enveEmuShortAttack(sidOperator* pVoice) +static inline UINT16 enveEmuShortAttack(sidOperator* pVoice) { #ifdef SID_FPUENVE pVoice->enveStep = (UINT16)pVoice->fenveStep; @@ -556,7 +556,7 @@ INLINE UINT16 enveEmuShortAttack(sidOperator* pVoice) return masterAmplModTable[ pVoice->sid->masterVolumeAmplIndex + pVoice->enveVol ]; } -INLINE UINT16 enveEmuAlterShortAttack(sidOperator* pVoice) +static inline UINT16 enveEmuAlterShortAttack(sidOperator* pVoice) { UINT8 attack = pVoice->SIDAD >> 4; #ifdef SID_FPUENVE @@ -571,7 +571,7 @@ INLINE UINT16 enveEmuAlterShortAttack(sidOperator* pVoice) return enveEmuShortAttack(pVoice); } -INLINE UINT16 enveEmuStartShortAttack(sidOperator* pVoice) +static inline UINT16 enveEmuStartShortAttack(sidOperator* pVoice) { pVoice->ADSRctrl = ENVE_SHORTATTACK; #ifdef SID_FPUENVE diff --git a/src/devices/sound/sidvoice.cpp b/src/devices/sound/sidvoice.cpp index 5f183307443..3104f69d680 100644 --- a/src/devices/sound/sidvoice.cpp +++ b/src/devices/sound/sidvoice.cpp @@ -48,7 +48,7 @@ void sidInitMixerEngine(running_machine &machine) } -INLINE void waveAdvance(sidOperator* pVoice) +static inline void waveAdvance(sidOperator* pVoice) { #if defined(DIRECT_FIXPOINT) pVoice->waveStep.l += pVoice->waveStepAdd.l; @@ -62,7 +62,7 @@ INLINE void waveAdvance(sidOperator* pVoice) #endif } -INLINE void noiseAdvance(sidOperator* pVoice) +static inline void noiseAdvance(sidOperator* pVoice) { pVoice->noiseStep += pVoice->noiseStepAdd; if (pVoice->noiseStep >= (1L<<20)) @@ -90,7 +90,7 @@ INLINE void noiseAdvance(sidOperator* pVoice) } } -INLINE void noiseAdvanceHp(sidOperator* pVoice) +static inline void noiseAdvanceHp(sidOperator* pVoice) { UINT32 tmp = pVoice->noiseStepAdd; while (tmp >= (1L<<20)) @@ -274,7 +274,7 @@ static void sidMode74(sidOperator* pVoice) { /* */ /* */ -INLINE void waveCalcCycleLen(sidOperator* pVoice) +static inline void waveCalcCycleLen(sidOperator* pVoice) { #if defined(DIRECT_FIXPOINT) pVoice->cycleAddLen.w[HI] = 0; @@ -326,7 +326,7 @@ INLINE void waveCalcCycleLen(sidOperator* pVoice) } /* see above (opening bracket) */ } -INLINE void waveCalcFilter(sidOperator* pVoice) +static inline void waveCalcFilter(sidOperator* pVoice) { if ( pVoice->filtEnabled ) { diff --git a/src/devices/sound/sn76477.cpp b/src/devices/sound/sn76477.cpp index af53b7bc7ab..bc89db04447 100644 --- a/src/devices/sound/sn76477.cpp +++ b/src/devices/sound/sn76477.cpp @@ -265,13 +265,13 @@ void sn76477_device::device_stop() #undef max #undef min -INLINE double max(double a, double b) +static inline double max(double a, double b) { return (a > b) ? a : b; } -INLINE double min(double a, double b) +static inline double min(double a, double b) { return (a < b) ? a : b; } diff --git a/src/devices/sound/sp0256.cpp b/src/devices/sound/sp0256.cpp index 31071bb247e..1ba54669ab2 100644 --- a/src/devices/sound/sp0256.cpp +++ b/src/devices/sound/sp0256.cpp @@ -215,7 +215,7 @@ void sp0256_device::device_reset() /* ======================================================================== */ /* LIMIT -- Limiter function for digital sample output. */ /* ======================================================================== */ -INLINE INT16 limit(INT16 s) +static inline INT16 limit(INT16 s) { #ifdef HIGH_QUALITY /* Higher quality than the original, but who cares? */ if (s > 8191) return 8191; @@ -230,7 +230,7 @@ INLINE INT16 limit(INT16 s) /* ======================================================================== */ /* LPC12_UPDATE -- Update the 12-pole filter, outputting samples. */ /* ======================================================================== */ -INLINE int lpc12_update(struct lpc12_t *f, int num_samp, INT16 *out, UINT32 *optr) +static inline int lpc12_update(struct lpc12_t *f, int num_samp, INT16 *out, UINT32 *optr) { int i, j; INT16 samp; @@ -360,7 +360,7 @@ static const int stage_map[6] = { 0, 1, 2, 3, 4, 5 }; /* ======================================================================== */ /* LPC12_REGDEC -- Decode the register set in the filter bank. */ /* ======================================================================== */ -INLINE void lpc12_regdec(struct lpc12_t *f) +static inline void lpc12_regdec(struct lpc12_t *f) { int i; @@ -722,7 +722,7 @@ static const INT16 sp0256_df_idx[16 * 8] = /* ======================================================================== */ /* BITREV32 -- Bit-reverse a 32-bit number. */ /* ======================================================================== */ -INLINE UINT32 bitrev32(UINT32 val) +static inline UINT32 bitrev32(UINT32 val) { val = ((val & 0xFFFF0000) >> 16) | ((val & 0x0000FFFF) << 16); val = ((val & 0xFF00FF00) >> 8) | ((val & 0x00FF00FF) << 8); @@ -736,7 +736,7 @@ INLINE UINT32 bitrev32(UINT32 val) /* ======================================================================== */ /* BITREV8 -- Bit-reverse a 8-bit number. */ /* ======================================================================== */ -INLINE UINT8 bitrev8(UINT8 val) +static inline UINT8 bitrev8(UINT8 val) { val = ((val & 0xF0) >> 4) | ((val & 0x0F) << 4); val = ((val & 0xCC) >> 2) | ((val & 0x33) << 2); diff --git a/src/devices/sound/spu.cpp b/src/devices/sound/spu.cpp index 31d04be95d6..50276f3c486 100644 --- a/src/devices/sound/spu.cpp +++ b/src/devices/sound/spu.cpp @@ -39,22 +39,22 @@ const device_type SPU = &device_creator; // // // -INLINE unsigned int min(unsigned int a, unsigned int b) +static inline unsigned int min(unsigned int a, unsigned int b) { return (a > b) ? b : a; } -INLINE unsigned int max(unsigned int a, unsigned int b) +static inline unsigned int max(unsigned int a, unsigned int b) { return (a > b) ? a : b; } -INLINE double mindb(double a, double b) +static inline double mindb(double a, double b) { return (a > b) ? b : a; } -INLINE double maxdb(double a, double b) +static inline double maxdb(double a, double b) { return (a > b) ? a : b; } diff --git a/src/devices/sound/ym2151.cpp b/src/devices/sound/ym2151.cpp index 5569fc6e9e1..9f5f63120ec 100644 --- a/src/devices/sound/ym2151.cpp +++ b/src/devices/sound/ym2151.cpp @@ -753,7 +753,7 @@ static void init_chip_tables(YM2151 *chip) } \ } -INLINE void envelope_KONKOFF(YM2151 *PSG, YM2151Operator * op, int v) +static inline void envelope_KONKOFF(YM2151 *PSG, YM2151Operator * op, int v) { if (v&0x08) /* M1 */ KEY_ON (op+0, 1) @@ -857,7 +857,7 @@ static TIMER_CALLBACK( timer_callback_chip_busy ) -INLINE void set_connect(YM2151 *PSG, YM2151Operator *om1, int cha, int v) +static inline void set_connect(YM2151 *PSG, YM2151Operator *om1, int cha, int v) { YM2151Operator *om2 = om1+1; YM2151Operator *oc1 = om1+2; @@ -949,7 +949,7 @@ INLINE void set_connect(YM2151 *PSG, YM2151Operator *om1, int cha, int v) } -INLINE void refresh_EG(YM2151Operator * op) +static inline void refresh_EG(YM2151Operator * op) { UINT32 kc; UINT32 v; @@ -1650,7 +1650,7 @@ void ym2151_reset_chip(void *_chip) -INLINE signed int op_calc(YM2151Operator * OP, unsigned int env, signed int pm) +static inline signed int op_calc(YM2151Operator * OP, unsigned int env, signed int pm) { UINT32 p; @@ -1663,7 +1663,7 @@ INLINE signed int op_calc(YM2151Operator * OP, unsigned int env, signed int pm) return tl_tab[p]; } -INLINE signed int op_calc1(YM2151Operator * OP, unsigned int env, signed int pm) +static inline signed int op_calc1(YM2151Operator * OP, unsigned int env, signed int pm) { UINT32 p; INT32 i; @@ -1687,7 +1687,7 @@ INLINE signed int op_calc1(YM2151Operator * OP, unsigned int env, signed int pm) #define volume_calc(OP) ((OP)->tl + ((UINT32)(OP)->volume) + (AM & (OP)->AMmask)) -INLINE void chan_calc(YM2151 *PSG, unsigned int chan) +static inline void chan_calc(YM2151 *PSG, unsigned int chan) { YM2151Operator *op; unsigned int env; @@ -1737,7 +1737,7 @@ INLINE void chan_calc(YM2151 *PSG, unsigned int chan) op->mem_value = PSG->mem; } -INLINE void chan7_calc(YM2151 *PSG) +static inline void chan7_calc(YM2151 *PSG) { YM2151Operator *op; unsigned int env; @@ -2007,7 +2007,7 @@ rate 11 1 | -- */ -INLINE void advance_eg(YM2151 *PSG) +static inline void advance_eg(YM2151 *PSG) { YM2151Operator *op; unsigned int i; @@ -2091,7 +2091,7 @@ INLINE void advance_eg(YM2151 *PSG) } -INLINE void advance(YM2151 *PSG) +static inline void advance(YM2151 *PSG) { YM2151Operator *op; unsigned int i; @@ -2275,7 +2275,7 @@ INLINE void advance(YM2151 *PSG) } #if 0 -INLINE signed int acc_calc(signed int value) +static inline signed int acc_calc(signed int value) { if (value>=0) { diff --git a/src/devices/sound/ym2413.cpp b/src/devices/sound/ym2413.cpp index fcab80555df..7573bfa4323 100644 --- a/src/devices/sound/ym2413.cpp +++ b/src/devices/sound/ym2413.cpp @@ -98,7 +98,7 @@ to do: //#define SAVE_SAMPLE #ifdef SAVE_SAMPLE -INLINE signed int acc_calc(signed int value) +static inline signed int acc_calc(signed int value) { if (value>=0) { @@ -628,7 +628,7 @@ static int num_lock = 0; #define SLOT8_2 (&chip->P_CH[8].SLOT[SLOT2]) -INLINE int limit( int val, int max, int min ) +static inline int limit( int val, int max, int min ) { if ( val > max ) val = max; @@ -640,7 +640,7 @@ INLINE int limit( int val, int max, int min ) /* advance LFO to next sample */ -INLINE void advance_lfo(YM2413 *chip) +static inline void advance_lfo(YM2413 *chip) { /* LFO */ chip->lfo_am_cnt += chip->lfo_am_inc; @@ -654,7 +654,7 @@ INLINE void advance_lfo(YM2413 *chip) } /* advance to next sample */ -INLINE void advance(YM2413 *chip) +static inline void advance(YM2413 *chip) { OPLL_CH *CH; OPLL_SLOT *op; @@ -883,7 +883,7 @@ INLINE void advance(YM2413 *chip) } -INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) { UINT32 p; @@ -894,7 +894,7 @@ INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigne return tl_tab[p]; } -INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) { UINT32 p; INT32 i; @@ -916,7 +916,7 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsign #define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (chip->LFO_AM & (OP)->AMmask)) /* calculate output */ -INLINE void chan_calc( YM2413 *chip, OPLL_CH *CH ) +static inline void chan_calc( YM2413 *chip, OPLL_CH *CH ) { OPLL_SLOT *SLOT; unsigned int env; @@ -993,7 +993,7 @@ number number BLK/FNUM2 FNUM Drum Hat Drum Tom Cymbal /* calculate rhythm */ -INLINE void rhythm_calc( YM2413 *chip, OPLL_CH *CH, unsigned int noise ) +static inline void rhythm_calc( YM2413 *chip, OPLL_CH *CH, unsigned int noise ) { OPLL_SLOT *SLOT; signed int out; @@ -1392,7 +1392,7 @@ static void OPLL_initalize(YM2413 *chip, device_t *device) /*logerror("YM2413init eg_timer_add=%8x eg_timer_overflow=%8x\n", chip->eg_timer_add, chip->eg_timer_overflow);*/ } -INLINE void KEY_ON(OPLL_SLOT *SLOT, UINT32 key_set) +static inline void KEY_ON(OPLL_SLOT *SLOT, UINT32 key_set) { if( !SLOT->key ) { @@ -1403,7 +1403,7 @@ INLINE void KEY_ON(OPLL_SLOT *SLOT, UINT32 key_set) SLOT->key |= key_set; } -INLINE void KEY_OFF(OPLL_SLOT *SLOT, UINT32 key_clr) +static inline void KEY_OFF(OPLL_SLOT *SLOT, UINT32 key_clr) { if( SLOT->key ) { @@ -1419,7 +1419,7 @@ INLINE void KEY_OFF(OPLL_SLOT *SLOT, UINT32 key_clr) } /* update phase increment counter of operator (also update the EG rates if necessary) */ -INLINE void CALC_FCSLOT(OPLL_CH *CH,OPLL_SLOT *SLOT) +static inline void CALC_FCSLOT(OPLL_CH *CH,OPLL_SLOT *SLOT) { int ksr; UINT32 SLOT_rs; @@ -1465,7 +1465,7 @@ INLINE void CALC_FCSLOT(OPLL_CH *CH,OPLL_SLOT *SLOT) } /* set multi,am,vib,EG-TYP,KSR,mul */ -INLINE void set_mul(YM2413 *chip,int slot,int v) +static inline void set_mul(YM2413 *chip,int slot,int v) { OPLL_CH *CH = &chip->P_CH[slot/2]; OPLL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -1479,7 +1479,7 @@ INLINE void set_mul(YM2413 *chip,int slot,int v) } /* set ksl, tl */ -INLINE void set_ksl_tl(YM2413 *chip,int chan,int v) +static inline void set_ksl_tl(YM2413 *chip,int chan,int v) { OPLL_CH *CH = &chip->P_CH[chan]; /* modulator */ @@ -1491,7 +1491,7 @@ INLINE void set_ksl_tl(YM2413 *chip,int chan,int v) } /* set ksl , waveforms, feedback */ -INLINE void set_ksl_wave_fb(YM2413 *chip,int chan,int v) +static inline void set_ksl_wave_fb(YM2413 *chip,int chan,int v) { OPLL_CH *CH = &chip->P_CH[chan]; /* modulator */ @@ -1509,7 +1509,7 @@ INLINE void set_ksl_wave_fb(YM2413 *chip,int chan,int v) } /* set attack rate & decay rate */ -INLINE void set_ar_dr(YM2413 *chip,int slot,int v) +static inline void set_ar_dr(YM2413 *chip,int slot,int v) { OPLL_CH *CH = &chip->P_CH[slot/2]; OPLL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -1533,7 +1533,7 @@ INLINE void set_ar_dr(YM2413 *chip,int slot,int v) } /* set sustain level & release rate */ -INLINE void set_sl_rr(YM2413 *chip,int slot,int v) +static inline void set_sl_rr(YM2413 *chip,int slot,int v) { OPLL_CH *CH = &chip->P_CH[slot/2]; OPLL_SLOT *SLOT = &CH->SLOT[slot&1]; diff --git a/src/devices/sound/ymdeltat.cpp b/src/devices/sound/ymdeltat.cpp index 3e592ea7ce2..d6668c7a8a5 100644 --- a/src/devices/sound/ymdeltat.cpp +++ b/src/devices/sound/ymdeltat.cpp @@ -476,7 +476,7 @@ void YM_DELTAT_savestate(device_t *device,YM_DELTAT *DELTAT) else if ( val < min ) val = min; \ } -INLINE void YM_DELTAT_synthesis_from_external_memory(YM_DELTAT *DELTAT) +static inline void YM_DELTAT_synthesis_from_external_memory(YM_DELTAT *DELTAT) { UINT32 step; int data; @@ -557,7 +557,7 @@ INLINE void YM_DELTAT_synthesis_from_external_memory(YM_DELTAT *DELTAT) -INLINE void YM_DELTAT_synthesis_from_CPU_memory(YM_DELTAT *DELTAT) +static inline void YM_DELTAT_synthesis_from_CPU_memory(YM_DELTAT *DELTAT) { UINT32 step; int data; diff --git a/src/devices/sound/ymf262.cpp b/src/devices/sound/ymf262.cpp index 366624ac5c4..84f0c22466d 100644 --- a/src/devices/sound/ymf262.cpp +++ b/src/devices/sound/ymf262.cpp @@ -609,7 +609,7 @@ static int num_lock = 0; -INLINE int limit( int val, int max, int min ) { +static inline int limit( int val, int max, int min ) { if ( val > max ) val = max; else if ( val < min ) @@ -620,7 +620,7 @@ INLINE int limit( int val, int max, int min ) { /* status set and IRQ handling */ -INLINE void OPL3_STATUS_SET(OPL3 *chip,int flag) +static inline void OPL3_STATUS_SET(OPL3 *chip,int flag) { /* set status flag masking out disabled IRQs */ chip->status |= (flag & chip->statusmask); @@ -636,7 +636,7 @@ INLINE void OPL3_STATUS_SET(OPL3 *chip,int flag) } /* status reset and IRQ handling */ -INLINE void OPL3_STATUS_RESET(OPL3 *chip,int flag) +static inline void OPL3_STATUS_RESET(OPL3 *chip,int flag) { /* reset status flag */ chip->status &= ~flag; @@ -652,7 +652,7 @@ INLINE void OPL3_STATUS_RESET(OPL3 *chip,int flag) } /* IRQ mask set */ -INLINE void OPL3_STATUSMASK_SET(OPL3 *chip,int flag) +static inline void OPL3_STATUSMASK_SET(OPL3 *chip,int flag) { chip->statusmask = flag; /* IRQ handling check */ @@ -662,7 +662,7 @@ INLINE void OPL3_STATUSMASK_SET(OPL3 *chip,int flag) /* advance LFO to next sample */ -INLINE void advance_lfo(OPL3 *chip) +static inline void advance_lfo(OPL3 *chip) { UINT8 tmp; @@ -683,7 +683,7 @@ INLINE void advance_lfo(OPL3 *chip) } /* advance to next sample */ -INLINE void advance(OPL3 *chip) +static inline void advance(OPL3 *chip) { OPL3_CH *CH; OPL3_SLOT *op; @@ -851,7 +851,7 @@ INLINE void advance(OPL3 *chip) } -INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) { UINT32 p; @@ -862,7 +862,7 @@ INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigne return tl_tab[p]; } -INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) { UINT32 p; @@ -878,7 +878,7 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsign /* calculate output of a standard 2 operator channel (or 1st part of a 4-op channel) */ -INLINE void chan_calc( OPL3 *chip, OPL3_CH *CH ) +static inline void chan_calc( OPL3 *chip, OPL3_CH *CH ) { OPL3_SLOT *SLOT; unsigned int env; @@ -913,7 +913,7 @@ INLINE void chan_calc( OPL3 *chip, OPL3_CH *CH ) } /* calculate output of a 2nd part of 4-op channel */ -INLINE void chan_calc_ext( OPL3 *chip, OPL3_CH *CH ) +static inline void chan_calc_ext( OPL3 *chip, OPL3_CH *CH ) { OPL3_SLOT *SLOT; unsigned int env; @@ -971,7 +971,7 @@ number number BLK/FNUM2 FNUM Drum Hat Drum Tom Cymbal /* calculate rhythm */ -INLINE void chan_calc_rhythm( OPL3 *chip, OPL3_CH *CH, unsigned int noise ) +static inline void chan_calc_rhythm( OPL3 *chip, OPL3_CH *CH, unsigned int noise ) { OPL3_SLOT *SLOT; signed int *chanout = chip->chanout; @@ -1370,7 +1370,7 @@ static void OPL3_initalize(OPL3 *chip) } -INLINE void FM_KEYON(OPL3_SLOT *SLOT, UINT32 key_set) +static inline void FM_KEYON(OPL3_SLOT *SLOT, UINT32 key_set) { if( !SLOT->key ) { @@ -1382,7 +1382,7 @@ INLINE void FM_KEYON(OPL3_SLOT *SLOT, UINT32 key_set) SLOT->key |= key_set; } -INLINE void FM_KEYOFF(OPL3_SLOT *SLOT, UINT32 key_clr) +static inline void FM_KEYOFF(OPL3_SLOT *SLOT, UINT32 key_clr) { if( SLOT->key ) { @@ -1398,7 +1398,7 @@ INLINE void FM_KEYOFF(OPL3_SLOT *SLOT, UINT32 key_clr) } /* update phase increment counter of operator (also update the EG rates if necessary) */ -INLINE void CALC_FCSLOT(OPL3_CH *CH,OPL3_SLOT *SLOT) +static inline void CALC_FCSLOT(OPL3_CH *CH,OPL3_SLOT *SLOT) { int ksr; @@ -1433,7 +1433,7 @@ INLINE void CALC_FCSLOT(OPL3_CH *CH,OPL3_SLOT *SLOT) } /* set multi,am,vib,EG-TYP,KSR,mul */ -INLINE void set_mul(OPL3 *chip,int slot,int v) +static inline void set_mul(OPL3 *chip,int slot,int v) { OPL3_CH *CH = &chip->P_CH[slot/2]; OPL3_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -1499,7 +1499,7 @@ INLINE void set_mul(OPL3 *chip,int slot,int v) } /* set ksl & tl */ -INLINE void set_ksl_tl(OPL3 *chip,int slot,int v) +static inline void set_ksl_tl(OPL3 *chip,int slot,int v) { OPL3_CH *CH = &chip->P_CH[slot/2]; OPL3_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -1563,7 +1563,7 @@ INLINE void set_ksl_tl(OPL3 *chip,int slot,int v) } /* set attack rate & decay rate */ -INLINE void set_ar_dr(OPL3 *chip,int slot,int v) +static inline void set_ar_dr(OPL3 *chip,int slot,int v) { OPL3_CH *CH = &chip->P_CH[slot/2]; OPL3_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -1590,7 +1590,7 @@ INLINE void set_ar_dr(OPL3 *chip,int slot,int v) } /* set sustain level & release rate */ -INLINE void set_sl_rr(OPL3 *chip,int slot,int v) +static inline void set_sl_rr(OPL3 *chip,int slot,int v) { OPL3_CH *CH = &chip->P_CH[slot/2]; OPL3_SLOT *SLOT = &CH->SLOT[slot&1]; diff --git a/src/devices/video/gf4500.cpp b/src/devices/video/gf4500.cpp index 06cb8cd9030..f3061597002 100644 --- a/src/devices/video/gf4500.cpp +++ b/src/devices/video/gf4500.cpp @@ -13,7 +13,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { diff --git a/src/devices/video/polylgcy.cpp b/src/devices/video/polylgcy.cpp index d88a68c86d1..b18c6941515 100644 --- a/src/devices/video/polylgcy.cpp +++ b/src/devices/video/polylgcy.cpp @@ -210,7 +210,7 @@ static void poly_state_presave(legacy_poly_manager *poly); down -------------------------------------------------*/ -INLINE INT32 round_coordinate(float value) +static inline INT32 round_coordinate(float value) { INT32 result = floor(value); return result + (value - (float)result > 0.5f); @@ -222,7 +222,7 @@ INLINE INT32 round_coordinate(float value) a simple tri_extent to a full poly_extent -------------------------------------------------*/ -INLINE void convert_tri_extent_to_poly_extent(poly_extent *dstextent, const tri_extent *srcextent, const polygon_info *polygon, INT32 y) +static inline void convert_tri_extent_to_poly_extent(poly_extent *dstextent, const tri_extent *srcextent, const polygon_info *polygon, INT32 y) { /* copy start/stop always */ dstextent->startx = srcextent->startx; @@ -242,7 +242,7 @@ INLINE void convert_tri_extent_to_poly_extent(poly_extent *dstextent, const tri_ a vertex based on p[0] crossing the clipval -------------------------------------------------*/ -INLINE void interpolate_vertex(poly_vertex *outv, const poly_vertex *v1, const poly_vertex *v2, int paramcount, float clipval) +static inline void interpolate_vertex(poly_vertex *outv, const poly_vertex *v1, const poly_vertex *v2, int paramcount, float clipval) { float frac = (clipval - v1->p[0]) / (v2->p[0] - v1->p[0]); int paramnum; @@ -260,7 +260,7 @@ INLINE void interpolate_vertex(poly_vertex *outv, const poly_vertex *v1, const p another -------------------------------------------------*/ -INLINE void copy_vertex(poly_vertex *outv, const poly_vertex *v, int paramcount) +static inline void copy_vertex(poly_vertex *outv, const poly_vertex *v, int paramcount) { int paramnum; @@ -276,7 +276,7 @@ INLINE void copy_vertex(poly_vertex *outv, const poly_vertex *v, int paramcount) object, blocking if we run out -------------------------------------------------*/ -INLINE polygon_info *allocate_polygon(legacy_poly_manager *poly, int miny, int maxy) +static inline polygon_info *allocate_polygon(legacy_poly_manager *poly, int miny, int maxy) { /* wait for a work item if we have to */ if (poly->polygon_next + 1 > poly->polygon_count) diff --git a/src/devices/video/psx.cpp b/src/devices/video/psx.cpp index 4c6efbdf355..9268c6dc575 100644 --- a/src/devices/video/psx.cpp +++ b/src/devices/video/psx.cpp @@ -101,7 +101,7 @@ static const UINT16 m_p_n_prevpointlist3[] = { 2, 0, 1 }; #define TEXTURE_V( a ) ( a.b.h ) #define TEXTURE_U( a ) ( a.b.l ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { @@ -1282,7 +1282,7 @@ void psxgpu_device::decode_tpage( UINT32 tpage ) a.sw.l = SINT11( COORD_X( a ) ); \ a.sw.h = SINT11( COORD_Y( a ) ); -INLINE int CullVertex( int a, int b ) +static inline int CullVertex( int a, int b ) { int d = a - b; if( d < -1023 || d > 1023 ) diff --git a/src/devices/video/stvvdp1.cpp b/src/devices/video/stvvdp1.cpp index 126089d40b5..e467bb4a68c 100644 --- a/src/devices/video/stvvdp1.cpp +++ b/src/devices/video/stvvdp1.cpp @@ -533,7 +533,7 @@ UINT8 saturn_state::stv_read_gouraud_table( void ) } } -INLINE INT32 _shading( INT32 color, INT32 correction ) +static inline INT32 _shading( INT32 color, INT32 correction ) { correction = (correction >> 16) & 0x1f; color += (correction - 16); diff --git a/src/devices/video/stvvdp2.cpp b/src/devices/video/stvvdp2.cpp index 5308b2afd6b..07b718741c2 100644 --- a/src/devices/video/stvvdp2.cpp +++ b/src/devices/video/stvvdp2.cpp @@ -2318,7 +2318,7 @@ UINT8 saturn_state::stv_vdp2_check_vram_cycle_pattern_registers( UINT8 access_co return access_command_ok == 3 ? 1 : 0; } -INLINE UINT32 stv_add_blend(UINT32 a, UINT32 b) +static inline UINT32 stv_add_blend(UINT32 a, UINT32 b) { rgb_t rb = (a & 0xff00ff) + (b & 0xff00ff); rgb_t g = (a & 0x00ff00) + (b & 0x00ff00); diff --git a/src/devices/video/vooddefs.h b/src/devices/video/vooddefs.h index f98aece2110..bf14947df16 100644 --- a/src/devices/video/vooddefs.h +++ b/src/devices/video/vooddefs.h @@ -1745,13 +1745,13 @@ struct voodoo_state * *************************************/ -INLINE void fifo_reset(fifo_state *f) +static inline void fifo_reset(fifo_state *f) { f->in = f->out = 0; } -INLINE void fifo_add(fifo_state *f, UINT32 data) +static inline void fifo_add(fifo_state *f, UINT32 data) { INT32 next_in; @@ -1769,7 +1769,7 @@ INLINE void fifo_add(fifo_state *f, UINT32 data) } -INLINE UINT32 fifo_remove(fifo_state *f) +static inline UINT32 fifo_remove(fifo_state *f) { UINT32 data = 0xffffffff; @@ -1791,25 +1791,25 @@ INLINE UINT32 fifo_remove(fifo_state *f) } -INLINE UINT32 fifo_peek(fifo_state *f) +static inline UINT32 fifo_peek(fifo_state *f) { return f->base[f->out]; } -INLINE int fifo_empty(fifo_state *f) +static inline int fifo_empty(fifo_state *f) { return (f->in == f->out); } -INLINE int fifo_full(fifo_state *f) +static inline int fifo_full(fifo_state *f) { return (f->in + 1 == f->out || (f->in == f->size - 1 && f->out == 0)); } -INLINE INT32 fifo_items(fifo_state *f) +static inline INT32 fifo_items(fifo_state *f) { INT32 items = f->in - f->out; if (items < 0) @@ -1818,7 +1818,7 @@ INLINE INT32 fifo_items(fifo_state *f) } -INLINE INT32 fifo_space(fifo_state *f) +static inline INT32 fifo_space(fifo_state *f) { INT32 items = f->in - f->out; if (items < 0) @@ -1847,7 +1847,7 @@ INLINE INT32 fifo_space(fifo_state *f) * *************************************/ -INLINE INT32 fast_reciplog(INT64 value, INT32 *log2) +static inline INT32 fast_reciplog(INT64 value, INT32 *log2) { extern UINT32 voodoo_reciplog[]; UINT32 temp, recip, rlog; @@ -1925,7 +1925,7 @@ INLINE INT32 fast_reciplog(INT64 value, INT32 *log2) * *************************************/ -INLINE INT32 float_to_int32(UINT32 data, int fixedbits) +static inline INT32 float_to_int32(UINT32 data, int fixedbits) { int exponent = ((data >> 23) & 0xff) - 127 - 23 + fixedbits; INT32 result = (data & 0x7fffff) | 0x800000; @@ -1949,7 +1949,7 @@ INLINE INT32 float_to_int32(UINT32 data, int fixedbits) } -INLINE INT64 float_to_int64(UINT32 data, int fixedbits) +static inline INT64 float_to_int64(UINT32 data, int fixedbits) { int exponent = ((data >> 23) & 0xff) - 127 - 23 + fixedbits; INT64 result = (data & 0x7fffff) | 0x800000; @@ -1980,7 +1980,7 @@ INLINE INT64 float_to_int64(UINT32 data, int fixedbits) * *************************************/ -INLINE UINT32 normalize_color_path(UINT32 eff_color_path) +static inline UINT32 normalize_color_path(UINT32 eff_color_path) { /* ignore the subpixel adjust and texture enable flags */ eff_color_path &= ~((1 << 26) | (1 << 27)); @@ -1989,7 +1989,7 @@ INLINE UINT32 normalize_color_path(UINT32 eff_color_path) } -INLINE UINT32 normalize_alpha_mode(UINT32 eff_alpha_mode) +static inline UINT32 normalize_alpha_mode(UINT32 eff_alpha_mode) { /* always ignore alpha ref value */ eff_alpha_mode &= ~(0xff << 24); @@ -2006,7 +2006,7 @@ INLINE UINT32 normalize_alpha_mode(UINT32 eff_alpha_mode) } -INLINE UINT32 normalize_fog_mode(UINT32 eff_fog_mode) +static inline UINT32 normalize_fog_mode(UINT32 eff_fog_mode) { /* if not doing fogging, ignore all the other fog bits */ if (!FOGMODE_ENABLE_FOG(eff_fog_mode)) @@ -2016,7 +2016,7 @@ INLINE UINT32 normalize_fog_mode(UINT32 eff_fog_mode) } -INLINE UINT32 normalize_fbz_mode(UINT32 eff_fbz_mode) +static inline UINT32 normalize_fbz_mode(UINT32 eff_fbz_mode) { /* ignore the draw buffer */ eff_fbz_mode &= ~(3 << 14); @@ -2025,7 +2025,7 @@ INLINE UINT32 normalize_fbz_mode(UINT32 eff_fbz_mode) } -INLINE UINT32 normalize_tex_mode(UINT32 eff_tex_mode) +static inline UINT32 normalize_tex_mode(UINT32 eff_tex_mode) { /* ignore the NCC table and seq_8_downld flags */ eff_tex_mode &= ~((1 << 5) | (1 << 31)); @@ -2042,7 +2042,7 @@ INLINE UINT32 normalize_tex_mode(UINT32 eff_tex_mode) } -INLINE UINT32 compute_raster_hash(const raster_info *info) +static inline UINT32 compute_raster_hash(const raster_info *info) { UINT32 hash; @@ -2199,7 +2199,7 @@ do } \ while (0) -INLINE rgbaint_t ATTR_FORCE_INLINE clampARGB(const rgbaint_t &iterargb, UINT32 FBZCP) +static inline rgbaint_t ATTR_FORCE_INLINE clampARGB(const rgbaint_t &iterargb, UINT32 FBZCP) { rgbaint_t result(iterargb); //rgbaint_t colorint((INT32) (itera>>12), (INT32) (iterr>>12), (INT32) (iterg>>12), (INT32) (iterb>>12)); @@ -2346,7 +2346,7 @@ do } \ while (0) -INLINE bool ATTR_FORCE_INLINE chromaKeyTest(voodoo_state *v, stats_block *stats, UINT32 fbzModeReg, rgbaint_t rgbaIntColor) +static inline bool ATTR_FORCE_INLINE chromaKeyTest(voodoo_state *v, stats_block *stats, UINT32 fbzModeReg, rgbaint_t rgbaIntColor) { if (FBZMODE_ENABLE_CHROMAKEY(fbzModeReg)) { @@ -2435,7 +2435,7 @@ do } \ while (0) -INLINE bool alphaMaskTest(stats_block *stats, UINT32 fbzModeReg, UINT8 alpha) +static inline bool alphaMaskTest(stats_block *stats, UINT32 fbzModeReg, UINT8 alpha) { if (FBZMODE_ENABLE_ALPHA_MASK(fbzModeReg)) { @@ -2521,7 +2521,7 @@ do } \ while (0) -INLINE bool ATTR_FORCE_INLINE alphaTest(voodoo_state *v, stats_block *stats, UINT32 alphaModeReg, UINT8 alpha) +static inline bool ATTR_FORCE_INLINE alphaTest(voodoo_state *v, stats_block *stats, UINT32 alphaModeReg, UINT8 alpha) { if (ALPHAMODE_ALPHATEST(alphaModeReg)) { @@ -2750,7 +2750,7 @@ do } \ while (0) -INLINE void ATTR_FORCE_INLINE alphaBlend(UINT32 FBZMODE, UINT32 ALPHAMODE, INT32 x, const UINT8 *dither, int dpix, UINT16 *depth, rgbaint_t &preFog, rgbaint_t &srcColor) +static inline void ATTR_FORCE_INLINE alphaBlend(UINT32 FBZMODE, UINT32 ALPHAMODE, INT32 x, const UINT8 *dither, int dpix, UINT16 *depth, rgbaint_t &preFog, rgbaint_t &srcColor) { if (ALPHAMODE_ALPHABLEND(ALPHAMODE)) { @@ -3068,7 +3068,7 @@ do } \ while (0) -INLINE void ATTR_FORCE_INLINE applyFogging(voodoo_state *v, UINT32 fogModeReg, UINT32 fbzCpReg, INT32 x, const UINT8 *dither4, INT32 fogDepth, +static inline void ATTR_FORCE_INLINE applyFogging(voodoo_state *v, UINT32 fogModeReg, UINT32 fbzCpReg, INT32 x, const UINT8 *dither4, INT32 fogDepth, rgbaint_t &color, INT32 iterz, INT64 iterw, UINT8 itera) { if (FOGMODE_ENABLE_FOG(fogModeReg)) @@ -3711,7 +3711,7 @@ do } \ while (0) -INLINE bool ATTR_FORCE_INLINE depthTest(UINT16 zaColorReg, stats_block *stats, INT32 destDepth, UINT32 fbzModeReg, INT32 biasdepth) +static inline bool ATTR_FORCE_INLINE depthTest(UINT16 zaColorReg, stats_block *stats, INT32 destDepth, UINT32 fbzModeReg, INT32 biasdepth) { /* handle depth buffer testing */ if (FBZMODE_ENABLE_DEPTHBUF(fbzModeReg)) @@ -4163,7 +4163,7 @@ do } \ while (0) -INLINE bool ATTR_FORCE_INLINE combineColor(voodoo_state *VV, stats_block *STATS, UINT32 FBZCOLORPATH, UINT32 FBZMODE, UINT32 ALPHAMODE, +static inline bool ATTR_FORCE_INLINE combineColor(voodoo_state *VV, stats_block *STATS, UINT32 FBZCOLORPATH, UINT32 FBZMODE, UINT32 ALPHAMODE, rgbaint_t TEXELARGB, INT32 ITERZ, INT64 ITERW, rgbaint_t &srcColor) { rgbaint_t c_other; @@ -4722,7 +4722,7 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co // The return value is coded as a 24.8 value. // The maximum error using a 4 bit lookup from the mantissa is 0.0875, which is less than 1/2 lsb (0.125) for 2 bits of fraction. // ****************************************************************************************************************************** -INLINE INT32 ATTR_FORCE_INLINE new_log2(double &value) +static inline INT32 ATTR_FORCE_INLINE new_log2(double &value) { static const INT32 new_log2_table[16] = {0, 22, 44, 63, 82, 100, 118, 134, 150, 165, 179, 193, 207, 220, 232, 244}; UINT64 ival = *((UINT64 *)&value); @@ -4738,7 +4738,7 @@ INLINE INT32 ATTR_FORCE_INLINE new_log2(double &value) // Computes A/C and B/C and returns log2 of 1/C // A, B and C are 16.32 values. The results are 24.8. -INLINE void ATTR_FORCE_INLINE multi_reciplog(INT64 valueA, INT64 valueB, INT64 valueC, INT32 &log, INT32 &resA, INT32 &resB) +static inline void ATTR_FORCE_INLINE multi_reciplog(INT64 valueA, INT64 valueB, INT64 valueC, INT32 &log, INT32 &resA, INT32 &resB) { double recip = double(1ULL<<(47-39))/valueC; double resAD = valueA * recip; @@ -4750,7 +4750,7 @@ INLINE void ATTR_FORCE_INLINE multi_reciplog(INT64 valueA, INT64 valueB, INT64 v } -INLINE rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, const UINT8 *dither4, const UINT32 TEXMODE, rgb_t *LOOKUP, INT32 LODBASE, INT64 ITERS, INT64 ITERT, INT64 ITERW, INT32 &lod) +static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, const UINT8 *dither4, const UINT32 TEXMODE, rgb_t *LOOKUP, INT32 LODBASE, INT64 ITERS, INT64 ITERT, INT64 ITERW, INT32 &lod) { rgbaint_t result; INT32 s, t, ilod; @@ -4941,7 +4941,7 @@ INLINE rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, const UINT return result; } -INLINE rgbaint_t ATTR_FORCE_INLINE combineTexture(tmu_state *TT, const UINT32 TEXMODE, rgbaint_t c_local, rgbaint_t c_other, INT32 lod) +static inline rgbaint_t ATTR_FORCE_INLINE combineTexture(tmu_state *TT, const UINT32 TEXMODE, rgbaint_t c_local, rgbaint_t c_other, INT32 lod) { INT32 a_other = c_other.get_a(); INT32 a_local = c_local.get_a(); diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index 277d3c9a287..72d94e994d4 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -285,7 +285,7 @@ static const raster_info predef_raster_table[] = in device is, in fact, a voodoo device -------------------------------------------------*/ -INLINE voodoo_state *get_safe_token(device_t *device) +static inline voodoo_state *get_safe_token(device_t *device) { assert(device != nullptr); assert((device->type() == VOODOO_1) || (device->type() == VOODOO_2) || (device->type() == VOODOO_BANSHEE) || (device->type() == VOODOO_3)); @@ -1426,7 +1426,7 @@ static void recompute_texture_params(tmu_state *t) } -INLINE INT32 prepare_tmu(tmu_state *t) +static inline INT32 prepare_tmu(tmu_state *t) { INT64 texdx, texdy; INT32 lodbase; diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 08eec1307bd..328079095c9 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -168,7 +168,7 @@ static void execute_dumpkbd(running_machine &machine, int ref, int params, const given address is valid for cheating -------------------------------------------------*/ -INLINE int cheat_address_is_valid(address_space &space, offs_t address) +static inline int cheat_address_is_valid(address_space &space, offs_t address) { return debug_cpu_translate(space, TRANSLATE_READ, &address) && (space.get_write_ptr(address) != nullptr); } @@ -179,7 +179,7 @@ INLINE int cheat_address_is_valid(address_space &space, offs_t address) the current cheat width, if signed -------------------------------------------------*/ -INLINE UINT64 cheat_sign_extend(const cheat_system *cheatsys, UINT64 value) +static inline UINT64 cheat_sign_extend(const cheat_system *cheatsys, UINT64 value) { if (cheatsys->signed_cheat) { @@ -196,7 +196,7 @@ INLINE UINT64 cheat_sign_extend(const cheat_system *cheatsys, UINT64 value) cheat_byte_swap - swap a value -------------------------------------------------*/ -INLINE UINT64 cheat_byte_swap(const cheat_system *cheatsys, UINT64 value) +static inline UINT64 cheat_byte_swap(const cheat_system *cheatsys, UINT64 value) { if (cheatsys->swapped_cheat) { @@ -217,7 +217,7 @@ INLINE UINT64 cheat_byte_swap(const cheat_system *cheatsys, UINT64 value) and swapping if necessary -------------------------------------------------*/ -INLINE UINT64 cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address) +static inline UINT64 cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address) { return cheat_sign_extend(cheatsys, cheat_byte_swap(cheatsys, debug_read_memory(space, address, cheatsys->width, TRUE))); } diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp index 1bff6cc81b1..2327d7284cc 100644 --- a/src/emu/debug/dvmemory.cpp +++ b/src/emu/debug/dvmemory.cpp @@ -211,7 +211,7 @@ void debug_view_memory::view_notify(debug_view_notification type) // whose 32 bit representation is value //------------------------------------------------- -INLINE float uint32_to_float(UINT32 value) +static inline float uint32_to_float(UINT32 value) { union { float f; @@ -227,7 +227,7 @@ INLINE float uint32_to_float(UINT32 value) // whose 64 bit representation is value //------------------------------------------------- -INLINE float uint64_to_double(UINT64 value) +static inline float uint64_to_double(UINT64 value) { union { double f; diff --git a/src/emu/debug/textbuf.cpp b/src/emu/debug/textbuf.cpp index cd96be9cd5a..e7daf96571a 100644 --- a/src/emu/debug/textbuf.cpp +++ b/src/emu/debug/textbuf.cpp @@ -50,7 +50,7 @@ struct text_buffer currently held in the buffer -------------------------------------------------*/ -INLINE INT32 buffer_used(text_buffer *text) +static inline INT32 buffer_used(text_buffer *text) { INT32 used = text->bufend - text->bufstart; if (used < 0) @@ -64,7 +64,7 @@ INLINE INT32 buffer_used(text_buffer *text) available in the buffer -------------------------------------------------*/ -INLINE INT32 buffer_space(text_buffer *text) +static inline INT32 buffer_space(text_buffer *text) { return text->bufsize - buffer_used(text); } diff --git a/src/emu/debugger.h b/src/emu/debugger.h index fe59fc6df52..bde3ad7572b 100644 --- a/src/emu/debugger.h +++ b/src/emu/debugger.h @@ -41,7 +41,7 @@ void debugger_flush_all_traces_on_abnormal_exit(void); this once per instruction from CPU cores -------------------------------------------------*/ -INLINE void debugger_instruction_hook(device_t *device, offs_t curpc) +static inline void debugger_instruction_hook(device_t *device, offs_t curpc) { #ifndef MAME_DEBUG_FAST if ((device->machine().debug_flags & DEBUG_FLAG_CALL_HOOK) != 0) @@ -55,7 +55,7 @@ INLINE void debugger_instruction_hook(device_t *device, offs_t curpc) anytime an exception is generated -------------------------------------------------*/ -INLINE void debugger_exception_hook(device_t *device, int exception) +static inline void debugger_exception_hook(device_t *device, int exception) { if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) device->debug()->exception_hook(exception); @@ -73,7 +73,7 @@ INLINE void debugger_exception_hook(device_t *device, int exception) execution for the given CPU -------------------------------------------------*/ -INLINE void debugger_start_cpu_hook(device_t *device, const attotime &endtime) +static inline void debugger_start_cpu_hook(device_t *device, const attotime &endtime) { if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) device->debug()->start_hook(endtime); @@ -86,7 +86,7 @@ INLINE void debugger_start_cpu_hook(device_t *device, const attotime &endtime) for the given CPU -------------------------------------------------*/ -INLINE void debugger_stop_cpu_hook(device_t *device) +static inline void debugger_stop_cpu_hook(device_t *device) { if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) device->debug()->stop_hook(); @@ -99,7 +99,7 @@ INLINE void debugger_stop_cpu_hook(device_t *device) acknowledged -------------------------------------------------*/ -INLINE void debugger_interrupt_hook(device_t *device, int irqline) +static inline void debugger_interrupt_hook(device_t *device, int irqline) { if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) device->debug()->interrupt_hook(irqline); @@ -116,7 +116,7 @@ INLINE void debugger_interrupt_hook(device_t *device, int irqline) next opportunity -------------------------------------------------*/ -INLINE void debugger_break(running_machine &machine) +static inline void debugger_break(running_machine &machine) { if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0) debug_cpu_get_visible_cpu(machine)->debug()->halt_on_next_instruction("Internal breakpoint\n"); @@ -129,7 +129,7 @@ INLINE void debugger_break(running_machine &machine) halted within the instruction hook -------------------------------------------------*/ -INLINE int debugger_within_instruction_hook(running_machine &machine) +static inline int debugger_within_instruction_hook(running_machine &machine) { if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0) return debug_cpu_within_instruction_hook(machine); diff --git a/src/emu/output.cpp b/src/emu/output.cpp index e2e919dfaa3..3977c0e809b 100644 --- a/src/emu/output.cpp +++ b/src/emu/output.cpp @@ -78,7 +78,7 @@ static void output_exit(running_machine &machine); get_hash - return the hash of an output value -------------------------------------------------*/ -INLINE UINT32 get_hash(const char *string) +static inline UINT32 get_hash(const char *string) { return core_crc32(0, (UINT8 *)string, (UINT32)strlen(string)); } @@ -88,7 +88,7 @@ INLINE UINT32 get_hash(const char *string) find_item - find an item based on a string -------------------------------------------------*/ -INLINE output_item *find_item(const char *string) +static inline output_item *find_item(const char *string) { UINT32 hash = get_hash(string); output_item *item; @@ -106,7 +106,7 @@ INLINE output_item *find_item(const char *string) create_new_item - create a new item -------------------------------------------------*/ -INLINE output_item *create_new_item(const char *outname, INT32 value) +static inline output_item *create_new_item(const char *outname, INT32 value) { auto item = global_alloc(output_item); UINT32 hash = get_hash(outname); diff --git a/src/emu/output.h b/src/emu/output.h index 9ab4fd86b12..95f8e40d821 100644 --- a/src/emu/output.h +++ b/src/emu/output.h @@ -62,33 +62,33 @@ const char *output_id_to_name(UINT32 id); INLINES ***************************************************************************/ -INLINE void output_set_led_value(int index, int value) +static inline void output_set_led_value(int index, int value) { output_set_indexed_value("led", index, value ? 1 : 0); } -INLINE void output_set_lamp_value(int index, int value) +static inline void output_set_lamp_value(int index, int value) { output_set_indexed_value("lamp", index, value); } -INLINE void output_set_digit_value(int index, int value) +static inline void output_set_digit_value(int index, int value) { output_set_indexed_value("digit", index, value); } -INLINE INT32 output_get_led_value(int index) +static inline INT32 output_get_led_value(int index) { return output_get_indexed_value("led", index); } -INLINE INT32 output_get_lamp_value(int index) +static inline INT32 output_get_lamp_value(int index) { return output_get_indexed_value("lamp", index); } -INLINE INT32 output_get_digit_value(int index) +static inline INT32 output_get_digit_value(int index) { return output_get_indexed_value("digit", index); } diff --git a/src/emu/rendutil.h b/src/emu/rendutil.h index 22c75d42ce6..d992d35d88c 100644 --- a/src/emu/rendutil.h +++ b/src/emu/rendutil.h @@ -38,7 +38,7 @@ bool render_load_png(bitmap_argb32 &bitmap, emu_file &file, const char *dirname, round-to-nearest -------------------------------------------------*/ -INLINE float render_round_nearest(float f) +static inline float render_round_nearest(float f) { return floor(f + 0.5f); } @@ -49,7 +49,7 @@ INLINE float render_round_nearest(float f) bounds -------------------------------------------------*/ -INLINE void set_render_bounds_xy(render_bounds *bounds, float x0, float y0, float x1, float y1) +static inline void set_render_bounds_xy(render_bounds *bounds, float x0, float y0, float x1, float y1) { bounds->x0 = x0; bounds->y0 = y0; @@ -63,7 +63,7 @@ INLINE void set_render_bounds_xy(render_bounds *bounds, float x0, float y0, floa bounds -------------------------------------------------*/ -INLINE void set_render_bounds_wh(render_bounds *bounds, float x0, float y0, float width, float height) +static inline void set_render_bounds_wh(render_bounds *bounds, float x0, float y0, float width, float height) { bounds->x0 = x0; bounds->y0 = y0; @@ -77,7 +77,7 @@ INLINE void set_render_bounds_wh(render_bounds *bounds, float x0, float y0, floa of two render_bounds -------------------------------------------------*/ -INLINE void sect_render_bounds(render_bounds *dest, const render_bounds *src) +static inline void sect_render_bounds(render_bounds *dest, const render_bounds *src) { dest->x0 = (dest->x0 > src->x0) ? dest->x0 : src->x0; dest->x1 = (dest->x1 < src->x1) ? dest->x1 : src->x1; @@ -91,7 +91,7 @@ INLINE void sect_render_bounds(render_bounds *dest, const render_bounds *src) render_bounds -------------------------------------------------*/ -INLINE void union_render_bounds(render_bounds *dest, const render_bounds *src) +static inline void union_render_bounds(render_bounds *dest, const render_bounds *src) { dest->x0 = (dest->x0 < src->x0) ? dest->x0 : src->x0; dest->x1 = (dest->x1 > src->x1) ? dest->x1 : src->x1; @@ -104,7 +104,7 @@ INLINE void union_render_bounds(render_bounds *dest, const render_bounds *src) set_render_color - cleaner way to set a color -------------------------------------------------*/ -INLINE void set_render_color(render_color *color, float a, float r, float g, float b) +static inline void set_render_color(render_color *color, float a, float r, float g, float b) { color->a = a; color->r = r; @@ -118,7 +118,7 @@ INLINE void set_render_color(render_color *color, float a, float r, float g, flo flip flags -------------------------------------------------*/ -INLINE int orientation_swap_flips(int orientation) +static inline int orientation_swap_flips(int orientation) { return (orientation & ORIENTATION_SWAP_XY) | ((orientation & ORIENTATION_FLIP_X) ? ORIENTATION_FLIP_Y : 0) | @@ -131,7 +131,7 @@ INLINE int orientation_swap_flips(int orientation) that will undo another orientation -------------------------------------------------*/ -INLINE int orientation_reverse(int orientation) +static inline int orientation_reverse(int orientation) { /* if not swapping X/Y, then just apply the same transform to reverse */ if (!(orientation & ORIENTATION_SWAP_XY)) @@ -148,7 +148,7 @@ INLINE int orientation_reverse(int orientation) after applying two subsequent orientations -------------------------------------------------*/ -INLINE int orientation_add(int orientation1, int orientation2) +static inline int orientation_add(int orientation1, int orientation2) { /* if the 2nd transform doesn't swap, just XOR together */ if (!(orientation2 & ORIENTATION_SWAP_XY)) @@ -166,7 +166,7 @@ INLINE int orientation_add(int orientation1, int orientation2) a single RGB component -------------------------------------------------*/ -INLINE float apply_brightness_contrast_gamma_fp(float srcval, float brightness, float contrast, float gamma) +static inline float apply_brightness_contrast_gamma_fp(float srcval, float brightness, float contrast, float gamma) { /* first apply gamma */ srcval = pow(srcval, 1.0f / gamma); @@ -189,7 +189,7 @@ INLINE float apply_brightness_contrast_gamma_fp(float srcval, float brightness, a single RGB component -------------------------------------------------*/ -INLINE UINT8 apply_brightness_contrast_gamma(UINT8 src, float brightness, float contrast, float gamma) +static inline UINT8 apply_brightness_contrast_gamma(UINT8 src, float brightness, float contrast, float gamma) { float srcval = (float)src * (1.0f / 255.0f); float result = apply_brightness_contrast_gamma_fp(srcval, brightness, contrast, gamma); diff --git a/src/emu/sound/filter.h b/src/emu/sound/filter.h index 5e671e85545..7e7398a2686 100644 --- a/src/emu/sound/filter.h +++ b/src/emu/sound/filter.h @@ -44,7 +44,7 @@ void filter_state_free(filter_state* s); void filter_state_reset(filter* f, filter_state* s); /* Insert a value in the filter state */ -INLINE void filter_insert(filter* f, filter_state* s, filter_real x) { +static inline void filter_insert(filter* f, filter_state* s, filter_real x) { /* next state */ ++s->prev_mac; if (s->prev_mac >= f->order) diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index 02522bc896a..3a016b25b10 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -143,7 +143,7 @@ static INT32 slider_crossoffset(running_machine &machine, void *arg, std::string // character a possible line break? //------------------------------------------------- -INLINE int is_breakable_char(unicode_char ch) +static inline int is_breakable_char(unicode_char ch) { // regular spaces and hyphens are breakable if (ch == ' ' || ch == '-') diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h index d5f85e2ff02..3b7a63d420d 100644 --- a/src/emu/uiinput.h +++ b/src/emu/uiinput.h @@ -93,7 +93,7 @@ bool ui_input_pressed_repeat(running_machine &machine, int code, int speed); move event to the specified render_target -------------------------------------------------*/ -INLINE void ui_input_push_mouse_move_event(running_machine &machine, render_target *target, INT32 x, INT32 y) +static inline void ui_input_push_mouse_move_event(running_machine &machine, render_target *target, INT32 x, INT32 y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_MOVE; @@ -109,7 +109,7 @@ INLINE void ui_input_push_mouse_move_event(running_machine &machine, render_targ mouse leave event to the specified render_target -------------------------------------------------*/ -INLINE void ui_input_push_mouse_leave_event(running_machine &machine, render_target *target) +static inline void ui_input_push_mouse_leave_event(running_machine &machine, render_target *target) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_LEAVE; @@ -123,7 +123,7 @@ INLINE void ui_input_push_mouse_leave_event(running_machine &machine, render_tar down event to the specified render_target -------------------------------------------------*/ -INLINE void ui_input_push_mouse_down_event(running_machine &machine, render_target *target, INT32 x, INT32 y) +static inline void ui_input_push_mouse_down_event(running_machine &machine, render_target *target, INT32 x, INT32 y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_DOWN; @@ -139,7 +139,7 @@ INLINE void ui_input_push_mouse_down_event(running_machine &machine, render_targ down event to the specified render_target -------------------------------------------------*/ -INLINE void ui_input_push_mouse_up_event(running_machine &machine, render_target *target, INT32 x, INT32 y) +static inline void ui_input_push_mouse_up_event(running_machine &machine, render_target *target, INT32 x, INT32 y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_UP; @@ -156,7 +156,7 @@ INLINE void ui_input_push_mouse_up_event(running_machine &machine, render_target render_target -------------------------------------------------*/ -INLINE void ui_input_push_mouse_double_click_event(running_machine &machine, render_target *target, INT32 x, INT32 y) +static inline void ui_input_push_mouse_double_click_event(running_machine &machine, render_target *target, INT32 x, INT32 y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_DOUBLE_CLICK; @@ -172,7 +172,7 @@ INLINE void ui_input_push_mouse_double_click_event(running_machine &machine, ren to the specified render_target -------------------------------------------------*/ -INLINE void ui_input_push_char_event(running_machine &machine, render_target *target, unicode_char ch) +static inline void ui_input_push_char_event(running_machine &machine, render_target *target, unicode_char ch) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_CHAR; diff --git a/src/lib/formats/ace_tap.cpp b/src/lib/formats/ace_tap.cpp index 10265ad5460..e247b0803d6 100644 --- a/src/lib/formats/ace_tap.cpp +++ b/src/lib/formats/ace_tap.cpp @@ -26,7 +26,7 @@ static int cas_size; /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -INLINE int ace_tap_cycle(INT16 *buffer, int sample_pos, int high, int low) +static inline int ace_tap_cycle(INT16 *buffer, int sample_pos, int high, int low) { int i = 0; @@ -48,7 +48,7 @@ INLINE int ace_tap_cycle(INT16 *buffer, int sample_pos, int high, int low) } -INLINE int ace_tap_silence(INT16 *buffer, int sample_pos, int samples) +static inline int ace_tap_silence(INT16 *buffer, int sample_pos, int samples) { int i = 0; @@ -64,7 +64,7 @@ INLINE int ace_tap_silence(INT16 *buffer, int sample_pos, int samples) } -INLINE int ace_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) +static inline int ace_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) { int i, samples; diff --git a/src/lib/formats/cbm_tap.cpp b/src/lib/formats/cbm_tap.cpp index 5c3033f9dad..1293d3c531d 100644 --- a/src/lib/formats/cbm_tap.cpp +++ b/src/lib/formats/cbm_tap.cpp @@ -135,7 +135,7 @@ static int len; /* This in fact gives the number of samples for half of the pulse */ -INLINE int tap_data_to_samplecount(int data, int frequency) +static inline int tap_data_to_samplecount(int data, int frequency) { // return (int) (0.5 * (0.5 + (((double)CBM_WAV_FREQUENCY / frequency) * (double)data))); // MESS TZX formula return (int) (0.5 * (((double)CBM_WAV_FREQUENCY / frequency) * (double)((data) + 0.5))); // tap2wav formula diff --git a/src/lib/formats/fdi_dsk.cpp b/src/lib/formats/fdi_dsk.cpp index 05d3d7807b7..b766671ecb8 100644 --- a/src/lib/formats/fdi_dsk.cpp +++ b/src/lib/formats/fdi_dsk.cpp @@ -131,7 +131,7 @@ struct fdi_pulse_track_header INLINE FUNCTIONS ***************************************************************************/ -INLINE struct fdidsk_tag *get_tag(floppy_image_legacy *floppy) +static inline struct fdidsk_tag *get_tag(floppy_image_legacy *floppy) { return (fdidsk_tag *)floppy_tag(floppy); } diff --git a/src/lib/formats/hect_tap.cpp b/src/lib/formats/hect_tap.cpp index 7b2120ddae1..ba79afe1180 100644 --- a/src/lib/formats/hect_tap.cpp +++ b/src/lib/formats/hect_tap.cpp @@ -40,7 +40,7 @@ enum /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -INLINE int hector_tap_cycle(INT16 *buffer, int sample_pos, int high, int low) +static inline int hector_tap_cycle(INT16 *buffer, int sample_pos, int high, int low) { int i = 0; @@ -62,7 +62,7 @@ INLINE int hector_tap_cycle(INT16 *buffer, int sample_pos, int high, int low) } -INLINE int hector_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) +static inline int hector_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) { /* Writing an entire byte */ int i, samples; @@ -81,7 +81,7 @@ INLINE int hector_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) } -INLINE int hector_tap_synchro(INT16 *buffer, int sample_pos, int nb_synchro) +static inline int hector_tap_synchro(INT16 *buffer, int sample_pos, int nb_synchro) { /* Writing an entire byte */ int i, samples; diff --git a/src/lib/formats/imageutl.h b/src/lib/formats/imageutl.h index 8b51adebabf..a2369e8284a 100644 --- a/src/lib/formats/imageutl.h +++ b/src/lib/formats/imageutl.h @@ -25,7 +25,7 @@ unsigned short ccitt_crc16_one( unsigned short crc, const unsigned char data ); * Alignment-friendly integer placement * ----------------------------------------------------------------------- */ -INLINE void place_integer_be(void *ptr, size_t offset, size_t size, UINT64 value) +static inline void place_integer_be(void *ptr, size_t offset, size_t size, UINT64 value) { UINT8 *byte_ptr = ((UINT8 *) ptr) + offset; UINT16 val16; @@ -56,7 +56,7 @@ INLINE void place_integer_be(void *ptr, size_t offset, size_t size, UINT64 value } } -INLINE UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size) +static inline UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size) { UINT64 result = 0; const UINT8 *byte_ptr = ((const UINT8 *) ptr) + offset; @@ -93,7 +93,7 @@ INLINE UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size) return result; } -INLINE void place_integer_le(void *ptr, size_t offset, size_t size, UINT64 value) +static inline void place_integer_le(void *ptr, size_t offset, size_t size, UINT64 value) { UINT8 *byte_ptr = ((UINT8 *) ptr) + offset; UINT16 val16; @@ -124,7 +124,7 @@ INLINE void place_integer_le(void *ptr, size_t offset, size_t size, UINT64 value } } -INLINE UINT64 pick_integer_le(const void *ptr, size_t offset, size_t size) +static inline UINT64 pick_integer_le(const void *ptr, size_t offset, size_t size) { UINT64 result = 0; const UINT8 *byte_ptr = ((const UINT8 *) ptr) + offset; diff --git a/src/lib/formats/kc_cas.cpp b/src/lib/formats/kc_cas.cpp index 40e261aed7f..3e3d36e3f8b 100644 --- a/src/lib/formats/kc_cas.cpp +++ b/src/lib/formats/kc_cas.cpp @@ -43,7 +43,7 @@ static int kc_image_size; /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -INLINE int kc_cas_cycle(INT16 *buffer, int sample_pos, int len) +static inline int kc_cas_cycle(INT16 *buffer, int sample_pos, int len) { int num_samples = KC_WAV_FREQUENCY / (len * 2); @@ -63,7 +63,7 @@ INLINE int kc_cas_cycle(INT16 *buffer, int sample_pos, int len) /******************************************************************* Generate n samples of silence ********************************************************************/ -INLINE int kc_cas_silence(INT16 *buffer, int sample_pos, int len) +static inline int kc_cas_silence(INT16 *buffer, int sample_pos, int len) { int i = 0; @@ -78,7 +78,7 @@ INLINE int kc_cas_silence(INT16 *buffer, int sample_pos, int len) /******************************************************************* Generate samples for 1 byte ********************************************************************/ -INLINE int kc_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) +static inline int kc_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) { int samples = 0; diff --git a/src/lib/formats/kim1_cas.cpp b/src/lib/formats/kim1_cas.cpp index db4c4a95a0b..ed9a1a36a0e 100644 --- a/src/lib/formats/kim1_cas.cpp +++ b/src/lib/formats/kim1_cas.cpp @@ -11,7 +11,7 @@ static int cas_size; -INLINE int kim1_output_signal( INT16 *buffer, int sample_pos, int high ) +static inline int kim1_output_signal( INT16 *buffer, int sample_pos, int high ) { int sample_count, i, j; @@ -62,7 +62,7 @@ INLINE int kim1_output_signal( INT16 *buffer, int sample_pos, int high ) } -INLINE int kim1_output_byte( INT16 *buffer, int sample_pos, UINT8 byte ) +static inline int kim1_output_byte( INT16 *buffer, int sample_pos, UINT8 byte ) { int i; int sample_count = 0; diff --git a/src/lib/formats/trs_cas.cpp b/src/lib/formats/trs_cas.cpp index 5e205348768..ec8bea116a7 100644 --- a/src/lib/formats/trs_cas.cpp +++ b/src/lib/formats/trs_cas.cpp @@ -21,7 +21,7 @@ static int cas_size; /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -INLINE int trs80l2_cas_cycle(INT16 *buffer, int sample_pos, int silence, int high, int low) +static inline int trs80l2_cas_cycle(INT16 *buffer, int sample_pos, int silence, int high, int low) { int i = 0; diff --git a/src/lib/formats/tzx_cas.cpp b/src/lib/formats/tzx_cas.cpp index 498de384e53..d78fee1595f 100644 --- a/src/lib/formats/tzx_cas.cpp +++ b/src/lib/formats/tzx_cas.cpp @@ -207,12 +207,12 @@ static void tzx_cas_get_blocks( const UINT8 *casdata, int caslen ) } } -INLINE int millisec_to_samplecount( int millisec ) +static inline int millisec_to_samplecount( int millisec ) { return (int) (millisec * ((double)TZX_WAV_FREQUENCY / 1000.0)); } -INLINE int tcycles_to_samplecount( int tcycles ) +static inline int tcycles_to_samplecount( int tcycles ) { return (int) ((0.5 + (((double)TZX_WAV_FREQUENCY / 3500000) * (double)tcycles)) * (double) t_scale); } @@ -335,7 +335,7 @@ static int tzx_handle_direct(INT16 **buffer, const UINT8 *bytes, int pause, int } -INLINE int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol, int maxp) +static inline int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol, int maxp) { int size = 0; const UINT8 *cursymb = symtable + (2 * maxp + 1)*symbol; @@ -395,7 +395,7 @@ INLINE int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol return size; } -INLINE int stream_get_bit(const UINT8 *bytes, UINT8 &stream_bit, UINT32 &stream_byte) +static inline int stream_get_bit(const UINT8 *bytes, UINT8 &stream_bit, UINT32 &stream_byte) { // get bit here UINT8 retbit = 0; diff --git a/src/lib/formats/vg5k_cas.cpp b/src/lib/formats/vg5k_cas.cpp index 6c10112ab30..2933f77f8c0 100644 --- a/src/lib/formats/vg5k_cas.cpp +++ b/src/lib/formats/vg5k_cas.cpp @@ -20,7 +20,7 @@ static int k7_size; /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -INLINE int vg5k_cas_cycle(INT16 *buffer, int sample_pos, int len) +static inline int vg5k_cas_cycle(INT16 *buffer, int sample_pos, int len) { int i = 0; @@ -45,7 +45,7 @@ INLINE int vg5k_cas_cycle(INT16 *buffer, int sample_pos, int len) /******************************************************************* Generate n samples of silence ********************************************************************/ -INLINE int vg5k_cas_silence(INT16 *buffer, int sample_pos, int len) +static inline int vg5k_cas_silence(INT16 *buffer, int sample_pos, int len) { int i = 0; @@ -60,7 +60,7 @@ INLINE int vg5k_cas_silence(INT16 *buffer, int sample_pos, int len) /******************************************************************* Generate the end-byte samples ********************************************************************/ -INLINE int vg5k_cas_eob(INT16 *buffer, int sample_pos) +static inline int vg5k_cas_eob(INT16 *buffer, int sample_pos) { int i, samples = 0; @@ -73,7 +73,7 @@ INLINE int vg5k_cas_eob(INT16 *buffer, int sample_pos) } -INLINE int vg5k_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) +static inline int vg5k_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) { /* Writing an entire byte */ int i, samples; @@ -100,7 +100,7 @@ INLINE int vg5k_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) /******************************************************************* Generate n sample of synchro ********************************************************************/ -INLINE int vg5k_k7_synchro(INT16 *buffer, int sample_pos, int len) +static inline int vg5k_k7_synchro(INT16 *buffer, int sample_pos, int len) { int i, samples = 0; diff --git a/src/lib/util/aviio.cpp b/src/lib/util/aviio.cpp index 95d96ca6422..90918c06673 100644 --- a/src/lib/util/aviio.cpp +++ b/src/lib/util/aviio.cpp @@ -471,7 +471,7 @@ static void printf_chunk_recursive(avi_file *file, avi_chunk *chunk, int indent) -------------------------------------------------*/ /** - * @fn INLINE UINT16 fetch_16bits(const UINT8 *data) + * @fn static inline UINT16 fetch_16bits(const UINT8 *data) * * @brief Fetches the 16bits. * @@ -480,7 +480,7 @@ static void printf_chunk_recursive(avi_file *file, avi_chunk *chunk, int indent) * @return The 16bits. */ -INLINE UINT16 fetch_16bits(const UINT8 *data) +static inline UINT16 fetch_16bits(const UINT8 *data) { return data[0] | (data[1] << 8); } @@ -492,7 +492,7 @@ INLINE UINT16 fetch_16bits(const UINT8 *data) -------------------------------------------------*/ /** - * @fn INLINE UINT32 fetch_32bits(const UINT8 *data) + * @fn static inline UINT32 fetch_32bits(const UINT8 *data) * * @brief Fetches the 32bits. * @@ -501,7 +501,7 @@ INLINE UINT16 fetch_16bits(const UINT8 *data) * @return The 32bits. */ -INLINE UINT32 fetch_32bits(const UINT8 *data) +static inline UINT32 fetch_32bits(const UINT8 *data) { return data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); } @@ -513,7 +513,7 @@ INLINE UINT32 fetch_32bits(const UINT8 *data) -------------------------------------------------*/ /** - * @fn INLINE UINT64 fetch_64bits(const UINT8 *data) + * @fn static inline UINT64 fetch_64bits(const UINT8 *data) * * @brief Fetches the 64bits. * @@ -522,7 +522,7 @@ INLINE UINT32 fetch_32bits(const UINT8 *data) * @return The 64bits. */ -INLINE UINT64 fetch_64bits(const UINT8 *data) +static inline UINT64 fetch_64bits(const UINT8 *data) { return (UINT64)data[0] | ((UINT64)data[1] << 8) | ((UINT64)data[2] << 16) | ((UINT64)data[3] << 24) | @@ -537,7 +537,7 @@ INLINE UINT64 fetch_64bits(const UINT8 *data) -------------------------------------------------*/ /** - * @fn INLINE void put_16bits(UINT8 *data, UINT16 value) + * @fn static inline void put_16bits(UINT8 *data, UINT16 value) * * @brief Puts the 16bits. * @@ -545,7 +545,7 @@ INLINE UINT64 fetch_64bits(const UINT8 *data) * @param value The value. */ -INLINE void put_16bits(UINT8 *data, UINT16 value) +static inline void put_16bits(UINT8 *data, UINT16 value) { data[0] = value >> 0; data[1] = value >> 8; @@ -558,7 +558,7 @@ INLINE void put_16bits(UINT8 *data, UINT16 value) -------------------------------------------------*/ /** - * @fn INLINE void put_32bits(UINT8 *data, UINT32 value) + * @fn static inline void put_32bits(UINT8 *data, UINT32 value) * * @brief Puts the 32bits. * @@ -566,7 +566,7 @@ INLINE void put_16bits(UINT8 *data, UINT16 value) * @param value The value. */ -INLINE void put_32bits(UINT8 *data, UINT32 value) +static inline void put_32bits(UINT8 *data, UINT32 value) { data[0] = value >> 0; data[1] = value >> 8; @@ -581,7 +581,7 @@ INLINE void put_32bits(UINT8 *data, UINT32 value) -------------------------------------------------*/ /** - * @fn INLINE void put_64bits(UINT8 *data, UINT64 value) + * @fn static inline void put_64bits(UINT8 *data, UINT64 value) * * @brief Puts the 64bits. * @@ -589,7 +589,7 @@ INLINE void put_32bits(UINT8 *data, UINT32 value) * @param value The value. */ -INLINE void put_64bits(UINT8 *data, UINT64 value) +static inline void put_64bits(UINT8 *data, UINT64 value) { data[0] = value >> 0; data[1] = value >> 8; @@ -608,7 +608,7 @@ INLINE void put_64bits(UINT8 *data, UINT64 value) -------------------------------------------------*/ /** - * @fn INLINE avi_stream *get_video_stream(avi_file *file) + * @fn static inline avi_stream *get_video_stream(avi_file *file) * * @brief Gets video stream. * @@ -617,7 +617,7 @@ INLINE void put_64bits(UINT8 *data, UINT64 value) * @return null if it fails, else the video stream. */ -INLINE avi_stream *get_video_stream(avi_file *file) +static inline avi_stream *get_video_stream(avi_file *file) { int streamnum; @@ -636,7 +636,7 @@ INLINE avi_stream *get_video_stream(avi_file *file) -------------------------------------------------*/ /** - * @fn INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) + * @fn static inline avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) * * @brief Gets audio stream. * @@ -647,7 +647,7 @@ INLINE avi_stream *get_video_stream(avi_file *file) * @return null if it fails, else the audio stream. */ -INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) +static inline avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) { int streamnum; @@ -674,7 +674,7 @@ INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) -------------------------------------------------*/ /** - * @fn INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 offset, UINT32 length) + * @fn static inline avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 offset, UINT32 length) * * @brief Sets stream chunk information. * @@ -686,7 +686,7 @@ INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) * @return An avi_error. */ -INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 offset, UINT32 length) +static inline avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 offset, UINT32 length) { /* if we need to allocate more, allocate more */ if (index >= stream->chunksalloc) @@ -720,7 +720,7 @@ INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 -------------------------------------------------*/ /** - * @fn INLINE UINT32 compute_idx1_size(avi_file *file) + * @fn static inline UINT32 compute_idx1_size(avi_file *file) * * @brief Calculates the index 1 size. * @@ -729,7 +729,7 @@ INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 * @return The calculated index 1 size. */ -INLINE UINT32 compute_idx1_size(avi_file *file) +static inline UINT32 compute_idx1_size(avi_file *file) { int chunks = 0; int strnum; @@ -748,7 +748,7 @@ INLINE UINT32 compute_idx1_size(avi_file *file) -------------------------------------------------*/ /** - * @fn INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) + * @fn static inline UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) * * @brief Gets chunkid for stream. * @@ -758,7 +758,7 @@ INLINE UINT32 compute_idx1_size(avi_file *file) * @return The chunkid for stream. */ -INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) +static inline UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) { UINT32 chunkid; @@ -778,7 +778,7 @@ INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) -------------------------------------------------*/ /** - * @fn INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) + * @fn static inline UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) * * @brief Framenum to samplenum. * @@ -788,7 +788,7 @@ INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) * @return An UINT32. */ -INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) +static inline UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) { return ((UINT64)file->info.audio_samplerate * (UINT64)framenum * (UINT64)file->info.video_sampletime + file->info.video_timescale - 1) / (UINT64)file->info.video_timescale; } @@ -801,7 +801,7 @@ INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) -------------------------------------------------*/ /** - * @fn INLINE avi_error expand_tempbuffer(avi_file *file, UINT32 length) + * @fn static inline avi_error expand_tempbuffer(avi_file *file, UINT32 length) * * @brief Expand tempbuffer. * @@ -811,7 +811,7 @@ INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) * @return An avi_error. */ -INLINE avi_error expand_tempbuffer(avi_file *file, UINT32 length) +static inline avi_error expand_tempbuffer(avi_file *file, UINT32 length) { /* expand the tempbuffer to hold the data if necessary */ if (length > file->tempbuffersize) diff --git a/src/lib/util/cdrom.cpp b/src/lib/util/cdrom.cpp index 917cb355839..a9a60ef97bd 100644 --- a/src/lib/util/cdrom.cpp +++ b/src/lib/util/cdrom.cpp @@ -130,7 +130,7 @@ struct cdrom_file -------------------------------------------------*/ /** - * @fn INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum) + * @fn static inline UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum) * * @brief Physical to chd lba. * @@ -141,7 +141,7 @@ struct cdrom_file * @return An UINT32. */ -INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum) +static inline UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum) { UINT32 chdlba; int track; @@ -164,7 +164,7 @@ INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &trac -------------------------------------------------*/ /** - * @fn INLINE UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum) + * @fn static inline UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum) * * @brief Logical to chd lba. * @@ -175,7 +175,7 @@ INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &trac * @return An UINT32. */ -INLINE UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum) +static inline UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum) { UINT32 chdlba, physlba; int track; diff --git a/src/lib/util/cdrom.h b/src/lib/util/cdrom.h index c0115701e35..c495a405513 100644 --- a/src/lib/util/cdrom.h +++ b/src/lib/util/cdrom.h @@ -145,12 +145,12 @@ void ecc_clear(UINT8 *sector); INLINE FUNCTIONS ***************************************************************************/ -INLINE UINT32 msf_to_lba(UINT32 msf) +static inline UINT32 msf_to_lba(UINT32 msf) { return ( ((msf&0x00ff0000)>>16) * 60 * 75) + (((msf&0x0000ff00)>>8) * 75) + ((msf&0x000000ff)>>0); } -INLINE UINT32 lba_to_msf(UINT32 lba) +static inline UINT32 lba_to_msf(UINT32 lba) { UINT8 m, s, f; @@ -167,7 +167,7 @@ INLINE UINT32 lba_to_msf(UINT32 lba) // segacd needs it like this.. investigate // Angelo also says PCE tracks often start playing at the // wrong address.. related? -INLINE UINT32 lba_to_msf_alt(int lba) +static inline UINT32 lba_to_msf_alt(int lba) { UINT32 ret = 0; diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index b7e389a35f7..a2242c133c6 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -104,7 +104,7 @@ static file_error osd_or_zlib_write(core_file *file, const void *buffer, UINT64 works for most platforms -------------------------------------------------*/ -INLINE int is_directory_separator(char c) +static inline int is_directory_separator(char c) { return (c == '\\' || c == '/' || c == ':'); } diff --git a/src/lib/util/jedparse.h b/src/lib/util/jedparse.h index 1615f25af34..0f23462b995 100644 --- a/src/lib/util/jedparse.h +++ b/src/lib/util/jedparse.h @@ -63,7 +63,7 @@ size_t jedbin_output(const jed_data *data, void *result, size_t length); INLINE FUNCTIONS ***************************************************************************/ -INLINE int jed_get_fuse(const jed_data *data, UINT32 fusenum) +static inline int jed_get_fuse(const jed_data *data, UINT32 fusenum) { if (fusenum < JED_MAX_FUSES) return (data->fusemap[fusenum / 8] >> (fusenum % 8)) & 1; @@ -72,7 +72,7 @@ INLINE int jed_get_fuse(const jed_data *data, UINT32 fusenum) } -INLINE void jed_set_fuse(jed_data *data, UINT32 fusenum, UINT8 value) +static inline void jed_set_fuse(jed_data *data, UINT32 fusenum, UINT8 value) { if (fusenum < JED_MAX_FUSES) { diff --git a/src/lib/util/png.cpp b/src/lib/util/png.cpp index 6e57d949f47..a6b269593ef 100644 --- a/src/lib/util/png.cpp +++ b/src/lib/util/png.cpp @@ -53,51 +53,51 @@ static const int samples[] = { 1, 0, 3, 1, 2, 0, 4 }; INLINE FUNCTIONS ***************************************************************************/ -INLINE UINT8 fetch_8bit(UINT8 *v) +static inline UINT8 fetch_8bit(UINT8 *v) { return *v; } #ifdef UNUSED_FUNCTION -INLINE UINT16 fetch_16bit(UINT8 *v) +static inline UINT16 fetch_16bit(UINT8 *v) { return BIG_ENDIANIZE_INT16(*(UINT16 *)v); } #endif -INLINE UINT32 fetch_32bit(UINT8 *v) +static inline UINT32 fetch_32bit(UINT8 *v) { return BIG_ENDIANIZE_INT32(*(UINT32 *)v); } -INLINE void put_8bit(UINT8 *v, UINT8 data) +static inline void put_8bit(UINT8 *v, UINT8 data) { *v = data; } #ifdef UNUSED_FUNCTION -INLINE void put_16bit(UINT8 *v, UINT16 data) +static inline void put_16bit(UINT8 *v, UINT16 data) { *(UINT16 *)v = BIG_ENDIANIZE_INT16(data); } #endif -INLINE void put_32bit(UINT8 *v, UINT32 data) +static inline void put_32bit(UINT8 *v, UINT32 data) { *(UINT32 *)v = BIG_ENDIANIZE_INT32(data); } -INLINE int compute_bpp(const png_info *pnginfo) +static inline int compute_bpp(const png_info *pnginfo) { return samples[pnginfo->color_type] * pnginfo->bit_depth / 8; } -INLINE int compute_rowbytes(const png_info *pnginfo) +static inline int compute_rowbytes(const png_info *pnginfo) { return (pnginfo->width * samples[pnginfo->color_type] * pnginfo->bit_depth + 7) / 8; } diff --git a/src/lib/util/pool.cpp b/src/lib/util/pool.cpp index e004f236b76..9712d8b6e00 100644 --- a/src/lib/util/pool.cpp +++ b/src/lib/util/pool.cpp @@ -100,7 +100,7 @@ static void report_failure(object_pool *pool, const char *format, ...) ATTR_PRIN object -------------------------------------------------*/ -INLINE int hash_object(void *object) +static inline int hash_object(void *object) { return ((size_t)object >> 4) % POOL_HASH_SIZE; } @@ -111,7 +111,7 @@ INLINE int hash_object(void *object) a given object type -------------------------------------------------*/ -INLINE objtype_entry *get_object_type(object_pool *pool, object_type type) +static inline objtype_entry *get_object_type(object_pool *pool, object_type type) { objtype_entry *entry; diff --git a/src/lib/util/unzip.cpp b/src/lib/util/unzip.cpp index a8f3ca434e2..876d8ae90c5 100644 --- a/src/lib/util/unzip.cpp +++ b/src/lib/util/unzip.cpp @@ -99,7 +99,7 @@ ***************************************************************************/ /** - * @fn INLINE UINT16 read_word(UINT8 *buf) + * @fn static inline UINT16 read_word(UINT8 *buf) * * @brief Reads a word. * @@ -108,13 +108,13 @@ * @return The word. */ -INLINE UINT16 read_word(UINT8 *buf) +static inline UINT16 read_word(UINT8 *buf) { return (buf[1] << 8) | buf[0]; } /** - * @fn INLINE UINT32 read_dword(UINT8 *buf) + * @fn static inline UINT32 read_dword(UINT8 *buf) * * @brief Reads a double word. * @@ -123,7 +123,7 @@ INLINE UINT16 read_word(UINT8 *buf) * @return The double word. */ -INLINE UINT32 read_dword(UINT8 *buf) +static inline UINT32 read_dword(UINT8 *buf) { return (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; } diff --git a/src/mame/audio/beezer.cpp b/src/mame/audio/beezer.cpp index f026b480f1b..3a295208073 100644 --- a/src/mame/audio/beezer.cpp +++ b/src/mame/audio/beezer.cpp @@ -192,7 +192,7 @@ void beezer_sound_device::device_reset() * *************************************/ // need to set int_flag properly here -INLINE void sh6840_apply_clock(struct sh6840_timer_channel_beez *t, int clocks) +static inline void sh6840_apply_clock(struct sh6840_timer_channel_beez *t, int clocks) { /* dual 8-bit case */ if (t->cr & 0x04) diff --git a/src/mame/audio/exidy.cpp b/src/mame/audio/exidy.cpp index 16de53a8dd3..c8bbaaf25ba 100644 --- a/src/mame/audio/exidy.cpp +++ b/src/mame/audio/exidy.cpp @@ -55,7 +55,7 @@ WRITE_LINE_MEMBER( exidy_sound_device::update_irq_state ) * *************************************/ -INLINE void sh6840_apply_clock(struct sh6840_timer_channel *t, int clocks) +static inline void sh6840_apply_clock(struct sh6840_timer_channel *t, int clocks) { /* dual 8-bit case */ if (t->cr & 0x04) diff --git a/src/mame/audio/micro3d.cpp b/src/mame/audio/micro3d.cpp index 0a53160f017..4e7cea003e9 100644 --- a/src/mame/audio/micro3d.cpp +++ b/src/mame/audio/micro3d.cpp @@ -22,20 +22,20 @@ *************************************/ /* Borrowed from segasnd.c */ -INLINE void configure_filter(m3d_filter_state *state, double r, double c) +static inline void configure_filter(m3d_filter_state *state, double r, double c) { state->capval = 0; state->exponent = 1.0 - exp(-1.0 / (r * c * 2000000/8)); } #if 0 -INLINE double step_rc_filter(m3d_filter_state *state, double input) +static inline double step_rc_filter(m3d_filter_state *state, double input) { state->capval += (input - state->capval) * state->exponent; return state->capval; } -INLINE double step_cr_filter(m3d_filter_state *state, double input) +static inline double step_cr_filter(m3d_filter_state *state, double input) { double result = (input - state->capval); state->capval += (input - state->capval) * state->exponent; diff --git a/src/mame/audio/segasnd.cpp b/src/mame/audio/segasnd.cpp index 72d58d8fa51..abc5df498d4 100644 --- a/src/mame/audio/segasnd.cpp +++ b/src/mame/audio/segasnd.cpp @@ -37,21 +37,21 @@ INLINE FUNCTIONS ***************************************************************************/ -INLINE void configure_filter(g80_filter_state *state, double r, double c) +static inline void configure_filter(g80_filter_state *state, double r, double c) { state->capval = 0; state->exponent = 1.0 - exp(-1.0 / (r * c * SAMPLE_RATE)); } -INLINE double step_rc_filter(g80_filter_state *state, double input) +static inline double step_rc_filter(g80_filter_state *state, double input) { state->capval += (input - state->capval) * state->exponent; return state->capval; } -INLINE double step_cr_filter(g80_filter_state *state, double input) +static inline double step_cr_filter(g80_filter_state *state, double input) { double result = (input - state->capval); state->capval += (input - state->capval) * state->exponent; @@ -503,7 +503,7 @@ READ8_MEMBER( usb_sound_device::t1_r ) * *************************************/ -INLINE void clock_channel(timer8253_channel *ch) +static inline void clock_channel(timer8253_channel *ch) { UINT8 lastgate = ch->lastgate; diff --git a/src/mame/audio/tx1.cpp b/src/mame/audio/tx1.cpp index e9983ad1cc9..b4dac235258 100644 --- a/src/mame/audio/tx1.cpp +++ b/src/mame/audio/tx1.cpp @@ -231,7 +231,7 @@ WRITE8_MEMBER( tx1_sound_device::ay8910_b_w ) ***************************************************************************/ -INLINE void update_engine(int eng[4]) +static inline void update_engine(int eng[4]) { int p0 = eng[0]; int p1 = eng[1]; diff --git a/src/mame/audio/vboy.cpp b/src/mame/audio/vboy.cpp index eb9947e9806..f6b77630522 100644 --- a/src/mame/audio/vboy.cpp +++ b/src/mame/audio/vboy.cpp @@ -184,8 +184,8 @@ static const INT8 outLvlTbl[16][16] = { { 0, 2, 4, 6, 8, 10, 12, 14, 16, 17, 19, 21, 23, 25, 27, 29} }; -INLINE UINT8 mgetb(register UINT8 *ptr) { return *ptr; } -INLINE void mputb(UINT8 *ptr, INT8 data) { *ptr = data; } +static inline UINT8 mgetb(register UINT8 *ptr) { return *ptr; } +static inline void mputb(UINT8 *ptr, INT8 data) { *ptr = data; } //************************************************************************** // LIVE DEVICE diff --git a/src/mame/drivers/39in1.cpp b/src/mame/drivers/39in1.cpp index e10e1fd8690..fcbd59370f4 100644 --- a/src/mame/drivers/39in1.cpp +++ b/src/mame/drivers/39in1.cpp @@ -103,7 +103,7 @@ public: #define VERBOSE_LEVEL ( 3 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char* s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char* s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/drivers/atarisy4.cpp b/src/mame/drivers/atarisy4.cpp index 44986485ecd..d03be4447b5 100644 --- a/src/mame/drivers/atarisy4.cpp +++ b/src/mame/drivers/atarisy4.cpp @@ -222,7 +222,7 @@ UINT32 atarisy4_state::screen_update_atarisy4(screen_device &screen, bitmap_rgb3 return 0; } -INLINE UINT32 xy_to_screen_addr(UINT32 x, UINT32 y) +static inline UINT32 xy_to_screen_addr(UINT32 x, UINT32 y) { // UINT32 offset = ((gpu.mcr >> 4) & 3) << 9; UINT32 offset = 0; diff --git a/src/mame/drivers/cdi.cpp b/src/mame/drivers/cdi.cpp index 9e01800ef5a..8b1e60376aa 100644 --- a/src/mame/drivers/cdi.cpp +++ b/src/mame/drivers/cdi.cpp @@ -38,7 +38,7 @@ TODO: #include "softlist.h" #if ENABLE_VERBOSE_LOG -INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/drivers/cxhumax.cpp b/src/mame/drivers/cxhumax.cpp index e7a2104d0fa..d1ed5d1b5e0 100644 --- a/src/mame/drivers/cxhumax.cpp +++ b/src/mame/drivers/cxhumax.cpp @@ -17,7 +17,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { @@ -835,12 +835,12 @@ void cxhumax_state::video_start() The document also contains the constants below as floats. --------------------------------------------------------------------------*/ -INLINE UINT8 clamp16_shift8(UINT32 x) +static inline UINT8 clamp16_shift8(UINT32 x) { return (((INT32) x < 0) ? 0 : (x > 65535 ? 255: x >> 8)); } -INLINE UINT32 ycc_to_rgb(UINT32 ycc) +static inline UINT32 ycc_to_rgb(UINT32 ycc) { /* original equations: diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp index a3b46e98f49..519ed10af03 100644 --- a/src/mame/drivers/ddenlovr.cpp +++ b/src/mame/drivers/ddenlovr.cpp @@ -686,7 +686,7 @@ void ddenlovr_state::do_plot( int x, int y, int pen ) } -INLINE int fetch_bit( UINT8 *src_data, int src_len, int *bit_addr ) +static inline int fetch_bit( UINT8 *src_data, int src_len, int *bit_addr ) { const int baddrmask = 0x7ffffff; @@ -705,7 +705,7 @@ INLINE int fetch_bit( UINT8 *src_data, int src_len, int *bit_addr ) return (src_data[baddr / 8] >> (7 - (baddr & 7))) & 1; } -INLINE int fetch_word( UINT8 *src_data, int src_len, int *bit_addr, int word_len ) +static inline int fetch_word( UINT8 *src_data, int src_len, int *bit_addr, int word_len ) { int res = 0; diff --git a/src/mame/drivers/dm7000.cpp b/src/mame/drivers/dm7000.cpp index 20c5e0bd787..24a6fe48f2c 100644 --- a/src/mame/drivers/dm7000.cpp +++ b/src/mame/drivers/dm7000.cpp @@ -43,7 +43,7 @@ #define VERBOSE_LEVEL ( 9 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp index 3f8ae3f392a..abaea79d40d 100644 --- a/src/mame/drivers/gba.cpp +++ b/src/mame/drivers/gba.cpp @@ -22,7 +22,7 @@ #define VERBOSE_LEVEL (0) -INLINE void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { @@ -1838,7 +1838,7 @@ WRITE32_MEMBER(gba_state::gba_io_w) } } -INLINE UINT32 COMBINE_DATA32_16(UINT32 prev, UINT32 data, UINT32 mem_mask) +static inline UINT32 COMBINE_DATA32_16(UINT32 prev, UINT32 data, UINT32 mem_mask) { COMBINE_DATA(&prev); switch(mem_mask) diff --git a/src/mame/drivers/gp32.cpp b/src/mame/drivers/gp32.cpp index 4627ddab5e6..4512c3db20f 100644 --- a/src/mame/drivers/gp32.cpp +++ b/src/mame/drivers/gp32.cpp @@ -25,7 +25,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) { if (VERBOSE_LEVEL >= n_level) { diff --git a/src/mame/drivers/multfish.cpp b/src/mame/drivers/multfish.cpp index 539a4dfdd20..e0a46ede44c 100644 --- a/src/mame/drivers/multfish.cpp +++ b/src/mame/drivers/multfish.cpp @@ -480,7 +480,7 @@ A12 <-> A13 } } -INLINE void rom_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) +static inline void rom_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) { UINT32 i, jscr; @@ -491,7 +491,7 @@ INLINE void rom_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor } memcpy(romptr,tmprom,igrosoft_gamble_ROM_SIZE); } -INLINE void rom_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) +static inline void rom_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) { UINT32 i, jscr; @@ -519,7 +519,7 @@ static void lottery_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, U rom_decodeh(&igrosoft_gamble_gfx[0x380000], &temprom[0], xor78, xor_addr); } -INLINE void roment_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) +static inline void roment_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) { UINT32 i, jscr; @@ -530,7 +530,7 @@ INLINE void roment_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 } memcpy(romptr,tmprom,igrosoft_gamble_ROM_SIZE); } -INLINE void roment_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) +static inline void roment_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) { UINT32 i, jscr; diff --git a/src/mame/drivers/namcoic.cpp b/src/mame/drivers/namcoic.cpp index 1cc553b93eb..8790639cfe7 100644 --- a/src/mame/drivers/namcoic.cpp +++ b/src/mame/drivers/namcoic.cpp @@ -561,7 +561,7 @@ READ16_MEMBER( namcos2_shared_state::c355_obj_position_r ) return m_c355_obj_position[offset]; } -INLINE UINT8 +static inline UINT8 nth_byte16( const UINT16 *pSource, int which ) { UINT16 data = pSource[which/2]; @@ -579,7 +579,7 @@ nth_byte16( const UINT16 *pSource, int which ) * read from 32-bit aligned memory as if it were an array of 16 bit words. */ #ifdef UNUSED_FUNCTION -INLINE UINT16 +static inline UINT16 nth_word32( const UINT32 *pSource, int which ) { UINT32 data = pSource[which/2]; @@ -598,7 +598,7 @@ nth_word32( const UINT32 *pSource, int which ) * read from 32-bit aligned memory as if it were an array of bytes. */ #ifdef UNUSED_FUNCTION -INLINE UINT8 +static inline UINT8 nth_byte32( const UINT32 *pSource, int which ) { UINT32 data = pSource[which/4]; diff --git a/src/mame/drivers/namcos23.cpp b/src/mame/drivers/namcos23.cpp index 66106e4bafd..0bda3aa8cb0 100644 --- a/src/mame/drivers/namcos23.cpp +++ b/src/mame/drivers/namcos23.cpp @@ -1655,7 +1655,7 @@ float namcos23_state::f24_to_f32(UINT32 v) return *(float *)&r; } -INLINE UINT8 light(UINT8 c, float l) +static inline UINT8 light(UINT8 c, float l) { if(l < 1) l = l*c; diff --git a/src/mame/drivers/photon2.cpp b/src/mame/drivers/photon2.cpp index c3aa6438a0e..f0683c72413 100644 --- a/src/mame/drivers/photon2.cpp +++ b/src/mame/drivers/photon2.cpp @@ -113,7 +113,7 @@ void photon2_state::video_start() #if 0 /* return the color to be used inverting FLASHing colors if necessary */ -INLINE unsigned char get_display_color (unsigned char color, int invert) +static inline unsigned char get_display_color (unsigned char color, int invert) { if (invert && (color & 0x80)) return (color & 0xc0) + ((color & 0x38) >> 3) + ((color & 0x07) << 3); @@ -138,7 +138,7 @@ void photon2_state::screen_eof_spectrum(screen_device &screen, bool state) } } -INLINE void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color) +static inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color) { bitmap.pix16(y, x) = (UINT16)color; } diff --git a/src/mame/drivers/subsino2.cpp b/src/mame/drivers/subsino2.cpp index 137f034337c..99c9cf97a09 100644 --- a/src/mame/drivers/subsino2.cpp +++ b/src/mame/drivers/subsino2.cpp @@ -223,7 +223,7 @@ WRITE8_MEMBER(subsino2_state::ss9601_byte_lo2_w) } -INLINE void ss9601_videoram_w(layer_t *l, vram_t vram, address_space &space, offs_t offset, UINT8 data) +static inline void ss9601_videoram_w(layer_t *l, vram_t vram, address_space &space, offs_t offset, UINT8 data) { l->videorams[vram][offset] = data; diff --git a/src/mame/drivers/taitotz.cpp b/src/mame/drivers/taitotz.cpp index 6c472379b17..5f83ed30285 100644 --- a/src/mame/drivers/taitotz.cpp +++ b/src/mame/drivers/taitotz.cpp @@ -760,14 +760,14 @@ static const float dot3_tex_table[32] = 0.266666f, 0.300000f, 0.333333f, 0.366666f, 0.400000f, 0.433333f, 0.466666f, 0.500000f, }; -INLINE float dot_product_vec3(VECTOR3 a, VECTOR3 b) +static inline float dot_product_vec3(VECTOR3 a, VECTOR3 b) { return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]); } // Fast inverse square-root // Adapted from http://en.wikipedia.org/wiki/Fast_inverse_square_root -INLINE float finvsqrt(float number) +static inline float finvsqrt(float number) { UINT32 i; float x2, y; @@ -783,7 +783,7 @@ INLINE float finvsqrt(float number) } #if 0 -INLINE void normalize_vec3(VECTOR3 *v) +static inline void normalize_vec3(VECTOR3 *v) { float l = finvsqrt(*v[0] * *v[0] + *v[1] * *v[1] + *v[2] * *v[2]); *v[0] *= l; @@ -792,7 +792,7 @@ INLINE void normalize_vec3(VECTOR3 *v) } #endif -INLINE float clamp_pos(float v) +static inline float clamp_pos(float v) { if (v < 0.0f) return 0.0f; @@ -800,7 +800,7 @@ INLINE float clamp_pos(float v) return v; } -INLINE UINT32 generate_texel_address(int iu, int iv) +static inline UINT32 generate_texel_address(int iu, int iv) { // generate texel address from U and V UINT32 addr = 0; @@ -1074,7 +1074,7 @@ void taitotz_renderer::draw_scanline(INT32 scanline, const extent_t &extent, con } } -INLINE int is_point_inside(float x, float y, float z, PLANE cp) +static inline int is_point_inside(float x, float y, float z, PLANE cp) { float s = (x * cp.x) + (y * cp.y) + (z * cp.z) + cp.d; if (s >= 0.0f) diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp index 1cc8a78eaaa..9fee0bf3ff1 100644 --- a/src/mame/drivers/viper.cpp +++ b/src/mame/drivers/viper.cpp @@ -440,7 +440,7 @@ UINT32 viper_state::screen_update_viper(screen_device &screen, bitmap_rgb32 &bit UINT32 m_mpc8240_regs[256/4]; -INLINE UINT64 read64le_with_32le_device_handler(read32_delegate handler, address_space &space, offs_t offset, UINT64 mem_mask) +static inline UINT64 read64le_with_32le_device_handler(read32_delegate handler, address_space &space, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_0_31) @@ -451,7 +451,7 @@ INLINE UINT64 read64le_with_32le_device_handler(read32_delegate handler, address } -INLINE void write64le_with_32le_device_handler(write32_delegate handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask) +static inline void write64le_with_32le_device_handler(write32_delegate handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_0_31) handler(space, offset * 2 + 0, data >> 0, mem_mask >> 0); @@ -459,7 +459,7 @@ INLINE void write64le_with_32le_device_handler(write32_delegate handler, address handler(space, offset * 2 + 1, data >> 32, mem_mask >> 32); } -INLINE UINT64 read64be_with_32le_device_handler(read32_delegate handler, address_space &space, offs_t offset, UINT64 mem_mask) +static inline UINT64 read64be_with_32le_device_handler(read32_delegate handler, address_space &space, offs_t offset, UINT64 mem_mask) { UINT64 result; mem_mask = FLIPENDIAN_INT64(mem_mask); @@ -468,7 +468,7 @@ INLINE UINT64 read64be_with_32le_device_handler(read32_delegate handler, address } -INLINE void write64be_with_32le_device_handler(write32_delegate handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask) +static inline void write64be_with_32le_device_handler(write32_delegate handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask) { data = FLIPENDIAN_INT64(data); mem_mask = FLIPENDIAN_INT64(mem_mask); diff --git a/src/mame/drivers/zaurus.cpp b/src/mame/drivers/zaurus.cpp index 971b821fb82..cf19f15c8ff 100644 --- a/src/mame/drivers/zaurus.cpp +++ b/src/mame/drivers/zaurus.cpp @@ -1452,7 +1452,7 @@ protected: #define VERBOSE_LEVEL ( 5 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char* s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char* s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/etc/jrcrypt.cpp b/src/mame/etc/jrcrypt.cpp index b1244151243..e973df30753 100644 --- a/src/mame/etc/jrcrypt.cpp +++ b/src/mame/etc/jrcrypt.cpp @@ -147,11 +147,11 @@ unsigned jrpacman_decode_roms(int address) return RAM[address]; // this should never happen! } #else -INLINE WordBit(word theWord, int theBit) +static inline WordBit(word theWord, int theBit) { return (theWord >> theBit)&1; } -INLINE ByteBit(byte theByte, int theBit) +static inline ByteBit(byte theByte, int theBit) { return (theByte >> theBit)&1; } diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h index 64d7a7f6c03..e71cf24f55f 100644 --- a/src/mame/includes/model2.h +++ b/src/mame/includes/model2.h @@ -257,7 +257,7 @@ struct m2_poly_extra_data }; -INLINE UINT16 get_texel( UINT32 base_x, UINT32 base_y, int x, int y, UINT32 *sheet ) +static inline UINT16 get_texel( UINT32 base_x, UINT32 base_y, int x, int y, UINT32 *sheet ) { UINT32 baseoffs = ((base_y/2)*512)+(base_x/2); UINT32 texeloffs = ((y/2)*512)+(x/2); diff --git a/src/mame/machine/appldriv.cpp b/src/mame/machine/appldriv.cpp index 1257b720e23..139da446140 100644 --- a/src/mame/machine/appldriv.cpp +++ b/src/mame/machine/appldriv.cpp @@ -19,7 +19,7 @@ #define PARENT_FLOPPY_2 "^floppy2" #define PARENT_FLOPPY_3 "^floppy3" -INLINE apple525_floppy_image_device *get_device(device_t *device) +static inline apple525_floppy_image_device *get_device(device_t *device) { assert(device != nullptr); assert(device->type() == FLOPPY_APPLE); diff --git a/src/mame/machine/cdi070.cpp b/src/mame/machine/cdi070.cpp index cc8f377d76a..892b625f2db 100644 --- a/src/mame/machine/cdi070.cpp +++ b/src/mame/machine/cdi070.cpp @@ -30,7 +30,7 @@ TODO: const device_type MACHINE_CDI68070 = &device_creator; #if ENABLE_VERBOSE_LOG -INLINE void ATTR_PRINTF(1,2) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(1,2) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/machine/cdicdic.cpp b/src/mame/machine/cdicdic.cpp index 75d10ddb125..a6fbd02da27 100644 --- a/src/mame/machine/cdicdic.cpp +++ b/src/mame/machine/cdicdic.cpp @@ -33,7 +33,7 @@ TODO: const device_type MACHINE_CDICDIC = &device_creator; #if ENABLE_VERBOSE_LOG -INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { @@ -99,7 +99,7 @@ const INT32 cdicdic_device::s_cdic_adpcm_filter_coef[5][2] = // INLINES //************************************************************************** -INLINE int CDIC_IS_VALID_SAMPLE_BUF(UINT16 *cdram, UINT16 addr) +static inline int CDIC_IS_VALID_SAMPLE_BUF(UINT16 *cdram, UINT16 addr) { UINT8 *cdram8 = ((UINT8*)cdram) + addr + 8; if(cdram8[2] != 0xff) @@ -109,7 +109,7 @@ INLINE int CDIC_IS_VALID_SAMPLE_BUF(UINT16 *cdram, UINT16 addr) return 0; } -INLINE double CDIC_SAMPLE_BUF_FREQ(UINT16 *cdram, UINT16 addr) +static inline double CDIC_SAMPLE_BUF_FREQ(UINT16 *cdram, UINT16 addr) { UINT8 *cdram8 = ((UINT8*)cdram) + addr + 8; switch(cdram8[2] & 0x3f) @@ -129,7 +129,7 @@ INLINE double CDIC_SAMPLE_BUF_FREQ(UINT16 *cdram, UINT16 addr) } } -INLINE int CDIC_SAMPLE_BUF_SIZE(UINT16 *cdram, UINT16 addr) +static inline int CDIC_SAMPLE_BUF_SIZE(UINT16 *cdram, UINT16 addr) { UINT8 *cdram8 = ((UINT8*)cdram) + addr + 8; switch(cdram8[2] & 0x3f) @@ -151,7 +151,7 @@ INLINE int CDIC_SAMPLE_BUF_SIZE(UINT16 *cdram, UINT16 addr) } } -INLINE INT16 clamp(INT16 in) +static inline INT16 clamp(INT16 in) { return in; } diff --git a/src/mame/machine/cdislave.cpp b/src/mame/machine/cdislave.cpp index ac9d4fe706f..e02b32f6221 100644 --- a/src/mame/machine/cdislave.cpp +++ b/src/mame/machine/cdislave.cpp @@ -32,7 +32,7 @@ const device_type MACHINE_CDISLAVE = &device_creator; #if ENABLE_VERBOSE_LOG -INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/machine/docg3.cpp b/src/mame/machine/docg3.cpp index fbd3cb02515..9ec4ef16b35 100644 --- a/src/mame/machine/docg3.cpp +++ b/src/mame/machine/docg3.cpp @@ -13,7 +13,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/machine/fddebug.cpp b/src/mame/machine/fddebug.cpp index 0a78590cb5c..61e019280db 100644 --- a/src/mame/machine/fddebug.cpp +++ b/src/mame/machine/fddebug.cpp @@ -309,7 +309,7 @@ static int validate_opcode(address_space &space, UINT32 pc, const UINT8 *opdata, used to decrypt it -----------------------------------------------*/ -INLINE int addr_to_keyaddr(offs_t address) +static inline int addr_to_keyaddr(offs_t address) { /* for address xx0000-xx0006 (but only if >= 000008), use key xx2000-xx2006 */ if ((address & 0x0ffc) == 0 && address >= 4) @@ -325,7 +325,7 @@ INLINE int addr_to_keyaddr(offs_t address) always be 1 -----------------------------------------------*/ -INLINE UINT8 mask_for_keyaddr(offs_t address) +static inline UINT8 mask_for_keyaddr(offs_t address) { /* the first half of the key always has bit 0x80 set; the second half 0x40 */ /* however, the values at 0000-0003 and 1000-1003 don't follow this rule */ @@ -343,7 +343,7 @@ INLINE UINT8 mask_for_keyaddr(offs_t address) the specified number of steps -----------------------------------------------*/ -INLINE UINT32 advance_seed(UINT32 seed, int count) +static inline UINT32 advance_seed(UINT32 seed, int count) { /* iterate over the seed for 'count' reps */ while (count--) @@ -360,7 +360,7 @@ INLINE UINT32 advance_seed(UINT32 seed, int count) from a seed and apply the given mask -----------------------------------------------*/ -INLINE UINT8 key_value_from_seed(UINT32 seed, UINT8 mask) +static inline UINT8 key_value_from_seed(UINT32 seed, UINT8 mask) { /* put bits 16-21 of the seed in the low 6 bits and OR with the mask */ return ((~seed >> 16) & 0x3f) | mask; @@ -373,7 +373,7 @@ INLINE UINT8 key_value_from_seed(UINT32 seed, UINT8 mask) given seed -----------------------------------------------*/ -INLINE void generate_key_bytes(UINT8 *dest, UINT32 keyoffs, UINT32 count, UINT32 seed) +static inline void generate_key_bytes(UINT8 *dest, UINT32 keyoffs, UINT32 count, UINT32 seed) { int bytenum; @@ -395,7 +395,7 @@ INLINE void generate_key_bytes(UINT8 *dest, UINT32 keyoffs, UINT32 count, UINT32 an opcode based on the opcode -----------------------------------------------*/ -INLINE UINT8 get_opcode_length(UINT16 opcode) +static inline UINT8 get_opcode_length(UINT16 opcode) { /* return the length from the table */ return optable[opcode].flags >> 28; @@ -407,7 +407,7 @@ INLINE UINT8 get_opcode_length(UINT16 opcode) constraint -----------------------------------------------*/ -INLINE void set_constraint(fd1094_constraint *constraint, UINT32 pc, UINT16 state, UINT16 value, UINT16 mask) +static inline void set_constraint(fd1094_constraint *constraint, UINT32 pc, UINT16 state, UINT16 value, UINT16 mask) { constraint->pc = pc; constraint->state = state; @@ -420,7 +420,7 @@ INLINE void set_constraint(fd1094_constraint *constraint, UINT32 pc, UINT16 stat for a given address -----------------------------------------------*/ -INLINE void print_possibilities(running_machine &machine) +static inline void print_possibilities(running_machine &machine) { int i; @@ -435,7 +435,7 @@ INLINE void print_possibilities(running_machine &machine) 0=no, 1=yes, 2=unlikely -----------------------------------------------*/ -INLINE int pc_is_valid(address_space &space, UINT32 pc, UINT32 flags) +static inline int pc_is_valid(address_space &space, UINT32 pc, UINT32 flags) { /* if we're odd or out of range, fail */ if ((pc & 1) == 1) @@ -453,7 +453,7 @@ INLINE int pc_is_valid(address_space &space, UINT32 pc, UINT32 flags) valid? 0=no, 1=yes, 2=unlikely -----------------------------------------------*/ -INLINE int addr_is_valid(address_space &space, UINT32 addr, UINT32 flags) +static inline int addr_is_valid(address_space &space, UINT32 addr, UINT32 flags) { /* if this a JMP, the address is a PC */ if (flags & OF_JMP) diff --git a/src/mame/machine/gaelco3d.cpp b/src/mame/machine/gaelco3d.cpp index a8fe3f32590..d4f9c58383a 100644 --- a/src/mame/machine/gaelco3d.cpp +++ b/src/mame/machine/gaelco3d.cpp @@ -158,13 +158,13 @@ static void *osd_sharedmem_ptr(osd_shared_mem *os_shmem) INLINE FUNCTIONS ***************************************************************************/ -INLINE void shmem_lock(shmem_t *shmem) +static inline void shmem_lock(shmem_t *shmem) { while (atomic_exchange32(&shmem->lock,1) == 0) ; } -INLINE void shmem_unlock(shmem_t *shmem) +static inline void shmem_unlock(shmem_t *shmem) { atomic_exchange32(&shmem->lock,0); } diff --git a/src/mame/machine/micro3d.cpp b/src/mame/machine/micro3d.cpp index 4c207dfe28f..f51d73dafb8 100644 --- a/src/mame/machine/micro3d.cpp +++ b/src/mame/machine/micro3d.cpp @@ -214,7 +214,7 @@ READ32_MEMBER(micro3d_state::micro3d_scc_r) * *************************************/ -INLINE INT64 dot_product(micro3d_vtx *v1, micro3d_vtx *v2) +static inline INT64 dot_product(micro3d_vtx *v1, micro3d_vtx *v2) { INT64 result = ((INT64)v1->x * (INT64)v2->x) + ((INT64)v1->y * (INT64)v2->y) + @@ -222,7 +222,7 @@ INLINE INT64 dot_product(micro3d_vtx *v1, micro3d_vtx *v2) return result; } -INLINE INT64 normalised_multiply(INT32 a, INT32 b) +static inline INT64 normalised_multiply(INT32 a, INT32 b) { INT64 result; diff --git a/src/mame/machine/midwayic.cpp b/src/mame/machine/midwayic.cpp index 783eb12ed3e..2d848da5d0f 100644 --- a/src/mame/machine/midwayic.cpp +++ b/src/mame/machine/midwayic.cpp @@ -202,7 +202,7 @@ WRITE8_MEMBER(midway_serial_pic_device::write) * *************************************/ -INLINE UINT8 make_bcd(UINT8 data) +static inline UINT8 make_bcd(UINT8 data) { return ((data / 10) << 4) | (data % 10); } diff --git a/src/mame/machine/n64.cpp b/src/mame/machine/n64.cpp index 91ce7e482e4..4918f1a1613 100644 --- a/src/mame/machine/n64.cpp +++ b/src/mame/machine/n64.cpp @@ -1739,7 +1739,7 @@ UINT8 n64_periphs::calc_mempak_crc(UINT8 *buffer, int length) return crc; } -INLINE UINT8 convert_to_bcd(int val) +static inline UINT8 convert_to_bcd(int val) { return ((val / 10) << 4) | (val % 10); } diff --git a/src/mame/machine/psxcd.cpp b/src/mame/machine/psxcd.cpp index 552ad78b3e4..069e9f224f1 100644 --- a/src/mame/machine/psxcd.cpp +++ b/src/mame/machine/psxcd.cpp @@ -6,7 +6,7 @@ #define VERBOSE_LEVEL ( 0 ) -INLINE void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/machine/sgi.cpp b/src/mame/machine/sgi.cpp index fe2259b5219..d9b6e8b8887 100644 --- a/src/mame/machine/sgi.cpp +++ b/src/mame/machine/sgi.cpp @@ -14,7 +14,7 @@ #define VERBOSE_LEVEL ( 2 ) #if 0 -INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/machine/smartmed.cpp b/src/mame/machine/smartmed.cpp index b3147c49316..f8295a4110d 100644 --- a/src/mame/machine/smartmed.cpp +++ b/src/mame/machine/smartmed.cpp @@ -30,13 +30,13 @@ struct UINT32BE UINT8 bytes[4]; }; -INLINE UINT32 get_UINT32BE(UINT32BE word) +static inline UINT32 get_UINT32BE(UINT32BE word) { return (word.bytes[0] << 24) | (word.bytes[1] << 16) | (word.bytes[2] << 8) | word.bytes[3]; } #ifdef UNUSED_FUNCTION -INLINE void set_UINT32BE(UINT32BE *word, UINT32 data) +static inline void set_UINT32BE(UINT32BE *word, UINT32 data) { word->bytes[0] = (data >> 24) & 0xff; word->bytes[1] = (data >> 16) & 0xff; diff --git a/src/mame/machine/tx1.cpp b/src/mame/machine/tx1.cpp index 93862c8c935..76658ae9231 100644 --- a/src/mame/machine/tx1.cpp +++ b/src/mame/machine/tx1.cpp @@ -20,7 +20,7 @@ #define ROL16(val, shift) ( ((UINT16)val << shift) | ((UINT16)val >> (16 - shift)) ) #define SWAP16(val) ( (((UINT16)val << 8) & 0xff00) | ((UINT16)val >> 8) ) -INLINE UINT8 reverse_nibble(UINT8 nibble) +static inline UINT8 reverse_nibble(UINT8 nibble) { return (nibble & 1) << 3 | (nibble & 2) << 1 | @@ -402,7 +402,7 @@ enum #define TX1_SET_INS0_BIT do { if (!(ins & 0x4) && math.i0ff) ins |= math.i0ff; } while(0) -INLINE UINT16 get_tx1_datarom_addr(math_t &math) +static inline UINT16 get_tx1_datarom_addr(math_t &math) { UINT16 addr; @@ -960,7 +960,7 @@ enum #define BB_SET_INS0_BIT do { if (!(ins & 0x4) && math.i0ff) ins |= math.i0ff;} while(0) -INLINE UINT16 get_bb_datarom_addr(math_t &math) +static inline UINT16 get_bb_datarom_addr(math_t &math) { UINT16 addr; diff --git a/src/mame/video/amiga.cpp b/src/mame/video/amiga.cpp index 79651098c66..d049cc2e165 100644 --- a/src/mame/video/amiga.cpp +++ b/src/mame/video/amiga.cpp @@ -381,7 +381,7 @@ void amiga_sprite_enable_comparitor(running_machine &machine, int which, int ena * *************************************/ -INLINE void fetch_sprite_data(amiga_state *state, int scanline, int sprite) +static inline void fetch_sprite_data(amiga_state *state, int scanline, int sprite) { CUSTOM_REG(REG_SPR0DATA + 4 * sprite) = state->chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 0); CUSTOM_REG(REG_SPR0DATB + 4 * sprite) = state->chip_ram_r(CUSTOM_REG_LONG(REG_SPR0PTH + 2 * sprite) + 2); @@ -457,7 +457,7 @@ static void update_sprite_dma(amiga_state *state, int scanline) * *************************************/ -INLINE UINT32 interleave_sprite_data(UINT16 lobits, UINT16 hibits) +static inline UINT32 interleave_sprite_data(UINT16 lobits, UINT16 hibits) { return (amiga_expand_byte[lobits & 0xff] << 0) | (amiga_expand_byte[lobits >> 8] << 16) | (amiga_expand_byte[hibits & 0xff] << 1) | (amiga_expand_byte[hibits >> 8] << 17); @@ -557,7 +557,7 @@ static int get_sprite_pixel(amiga_state *state, int x) * *************************************/ -INLINE UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs) +static inline UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs) { UINT8 pix = (CUSTOM_REG(REG_BPL1DAT) >> obitoffs) & 1; if (planes >= 3) @@ -570,7 +570,7 @@ INLINE UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs } -INLINE UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int ebitoffs) +static inline UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int ebitoffs) { UINT8 pix = 0; if (planes >= 2) @@ -586,7 +586,7 @@ INLINE UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int ebitoff return pix; } -INLINE void fetch_bitplane_data(amiga_state *state, int plane) +static inline void fetch_bitplane_data(amiga_state *state, int plane) { CUSTOM_REG(REG_BPL1DAT + plane) = state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)); CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2) += 2; @@ -599,7 +599,7 @@ INLINE void fetch_bitplane_data(amiga_state *state, int plane) * *************************************/ -INLINE int update_ham(amiga_state *state, int newpix) +static inline int update_ham(amiga_state *state, int newpix) { switch (newpix >> 4) { diff --git a/src/mame/video/amigaaga.cpp b/src/mame/video/amigaaga.cpp index 6af424998e0..88dac2caf91 100644 --- a/src/mame/video/amigaaga.cpp +++ b/src/mame/video/amigaaga.cpp @@ -89,7 +89,7 @@ VIDEO_START_MEMBER(amiga_state,amiga_aga) * *************************************/ -INLINE void fetch_sprite_data(amiga_state *state, int scanline, int sprite) +static inline void fetch_sprite_data(amiga_state *state, int scanline, int sprite) { switch((CUSTOM_REG(REG_FMODE) >> 2) & 0x03) { @@ -217,7 +217,7 @@ static void update_sprite_dma(amiga_state *state, int scanline) * *************************************/ -INLINE UINT32 interleave_sprite_data(UINT16 lobits, UINT16 hibits) +static inline UINT32 interleave_sprite_data(UINT16 lobits, UINT16 hibits) { return (amiga_expand_byte[lobits & 0xff] << 0) | (amiga_expand_byte[lobits >> 8] << 16) | (amiga_expand_byte[hibits & 0xff] << 1) | (amiga_expand_byte[hibits >> 8] << 17); @@ -332,7 +332,7 @@ static int get_sprite_pixel(amiga_state *state, int x) * *************************************/ -INLINE UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs) +static inline UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs) { UINT64 *aga_bpldat = state->m_aga_bpldat; UINT8 pix = (aga_bpldat[0] >> obitoffs) & 1; @@ -350,7 +350,7 @@ INLINE UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs } -INLINE UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int ebitoffs) +static inline UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int ebitoffs) { UINT8 pix = 0; if (planes >= 2) @@ -371,7 +371,7 @@ INLINE UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int ebitoff return pix; } -INLINE void fetch_bitplane_data(amiga_state *state, int plane) +static inline void fetch_bitplane_data(amiga_state *state, int plane) { UINT64 *aga_bpldat = state->m_aga_bpldat; @@ -409,7 +409,7 @@ INLINE void fetch_bitplane_data(amiga_state *state, int plane) * *************************************/ -INLINE rgb_t update_ham(amiga_state *state, int newpix) +static inline rgb_t update_ham(amiga_state *state, int newpix) { switch (newpix & 0x03) { diff --git a/src/mame/video/gba.cpp b/src/mame/video/gba.cpp index e0883eafee1..17b8d926938 100644 --- a/src/mame/video/gba.cpp +++ b/src/mame/video/gba.cpp @@ -15,7 +15,7 @@ #define VERBOSE_LEVEL (0) -INLINE void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { @@ -34,9 +34,9 @@ static const int coeff[32] = { }; /* Utility functions */ -INLINE UINT32 alpha_blend_pixel(UINT32 color0, UINT32 color1, int ca, int cb); -INLINE UINT32 increase_brightness(UINT32 color, int coeff_); -INLINE UINT32 decrease_brightness(UINT32 color, int coeff_); +static inline UINT32 alpha_blend_pixel(UINT32 color0, UINT32 color1, int ca, int cb); +static inline UINT32 increase_brightness(UINT32 color, int coeff_); +static inline UINT32 decrease_brightness(UINT32 color, int coeff_); #define GBA_MODE0 0 #define GBA_MODE1 1 @@ -1776,7 +1776,7 @@ inline int gba_state::is_in_window(int x, int window) return 0; } -INLINE UINT32 alpha_blend_pixel(UINT32 color0, UINT32 color1, int ca, int cb) +static inline UINT32 alpha_blend_pixel(UINT32 color0, UINT32 color1, int ca, int cb) { if(color0 < 0x80000000) { @@ -1799,7 +1799,7 @@ INLINE UINT32 alpha_blend_pixel(UINT32 color0, UINT32 color1, int ca, int cb) return color0; } -INLINE UINT32 increase_brightness(UINT32 color, int coeff_) +static inline UINT32 increase_brightness(UINT32 color, int coeff_) { int r = (color >> 0) & 0x1f; int g = (color >> 5) & 0x1f; @@ -1816,7 +1816,7 @@ INLINE UINT32 increase_brightness(UINT32 color, int coeff_) return (color & 0xffff0000) | (b << 10) | (g << 5) | r; } -INLINE UINT32 decrease_brightness(UINT32 color, int coeff_) +static inline UINT32 decrease_brightness(UINT32 color, int coeff_) { int r = (color >> 0) & 0x1f; int g = (color >> 5) & 0x1f; diff --git a/src/mame/video/hng64.cpp b/src/mame/video/hng64.cpp index ac7084687b6..015c8ae0fac 100644 --- a/src/mame/video/hng64.cpp +++ b/src/mame/video/hng64.cpp @@ -220,7 +220,7 @@ static void hng64_configure_blit_parameters(blit_parameters *blit, tilemap_t *tm } } -INLINE UINT32 alpha_additive_r32(UINT32 d, UINT32 s, UINT8 level) +static inline UINT32 alpha_additive_r32(UINT32 d, UINT32 s, UINT8 level) { UINT32 add; add = (s & 0x00ff0000) + (d & 0x00ff0000); diff --git a/src/mame/video/k053936.cpp b/src/mame/video/k053936.cpp index b7ce3aa158f..f29039970dc 100644 --- a/src/mame/video/k053936.cpp +++ b/src/mame/video/k053936.cpp @@ -433,7 +433,7 @@ void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy) cliprect.set(minx, maxx, miny, maxy); } -INLINE void K053936GP_copyroz32clip( running_machine &machine, +static inline void K053936GP_copyroz32clip( running_machine &machine, bitmap_rgb32 &dst_bitmap, bitmap_ind16 &src_bitmap, const rectangle &dst_cliprect, const rectangle &src_cliprect, UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy, diff --git a/src/mame/video/konamigx.cpp b/src/mame/video/konamigx.cpp index a1720ccca1a..ab0b87a06fa 100644 --- a/src/mame/video/konamigx.cpp +++ b/src/mame/video/konamigx.cpp @@ -14,7 +14,7 @@ #define VERBOSE 0 -INLINE void set_color_555(palette_device &palette, pen_t color, int rshift, int gshift, int bshift, UINT16 data); +static inline void set_color_555(palette_device &palette, pen_t color, int rshift, int gshift, int bshift, UINT16 data); void konamigx_state::konamigx_precache_registers(void) @@ -1559,7 +1559,7 @@ UINT32 konamigx_state::screen_update_konamigx_right(screen_device &screen, bitma return 0; } -INLINE void set_color_555(palette_device &palette, pen_t color, int rshift, int gshift, int bshift, UINT16 data) +static inline void set_color_555(palette_device &palette, pen_t color, int rshift, int gshift, int bshift, UINT16 data) { palette.set_pen_color(color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift)); } diff --git a/src/mame/video/mcd212.cpp b/src/mame/video/mcd212.cpp index aec55056c8f..d7912615bbf 100644 --- a/src/mame/video/mcd212.cpp +++ b/src/mame/video/mcd212.cpp @@ -30,7 +30,7 @@ TODO: const device_type MACHINE_MCD212 = &device_creator; #if ENABLE_VERBOSE_LOG -INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { @@ -729,7 +729,7 @@ void mcd212_device::process_dca(int channel) m_channel[channel].dca = addr * 2; } -INLINE UINT8 MCD212_LIM(INT32 in) +static inline UINT8 MCD212_LIM(INT32 in) { if(in < 0) { @@ -742,7 +742,7 @@ INLINE UINT8 MCD212_LIM(INT32 in) return (UINT8)in; } -INLINE UINT8 BYTE_TO_CLUT(int channel, int icm, UINT8 byte) +static inline UINT8 BYTE_TO_CLUT(int channel, int icm, UINT8 byte) { switch(icm) { diff --git a/src/mame/video/midzeus.cpp b/src/mame/video/midzeus.cpp index d0f7330a8d4..7cf60e4f6a5 100644 --- a/src/mame/video/midzeus.cpp +++ b/src/mame/video/midzeus.cpp @@ -114,10 +114,10 @@ static int is_mk4b; * *************************************/ -INLINE UINT8 get_texel_4bit(const void *base, int y, int x, int width); -INLINE UINT8 get_texel_alt_4bit(const void *base, int y, int x, int width); -INLINE UINT8 get_texel_8bit(const void *base, int y, int x, int width); -INLINE UINT8 get_texel_alt_8bit(const void *base, int y, int x, int width); +static inline UINT8 get_texel_4bit(const void *base, int y, int x, int width); +static inline UINT8 get_texel_alt_4bit(const void *base, int y, int x, int width); +static inline UINT8 get_texel_8bit(const void *base, int y, int x, int width); +static inline UINT8 get_texel_alt_8bit(const void *base, int y, int x, int width); /************************************* @@ -160,25 +160,25 @@ INLINE UINT8 get_texel_alt_8bit(const void *base, int y, int x, int width); * *************************************/ -INLINE void *waveram0_ptr_from_block_addr(UINT32 addr) +static inline void *waveram0_ptr_from_block_addr(UINT32 addr) { UINT32 blocknum = (addr % WAVERAM0_WIDTH) + ((addr >> 12) % WAVERAM0_HEIGHT) * WAVERAM0_WIDTH; return WAVERAM_BLOCK0(blocknum); } -INLINE void *waveram0_ptr_from_expanded_addr(UINT32 addr) +static inline void *waveram0_ptr_from_expanded_addr(UINT32 addr) { UINT32 blocknum = (addr % WAVERAM0_WIDTH) + ((addr >> 16) % WAVERAM0_HEIGHT) * WAVERAM0_WIDTH; return WAVERAM_BLOCK0(blocknum); } -INLINE void *waveram1_ptr_from_expanded_addr(UINT32 addr) +static inline void *waveram1_ptr_from_expanded_addr(UINT32 addr) { UINT32 blocknum = (addr % WAVERAM1_WIDTH) + ((addr >> 16) % WAVERAM1_HEIGHT) * WAVERAM1_WIDTH; return WAVERAM_BLOCK1(blocknum); } -INLINE void *waveram0_ptr_from_texture_addr(UINT32 addr, int width) +static inline void *waveram0_ptr_from_texture_addr(UINT32 addr, int width) { UINT32 blocknum = (((addr & ~1) * width) / 8) % (WAVERAM0_WIDTH * WAVERAM0_HEIGHT); return WAVERAM_BLOCK0(blocknum); @@ -192,7 +192,7 @@ INLINE void *waveram0_ptr_from_texture_addr(UINT32 addr, int width) * *************************************/ -INLINE void waveram_plot_depth(int y, int x, UINT16 color, UINT16 depth) +static inline void waveram_plot_depth(int y, int x, UINT16 color, UINT16 depth) { if (zeus_cliprect.contains(x, y)) { @@ -202,13 +202,13 @@ INLINE void waveram_plot_depth(int y, int x, UINT16 color, UINT16 depth) } #ifdef UNUSED_FUNCTION -INLINE void waveram_plot(int y, int x, UINT16 color) +static inline void waveram_plot(int y, int x, UINT16 color) { if (zeus_cliprect.contains(x, y)) WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); } -INLINE void waveram_plot_check_depth(int y, int x, UINT16 color, UINT16 depth) +static inline void waveram_plot_check_depth(int y, int x, UINT16 color, UINT16 depth) { if (zeus_cliprect.contains(x, y)) { @@ -221,7 +221,7 @@ INLINE void waveram_plot_check_depth(int y, int x, UINT16 color, UINT16 depth) } } -INLINE void waveram_plot_check_depth_nowrite(int y, int x, UINT16 color, UINT16 depth) +static inline void waveram_plot_check_depth_nowrite(int y, int x, UINT16 color, UINT16 depth) { if (zeus_cliprect.contains(x, y)) { @@ -240,26 +240,26 @@ INLINE void waveram_plot_check_depth_nowrite(int y, int x, UINT16 color, UINT16 *************************************/ // 4x2 block size -INLINE UINT8 get_texel_4bit(const void *base, int y, int x, int width) +static inline UINT8 get_texel_4bit(const void *base, int y, int x, int width) { UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3); return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f; } -INLINE UINT8 get_texel_8bit(const void *base, int y, int x, int width) +static inline UINT8 get_texel_8bit(const void *base, int y, int x, int width) { UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 4) << 3) + ((y & 1) << 2) + (x & 3); return WAVERAM_READ8(base, byteoffs); } // 2x2 block size -INLINE UINT8 get_texel_alt_4bit(const void *base, int y, int x, int width) +static inline UINT8 get_texel_alt_4bit(const void *base, int y, int x, int width) { UINT32 byteoffs = (y / 4) * (width * 4) + ((x / 4) << 3) + ((y & 3) << 1) + ((x / 2) & 1); return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f; } -INLINE UINT8 get_texel_alt_8bit(const void *base, int y, int x, int width) +static inline UINT8 get_texel_alt_8bit(const void *base, int y, int x, int width) { UINT32 byteoffs = (y / 4) * (width * 4) + ((x / 2) << 3) + ((y & 3) << 1) + (x & 1); return WAVERAM_READ8(base, byteoffs); diff --git a/src/mame/video/midzeus2.cpp b/src/mame/video/midzeus2.cpp index 4b1c3d65689..670af222960 100644 --- a/src/mame/video/midzeus2.cpp +++ b/src/mame/video/midzeus2.cpp @@ -165,20 +165,20 @@ static int subregwrite_count[0x100]; * *************************************/ -INLINE void *waveram0_ptr_from_expanded_addr(UINT32 addr) +static inline void *waveram0_ptr_from_expanded_addr(UINT32 addr) { UINT32 blocknum = (addr % WAVERAM0_WIDTH) + ((addr >> 16) % WAVERAM0_HEIGHT) * WAVERAM0_WIDTH; return WAVERAM_BLOCK0(blocknum); } -INLINE void *waveram1_ptr_from_expanded_addr(UINT32 addr) +static inline void *waveram1_ptr_from_expanded_addr(UINT32 addr) { UINT32 blocknum = (addr % WAVERAM1_WIDTH) + ((addr >> 16) % WAVERAM1_HEIGHT) * WAVERAM1_WIDTH; return WAVERAM_BLOCK1(blocknum); } #ifdef UNUSED_FUNCTION -INLINE void *waveram0_ptr_from_texture_addr(UINT32 addr, int width) +static inline void *waveram0_ptr_from_texture_addr(UINT32 addr, int width) { UINT32 blocknum = ((addr & ~1) * width) / 8; return WAVERAM_BLOCK0(blocknum); @@ -193,14 +193,14 @@ INLINE void *waveram0_ptr_from_texture_addr(UINT32 addr, int width) *************************************/ #ifdef UNUSED_FUNCTION -INLINE void waveram_plot(int y, int x, UINT32 color) +static inline void waveram_plot(int y, int x, UINT32 color) { if (zeus_cliprect.contains(x, y)) WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); } #endif -INLINE void waveram_plot_depth(int y, int x, UINT32 color, UINT16 depth) +static inline void waveram_plot_depth(int y, int x, UINT32 color, UINT16 depth) { if (zeus_cliprect.contains(x, y)) { @@ -210,7 +210,7 @@ INLINE void waveram_plot_depth(int y, int x, UINT32 color, UINT16 depth) } #ifdef UNUSED_FUNCTION -INLINE void waveram_plot_check_depth(int y, int x, UINT32 color, UINT16 depth) +static inline void waveram_plot_check_depth(int y, int x, UINT32 color, UINT16 depth) { if (zeus_cliprect.contains(x, y)) { @@ -225,7 +225,7 @@ INLINE void waveram_plot_check_depth(int y, int x, UINT32 color, UINT16 depth) #endif #ifdef UNUSED_FUNCTION -INLINE void waveram_plot_check_depth_nowrite(int y, int x, UINT32 color, UINT16 depth) +static inline void waveram_plot_check_depth_nowrite(int y, int x, UINT32 color, UINT16 depth) { if (zeus_cliprect.contains(x, y)) { @@ -243,7 +243,7 @@ INLINE void waveram_plot_check_depth_nowrite(int y, int x, UINT32 color, UINT16 * *************************************/ -INLINE UINT8 get_texel_8bit(const void *base, int y, int x, int width) +static inline UINT8 get_texel_8bit(const void *base, int y, int x, int width) { UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 4) << 3) + ((y & 1) << 2) + (x & 3); return WAVERAM_READ8(base, byteoffs); @@ -251,7 +251,7 @@ INLINE UINT8 get_texel_8bit(const void *base, int y, int x, int width) #ifdef UNUSED_FUNCTION -INLINE UINT8 get_texel_4bit(const void *base, int y, int x, int width) +static inline UINT8 get_texel_4bit(const void *base, int y, int x, int width) { UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3); return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f; diff --git a/src/mame/video/model2.cpp b/src/mame/video/model2.cpp index 93d41b28552..8915d2ee5c1 100644 --- a/src/mame/video/model2.cpp +++ b/src/mame/video/model2.cpp @@ -105,7 +105,7 @@ * *******************************************/ -INLINE void transform_point( poly_vertex *point, float *matrix ) +static inline void transform_point( poly_vertex *point, float *matrix ) { float tx = (point->x * matrix[0]) + (point->y * matrix[3]) + (point->pz * matrix[6]) + (matrix[9]); float ty = (point->x * matrix[1]) + (point->y * matrix[4]) + (point->pz * matrix[7]) + (matrix[10]); @@ -116,7 +116,7 @@ INLINE void transform_point( poly_vertex *point, float *matrix ) point->pz = tz; } -INLINE void transform_vector( poly_vertex *vector, float *matrix ) +static inline void transform_vector( poly_vertex *vector, float *matrix ) { float tx = (vector->x * matrix[0]) + (vector->y * matrix[3]) + (vector->pz * matrix[6]); float ty = (vector->x * matrix[1]) + (vector->y * matrix[4]) + (vector->pz * matrix[7]); @@ -127,7 +127,7 @@ INLINE void transform_vector( poly_vertex *vector, float *matrix ) vector->pz = tz; } -INLINE void normalize_vector( poly_vertex *vector ) +static inline void normalize_vector( poly_vertex *vector ) { float n = sqrt( (vector->x * vector->x) + (vector->y * vector->y) + (vector->pz * vector->pz) ); @@ -140,12 +140,12 @@ INLINE void normalize_vector( poly_vertex *vector ) } } -INLINE float dot_product( poly_vertex *v1, poly_vertex *v2 ) +static inline float dot_product( poly_vertex *v1, poly_vertex *v2 ) { return (v1->x * v2->x) + (v1->y * v2->y) + (v1->pz * v2->pz); } -INLINE void vector_cross3( poly_vertex *dst, poly_vertex *v0, poly_vertex *v1, poly_vertex *v2 ) +static inline void vector_cross3( poly_vertex *dst, poly_vertex *v0, poly_vertex *v1, poly_vertex *v2 ) { poly_vertex p1, p2; diff --git a/src/mame/video/model3.cpp b/src/mame/video/model3.cpp index 4cea4a5a2e7..9e1e60be5d8 100644 --- a/src/mame/video/model3.cpp +++ b/src/mame/video/model3.cpp @@ -1312,7 +1312,7 @@ WRITE64_MEMBER(model3_state::real3d_cmd_w) /*****************************************************************************/ /* matrix and vector operations */ -INLINE float dot_product3(VECTOR3 a, VECTOR3 b) +static inline float dot_product3(VECTOR3 a, VECTOR3 b) { return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]); } diff --git a/src/mame/video/namcofl.cpp b/src/mame/video/namcofl.cpp index d15d63ac7eb..cf2f73805c6 100644 --- a/src/mame/video/namcofl.cpp +++ b/src/mame/video/namcofl.cpp @@ -11,7 +11,7 @@ * read from 32-bit aligned memory as if it were an array of 16 bit words. */ #ifdef UNUSED_FUNCTION -INLINE UINT16 +static inline UINT16 nth_word32( const UINT32 *source, int which ) { source += which/2; @@ -31,7 +31,7 @@ nth_word32( const UINT32 *source, int which ) * read from 32-bit aligned memory as if it were an array of bytes. */ #ifdef UNUSED_FUNCTION -INLINE UINT8 +static inline UINT8 nth_byte32( const UINT32 *pSource, int which ) { UINT32 data = pSource[which/4]; diff --git a/src/mame/video/namconb1.cpp b/src/mame/video/namconb1.cpp index cc38da66c8a..007ee859ad5 100644 --- a/src/mame/video/namconb1.cpp +++ b/src/mame/video/namconb1.cpp @@ -10,7 +10,7 @@ /* nth_word32 is a general-purpose utility function, which allows us to * read from 32-bit aligned memory as if it were an array of 16 bit words. */ -INLINE UINT16 +static inline UINT16 nth_word32( const UINT32 *source, int which ) { source += which/2; @@ -27,7 +27,7 @@ nth_word32( const UINT32 *source, int which ) /* nth_byte32 is a general-purpose utility function, which allows us to * read from 32-bit aligned memory as if it were an array of bytes. */ -INLINE UINT8 +static inline UINT8 nth_byte32( const UINT32 *pSource, int which ) { UINT32 data = pSource[which/4]; diff --git a/src/mame/video/namcos2.cpp b/src/mame/video/namcos2.cpp index 96ab3a18de1..d45dd94278d 100644 --- a/src/mame/video/namcos2.cpp +++ b/src/mame/video/namcos2.cpp @@ -64,7 +64,7 @@ struct roz_param int wrap; }; -INLINE void +static inline void draw_roz_helper_block(const struct roz_param *rozInfo, int destx, int desty, int srcx, int srcy, int width, int height, bitmap_ind16 &destbitmap, bitmap_ind8 &flagsbitmap, diff --git a/src/mame/video/newport.cpp b/src/mame/video/newport.cpp index 8d331fbb60f..52aff54c3ce 100644 --- a/src/mame/video/newport.cpp +++ b/src/mame/video/newport.cpp @@ -32,7 +32,7 @@ #define VERBOSE_LEVEL ( 0 ) #if 0 -INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ... ) +static inline void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { diff --git a/src/mame/video/rdpfiltr.inc b/src/mame/video/rdpfiltr.inc index 31f10f4858a..019a928a727 100644 --- a/src/mame/video/rdpfiltr.inc +++ b/src/mame/video/rdpfiltr.inc @@ -1,16 +1,16 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz #if 0 -INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres); -INLINE void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 fbuff_index); -INLINE void restore_filter16(INT32* r, INT32* g, INT32* b, UINT16* fbuff, UINT32 fbuff_index, UINT32 hres); -INLINE void divot_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuffer); -INLINE void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuff, UINT32 hres); -INLINE void restore_two(color_t* filtered, color_t* neighbour); -INLINE void video_max(UINT32* Pixels, UINT8* max, UINT32* enb); -INLINE UINT32 ge_two(UINT32 enb); - -INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres) +static inline void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres); +static inline void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 fbuff_index); +static inline void restore_filter16(INT32* r, INT32* g, INT32* b, UINT16* fbuff, UINT32 fbuff_index, UINT32 hres); +static inline void divot_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuffer); +static inline void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuff, UINT32 hres); +static inline void restore_two(color_t* filtered, color_t* neighbour); +static inline void video_max(UINT32* Pixels, UINT8* max, UINT32* enb); +static inline UINT32 ge_two(UINT32 enb); + +static inline void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres) { color_t penumax, penumin, max, min; UINT16 pix = *vbuff; @@ -210,7 +210,7 @@ INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UI } // This needs to be fixed for endianness. -INLINE void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 fbuff_index) +static inline void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 fbuff_index) { UINT8 leftr, leftg, leftb, rightr, rightg, rightb; UINT16 leftpix, rightpix; @@ -256,7 +256,7 @@ INLINE void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 f } } -INLINE void divot_filter16_buffer(int* r, int* g, int* b, color_t* vibuffer) +static inline void divot_filter16_buffer(int* r, int* g, int* b, color_t* vibuffer) { color_t leftpix = vibuffer[-1]; color_t rightpix = vibuffer[1]; @@ -303,7 +303,7 @@ INLINE void divot_filter16_buffer(int* r, int* g, int* b, color_t* vibuffer) } // Fix me. -INLINE void restore_filter16(int* r, int* g, int* b, UINT16* fbuff, UINT32 fbuff_index, UINT32 hres) +static inline void restore_filter16(int* r, int* g, int* b, UINT16* fbuff, UINT32 fbuff_index, UINT32 hres) { INT32 leftuppix = -hres - 1; INT32 leftdownpix = hres - 1; @@ -430,7 +430,7 @@ INLINE void restore_filter16(int* r, int* g, int* b, UINT16* fbuff, UINT32 fbuff } } -INLINE void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuff, UINT32 hres) +static inline void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuff, UINT32 hres) { color_t filtered; color_t leftuppix, leftdownpix, leftpix; @@ -474,7 +474,7 @@ INLINE void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuf } // This is wrong, only the 5 upper bits are compared. -INLINE void restore_two(color_t* filtered, color_t* neighbour) +static inline void restore_two(color_t* filtered, color_t* neighbour) { if (neighbour->i.r > filtered->i.r) { @@ -502,7 +502,7 @@ INLINE void restore_two(color_t* filtered, color_t* neighbour) } } -INLINE void video_max(UINT32* Pixels, UINT8* max, UINT32* enb) +static inline void video_max(UINT32* Pixels, UINT8* max, UINT32* enb) { int i; int pos = 0; @@ -526,7 +526,7 @@ INLINE void video_max(UINT32* Pixels, UINT8* max, UINT32* enb) *max = Pixels[pos]; } -INLINE UINT32 ge_two(UINT32 enb) +static inline UINT32 ge_two(UINT32 enb) { if(enb & 1) { diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp index 34656f1b9b1..3e150303609 100644 --- a/src/mame/video/tatsumi.cpp +++ b/src/mame/video/tatsumi.cpp @@ -169,7 +169,7 @@ VIDEO_START_MEMBER(tatsumi_state,bigfight) /********************************************************************/ template -INLINE void roundupt_drawgfxzoomrotate(tatsumi_state *state, +static inline void roundupt_drawgfxzoomrotate(tatsumi_state *state, _BitmapClass &dest_bmp, const rectangle &clip, gfx_element *gfx, UINT32 code,UINT32 color,int flipx,int flipy,UINT32 ssx,UINT32 ssy, int scalex, int scaley, int rotate, int write_priority_only ) diff --git a/src/mame/video/victory.cpp b/src/mame/video/victory.cpp index a265f3d3815..99ce602429b 100644 --- a/src/mame/video/victory.cpp +++ b/src/mame/video/victory.cpp @@ -510,7 +510,7 @@ Registers: * *************************************/ -INLINE void count_states(struct micro_t µ, int states) +static inline void count_states(struct micro_t µ, int states) { attotime state_time = MICRO_STATE_CLOCK_PERIOD * states; diff --git a/src/mame/video/vrender0.cpp b/src/mame/video/vrender0.cpp index 1b968053882..7b2af322548 100644 --- a/src/mame/video/vrender0.cpp +++ b/src/mame/video/vrender0.cpp @@ -116,7 +116,7 @@ no color in the palette will have this value #define RGB32(r,g,b) ((r << 16) | (g << 8) | (b << 0)) #define RGB16(r,g,b) ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | ((b & 0xf8) >> 3) -INLINE UINT16 RGB32TO16(UINT32 rgb) +static inline UINT16 RGB32TO16(UINT32 rgb) { return (((rgb >> (16 + 3)) & 0x1f) << 11) | (((rgb >> (8 + 2)) & 0x3f) << 5) | (((rgb >> (3)) & 0x1f) << 0); } @@ -125,7 +125,7 @@ INLINE UINT16 RGB32TO16(UINT32 rgb) #define EXTRACTG8(Src) (((Src >> 5) << 2) & 0xff) #define EXTRACTB8(Src) (((Src >> 0) << 3) & 0xff) -INLINE UINT16 Shade(UINT16 Src, UINT32 Shade) +static inline UINT16 Shade(UINT16 Src, UINT32 Shade) { UINT32 scr = (EXTRACTR8(Src) * ((Shade >> 16) & 0xff)) >> 8; UINT32 scg = (EXTRACTG8(Src) * ((Shade >> 8) & 0xff)) >> 8; diff --git a/src/mame/video/wgp.cpp b/src/mame/video/wgp.cpp index 9cd1ef49871..9a7c78b1140 100644 --- a/src/mame/video/wgp.cpp +++ b/src/mame/video/wgp.cpp @@ -477,7 +477,7 @@ void wgp_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const CUSTOM DRAW *********************************************************/ -INLINE void bryan2_drawscanline( bitmap_ind16 &bitmap, int x, int y, int length, +static inline void bryan2_drawscanline( bitmap_ind16 &bitmap, int x, int y, int length, const UINT16 *src, int transparent, UINT32 orient, bitmap_ind8 &priority, int pri ) { UINT16 *dsti = &bitmap.pix16(y, x); diff --git a/src/osd/eigccppc.h b/src/osd/eigccppc.h index 846a0aac55b..dacf6b5efc3 100644 --- a/src/osd/eigccppc.h +++ b/src/osd/eigccppc.h @@ -41,7 +41,7 @@ -------------------------------------------------*/ #define mul_32x32_hi _mul_32x32_hi -INLINE INT32 ATTR_CONST ATTR_FORCE_INLINE +static inline INT32 ATTR_CONST ATTR_FORCE_INLINE _mul_32x32_hi(INT32 val1, INT32 val2) { INT32 result; @@ -64,7 +64,7 @@ _mul_32x32_hi(INT32 val1, INT32 val2) -------------------------------------------------*/ #define mulu_32x32_hi _mulu_32x32_hi -INLINE UINT32 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT32 ATTR_CONST ATTR_FORCE_INLINE _mulu_32x32_hi(UINT32 val1, UINT32 val2) { UINT32 result; @@ -89,7 +89,7 @@ _mulu_32x32_hi(UINT32 val1, UINT32 val2) #if !defined(__ppc64__) && !defined(__PPC64__) && !defined(_ARCH_PPC64) #define mul_32x32_shift _mul_32x32_shift -INLINE INT32 ATTR_CONST ATTR_FORCE_INLINE +static inline INT32 ATTR_CONST ATTR_FORCE_INLINE _mul_32x32_shift(INT32 val1, INT32 val2, UINT8 shift) { INT32 result; @@ -123,7 +123,7 @@ _mul_32x32_shift(INT32 val1, INT32 val2, UINT8 shift) #if !defined(__ppc64__) && !defined(__PPC64__) && !defined(_ARCH_PPC64) #define mulu_32x32_shift _mulu_32x32_shift -INLINE UINT32 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT32 ATTR_CONST ATTR_FORCE_INLINE _mulu_32x32_shift(UINT32 val1, UINT32 val2, UINT8 shift) { UINT32 result; @@ -222,7 +222,7 @@ _mulu_32x32_shift(UINT32 val1, UINT32 val2, UINT8 shift) -------------------------------------------------*/ #define recip_approx _recip_approx -INLINE float ATTR_CONST ATTR_FORCE_INLINE +static inline float ATTR_CONST ATTR_FORCE_INLINE _recip_approx(float value) { float result; @@ -248,7 +248,7 @@ _recip_approx(float value) -------------------------------------------------*/ #define count_leading_zeros _count_leading_zeros -INLINE UINT8 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT8 ATTR_CONST ATTR_FORCE_INLINE _count_leading_zeros(UINT32 value) { UINT32 result; @@ -269,7 +269,7 @@ _count_leading_zeros(UINT32 value) -------------------------------------------------*/ #define count_leading_ones _count_leading_ones -INLINE UINT8 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT8 ATTR_CONST ATTR_FORCE_INLINE _count_leading_ones(UINT32 value) { UINT32 result; @@ -298,7 +298,7 @@ _count_leading_ones(UINT32 value) -------------------------------------------------*/ #define compare_exchange32 _compare_exchange32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) { INT32 result; @@ -332,7 +332,7 @@ _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) #if defined(__ppc64__) || defined(__PPC64__) #define compare_exchange64 _compare_exchange64 -INLINE INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) { INT64 result; @@ -365,7 +365,7 @@ _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) -------------------------------------------------*/ #define atomic_exchange32 _atomic_exchange32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) { INT32 result; @@ -393,7 +393,7 @@ _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) -------------------------------------------------*/ #define atomic_add32 _atomic_add32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _atomic_add32(INT32 volatile *ptr, INT32 delta) { INT32 result; @@ -422,7 +422,7 @@ _atomic_add32(INT32 volatile *ptr, INT32 delta) -------------------------------------------------*/ #define atomic_increment32 _atomic_increment32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _atomic_increment32(INT32 volatile *ptr) { INT32 result; @@ -450,7 +450,7 @@ _atomic_increment32(INT32 volatile *ptr) -------------------------------------------------*/ #define atomic_decrement32 _atomic_decrement32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _atomic_decrement32(INT32 volatile *ptr) { INT32 result; @@ -484,7 +484,7 @@ _atomic_decrement32(INT32 volatile *ptr) -------------------------------------------------*/ #define get_profile_ticks _get_profile_ticks -INLINE INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) +static inline INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) { // fix me - should use the time base return osd_ticks(); diff --git a/src/osd/eigccx86.h b/src/osd/eigccx86.h index a33df410994..2be2164a165 100644 --- a/src/osd/eigccx86.h +++ b/src/osd/eigccx86.h @@ -41,7 +41,7 @@ union _x86_union #ifndef __x86_64__ #define mul_32x32 _mul_32x32 -INLINE INT64 ATTR_CONST ATTR_FORCE_INLINE +static inline INT64 ATTR_CONST ATTR_FORCE_INLINE _mul_32x32(INT32 a, INT32 b) { INT64 result; @@ -67,7 +67,7 @@ _mul_32x32(INT32 a, INT32 b) #ifndef __x86_64__ #define mulu_32x32 _mulu_32x32 -INLINE UINT64 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT64 ATTR_CONST ATTR_FORCE_INLINE _mulu_32x32(UINT32 a, UINT32 b) { UINT64 result; @@ -92,7 +92,7 @@ _mulu_32x32(UINT32 a, UINT32 b) -------------------------------------------------*/ #define mul_32x32_hi _mul_32x32_hi -INLINE INT32 ATTR_CONST ATTR_FORCE_INLINE +static inline INT32 ATTR_CONST ATTR_FORCE_INLINE _mul_32x32_hi(INT32 a, INT32 b) { INT32 result, temp; @@ -117,7 +117,7 @@ _mul_32x32_hi(INT32 a, INT32 b) -------------------------------------------------*/ #define mulu_32x32_hi _mulu_32x32_hi -INLINE UINT32 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT32 ATTR_CONST ATTR_FORCE_INLINE _mulu_32x32_hi(UINT32 a, UINT32 b) { UINT32 result, temp; @@ -144,7 +144,7 @@ _mulu_32x32_hi(UINT32 a, UINT32 b) #ifndef __x86_64__ #define mul_32x32_shift _mul_32x32_shift -INLINE INT32 ATTR_CONST ATTR_FORCE_INLINE +static inline INT32 ATTR_CONST ATTR_FORCE_INLINE _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) { INT32 result; @@ -174,7 +174,7 @@ _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) #ifndef __x86_64__ #define mulu_32x32_shift _mulu_32x32_shift -INLINE UINT32 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT32 ATTR_CONST ATTR_FORCE_INLINE _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) { UINT32 result; @@ -202,7 +202,7 @@ _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) #ifndef __x86_64__ #define div_64x32 _div_64x32 -INLINE INT32 ATTR_CONST ATTR_FORCE_INLINE +static inline INT32 ATTR_CONST ATTR_FORCE_INLINE _div_64x32(INT64 a, INT32 b) { INT32 result, temp; @@ -229,7 +229,7 @@ _div_64x32(INT64 a, INT32 b) #ifndef __x86_64__ #define divu_64x32 _divu_64x32 -INLINE UINT32 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT32 ATTR_CONST ATTR_FORCE_INLINE _divu_64x32(UINT64 a, UINT32 b) { UINT32 result, temp; @@ -257,7 +257,7 @@ _divu_64x32(UINT64 a, UINT32 b) #ifndef __x86_64__ #define div_64x32_rem _div_64x32_rem -INLINE INT32 ATTR_FORCE_INLINE +static inline INT32 ATTR_FORCE_INLINE _div_64x32_rem(INT64 dividend, INT32 divisor, INT32 *remainder) { INT32 quotient; @@ -285,7 +285,7 @@ _div_64x32_rem(INT64 dividend, INT32 divisor, INT32 *remainder) #ifndef __x86_64__ #define divu_64x32_rem _divu_64x32_rem -INLINE UINT32 ATTR_FORCE_INLINE +static inline UINT32 ATTR_FORCE_INLINE _divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder) { UINT32 quotient; @@ -304,7 +304,7 @@ _divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder) } #else #define divu_64x32_rem _divu_64x32_rem -INLINE UINT32 ATTR_FORCE_INLINE +static inline UINT32 ATTR_FORCE_INLINE _divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder) { UINT32 quotient; @@ -336,7 +336,7 @@ _divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder) #ifndef __x86_64__ #define div_32x32_shift _div_32x32_shift -INLINE INT32 ATTR_CONST ATTR_FORCE_INLINE +static inline INT32 ATTR_CONST ATTR_FORCE_INLINE _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) { INT32 result; @@ -368,7 +368,7 @@ _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) #ifndef __x86_64__ #define divu_32x32_shift _divu_32x32_shift -INLINE UINT32 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT32 ATTR_CONST ATTR_FORCE_INLINE _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) { INT32 result; @@ -399,7 +399,7 @@ _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) #ifndef __x86_64__ #define mod_64x32 _mod_64x32 -INLINE INT32 ATTR_CONST ATTR_FORCE_INLINE +static inline INT32 ATTR_CONST ATTR_FORCE_INLINE _mod_64x32(INT64 a, INT32 b) { INT32 result, temp; @@ -426,7 +426,7 @@ _mod_64x32(INT64 a, INT32 b) #ifndef __x86_64__ #define modu_64x32 _modu_64x32 -INLINE UINT32 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT32 ATTR_CONST ATTR_FORCE_INLINE _modu_64x32(UINT64 a, UINT32 b) { UINT32 result, temp; @@ -453,7 +453,7 @@ _modu_64x32(UINT64 a, UINT32 b) #ifdef __SSE2__ #define recip_approx _recip_approx -INLINE float ATTR_CONST +static inline float ATTR_CONST _recip_approx(float value) { __m128 value_xmm = _mm_set_ss(value); @@ -476,7 +476,7 @@ _recip_approx(float value) -------------------------------------------------*/ #define count_leading_zeros _count_leading_zeros -INLINE UINT8 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT8 ATTR_CONST ATTR_FORCE_INLINE _count_leading_zeros(UINT32 value) { UINT32 result; @@ -501,7 +501,7 @@ _count_leading_zeros(UINT32 value) -------------------------------------------------*/ #define count_leading_ones _count_leading_ones -INLINE UINT8 ATTR_CONST ATTR_FORCE_INLINE +static inline UINT8 ATTR_CONST ATTR_FORCE_INLINE _count_leading_ones(UINT32 value) { UINT32 result; @@ -535,7 +535,7 @@ _count_leading_ones(UINT32 value) -------------------------------------------------*/ #define compare_exchange32 _compare_exchange32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) { INT32 result; @@ -562,7 +562,7 @@ _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) #ifdef __x86_64__ #define compare_exchange64 _compare_exchange64 -INLINE INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) { INT64 result; @@ -588,7 +588,7 @@ _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) -------------------------------------------------*/ #define atomic_exchange32 _atomic_exchange32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) { INT32 result; @@ -611,7 +611,7 @@ _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) -------------------------------------------------*/ #define atomic_add32 _atomic_add32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _atomic_add32(INT32 volatile *ptr, INT32 delta) { INT32 result = delta; @@ -635,7 +635,7 @@ _atomic_add32(INT32 volatile *ptr, INT32 delta) -------------------------------------------------*/ #define atomic_increment32 _atomic_increment32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _atomic_increment32(INT32 volatile *ptr) { INT32 result = 1; @@ -659,7 +659,7 @@ _atomic_increment32(INT32 volatile *ptr) -------------------------------------------------*/ #define atomic_decrement32 _atomic_decrement32 -INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE _atomic_decrement32(INT32 volatile *ptr) { INT32 result = -1; @@ -691,7 +691,7 @@ _atomic_decrement32(INT32 volatile *ptr) #define get_profile_ticks _get_profile_ticks #ifndef __x86_64__ -INLINE UINT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) +static inline UINT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) { UINT64 result; __asm__ __volatile__ ( @@ -701,7 +701,7 @@ INLINE UINT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) return result; } #else -INLINE UINT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) +static inline UINT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) { _x86_union r; __asm__ __volatile__ ( diff --git a/src/osd/eivc.h b/src/osd/eivc.h index 93927b1712b..3794e7ff169 100644 --- a/src/osd/eivc.h +++ b/src/osd/eivc.h @@ -49,7 +49,7 @@ extern "C" unsigned char _BitScanReverse(unsigned long *Index, unsigned long Mas #ifndef count_leading_zeros #define count_leading_zeros _count_leading_zeros -INLINE UINT8 _count_leading_zeros(UINT32 value) +static inline UINT8 _count_leading_zeros(UINT32 value) { UINT32 index; return _BitScanReverse((unsigned long *)&index, value) ? (index ^ 31) : 32; @@ -64,7 +64,7 @@ INLINE UINT8 _count_leading_zeros(UINT32 value) #ifndef count_leading_ones #define count_leading_ones _count_leading_ones -INLINE UINT8 _count_leading_ones(UINT32 value) +static inline UINT8 _count_leading_ones(UINT32 value) { UINT32 index; return _BitScanReverse((unsigned long *)&index, ~value) ? (index ^ 31) : 32; @@ -86,7 +86,7 @@ INLINE UINT8 _count_leading_ones(UINT32 value) #ifndef compare_exchange32 #define compare_exchange32 _compare_exchange32 -INLINE INT32 _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) +static inline INT32 _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) { return _InterlockedCompareExchange((volatile long *)ptr, exchange, compare); } @@ -103,7 +103,7 @@ INLINE INT32 _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 excha #ifdef PTR64 #ifndef compare_exchange64 #define compare_exchange64 _compare_exchange64 -INLINE INT64 _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) +static inline INT64 _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) { return _InterlockedCompareExchange64(ptr, exchange, compare); } @@ -119,7 +119,7 @@ INLINE INT64 _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 excha #ifndef atomic_exchange32 #define atomic_exchange32 _atomic_exchange32 -INLINE INT32 _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) +static inline INT32 _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) { return _InterlockedExchange((volatile long *)ptr, exchange); } @@ -134,7 +134,7 @@ INLINE INT32 _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) #ifndef atomic_add32 #define atomic_add32 _atomic_add32 -INLINE INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta) +static inline INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta) { return _InterlockedExchangeAdd((volatile long *)ptr, delta) + delta; } @@ -149,7 +149,7 @@ INLINE INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta) #ifndef atomic_increment32 #define atomic_increment32 _atomic_increment32 -INLINE INT32 _atomic_increment32(INT32 volatile *ptr) +static inline INT32 _atomic_increment32(INT32 volatile *ptr) { return _InterlockedIncrement((volatile long *)ptr); } @@ -164,7 +164,7 @@ INLINE INT32 _atomic_increment32(INT32 volatile *ptr) #ifndef atomic_decrement32 #define atomic_decrement32 _atomic_decrement32 -INLINE INT32 _atomic_decrement32(INT32 volatile *ptr) +static inline INT32 _atomic_decrement32(INT32 volatile *ptr) { return _InterlockedDecrement((volatile long *)ptr); } diff --git a/src/osd/eivcx86.h b/src/osd/eivcx86.h index b834bc2aa25..b6139f70c26 100644 --- a/src/osd/eivcx86.h +++ b/src/osd/eivcx86.h @@ -28,7 +28,7 @@ #ifndef PTR64 #define mul_32x32 _mul_32x32 -INLINE INT64 _mul_32x32(INT32 a, INT32 b) +static inline INT64 _mul_32x32(INT32 a, INT32 b) { // in theory this should work, but it is untested __asm @@ -49,7 +49,7 @@ INLINE INT64 _mul_32x32(INT32 a, INT32 b) #ifndef PTR64 #define mulu_32x32 _mulu_32x32 -INLINE UINT64 _mulu_32x32(UINT32 a, UINT32 b) +static inline UINT64 _mulu_32x32(UINT32 a, UINT32 b) { // in theory this should work, but it is untested __asm @@ -70,7 +70,7 @@ INLINE UINT64 _mulu_32x32(UINT32 a, UINT32 b) #ifndef PTR64 #define mul_32x32_hi _mul_32x32_hi -INLINE INT32 _mul_32x32_hi(INT32 a, INT32 b) +static inline INT32 _mul_32x32_hi(INT32 a, INT32 b) { INT32 result; @@ -94,7 +94,7 @@ INLINE INT32 _mul_32x32_hi(INT32 a, INT32 b) #ifndef PTR64 #define mulu_32x32_hi _mulu_32x32_hi -INLINE UINT32 _mulu_32x32_hi(UINT32 a, UINT32 b) +static inline UINT32 _mulu_32x32_hi(UINT32 a, UINT32 b) { INT32 result; @@ -119,7 +119,7 @@ INLINE UINT32 _mulu_32x32_hi(UINT32 a, UINT32 b) #ifndef PTR64 #define mul_32x32_shift _mul_32x32_shift -INLINE INT32 _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) +static inline INT32 _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) { INT32 result; @@ -146,7 +146,7 @@ INLINE INT32 _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) #ifndef PTR64 #define mulu_32x32_shift _mulu_32x32_shift -INLINE UINT32 _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) +static inline UINT32 _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) { INT32 result; @@ -171,7 +171,7 @@ INLINE UINT32 _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) #ifndef PTR64 #define div_64x32 _div_64x32 -INLINE INT32 _div_64x32(INT64 a, INT32 b) +static inline INT32 _div_64x32(INT64 a, INT32 b) { INT32 result; INT32 alow = a; @@ -197,7 +197,7 @@ INLINE INT32 _div_64x32(INT64 a, INT32 b) #ifndef PTR64 #define divu_64x32 _divu_64x32 -INLINE UINT32 _divu_64x32(UINT64 a, UINT32 b) +static inline UINT32 _divu_64x32(UINT64 a, UINT32 b) { UINT32 result; UINT32 alow = a; @@ -224,7 +224,7 @@ INLINE UINT32 _divu_64x32(UINT64 a, UINT32 b) #ifndef PTR64 #define div_64x32_rem _div_64x32_rem -INLINE INT32 _div_64x32_rem(INT64 a, INT32 b, INT32 *remainder) +static inline INT32 _div_64x32_rem(INT64 a, INT32 b, INT32 *remainder) { INT32 result; INT32 alow = a; @@ -254,7 +254,7 @@ INLINE INT32 _div_64x32_rem(INT64 a, INT32 b, INT32 *remainder) #ifndef PTR64 #define divu_64x32_rem _divu_64x32_rem -INLINE UINT32 _divu_64x32_rem(UINT64 a, UINT32 b, UINT32 *remainder) +static inline UINT32 _divu_64x32_rem(UINT64 a, UINT32 b, UINT32 *remainder) { UINT32 result; UINT32 alow = a; @@ -284,7 +284,7 @@ INLINE UINT32 _divu_64x32_rem(UINT64 a, UINT32 b, UINT32 *remainder) #ifndef PTR64 #define div_32x32_shift _div_32x32_shift -INLINE INT32 _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) +static inline INT32 _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) { INT32 result; @@ -312,7 +312,7 @@ INLINE INT32 _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) #ifndef PTR64 #define divu_32x32_shift _divu_32x32_shift -INLINE UINT32 _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) +static inline UINT32 _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) { UINT32 result; @@ -339,7 +339,7 @@ INLINE UINT32 _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) #ifndef PTR64 #define mod_64x32 _mod_64x32 -INLINE INT32 _mod_64x32(INT64 a, INT32 b) +static inline INT32 _mod_64x32(INT64 a, INT32 b) { INT32 result; INT32 alow = a; @@ -365,7 +365,7 @@ INLINE INT32 _mod_64x32(INT64 a, INT32 b) #ifndef PTR64 #define modu_64x32 _modu_64x32 -INLINE UINT32 _modu_64x32(UINT64 a, UINT32 b) +static inline UINT32 _modu_64x32(UINT64 a, UINT32 b) { UINT32 result; UINT32 alow = a; @@ -391,7 +391,7 @@ INLINE UINT32 _modu_64x32(UINT64 a, UINT32 b) #ifdef PTR64 #define recip_approx _recip_approx -INLINE float _recip_approx(float z) +static inline float _recip_approx(float z) { __m128 mz = _mm_set_ss(z); __m128 mooz = _mm_rcp_ss(mz); @@ -414,7 +414,7 @@ INLINE float _recip_approx(float z) #ifndef PTR64 #define count_leading_zeros _count_leading_zeros -INLINE UINT8 _count_leading_zeros(UINT32 value) +static inline UINT8 _count_leading_zeros(UINT32 value) { INT32 result; @@ -440,7 +440,7 @@ INLINE UINT8 _count_leading_zeros(UINT32 value) #ifndef PTR64 #define count_leading_ones _count_leading_ones -INLINE UINT8 _count_leading_ones(UINT32 value) +static inline UINT8 _count_leading_ones(UINT32 value) { INT32 result; @@ -477,14 +477,14 @@ INLINE UINT8 _count_leading_ones(UINT32 value) #ifdef PTR64 -INLINE osd_ticks_t _get_profile_ticks(void) +static inline osd_ticks_t _get_profile_ticks(void) { return __rdtsc(); } #else -INLINE osd_ticks_t _get_profile_ticks(void) +static inline osd_ticks_t _get_profile_ticks(void) { UINT64 result; UINT64 *presult = &result; diff --git a/src/osd/eminline.h b/src/osd/eminline.h index 79b154d9ba8..80b31437f2a 100644 --- a/src/osd/eminline.h +++ b/src/osd/eminline.h @@ -19,7 +19,7 @@ #if defined(__i386__) || defined(__x86_64__) -INLINE void ATTR_FORCE_INLINE +static inline void ATTR_FORCE_INLINE osd_yield_processor(void) { __asm__ __volatile__ ( " rep ; nop ;" ); @@ -32,7 +32,7 @@ osd_yield_processor(void) // osd_exchange64 //============================================================ -INLINE INT64 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT64 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE _osd_exchange64(INT64 volatile *ptr, INT64 exchange) { INT64 ret; @@ -52,7 +52,7 @@ _osd_exchange64(INT64 volatile *ptr, INT64 exchange) #elif defined(__ppc__) || defined (__PPC__) || defined(__ppc64__) || defined(__PPC64__) -INLINE void ATTR_FORCE_INLINE +static inline void ATTR_FORCE_INLINE osd_yield_processor(void) { __asm__ __volatile__ ( " nop \n nop \n" ); @@ -66,7 +66,7 @@ osd_yield_processor(void) // osd_exchange64 //============================================================ -INLINE INT64 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE +static inline INT64 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE _osd_exchange64(INT64 volatile *ptr, INT64 exchange) { INT64 ret; @@ -152,7 +152,7 @@ INT64 win_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) -------------------------------------------------*/ #ifndef mul_32x32 -INLINE INT64 mul_32x32(INT32 a, INT32 b) +static inline INT64 mul_32x32(INT32 a, INT32 b) { return (INT64)a * (INT64)b; } @@ -166,7 +166,7 @@ INLINE INT64 mul_32x32(INT32 a, INT32 b) -------------------------------------------------*/ #ifndef mulu_32x32 -INLINE UINT64 mulu_32x32(UINT32 a, UINT32 b) +static inline UINT64 mulu_32x32(UINT32 a, UINT32 b) { return (UINT64)a * (UINT64)b; } @@ -180,7 +180,7 @@ INLINE UINT64 mulu_32x32(UINT32 a, UINT32 b) -------------------------------------------------*/ #ifndef mul_32x32_hi -INLINE INT32 mul_32x32_hi(INT32 a, INT32 b) +static inline INT32 mul_32x32_hi(INT32 a, INT32 b) { return (UINT32)(((INT64)a * (INT64)b) >> 32); } @@ -194,7 +194,7 @@ INLINE INT32 mul_32x32_hi(INT32 a, INT32 b) -------------------------------------------------*/ #ifndef mulu_32x32_hi -INLINE UINT32 mulu_32x32_hi(UINT32 a, UINT32 b) +static inline UINT32 mulu_32x32_hi(UINT32 a, UINT32 b) { return (UINT32)(((UINT64)a * (UINT64)b) >> 32); } @@ -209,7 +209,7 @@ INLINE UINT32 mulu_32x32_hi(UINT32 a, UINT32 b) -------------------------------------------------*/ #ifndef mul_32x32_shift -INLINE INT32 mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) +static inline INT32 mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) { return (INT32)(((INT64)a * (INT64)b) >> shift); } @@ -224,7 +224,7 @@ INLINE INT32 mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) -------------------------------------------------*/ #ifndef mulu_32x32_shift -INLINE UINT32 mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) +static inline UINT32 mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) { return (UINT32)(((UINT64)a * (UINT64)b) >> shift); } @@ -237,7 +237,7 @@ INLINE UINT32 mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) -------------------------------------------------*/ #ifndef div_64x32 -INLINE INT32 div_64x32(INT64 a, INT32 b) +static inline INT32 div_64x32(INT64 a, INT32 b) { return a / (INT64)b; } @@ -250,7 +250,7 @@ INLINE INT32 div_64x32(INT64 a, INT32 b) -------------------------------------------------*/ #ifndef divu_64x32 -INLINE UINT32 divu_64x32(UINT64 a, UINT32 b) +static inline UINT32 divu_64x32(UINT64 a, UINT32 b) { return a / (UINT64)b; } @@ -264,7 +264,7 @@ INLINE UINT32 divu_64x32(UINT64 a, UINT32 b) -------------------------------------------------*/ #ifndef div_64x32_rem -INLINE INT32 div_64x32_rem(INT64 a, INT32 b, INT32 *remainder) +static inline INT32 div_64x32_rem(INT64 a, INT32 b, INT32 *remainder) { INT32 res = div_64x32(a, b); *remainder = a - ((INT64)b * res); @@ -280,7 +280,7 @@ INLINE INT32 div_64x32_rem(INT64 a, INT32 b, INT32 *remainder) -------------------------------------------------*/ #ifndef divu_64x32_rem -INLINE UINT32 divu_64x32_rem(UINT64 a, UINT32 b, UINT32 *remainder) +static inline UINT32 divu_64x32_rem(UINT64 a, UINT32 b, UINT32 *remainder) { UINT32 res = divu_64x32(a, b); *remainder = a - ((UINT64)b * res); @@ -296,7 +296,7 @@ INLINE UINT32 divu_64x32_rem(UINT64 a, UINT32 b, UINT32 *remainder) -------------------------------------------------*/ #ifndef div_32x32_shift -INLINE INT32 div_32x32_shift(INT32 a, INT32 b, UINT8 shift) +static inline INT32 div_32x32_shift(INT32 a, INT32 b, UINT8 shift) { return ((INT64)a << shift) / (INT64)b; } @@ -310,7 +310,7 @@ INLINE INT32 div_32x32_shift(INT32 a, INT32 b, UINT8 shift) -------------------------------------------------*/ #ifndef divu_32x32_shift -INLINE UINT32 divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) +static inline UINT32 divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) { return ((UINT64)a << shift) / (UINT64)b; } @@ -323,7 +323,7 @@ INLINE UINT32 divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) -------------------------------------------------*/ #ifndef mod_64x32 -INLINE INT32 mod_64x32(INT64 a, INT32 b) +static inline INT32 mod_64x32(INT64 a, INT32 b) { return a - (b * div_64x32(a, b)); } @@ -336,7 +336,7 @@ INLINE INT32 mod_64x32(INT64 a, INT32 b) -------------------------------------------------*/ #ifndef modu_64x32 -INLINE UINT32 modu_64x32(UINT64 a, UINT32 b) +static inline UINT32 modu_64x32(UINT64 a, UINT32 b) { return a - (b * divu_64x32(a, b)); } @@ -349,7 +349,7 @@ INLINE UINT32 modu_64x32(UINT64 a, UINT32 b) -------------------------------------------------*/ #ifndef recip_approx -INLINE float recip_approx(float value) +static inline float recip_approx(float value) { return 1.0f / value; } @@ -367,7 +367,7 @@ INLINE float recip_approx(float value) -------------------------------------------------*/ #ifndef count_leading_zeros -INLINE UINT8 count_leading_zeros(UINT32 val) +static inline UINT8 count_leading_zeros(UINT32 val) { UINT8 count; for (count = 0; (INT32)val >= 0; count++) val <<= 1; @@ -382,7 +382,7 @@ INLINE UINT8 count_leading_zeros(UINT32 val) -------------------------------------------------*/ #ifndef count_leading_ones -INLINE UINT8 count_leading_ones(UINT32 val) +static inline UINT8 count_leading_ones(UINT32 val) { UINT8 count; for (count = 0; (INT32)val < 0; count++) val <<= 1; @@ -409,7 +409,7 @@ INLINE UINT8 count_leading_ones(UINT32 val) -------------------------------------------------*/ #ifndef compare_exchange32 -INLINE INT32 compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) +static inline INT32 compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) { INT32 oldval = *ptr; if (*ptr == compare) @@ -433,7 +433,7 @@ INLINE INT32 compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchan #ifdef PTR64 #ifndef compare_exchange64 -INLINE INT64 compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) +static inline INT64 compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) { INT64 oldval = *ptr; if (*ptr == compare) @@ -452,7 +452,7 @@ INLINE INT64 compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchan -------------------------------------------------*/ #ifndef compare_exchange_ptr -INLINE void *compare_exchange_ptr(void * volatile *ptr, void *compare, void *exchange) +static inline void *compare_exchange_ptr(void * volatile *ptr, void *compare, void *exchange) { #ifdef PTR64 INT64 result; @@ -478,7 +478,7 @@ INLINE void *compare_exchange_ptr(void * volatile *ptr, void *compare, void *exc -------------------------------------------------*/ #ifndef atomic_exchange32 -INLINE INT32 atomic_exchange32(INT32 volatile *ptr, INT32 exchange) +static inline INT32 atomic_exchange32(INT32 volatile *ptr, INT32 exchange) { INT32 oldval = *ptr; *ptr = exchange; @@ -499,7 +499,7 @@ INLINE INT32 atomic_exchange32(INT32 volatile *ptr, INT32 exchange) -------------------------------------------------*/ #ifndef atomic_add32 -INLINE INT32 atomic_add32(INT32 volatile *ptr, INT32 delta) +static inline INT32 atomic_add32(INT32 volatile *ptr, INT32 delta) { return (*ptr += delta); } @@ -518,7 +518,7 @@ INLINE INT32 atomic_add32(INT32 volatile *ptr, INT32 delta) -------------------------------------------------*/ #ifndef atomic_increment32 -INLINE INT32 atomic_increment32(INT32 volatile *ptr) +static inline INT32 atomic_increment32(INT32 volatile *ptr) { return atomic_add32(ptr, 1); } @@ -537,7 +537,7 @@ INLINE INT32 atomic_increment32(INT32 volatile *ptr) -------------------------------------------------*/ #ifndef atomic_decrement32 -INLINE INT32 atomic_decrement32(INT32 volatile *ptr) +static inline INT32 atomic_decrement32(INT32 volatile *ptr) { return atomic_add32(ptr, -1); } @@ -557,7 +557,7 @@ INLINE INT32 atomic_decrement32(INT32 volatile *ptr) -------------------------------------------------*/ #ifndef get_profile_ticks -INLINE INT64 get_profile_ticks(void) +static inline INT64 get_profile_ticks(void) { return osd_ticks(); } diff --git a/src/osd/modules/debugger/debugint.cpp b/src/osd/modules/debugger/debugint.cpp index 9688a17c8e3..246a19a88a6 100644 --- a/src/osd/modules/debugger/debugint.cpp +++ b/src/osd/modules/debugger/debugint.cpp @@ -238,17 +238,17 @@ public: INLINE FUNCTIONS ***************************************************************************/ -INLINE int dview_is_state(DView *dv, int state) +static inline int dview_is_state(DView *dv, int state) { return ((dv->state & state) ? TRUE : FALSE); } -INLINE int dview_is_state_all(DView *dv, int state) +static inline int dview_is_state_all(DView *dv, int state) { return ((dv->state & state) == state ? TRUE : FALSE); } -INLINE void dview_set_state(DView *dv, int state, int onoff) +static inline void dview_set_state(DView *dv, int state, int onoff) { if (onoff) dv->state |= state; @@ -682,7 +682,7 @@ static int dview_on_mouse(DView *dv, int mx, int my, bool button) } -INLINE void map_attr_to_fg_bg(unsigned char attr, rgb_t *fg, rgb_t *bg) +static inline void map_attr_to_fg_bg(unsigned char attr, rgb_t *fg, rgb_t *bg) { *bg = rgb_t(0xff,0xff,0xff,0xff); *fg = rgb_t(0xff,0x00,0x00,0x00); diff --git a/src/osd/modules/render/d3d/d3d9intf.cpp b/src/osd/modules/render/d3d/d3d9intf.cpp index cb8eb741f65..e4f5e08db3b 100644 --- a/src/osd/modules/render/d3d/d3d9intf.cpp +++ b/src/osd/modules/render/d3d/d3d9intf.cpp @@ -39,7 +39,7 @@ static void set_interfaces(base *d3dptr); // INLINES //============================================================ -INLINE void convert_present_params(const present_parameters *params, D3DPRESENT_PARAMETERS *d3d9params) +static inline void convert_present_params(const present_parameters *params, D3DPRESENT_PARAMETERS *d3d9params) { memset(d3d9params, 0, sizeof(*d3d9params)); d3d9params->BackBufferWidth = params->BackBufferWidth; diff --git a/src/osd/modules/render/draw13.cpp b/src/osd/modules/render/draw13.cpp index f1f75fe57bf..f357d567e71 100644 --- a/src/osd/modules/render/draw13.cpp +++ b/src/osd/modules/render/draw13.cpp @@ -354,17 +354,17 @@ static bool blit_info_initialized = false; //============================================================ -INLINE float round_nearest(float f) +static inline float round_nearest(float f) { return floor(f + 0.5f); } -INLINE HashT texture_compute_hash(const render_texinfo &texture, const UINT32 flags) +static inline HashT texture_compute_hash(const render_texinfo &texture, const UINT32 flags) { return (HashT)texture.base ^ (flags & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)); } -INLINE SDL_BlendMode map_blendmode(const int blendmode) +static inline SDL_BlendMode map_blendmode(const int blendmode) { switch (blendmode) { @@ -382,7 +382,7 @@ INLINE SDL_BlendMode map_blendmode(const int blendmode) return SDL_BLENDMODE_NONE; } -INLINE void set_coloralphamode(SDL_Texture *texture_id, const render_color *color) +static inline void set_coloralphamode(SDL_Texture *texture_id, const render_color *color) { UINT32 sr = (UINT32)(255.0f * color->r); UINT32 sg = (UINT32)(255.0f * color->g); diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index 04fdadbcbbc..ee99588ebdf 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -92,7 +92,7 @@ static const line_aa_step line_aa_4step[] = // INLINES //============================================================ -INLINE BOOL GetClientRectExceptMenu(HWND hWnd, PRECT pRect, BOOL fullscreen) +static inline BOOL GetClientRectExceptMenu(HWND hWnd, PRECT pRect, BOOL fullscreen) { static HMENU last_menu; static RECT last_rect; @@ -119,7 +119,7 @@ INLINE BOOL GetClientRectExceptMenu(HWND hWnd, PRECT pRect, BOOL fullscreen) } -INLINE UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr) +static inline UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr) { /* original equations: @@ -2199,7 +2199,7 @@ void texture_info::compute_size(int texwidth, int texheight) // copyline_palette16 //============================================================ -INLINE void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) +static inline void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) { int x; @@ -2217,7 +2217,7 @@ INLINE void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const // copyline_palettea16 //============================================================ -INLINE void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) +static inline void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) { int x; @@ -2235,7 +2235,7 @@ INLINE void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const // copyline_rgb32 //============================================================ -INLINE void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix) +static inline void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix) { int x; @@ -2278,7 +2278,7 @@ INLINE void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_ // copyline_argb32 //============================================================ -INLINE void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix) +static inline void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix) { int x; @@ -2321,7 +2321,7 @@ INLINE void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, const rgb // copyline_yuy16_to_yuy2 //============================================================ -INLINE void copyline_yuy16_to_yuy2(UINT16 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) +static inline void copyline_yuy16_to_yuy2(UINT16 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) { int x; @@ -2386,7 +2386,7 @@ INLINE void copyline_yuy16_to_yuy2(UINT16 *dst, const UINT16 *src, int width, co // copyline_yuy16_to_uyvy //============================================================ -INLINE void copyline_yuy16_to_uyvy(UINT16 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) +static inline void copyline_yuy16_to_uyvy(UINT16 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) { int x; @@ -2449,7 +2449,7 @@ INLINE void copyline_yuy16_to_uyvy(UINT16 *dst, const UINT16 *src, int width, co // copyline_yuy16_to_argb //============================================================ -INLINE void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) +static inline void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix) { int x; diff --git a/src/osd/modules/render/drawdd.cpp b/src/osd/modules/render/drawdd.cpp index 8ba2df0df91..fb82dff3c1f 100644 --- a/src/osd/modules/render/drawdd.cpp +++ b/src/osd/modules/render/drawdd.cpp @@ -171,7 +171,7 @@ inline void renderer_dd::update_outer_rects() } -INLINE int better_mode(int width0, int height0, int width1, int height1, float desired_aspect) +static inline int better_mode(int width0, int height0, int width1, int height1, float desired_aspect) { float aspect0 = (float)width0 / (float)height0; float aspect1 = (float)width1 / (float)height1; diff --git a/src/osd/modules/render/drawogl.cpp b/src/osd/modules/render/drawogl.cpp index caaa4d6ea74..4a2744e4068 100644 --- a/src/osd/modules/render/drawogl.cpp +++ b/src/osd/modules/render/drawogl.cpp @@ -655,7 +655,7 @@ static const line_aa_step line_aa_4step[] = // INLINES //============================================================ -INLINE HashT texture_compute_hash(const render_texinfo *texture, UINT32 flags) +static inline HashT texture_compute_hash(const render_texinfo *texture, UINT32 flags) { HashT h = (HashT)texture->base ^ (flags & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)); //printf("hash %d\n", (int) h % HASH_SIZE); @@ -1998,7 +1998,7 @@ void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsour } } -INLINE int get_valid_pow2_value(int v, int needPow2) +static inline int get_valid_pow2_value(int v, int needPow2) { return (needPow2)?gl_round_to_pow2(v):v; } @@ -2569,7 +2569,7 @@ ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, // copyline_palette16 //============================================================ -INLINE void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) +static inline void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) { int x; @@ -2592,7 +2592,7 @@ INLINE void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const // copyline_palettea16 //============================================================ -INLINE void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) +static inline void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) { int x; @@ -2615,7 +2615,7 @@ INLINE void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const // copyline_rgb32 //============================================================ -INLINE void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) +static inline void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) { int x; @@ -2667,7 +2667,7 @@ INLINE void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_ // copyline_argb32 //============================================================ -INLINE void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) +static inline void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) { int x; @@ -2710,7 +2710,7 @@ INLINE void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, const rgb } } -INLINE UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr) +static inline UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr) { /* original equations: @@ -2755,7 +2755,7 @@ INLINE UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr) // copyline_yuy16_to_argb //============================================================ -INLINE void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) +static inline void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix, int xprescale) { int x; diff --git a/src/osd/modules/sync/sync_ntc.cpp b/src/osd/modules/sync/sync_ntc.cpp index e283be5000a..462c56ee434 100644 --- a/src/osd/modules/sync/sync_ntc.cpp +++ b/src/osd/modules/sync/sync_ntc.cpp @@ -177,7 +177,7 @@ void osd_scalable_lock_free(osd_scalable_lock *lock) free(lock); } -INLINE pthread_t osd_compare_exchange_pthread_t(pthread_t volatile *ptr, pthread_t compare, pthread_t exchange) +static inline pthread_t osd_compare_exchange_pthread_t(pthread_t volatile *ptr, pthread_t compare, pthread_t exchange) { #ifdef PTR64 INT64 result = compare_exchange64((INT64 volatile *)ptr, (INT64)compare, (INT64)exchange); @@ -187,7 +187,7 @@ INLINE pthread_t osd_compare_exchange_pthread_t(pthread_t volatile *ptr, pthread return (pthread_t)result; } -INLINE pthread_t osd_exchange_pthread_t(pthread_t volatile *ptr, pthread_t exchange) +static inline pthread_t osd_exchange_pthread_t(pthread_t volatile *ptr, pthread_t exchange) { #ifdef PTR64 INT64 result = osd_exchange64((INT64 volatile *)ptr, (INT64)exchange); diff --git a/src/osd/modules/sync/sync_os2.cpp b/src/osd/modules/sync/sync_os2.cpp index 0bc452807e6..dba34065610 100644 --- a/src/osd/modules/sync/sync_os2.cpp +++ b/src/osd/modules/sync/sync_os2.cpp @@ -167,7 +167,7 @@ void osd_scalable_lock_free(osd_scalable_lock *lock) free(lock); } -INLINE pthread_t osd_compare_exchange_pthread_t(pthread_t volatile *ptr, pthread_t compare, pthread_t exchange) +static inline pthread_t osd_compare_exchange_pthread_t(pthread_t volatile *ptr, pthread_t compare, pthread_t exchange) { #ifdef PTR64 INT64 result = compare_exchange64((INT64 volatile *)ptr, (INT64)compare, (INT64)exchange); @@ -177,7 +177,7 @@ INLINE pthread_t osd_compare_exchange_pthread_t(pthread_t volatile *ptr, pthread return (pthread_t)result; } -INLINE pthread_t osd_exchange_pthread_t(pthread_t volatile *ptr, pthread_t exchange) +static inline pthread_t osd_exchange_pthread_t(pthread_t volatile *ptr, pthread_t exchange) { #ifdef PTR64 INT64 result = osd_exchange64((INT64 volatile *)ptr, (INT64)exchange); diff --git a/src/osd/osdcore.h b/src/osd/osdcore.h index d39e49d3bff..b7180accac8 100644 --- a/src/osd/osdcore.h +++ b/src/osd/osdcore.h @@ -675,7 +675,7 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call /* inline helper to queue a single work item using the same interface */ -INLINE osd_work_item *osd_work_item_queue(osd_work_queue *queue, osd_work_callback callback, void *param, UINT32 flags) +static inline osd_work_item *osd_work_item_queue(osd_work_queue *queue, osd_work_callback callback, void *param, UINT32 flags) { return osd_work_item_queue_multiple(queue, callback, 1, param, 0, flags); } diff --git a/src/osd/sdl/input.cpp b/src/osd/sdl/input.cpp index 1bfde78ee8b..e2732c0a61c 100644 --- a/src/osd/sdl/input.cpp +++ b/src/osd/sdl/input.cpp @@ -1525,7 +1525,7 @@ INT32 normalize_absolute_axis(INT32 raw, INT32 rawmin, INT32 rawmax) //============================================================ #if (SDLMAME_SDL2) -INLINE sdl_window_info * window_from_id(Uint32 windowID) +static inline sdl_window_info * window_from_id(Uint32 windowID) { sdl_window_info *w; SDL_Window *window = SDL_GetWindowFromID(windowID); @@ -1541,7 +1541,7 @@ INLINE sdl_window_info * window_from_id(Uint32 windowID) return NULL; } -INLINE void resize_all_windows(void) +static inline void resize_all_windows(void) { sdl_window_info *w; osd_ticks_t now = osd_ticks(); diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp index 683f3369f68..47ab3cdd162 100644 --- a/src/osd/sdl/window.cpp +++ b/src/osd/sdl/window.cpp @@ -146,7 +146,7 @@ static void sdlwindow_sync(void); //============================================================ -INLINE void execute_async(osd_work_callback callback, const worker_param &wp) +static inline void execute_async(osd_work_callback callback, const worker_param &wp) { worker_param *wp_temp = (worker_param *) osd_malloc(sizeof(worker_param)); *wp_temp = wp; @@ -158,7 +158,7 @@ INLINE void execute_async(osd_work_callback callback, const worker_param &wp) callback((void *) wp_temp, 0); } -INLINE void execute_sync(osd_work_callback callback, const worker_param &wp) +static inline void execute_sync(osd_work_callback callback, const worker_param &wp) { worker_param *wp_temp = (worker_param *) osd_malloc(sizeof(worker_param)); *wp_temp = wp; @@ -171,7 +171,7 @@ INLINE void execute_sync(osd_work_callback callback, const worker_param &wp) // execute_async_wait //============================================================ -INLINE void execute_async_wait(osd_work_callback callback, const worker_param &wp) +static inline void execute_async_wait(osd_work_callback callback, const worker_param &wp) { execute_async(callback, wp); sdlwindow_sync(); @@ -380,7 +380,7 @@ void sdl_osd_interface::window_exit() // sdlwindow_blit_surface_size //============================================================ -INLINE int better_mode(int width0, int height0, int width1, int height1, float desired_aspect) +static inline int better_mode(int width0, int height0, int width1, int height1, float desired_aspect) { float aspect0 = (float)width0 / (float)height0; float aspect1 = (float)width1 / (float)height1; diff --git a/src/osd/windows/input.cpp b/src/osd/windows/input.cpp index 0fca59e2fe9..ccfd7b24006 100644 --- a/src/osd/windows/input.cpp +++ b/src/osd/windows/input.cpp @@ -416,7 +416,7 @@ static const key_trans_entry win_key_trans_table[] = // INLINE FUNCTIONS //============================================================ -INLINE void poll_if_necessary(running_machine &machine) +static inline void poll_if_necessary(running_machine &machine) { // make sure we poll at least once every 1/4 second if (GetTickCount() > last_poll + 1000 / 4) @@ -424,7 +424,7 @@ INLINE void poll_if_necessary(running_machine &machine) } -INLINE input_item_id keyboard_map_scancode_to_itemid(int scancode) +static inline input_item_id keyboard_map_scancode_to_itemid(int scancode) { int tablenum; @@ -438,7 +438,7 @@ INLINE input_item_id keyboard_map_scancode_to_itemid(int scancode) } -INLINE INT32 normalize_absolute_axis(INT32 raw, INT32 rawmin, INT32 rawmax) +static inline INT32 normalize_absolute_axis(INT32 raw, INT32 rawmin, INT32 rawmax) { INT32 center = (rawmax + rawmin) / 2; diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h index 0010d2bbd28..62d4f57db55 100644 --- a/src/osd/windows/window.h +++ b/src/osd/windows/window.h @@ -171,13 +171,13 @@ extern int win_create_menu(running_machine &machine, HMENU *menus); // rect_width / rect_height //============================================================ -INLINE int rect_width(const RECT *rect) +static inline int rect_width(const RECT *rect) { return rect->right - rect->left; } -INLINE int rect_height(const RECT *rect) +static inline int rect_height(const RECT *rect) { return rect->bottom - rect->top; } diff --git a/src/osd/windows/winfile.cpp b/src/osd/windows/winfile.cpp index 5c4bd309070..da4b0361591 100644 --- a/src/osd/windows/winfile.cpp +++ b/src/osd/windows/winfile.cpp @@ -33,7 +33,7 @@ static DWORD create_path_recursive(const TCHAR *path); // INLINE FUNCTIONS //============================================================ -INLINE int is_path_to_physical_drive(const char *path) +static inline int is_path_to_physical_drive(const char *path) { return (_strnicmp(path, "\\\\.\\physicaldrive", 17) == 0); } diff --git a/src/tools/imgtool/library.h b/src/tools/imgtool/library.h index 0ea52a68e44..f9b792bc740 100644 --- a/src/tools/imgtool/library.h +++ b/src/tools/imgtool/library.h @@ -297,7 +297,7 @@ union imgtoolinfo -INLINE INT64 imgtool_get_info_int(const imgtool_class *imgclass, UINT32 state) +static inline INT64 imgtool_get_info_int(const imgtool_class *imgclass, UINT32 state) { union imgtoolinfo info; info.i = 0; @@ -305,7 +305,7 @@ INLINE INT64 imgtool_get_info_int(const imgtool_class *imgclass, UINT32 state) return info.i; } -INLINE void *imgtool_get_info_ptr(const imgtool_class *imgclass, UINT32 state) +static inline void *imgtool_get_info_ptr(const imgtool_class *imgclass, UINT32 state) { union imgtoolinfo info; info.p = nullptr; @@ -313,7 +313,7 @@ INLINE void *imgtool_get_info_ptr(const imgtool_class *imgclass, UINT32 state) return info.p; } -INLINE void *imgtool_get_info_fct(const imgtool_class *imgclass, UINT32 state) +static inline void *imgtool_get_info_fct(const imgtool_class *imgclass, UINT32 state) { union imgtoolinfo info; info.f = nullptr; @@ -321,7 +321,7 @@ INLINE void *imgtool_get_info_fct(const imgtool_class *imgclass, UINT32 state) return info.f; } -INLINE char *imgtool_get_info_string(const imgtool_class *imgclass, UINT32 state) +static inline char *imgtool_get_info_string(const imgtool_class *imgclass, UINT32 state) { union imgtoolinfo info; info.s = nullptr; diff --git a/src/tools/imgtool/modules/concept.cpp b/src/tools/imgtool/modules/concept.cpp index a5c5a37b1ad..3da7304c955 100644 --- a/src/tools/imgtool/modules/concept.cpp +++ b/src/tools/imgtool/modules/concept.cpp @@ -30,7 +30,7 @@ struct UINT16xE Returns value of word in native format */ -INLINE UINT16 get_UINT16xE(int little_endian, UINT16xE word) +static inline UINT16 get_UINT16xE(int little_endian, UINT16xE word) { return little_endian ? (word.bytes[0] | (word.bytes[1] << 8)) : ((word.bytes[0] << 8) | word.bytes[1]); } @@ -46,7 +46,7 @@ INLINE UINT16 get_UINT16xE(int little_endian, UINT16xE word) word (O): pointer to word to write data (I): value to write in word, in native format */ -INLINE void set_UINT16xE(int little_endian, UINT16xE *word, UINT16 data) +static inline void set_UINT16xE(int little_endian, UINT16xE *word, UINT16 data) { if (little_endian) { diff --git a/src/tools/imgtool/modules/mac.cpp b/src/tools/imgtool/modules/mac.cpp index 53ae4be3ec0..938a8a19ec5 100644 --- a/src/tools/imgtool/modules/mac.cpp +++ b/src/tools/imgtool/modules/mac.cpp @@ -131,24 +131,24 @@ struct UINT32BE UINT8 bytes[4]; }; -INLINE UINT16 get_UINT16BE(UINT16BE word) +static inline UINT16 get_UINT16BE(UINT16BE word) { return (word.bytes[0] << 8) | word.bytes[1]; } -INLINE void set_UINT16BE(UINT16BE *word, UINT16 data) +static inline void set_UINT16BE(UINT16BE *word, UINT16 data) { word->bytes[0] = (data >> 8) & 0xff; word->bytes[1] = data & 0xff; } #if 0 -INLINE UINT32 get_UINT24BE(UINT24BE word) +static inline UINT32 get_UINT24BE(UINT24BE word) { return (word.bytes[0] << 16) | (word.bytes[1] << 8) | word.bytes[2]; } -INLINE void set_UINT24BE(UINT24BE *word, UINT32 data) +static inline void set_UINT24BE(UINT24BE *word, UINT32 data) { word->bytes[0] = (data >> 16) & 0xff; word->bytes[1] = (data >> 8) & 0xff; @@ -156,12 +156,12 @@ INLINE void set_UINT24BE(UINT24BE *word, UINT32 data) } #endif -INLINE UINT32 get_UINT32BE(UINT32BE word) +static inline UINT32 get_UINT32BE(UINT32BE word) { return (word.bytes[0] << 24) | (word.bytes[1] << 16) | (word.bytes[2] << 8) | word.bytes[3]; } -INLINE void set_UINT32BE(UINT32BE *word, UINT32 data) +static inline void set_UINT32BE(UINT32BE *word, UINT32 data) { word->bytes[0] = (data >> 24) & 0xff; word->bytes[1] = (data >> 16) & 0xff; @@ -583,7 +583,7 @@ static int mac_stricmp(const UINT8 *s1, const UINT8 *s2) Return a zero if s1 and s2 are equal, a negative value if s1 is less than s2, and a positive value if s1 is greater than s2. */ -INLINE void mac_strcpy(UINT8 *dest, const UINT8 *src) +static inline void mac_strcpy(UINT8 *dest, const UINT8 *src) { memcpy(dest, src, src[0]+1); } @@ -704,7 +704,7 @@ static imgtoolerr_t image_write_block(mac_l1_imgref *image, UINT32 block, const Return tag length */ -INLINE int image_get_tag_len(mac_l1_imgref *image) +static inline int image_get_tag_len(mac_l1_imgref *image) { return 0; } diff --git a/src/tools/imgtool/modules/ti99.cpp b/src/tools/imgtool/modules/ti99.cpp index 220cbebdb27..eb72b22c577 100644 --- a/src/tools/imgtool/modules/ti99.cpp +++ b/src/tools/imgtool/modules/ti99.cpp @@ -278,23 +278,23 @@ struct UINT16LE UINT8 bytes[2]; }; -INLINE UINT16 get_UINT16BE(UINT16BE word) +static inline UINT16 get_UINT16BE(UINT16BE word) { return (word.bytes[0] << 8) | word.bytes[1]; } -INLINE void set_UINT16BE(UINT16BE *word, UINT16 data) +static inline void set_UINT16BE(UINT16BE *word, UINT16 data) { word->bytes[0] = (data >> 8) & 0xff; word->bytes[1] = data & 0xff; } -INLINE UINT16 get_UINT16LE(UINT16LE word) +static inline UINT16 get_UINT16LE(UINT16LE word) { return word.bytes[0] | (word.bytes[1] << 8); } -INLINE void set_UINT16LE(UINT16LE *word, UINT16 data) +static inline void set_UINT16LE(UINT16LE *word, UINT16 data) { word->bytes[0] = data & 0xff; word->bytes[1] = (data >> 8) & 0xff; @@ -1081,7 +1081,7 @@ static void close_image_lvl1(ti99_lvl1_imgref *l1_img) Return offset in image */ -INLINE int sector_address_to_image_offset(const ti99_lvl1_imgref *l1_img, const ti99_sector_address *address) +static inline int sector_address_to_image_offset(const ti99_lvl1_imgref *l1_img, const ti99_sector_address *address) { int offset = 0; @@ -2200,7 +2200,7 @@ static int alloc_fdr_AU(struct ti99_lvl2_imgref *l2_img, unsigned *fdr_AU) return IMGTOOLERR_NOSPACE; } -INLINE int get_dsk_fdr_cluster_baseAU(struct ti99_lvl2_imgref *l2_img, dsk_fdr *fdr, int cluster_index) +static inline int get_dsk_fdr_cluster_baseAU(struct ti99_lvl2_imgref *l2_img, dsk_fdr *fdr, int cluster_index) { int reply; @@ -2213,7 +2213,7 @@ INLINE int get_dsk_fdr_cluster_baseAU(struct ti99_lvl2_imgref *l2_img, dsk_fdr * return reply; } -INLINE int get_dsk_fdr_cluster_baseaphysrec(struct ti99_lvl2_imgref *l2_img, dsk_fdr *fdr, int cluster_index) +static inline int get_dsk_fdr_cluster_baseaphysrec(struct ti99_lvl2_imgref *l2_img, dsk_fdr *fdr, int cluster_index) { int reply; @@ -2226,18 +2226,18 @@ INLINE int get_dsk_fdr_cluster_baseaphysrec(struct ti99_lvl2_imgref *l2_img, dsk return reply; } -INLINE int get_dsk_fdr_cluster_lastfphysrec(dsk_fdr *fdr, int cluster_index) +static inline int get_dsk_fdr_cluster_lastfphysrec(dsk_fdr *fdr, int cluster_index) { return (fdr->clusters[cluster_index][2] << 4) | (fdr->clusters[cluster_index][1] >> 4); } -INLINE void set_dsk_fdr_cluster_lastfphysrec(dsk_fdr *fdr, int cluster_index, int data) +static inline void set_dsk_fdr_cluster_lastfphysrec(dsk_fdr *fdr, int cluster_index, int data) { fdr->clusters[cluster_index][1] = (fdr->clusters[cluster_index][1] & 0x0f) | (data << 4); fdr->clusters[cluster_index][2] = data >> 4; } -INLINE void set_dsk_fdr_cluster(struct ti99_lvl2_imgref *l2_img, dsk_fdr *fdr, int cluster_index, int baseAU, int lastfphysrec) +static inline void set_dsk_fdr_cluster(struct ti99_lvl2_imgref *l2_img, dsk_fdr *fdr, int cluster_index, int baseAU, int lastfphysrec) { /* convert AU address to FDR value */ if (l2_img->AUformat.physrecsperAU <= 2) @@ -2249,29 +2249,29 @@ INLINE void set_dsk_fdr_cluster(struct ti99_lvl2_imgref *l2_img, dsk_fdr *fdr, i fdr->clusters[cluster_index][2] = lastfphysrec >> 4; } -INLINE unsigned get_win_fdr_fphysrecs(win_fdr *fdr) +static inline unsigned get_win_fdr_fphysrecs(win_fdr *fdr) { return (((unsigned) fdr->xinfo_MSB << 12) & 0xf0000) | get_UINT16BE(fdr->fphysrecs_LSW); } -INLINE void set_win_fdr_fphysrecs(win_fdr *fdr, unsigned data) +static inline void set_win_fdr_fphysrecs(win_fdr *fdr, unsigned data) { fdr->xinfo_MSB = (fdr->xinfo_MSB & 0x0f) | ((data >> 12) & 0xf0); set_UINT16BE(&fdr->fphysrecs_LSW, data & 0xffff); } -INLINE unsigned get_win_fdr_fixrecs(win_fdr *fdr) +static inline unsigned get_win_fdr_fixrecs(win_fdr *fdr) { return (((unsigned) fdr->xinfo_MSB << 16) & 0xf0000) | get_UINT16LE(fdr->fixrecs_LSW); } -INLINE void set_win_fdr_fixrecs(win_fdr *fdr, unsigned data) +static inline void set_win_fdr_fixrecs(win_fdr *fdr, unsigned data) { fdr->xinfo_MSB = (fdr->xinfo_MSB & 0xf0) | ((data >> 16) & 0x0f); set_UINT16LE(&fdr->fixrecs_LSW, data & 0xffff); } -INLINE unsigned get_win_fdr_prevsibFDR_aphysrec(struct ti99_lvl2_imgref *l2_img, win_fdr *fdr) +static inline unsigned get_win_fdr_prevsibFDR_aphysrec(struct ti99_lvl2_imgref *l2_img, win_fdr *fdr) { unsigned prevsibFDR_AU = get_UINT16BE(fdr->prevsibFDR_AU); @@ -2280,7 +2280,7 @@ INLINE unsigned get_win_fdr_prevsibFDR_aphysrec(struct ti99_lvl2_imgref *l2_img, : 0; } -INLINE unsigned get_win_fdr_nextsibFDR_aphysrec(struct ti99_lvl2_imgref *l2_img, win_fdr *fdr) +static inline unsigned get_win_fdr_nextsibFDR_aphysrec(struct ti99_lvl2_imgref *l2_img, win_fdr *fdr) { unsigned nextsibFDR_AU = get_UINT16BE(fdr->nextsibFDR_AU); @@ -2289,7 +2289,7 @@ INLINE unsigned get_win_fdr_nextsibFDR_aphysrec(struct ti99_lvl2_imgref *l2_img, : 0; } -INLINE unsigned get_win_fdr_cursibFDR_basefphysrec(win_fdr *fdr) +static inline unsigned get_win_fdr_cursibFDR_basefphysrec(win_fdr *fdr) { return get_UINT16BE(fdr->prevsibFDR_AU) ? get_win_fdr_fphysrecs(fdr) : 0; } diff --git a/src/tools/imgtool/modules/ti990hd.cpp b/src/tools/imgtool/modules/ti990hd.cpp index 2c2a6c3a13c..554addb97bd 100644 --- a/src/tools/imgtool/modules/ti990hd.cpp +++ b/src/tools/imgtool/modules/ti990hd.cpp @@ -47,23 +47,23 @@ struct UINT32BE UINT8 bytes[4]; }; -INLINE UINT16 get_UINT16BE(UINT16BE word) +static inline UINT16 get_UINT16BE(UINT16BE word) { return (word.bytes[0] << 8) | word.bytes[1]; } -INLINE void set_UINT16BE(UINT16BE *word, UINT16 data) +static inline void set_UINT16BE(UINT16BE *word, UINT16 data) { word->bytes[0] = (data >> 8) & 0xff; word->bytes[1] = data & 0xff; } -INLINE UINT32 get_UINT32BE(UINT32BE word) +static inline UINT32 get_UINT32BE(UINT32BE word) { return (word.bytes[0] << 24) | (word.bytes[1] << 16) | (word.bytes[2] << 8) | word.bytes[3]; } -INLINE void set_UINT32BE(UINT32BE *word, UINT32 data) +static inline void set_UINT32BE(UINT32BE *word, UINT32 data) { word->bytes[0] = (data >> 24) & 0xff; word->bytes[1] = (data >> 16) & 0xff; diff --git a/src/tools/regrep.cpp b/src/tools/regrep.cpp index 6f5adbf8f22..121ebac6865 100644 --- a/src/tools/regrep.cpp +++ b/src/tools/regrep.cpp @@ -169,7 +169,7 @@ static void append_driver_list_table(const char *header, std::string &dirname, c from a string -------------------------------------------------*/ -INLINE char *trim_string(char *string) +static inline char *trim_string(char *string) { int length; @@ -191,7 +191,7 @@ INLINE char *trim_string(char *string) index for a given entry -------------------------------------------------*/ -INLINE int get_unique_index(const summary_file *curfile, int index) +static inline int get_unique_index(const summary_file *curfile, int index) { int listnum, curindex = 0; -- cgit v1.2.3-70-g09d2