compile fixes for GCC5.1.1 win64 and CPP11 mode.. requested by mingw team to test LTO fixes. please add #ifdefs if 64 bit printf does not work for you

This commit is contained in:
Cowering 2015-05-28 17:03:36 -05:00
parent e2f8eed5b6
commit 4332164659
14 changed files with 70 additions and 44 deletions

View File

@ -1318,7 +1318,12 @@ void ns_mgr_free(struct ns_mgr *s) {
#define STR(x) STRX(x)
#define __func__ __FILE__ ":" STR(__LINE__)
#endif
// find proper defines for this for VS and other compilers
#if defined(__USE_MINGW_ANSI_STDIO)
#define INT64_FMT "lld"
#else
#define INT64_FMT "I64d"
#endif
#define flockfile(x) ((void) (x))
#define funlockfile(x) ((void) (x))
typedef struct _stati64 file_stat_t;
@ -2477,7 +2482,7 @@ int mg_url_decode(const char *src, size_t src_len, char *dst,
static int is_valid_http_method(const char *s) {
return !strcmp(s, "GET") || !strcmp(s, "POST") || !strcmp(s, "HEAD") ||
!strcmp(s, "CONNECT") || !strcmp(s, "PUT") || !strcmp(s, "DELETE") ||
!strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL") ||
!strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL") ||
!strcmp(s, "PATCH");
}

View File

@ -30,7 +30,7 @@ typedef struct {
} prom_load_t;
#define ZERO 0
#define KEEP ~0
#define KEEP ~0U
#define AMAP_DEFAULT {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
#define AMAP_CONST_PROM {3,2,1,4,5,6,7,0,}

View File

@ -835,7 +835,7 @@ static const INT32 immediate_values[32] =
{
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 0, 0, 0, 32, 64, 128, 0x80000000,
16, 0, 0, 0, 32, 64, 128, -2147483648 /*0x80000000 */,
-8, -7, -6, -5, -4, -3, -2, -1
};

View File

@ -139,7 +139,7 @@ static const code_string_table devclass_token_table[] =
{ DEVICE_CLASS_MOUSE, "MOUSECODE" },
{ DEVICE_CLASS_LIGHTGUN, "GUNCODE" },
{ DEVICE_CLASS_JOYSTICK, "JOYCODE" },
{ ~0, "UNKCODE" }
{ ~0U, "UNKCODE" }
};
// friendly strings for device classes
@ -149,7 +149,7 @@ static const code_string_table devclass_string_table[] =
{ DEVICE_CLASS_MOUSE, "Mouse" },
{ DEVICE_CLASS_LIGHTGUN, "Gun" },
{ DEVICE_CLASS_JOYSTICK, "Joy" },
{ ~0, "Unk" }
{ ~0U, "Unk" }
};
// token strings for item modifiers
@ -161,7 +161,7 @@ static const code_string_table modifier_token_table[] =
{ ITEM_MODIFIER_RIGHT, "RIGHT" },
{ ITEM_MODIFIER_UP, "UP" },
{ ITEM_MODIFIER_DOWN, "DOWN" },
{ ~0, "" }
{ ~0U, "" }
};
// friendly strings for item modifiers
@ -173,7 +173,7 @@ static const code_string_table modifier_string_table[] =
{ ITEM_MODIFIER_RIGHT, "Right" },
{ ITEM_MODIFIER_UP, "Up" },
{ ITEM_MODIFIER_DOWN, "Down" },
{ ~0, "" }
{ ~0U, "" }
};
// token strings for item classes
@ -182,7 +182,7 @@ static const code_string_table itemclass_token_table[] =
{ ITEM_CLASS_SWITCH, "SWITCH" },
{ ITEM_CLASS_ABSOLUTE, "ABSOLUTE" },
{ ITEM_CLASS_RELATIVE, "RELATIVE" },
{ ~0, "" }
{ ~0U, "" }
};
// token strings for standard item ids
@ -411,7 +411,7 @@ static const code_string_table itemid_token_table[] =
{ ITEM_ID_ADD_RELATIVE15,"ADDREL15" },
{ ITEM_ID_ADD_RELATIVE16,"ADDREL16" },
{ ~0, NULL }
{ ~0U, NULL }
};

