From: Frode Solheim Date: Wed, 23 Sep 2015 20:38:39 +0000 (+0200) Subject: Trivial compilation warning fixes (logging, const, static) X-Git-Tag: 3200~53^2~4 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=d0dffcf102ddb47167e97e03c34f0be2227f5317;p=francis%2Fwinuae.git Trivial compilation warning fixes (logging, const, static) --- diff --git a/a2091.cpp b/a2091.cpp index 6340bbcf..e8bbb27c 100644 --- a/a2091.cpp +++ b/a2091.cpp @@ -1846,7 +1846,7 @@ static void a2090_st506(struct wd_state *wd, uae_u8 b) } uaecptr cbp = wd->cdmac.c8727_st506_cb << 9; if (!valid_address(cbp, 16)) { - write_log(_T("Invalid ST-506 command block address %08x\n"), cb); + write_log(_T("Invalid ST-506 command block address %08x\n"), cbp); return; } for (int i = 0; i < sizeof cb; i++) { diff --git a/cia.cpp b/cia.cpp index e78c3cde..5ae61a5a 100644 --- a/cia.cpp +++ b/cia.cpp @@ -612,7 +612,7 @@ static void do_tod_hack (int dotod) if (rate <= 0) return; if (rate != oldrate || (ciaatod & 0xfff) != (tod_hack_tod_last & 0xfff)) { - write_log (_T("TOD HACK reset %d,%d %d,%d\n"), rate, oldrate, ciaatod, tod_hack_tod_last); + write_log (_T("TOD HACK reset %d,%d %ld,%lld\n"), rate, oldrate, ciaatod, tod_hack_tod_last); tod_hack_reset (); oldrate = rate; docount = 1; diff --git a/disk.cpp b/disk.cpp index ddd89aaf..7446e106 100644 --- a/disk.cpp +++ b/disk.cpp @@ -1066,7 +1066,7 @@ static void update_disk_statusline(int num) drive *drv = &floppy[num]; if (!drv->diskfile) return; - TCHAR *fname = zfile_getoriginalname(drv->diskfile); + const TCHAR *fname = zfile_getoriginalname(drv->diskfile); if (!fname) fname = zfile_getname(drv->diskfile); if (!fname) @@ -2955,7 +2955,7 @@ void DISK_select (uae_u8 data) if ((prev_data & 0x04) != (data & 0x04)) write_log (_T(" side %d "), (data & 0x04) ? 1 : 0); } else { - write_log (_T(" %d%d%d%d% "), (selected & 1) ? 0 : 1, (selected & 2) ? 0 : 1, (selected & 4) ? 0 : 1, (selected & 8) ? 0 : 1); + write_log (_T(" %d%d%d%d "), (selected & 1) ? 0 : 1, (selected & 2) ? 0 : 1, (selected & 4) ? 0 : 1, (selected & 8) ? 0 : 1); if ((prev_data & 0x80) != (data & 0x80)) write_log (_T(" dskmotor %d "), (data & 0x80) ? 1 : 0); if ((prev_data & 0x02) != (data & 0x02)) @@ -4694,7 +4694,7 @@ int disk_prevnext (int drive, int dir) return 1; } -int getdebug(void) +static int getdebug(void) { return floppy[0].mfmpos; } diff --git a/gfxboard.cpp b/gfxboard.cpp index 99f97da2..b7f15a81 100644 --- a/gfxboard.cpp +++ b/gfxboard.cpp @@ -83,8 +83,8 @@ static bool memlogw = false; struct gfxboard { const TCHAR *name; - TCHAR *manufacturername; - TCHAR *configname; + const TCHAR *manufacturername; + const TCHAR *configname; int manufacturer; int model_memory; int model_registers; diff --git a/idecontrollers.cpp b/idecontrollers.cpp index 717be7f7..a0f724d7 100644 --- a/idecontrollers.cpp +++ b/idecontrollers.cpp @@ -1462,7 +1462,7 @@ static addrbank *x86_at_hd_init(struct romconfig *rc, int type) ide->configured = 1; ide->bank = &ide_bank_generic; - struct zfile *f = read_device_from_romconfig(rc, NULL); + struct zfile *f = read_device_from_romconfig(rc, 0); if (f) { x86_xt_ide_bios(f, rc); zfile_fclose(f); diff --git a/include/ide.h b/include/ide.h index 4807b648..e65d8ff6 100644 --- a/include/ide.h +++ b/include/ide.h @@ -134,28 +134,28 @@ uae_u8 *ide_save_state(uae_u8 *dst, struct ide_hdf *ide); uae_u8 *ide_restore_state(uae_u8 *src, struct ide_hdf *ide); #define IDE_MEMORY_FUNCTIONS(x, y, z) \ -void REGPARAM2 x ## _bput(uaecptr addr, uae_u32 b) \ +static void REGPARAM2 x ## _bput(uaecptr addr, uae_u32 b) \ { \ y ## _write_byte(z, addr, b); \ } \ -void REGPARAM2 x ## _wput(uaecptr addr, uae_u32 b) \ +static void REGPARAM2 x ## _wput(uaecptr addr, uae_u32 b) \ { \ y ## _write_word(z, addr, b); \ } \ -void REGPARAM2 x ## _lput(uaecptr addr, uae_u32 b) \ +static void REGPARAM2 x ## _lput(uaecptr addr, uae_u32 b) \ { \ y ## _write_word(z, addr, b >> 16); \ y ## _write_word(z, addr + 2, b); \ } \ -uae_u32 REGPARAM2 x ## _bget(uaecptr addr) \ +static uae_u32 REGPARAM2 x ## _bget(uaecptr addr) \ { \ return y ## _read_byte(z, addr); \ } \ -uae_u32 REGPARAM2 x ## _wget(uaecptr addr) \ +static uae_u32 REGPARAM2 x ## _wget(uaecptr addr) \ { \ return y ## _read_word(z, addr); \ } \ -uae_u32 REGPARAM2 x ## _lget(uaecptr addr) \ +static uae_u32 REGPARAM2 x ## _lget(uaecptr addr) \ { \ uae_u32 v = y ## _read_word(z, addr) << 16; \ v |= y ## _read_word(z, addr + 2); \ diff --git a/mame/a2410.cpp b/mame/a2410.cpp index 6960ced0..fd7a67e0 100644 --- a/mame/a2410.cpp +++ b/mame/a2410.cpp @@ -17,6 +17,7 @@ #include "picasso96.h" #include "statusline.h" #include "newcpu.h" +#include "gfxboard.h" static int tms_vp, tms_hp; rectangle tms_rectangle; diff --git a/ncr9x_scsi.cpp b/ncr9x_scsi.cpp index a0904ce0..a53d121c 100644 --- a/ncr9x_scsi.cpp +++ b/ncr9x_scsi.cpp @@ -1344,7 +1344,7 @@ static uae_u32 REGPARAM2 ncr9x_generic_lget (uaecptr addr) return ncr9x_lget(ncr, addr); return 0; } -uae_u8 *REGPARAM2 ncr9x_generic_xlate(uaecptr addr) +static uae_u8 *REGPARAM2 ncr9x_generic_xlate(uaecptr addr) { struct ncr9x_state *ncr = getscsiboard(addr); if (!ncr) @@ -1353,7 +1353,7 @@ uae_u8 *REGPARAM2 ncr9x_generic_xlate(uaecptr addr) return ncr->rom + addr; } -int REGPARAM2 ncr9x_generic_check(uaecptr a, uae_u32 b) +static int REGPARAM2 ncr9x_generic_check(uaecptr a, uae_u32 b) { struct ncr9x_state *ncr = getscsiboard(a); if (!ncr) diff --git a/newcpu.cpp b/newcpu.cpp index 079f8116..9e4e4768 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -1557,7 +1557,7 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode else _stprintf (offtxt, _T("$%04x"), disp16); addr = m68k_areg (regs, reg) + disp16; - _stprintf (buffer, _T("(A%d, %s) == $%08x"), reg, offtxt, (unsigned long)addr); + _stprintf (buffer, _T("(A%d, %s) == $%08x"), reg, offtxt, addr); } break; case Ad8r: @@ -1601,7 +1601,7 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode case PC16: disp16 = get_iword_debug (pc); pc += 2; addr += (uae_s16)disp16; - _stprintf (buffer, _T("(PC,$%04x) == $%08x"), disp16 & 0xffff, (unsigned long)addr); + _stprintf (buffer, _T("(PC,$%04x) == $%08x"), disp16 & 0xffff, addr); break; case PC8r: dp = get_iword_debug (pc); pc += 2; @@ -3984,7 +3984,7 @@ static void m68k_run_1_ce (void) cont: if (cputrace.needendcycles) { cputrace.needendcycles = 0; - write_log (_T("STARTCYCLES=%08x ENDCYCLES=%08x\n"), cputrace.startcycles, get_cycles ()); + write_log (_T("STARTCYCLES=%08x ENDCYCLES=%08lx\n"), cputrace.startcycles, get_cycles ()); log_dma_record (); }