summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-12-30 02:57:38 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-12-30 02:57:38 +0000
commitad010bc54edae64a928533eda09937aa21dbe786 (patch)
treeb2a1df4b048e931e58bff6631ffa278cfadf0240
parent548a251518fbbf7306357eeb7fa058b7c35223d8 (diff)
Fix some errors the 4.4.3 compiler complains about in C++ mode.
-rw-r--r--src/emu/cpu/drcbex64.c22
-rw-r--r--src/lib/util/chd.c2
-rw-r--r--src/mame/video/model3.c2
3 files changed, 17 insertions, 9 deletions
diff --git a/src/emu/cpu/drcbex64.c b/src/emu/cpu/drcbex64.c
index 90b390a66aa..5714065478a 100644
--- a/src/emu/cpu/drcbex64.c
+++ b/src/emu/cpu/drcbex64.c
@@ -3679,6 +3679,7 @@ static x86code *op_getflgs(drcbe_state *drcbe, x86code *dst, const drcuml_instru
static x86code *op_save(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst)
{
drcuml_parameter dstp;
+ int regoffs;
int regnum;
/* validate instruction */
@@ -3707,26 +3708,28 @@ static x86code *op_save(drcbe_state *drcbe, x86code *dst, const drcuml_instructi
emit_mov_m32_r32(&dst, MBD(REG_RCX, offsetof(drcuml_machine_state, exp)), REG_EAX); // mov state->exp,eax
/* copy integer registers */
+ regoffs = offsetof(drcuml_machine_state, r);
for (regnum = 0; regnum < ARRAY_LENGTH(drcbe->state.r); regnum++)
{
if (int_register_map[regnum] != 0)
- emit_mov_m64_r64(&dst, MBD(REG_RCX, offsetof(drcuml_machine_state, r[regnum].d)), int_register_map[regnum]);
+ emit_mov_m64_r64(&dst, MBD(REG_RCX, regoffs + 8 * regnum), int_register_map[regnum]);
else
{
emit_mov_r64_m64(&dst, REG_RAX, MABS(drcbe, &drcbe->state.r[regnum].d));
- emit_mov_m64_r64(&dst, MBD(REG_RCX, offsetof(drcuml_machine_state, r[regnum].d)), REG_RAX);
+ emit_mov_m64_r64(&dst, MBD(REG_RCX, regoffs + 8 * regnum), REG_RAX);
}
}
/* copy FP registers */
+ regoffs = offsetof(drcuml_machine_state, f);
for (regnum = 0; regnum < ARRAY_LENGTH(drcbe->state.f); regnum++)
{
if (float_register_map[regnum] != 0)
- emit_movsd_m64_r128(&dst, MBD(REG_RCX, offsetof(drcuml_machine_state, f[regnum].d)), float_register_map[regnum]);
+ emit_movsd_m64_r128(&dst, MBD(REG_RCX, regoffs + 8 * regnum), float_register_map[regnum]);
else
{
emit_mov_r64_m64(&dst, REG_RAX, MABS(drcbe, &drcbe->state.f[regnum].d));
- emit_mov_m64_r64(&dst, MBD(REG_RCX, offsetof(drcuml_machine_state, f[regnum].d)), REG_RAX);
+ emit_mov_m64_r64(&dst, MBD(REG_RCX, regoffs + 8 * regnum), REG_RAX);
}
}
@@ -3741,6 +3744,7 @@ static x86code *op_save(drcbe_state *drcbe, x86code *dst, const drcuml_instructi
static x86code *op_restore(drcbe_state *drcbe, x86code *dst, const drcuml_instruction *inst)
{
drcuml_parameter dstp;
+ int regoffs;
int regnum;
/* validate instruction */
@@ -3754,25 +3758,27 @@ static x86code *op_restore(drcbe_state *drcbe, x86code *dst, const drcuml_instru
emit_mov_r64_imm(&dst, REG_ECX, dstp.value); // mov rcx,dstp
/* copy integer registers */
+ regoffs = offsetof(drcuml_machine_state, r);
for (regnum = 0; regnum < ARRAY_LENGTH(drcbe->state.r); regnum++)
{
if (int_register_map[regnum] != 0)
- emit_mov_r64_m64(&dst, int_register_map[regnum], MBD(REG_RCX, offsetof(drcuml_machine_state, r[regnum].d)));
+ emit_mov_r64_m64(&dst, int_register_map[regnum], MBD(REG_RCX, regoffs + 8 * regnum));
else
{
- emit_mov_r64_m64(&dst, REG_RAX, MBD(REG_RCX, offsetof(drcuml_machine_state, r[regnum].d)));
+ emit_mov_r64_m64(&dst, REG_RAX, MBD(REG_RCX, regoffs + 8 * regnum));
emit_mov_m64_r64(&dst, MABS(drcbe, &drcbe->state.r[regnum].d), REG_RAX);
}
}
/* copy FP registers */
+ regoffs = offsetof(drcuml_machine_state, f);
for (regnum = 0; regnum < ARRAY_LENGTH(drcbe->state.f); regnum++)
{
if (float_register_map[regnum] != 0)
- emit_movsd_r128_m64(&dst, float_register_map[regnum], MBD(REG_RCX, offsetof(drcuml_machine_state, f[regnum].d)));
+ emit_movsd_r128_m64(&dst, float_register_map[regnum], MBD(REG_RCX, regoffs + 8 * regnum));
else
{
- emit_mov_r64_m64(&dst, REG_RAX, MBD(REG_RCX, offsetof(drcuml_machine_state, f[regnum].d)));
+ emit_mov_r64_m64(&dst, REG_RAX, MBD(REG_RCX, regoffs + 8 * regnum));
emit_mov_m64_r64(&dst, MABS(drcbe, &drcbe->state.f[regnum].d), REG_RAX);
}
}
diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c
index c83f6b81c5f..ef09df83211 100644
--- a/src/lib/util/chd.c
+++ b/src/lib/util/chd.c
@@ -1222,7 +1222,7 @@ chd_error chd_get_metadata(chd_file *chd, UINT32 searchtag, UINT32 searchindex,
chd_error chd_set_metadata(chd_file *chd, UINT32 metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags)
{
UINT8 raw_meta_header[METADATA_HEADER_SIZE];
- metadata_entry metaentry;
+ metadata_entry metaentry = { 0 };
chd_error err;
UINT64 offset;
UINT32 count;
diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c
index ea72b818d54..3731e90c955 100644
--- a/src/mame/video/model3.c
+++ b/src/mame/video/model3.c
@@ -1148,6 +1148,8 @@ static void draw_model(UINT32 addr)
center_x = (float)(viewport_region_x + (viewport_region_width / 2));
center_y = (float)(viewport_region_y + (viewport_region_height / 2));
+ memset(prev_vertex, 0, sizeof(prev_vertex));
+
while (!last_polygon)
{
float texture_coord_scale;