View File

@ -28,8 +28,8 @@
*************************************/
// FIXME
//#undef I64FMT
//#define I64FMT "ll"
#undef I64FMT
#define I64FMT "ll"
DISCRETE_START( dso_csvlog )

View File

@ -344,7 +344,7 @@ static const int slot_array[32]=
/* table is 3dB/octave , DV converts this into 6dB/octave */
/* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */
#define DV (0.1875/2.0)
static const UINT32 ksl_tab[8*16]=
static const double ksl_tab[8*16]=
{
/* OCT 0 */
0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
@ -511,7 +511,7 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),
/* multiple table */
#define ML 2
static const UINT8 mul_tab[16]= {
static const double mul_tab[16]= {
/* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */
0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML,
8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML
@ -1299,7 +1299,7 @@ static void OPL_initalize(FM_OPL *OPL)
logerror("FMOPL.C: ksl_tab[oct=%2i] =",i);
for (j=0; j<16; j++)
{
logerror("%08x ", ksl_tab[i*16+j] );
logerror("%08x ", (UINT32) ksl_tab[i*16+j] );
}
logerror("\n");
}
@ -1388,7 +1388,7 @@ 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];
SLOT->mul = mul_tab[v&0x0f];
SLOT->mul = (UINT8)mul_tab[v&0x0f];
SLOT->KSR = (v&0x10) ? 0 : 2;
SLOT->eg_type = (v&0x20);
SLOT->vib = (v&0x40);
@ -1674,7 +1674,7 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
CH->block_fnum = block_fnum;
CH->ksl_base = ksl_tab[block_fnum>>6];
CH->ksl_base = (UINT32) ksl_tab[block_fnum>>6];
CH->fc = OPL->fn_tab[block_fnum&0x03ff] >> (7-block);
/* BLK 2,1,0 bits -> bits 3,2,1 of kcode */

View File

@ -280,7 +280,7 @@ struct YM2413
/* table is 3dB/octave, DV converts this into 6dB/octave */
/* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */
#define DV (0.1875/1.0)
static const UINT32 ksl_tab[8*16]=
static const double ksl_tab[8*16]=
{
/* OCT 0 */
0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
@ -447,7 +447,7 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),
/* multiple table */
#define ML 2
static const UINT8 mul_tab[16]= {
static const double mul_tab[16]= {
/* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */
0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML,
8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML
@ -1367,7 +1367,7 @@ static void OPLL_initalize(YM2413 *chip, device_t *device)
logerror("ym2413.c: ksl_tab[oct=%2i] =",i);
for (j=0; j<16; j++)
{
logerror("%08x ", ksl_tab[i*16+j] );
logerror("%08x ", (UINT32)ksl_tab[i*16+j] );
}
logerror("\n");
}
@ -1470,7 +1470,7 @@ 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];
SLOT->mul = mul_tab[v&0x0f];
SLOT->mul = (UINT8)mul_tab[v&0x0f];
SLOT->KSR = (v&0x10) ? 0 : 2;
SLOT->eg_type = (v&0x20);
SLOT->vib = (v&0x40);
@ -1839,7 +1839,7 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v)
/* BLK 2,1,0 bits -> bits 3,2,1 of kcode, FNUM MSB -> kcode LSB */
CH->kcode = (block_fnum&0x0f00)>>8;
CH->ksl_base = ksl_tab[block_fnum>>5];
CH->ksl_base = (UINT32) ksl_tab[block_fnum>>5];
block_fnum = block_fnum * 2;
block = (block_fnum&0x1c00) >> 10;

View File

