[Scummvm-cvs-logs] CVS: scummvm/scumm script_v6.cpp,1.101,1.102
Marcus Comstedt
marcus_c at users.sourceforge.net
Sun May 4 10:23:37 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: tools .cvsignore,1.3,1.4 README,1.2,1.3 descumm3.dsp,1.4,NONE descumm5.dsp,1.4,NONE
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.76,2.77 script_v2.cpp,2.43,2.44
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv9093
Modified Files:
script_v6.cpp
Log Message:
GCC believes that if we cast a pointer to <type *>, then we are guaranteeing
that the pointer has proper alignment for <type>, and that it can replace the
memcpy() with a direct assignment. This totally defies the purpose of the
memcpy(), which is there precisely because the memory is unaligned. Avoid
problems by not making the cast.
Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- script_v6.cpp 30 Apr 2003 13:23:30 -0000 1.101
+++ script_v6.cpp 4 May 2003 17:21:31 -0000 1.102
@@ -425,14 +425,14 @@
} else if (_features & GF_AFTER_V8) {
#if defined(SCUMM_NEED_ALIGNMENT)
uint32 tmp = TO_LE_32(value);
- memcpy(&((uint32 *)ah->data)[base], &tmp, 4);
+ memcpy(&((char *)ah->data)[base*sizeof(uint32)], &tmp, 4);
#else
((uint32 *)ah->data)[base] = TO_LE_32(value);
#endif
} else {
#if defined(SCUMM_NEED_ALIGNMENT)
uint16 tmp = TO_LE_16(value);
- memcpy(&((uint16 *)ah->data)[base], &tmp, 2);
+ memcpy(&((char *)ah->data)[base*sizeof(uint16)], &tmp, 2);
#else
((uint16 *)ah->data)[base] = TO_LE_16(value);
#endif
- Previous message: [Scummvm-cvs-logs] CVS: tools .cvsignore,1.3,1.4 README,1.2,1.3 descumm3.dsp,1.4,NONE descumm5.dsp,1.4,NONE
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.76,2.77 script_v2.cpp,2.43,2.44
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list