@ -297,7 +297,7 @@ static const int slot_array[32]=
/* table is 3dB/octave , DV converts this into 6dB/octave */
/* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */
#define DV (0.1875/2.0)
static const UINT32 ksl_tab[8*16]=
static const double ksl_tab[8*16]=
{
/* OCT 0 */
0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
@ -464,7 +464,7 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),
/* multiple table */
#define ML 2
static const UINT8 mul_tab[16]= {
static const double mul_tab[16]= {
/* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */
0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML,
8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML
@ -1345,7 +1345,7 @@ static void OPL3_initalize(OPL3 *chip)
logerror("YMF262.C: ksl_tab[oct=%2i] =",i);
for (j=0; j<16; j++)
{
logerror("%08x ", ksl_tab[i*16+j] );
logerror("%08x ", (UINT32) ksl_tab[i*16+j] );
}
logerror("\n");
}
@ -1438,7 +1438,7 @@ 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];
SLOT->mul = mul_tab[v&0x0f];
SLOT->mul = (UINT8)mul_tab[v&0x0f];
SLOT->KSR = (v&0x10) ? 0 : 2;
SLOT->eg_type = (v&0x20);
SLOT->vib = (v&0x40);
@ -1959,7 +1959,7 @@ static void OPL3WriteReg(OPL3 *chip, int r, int v)
CH->block_fnum = block_fnum;
CH->ksl_base = ksl_tab[block_fnum>>6];
CH->ksl_base = (UINT32) ksl_tab[block_fnum>>6];
CH->fc = chip->fn_tab[block_fnum&0x03ff] >> (7-block);
/* BLK 2,1,0 bits -> bits 3,2,1 of kcode */

View File

@ -16,6 +16,7 @@
#include <string.h>
#include <assert.h>
#include "pool.h"
#include "flopimg.h"
#define BUFSZ 512 // new input buffer
@ -95,13 +96,28 @@ struct td0dsk_t
struct floppy_image_legacy
{
struct io_generic io;
const struct FloppyFormat *floppy_option;
struct FloppyCallbacks format;
/* loaded track stuff */
int loaded_track_head;
int loaded_track_index;
UINT32 loaded_track_size;
void *loaded_track_data;
UINT8 loaded_track_status;
UINT8 flags;
/* tagging system */
object_pool *tags;
void *tag_data;
};
static struct td0dsk_tag *get_tag(floppy_image_legacy *floppy)
{
struct td0dsk_tag *tag;
tag = (td0dsk_tag *)floppy_tag(floppy);
tag = (td0dsk_tag *)floppy_tag((floppy_image_legacy *)floppy);
return tag;
}

View File

@ -40,7 +40,7 @@
static const int IKBD_MOUSE_XYA[3][4] = { { 0, 0, 0, 0 }, { 1, 1, 0, 0 }, { 0, 1, 1, 0 } };
static const int IKBD_MOUSE_XYB[3][4] = { { 0, 0, 0, 0 }, { 0, 1, 1, 0 }, { 1, 1, 0, 0 } };
static const int DMASOUND_RATE[] = { Y2/640/8, Y2/640/4, Y2/640/2, Y2/640 };
static const int DMASOUND_RATE[] = { (int)(Y2/640/8), (int)(Y2/640/4), (int)(Y2/640/2), (int)(Y2/640) };
//**************************************************************************
@ -1927,7 +1927,6 @@ void st_state::state_save()
save_item(NAME(m_acia_midi_irq));
}
//-------------------------------------------------
// MACHINE_START( st )
//-------------------------------------------------

View File

@ -72,7 +72,8 @@ public:
DECLARE_READ8_MEMBER(nascom1_port_01_r);
DECLARE_WRITE8_MEMBER(nascom1_port_01_w);
DECLARE_READ8_MEMBER(nascom1_port_02_r);
virtual DECLARE_DRIVER_INIT(nascom);
// FIXME
/*virtual*/ DECLARE_DRIVER_INIT(nascom);
void screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect, int char_height);
DECLARE_READ8_MEMBER(nascom1_hd6402_si);
DECLARE_WRITE8_MEMBER(nascom1_hd6402_so);
@ -112,9 +113,9 @@ public:
DECLARE_WRITE_LINE_MEMBER(ram_disable_w);
DECLARE_WRITE_LINE_MEMBER(ram_disable_cpm_w);
virtual DECLARE_DRIVER_INIT(nascom);
virtual DECLARE_DRIVER_INIT(nascomc);
// FIXME
/*virtual*/ DECLARE_DRIVER_INIT(nascom);
/*virtual*/ DECLARE_DRIVER_INIT(nascomc);
UINT32 screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
int load_cart(device_image_interface &image, generic_slot_device *slot, int slot_id);

View File

@ -910,30 +910,30 @@ static const UINT8 smc777_keytable[2][0xa0] =
{
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* numpad */
0x38, 0x39, 0x2f, 0x2a, 0x2d, 0x2b, 0x0d, 0x2e,
-1, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* A - G */
0xff, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* A - G */
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* H - O */
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* P - W */
0x78, 0x79, 0x7a, 0x2d, 0x5d, 0x60, -1, -1, /* X - Z */
0x78, 0x79, 0x7a, 0x2d, 0x5d, 0x60, 0xff, 0xff, /* X - Z */
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0 - 7*/
0x38, 0x39, 0x3b, 0x5c, 0x2c, 0x2e, 0x2f, -1, /* 8 - 9 */
0x0d, 0x20, 0x08, 0x09, 0x1b, 0x0f, 0x11, -1,
0x38, 0x39, 0x3b, 0x5c, 0x2c, 0x2e, 0x2f, 0xff, /* 8 - 9 */
0x0d, 0x20, 0x08, 0x09, 0x1b, 0x0f, 0x11, 0xff,
0x17, 0x1c, 0x16, 0x19, 0x14, 0x0e, 0x12, 0x03,
0x01, 0x02, 0x04, 0x06, 0x0b, -1, -1, -1,
0x01, 0x02, 0x04, 0x06, 0x0b, 0xff, 0xff, 0xff,
},
/* shift */
{
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* numpad */
0x38, 0x39, 0x2f, 0x2a, 0x2d, 0x2b, 0x0d, 0x2e,
-1, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0xff, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* H - O */
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* P - W */
0x58, 0x59, 0x5a, 0x5f, 0x7d, 0x7e, -1, -1, /* X - Z */
0x58, 0x59, 0x5a, 0x5f, 0x7d, 0x7e, 0xff, 0xff, /* X - Z */
0x29, 0x21, 0x40, 0x23, 0x24, 0x25, 0x5e, 0x26,
0x2a, 0x28, 0x3a, 0x7c, 0x3c, 0x3e, 0x3f, -1,
0x0d, 0x20, 0x08, 0x09, 0x1b, 0x0f, 0x11, -1,
0x2a, 0x28, 0x3a, 0x7c, 0x3c, 0x3e, 0x3f, 0xff,
0x0d, 0x20, 0x08, 0x09, 0x1b, 0x0f, 0x11, 0xff,
0x17, 0x1c, 0x16, 0x19, 0x14, 0x0e, 0x12, 0x03,
0x15, 0x18, 0x12, 0x05, 0x03, -1, -1, -1, /* F1 - F5 */
0x15, 0x18, 0x12, 0x05, 0x03, 0xff, 0xff, 0xff, /* F1 - F5 */
}
};

View File

@ -332,7 +332,8 @@ public:
int m_monochrome;
required_device<palette_device> m_palette;
virtual DECLARE_WRITE_LINE_MEMBER( write_monochrome );
// make GCC 5.1 happy.. FIXME
/*virtual*/ DECLARE_WRITE_LINE_MEMBER( write_monochrome );
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);

View File

@ -39,7 +39,9 @@ extern int drawnone_init(running_machine &machine, osd_draw_callbacks *callbacks
extern int drawgdi_init(running_machine &machine, osd_draw_callbacks *callbacks);
extern int drawdd_init(running_machine &machine, osd_draw_callbacks *callbacks);
extern int drawd3d_init(running_machine &machine, osd_draw_callbacks *callbacks);
#if defined(USE_BGFX)
extern int drawbgfx_init(running_machine &machine, osd_draw_callbacks *callbacks);
#endif
#if (USE_OPENGL)
extern int drawogl_init(running_machine &machine, osd_draw_callbacks *callbacks);
#endif
@ -227,8 +229,10 @@ bool windows_osd_interface::window_init()
}
if (video_config.mode == VIDEO_MODE_GDI)
drawgdi_init(machine(), &draw);
#if defined(USE_BGFX)
if (video_config.mode == VIDEO_MODE_BGFX)
drawbgfx_init(machine(), &draw);
#endif
if (video_config.mode == VIDEO_MODE_NONE)
drawnone_init(machine(), &draw);
#if (USE_OPENGL)