[Scummvm-cvs-logs] CVS: scummvm akos.cpp,1.2,1.3 object.cpp,1.16,1.17

Ludvig Strigeus strigeus at users.sourceforge.net
Mon Dec 3 03:50:01 CET 2001


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv14703

Modified Files:
	akos.cpp object.cpp 
Log Message:
Fixed a couple of alignment issues

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/akos.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** akos.cpp	2001/11/27 17:56:04	1.2
--- akos.cpp	2001/12/03 11:49:06	1.3
***************
*** 123,127 ****
  
  	akpl = findResource(MKID('AKPL'), ar->akos);
! 	size = READ_BE_UINT32(akpl+4) - 8;
  	akpl += 8;
  
--- 123,127 ----
  
  	akpl = findResource(MKID('AKPL'), ar->akos);
! 	size = READ_BE_UINT32_UNALIGNED(akpl+4) - 8;
  	akpl += 8;
  
***************
*** 184,188 ****
  		off = ar->akof + (code & 0xFFF);
  
! 		assert( (code & 0xFFF)*6 < READ_BE_UINT32((byte*)ar->akof - 4)-8 );
  
  		assert( (code&0x7000) == 0);
--- 184,188 ----
  		off = ar->akof + (code & 0xFFF);
  
! 		assert( (code & 0xFFF)*6 < READ_BE_UINT32_UNALIGNED((byte*)ar->akof - 4)-8 );
  
  		assert( (code&0x7000) == 0);
***************
*** 470,474 ****
  
  	/* Setup color decoding variables */
! 	num_colors = READ_BE_UINT32(ar->akpl-4)-8;
  	if (num_colors == 32) {
  		ar->v1.mask = (1<<3)-1;
--- 470,474 ----
  
  	/* Setup color decoding variables */
! 	num_colors = READ_BE_UINT32_UNALIGNED(ar->akpl-4)-8;
  	if (num_colors == 32) {
  		ar->v1.mask = (1<<3)-1;
***************
*** 768,772 ****
  	size = 0;
  	if (akfo) {
! 		size = (READ_BE_UINT32(akfo)-8)>>1;
  		akfo += 8;
  	}	
--- 768,772 ----
  	size = 0;
  	if (akfo) {
! 		size = (READ_BE_UINT32_UNALIGNED(akfo)-8)>>1;
  		akfo += 8;
  	}	
***************
*** 1040,1042 ****
  
  
! #endif
\ No newline at end of file
--- 1040,1042 ----
  
  
! #endif

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/object.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** object.cpp	2001/11/27 17:56:04	1.16
--- object.cpp	2001/12/03 11:49:06	1.17
***************
*** 622,626 ****
  		fo->obcd = obcdptr = getObjectAddress(id);
  		assert((byte*)obcdptr > (byte*)256);
! 		fo->obim = obimptr = obcdptr + READ_BE_UINT32(&((ImageHeader*)obcdptr)->size);
  		fo->cdhd = (CodeHeader*)findResource(MKID('CDHD'), obcdptr);
  		fo->imhd = (ImageHeader*)findResource(MKID('IMHD'), obimptr);
--- 622,626 ----
  		fo->obcd = obcdptr = getObjectAddress(id);
  		assert((byte*)obcdptr > (byte*)256);
! 		fo->obim = obimptr = obcdptr + READ_BE_UINT32_UNALIGNED(&((ImageHeader*)obcdptr)->size);
  		fo->cdhd = (CodeHeader*)findResource(MKID('CDHD'), obcdptr);
  		fo->imhd = (ImageHeader*)findResource(MKID('IMHD'), obimptr);
***************
*** 842,846 ****
  		error("setCursorImg: No such image");
  
! 	size = READ_BE_UINT32(dataptr+4);
  	if (size > sizeof(_grabbedCursor))
  		error("setCursorImg: Cursor image too large");
--- 842,846 ----
  		error("setCursorImg: No such image");
  
! 	size = READ_BE_UINT32_UNALIGNED(dataptr+4);
  	if (size > sizeof(_grabbedCursor))
  		error("setCursorImg: Cursor image too large");
***************
*** 1015,1022 ****
  
  	/* Setup sizes */
! 	obcd_size = READ_BE_UINT32(foir.obcd + 4);
  	od->offs_obcd_to_room = 8;
  	od->offs_obim_to_room = obcd_size + 8;
! 	obim_size = READ_BE_UINT32(foir.obim + 4);
  	flob_size = obcd_size + obim_size + 8;
  
--- 1015,1022 ----
  
  	/* Setup sizes */
! 	obcd_size = READ_BE_UINT32_UNALIGNED(foir.obcd + 4);
  	od->offs_obcd_to_room = 8;
  	od->offs_obim_to_room = obcd_size + 8;
! 	obim_size = READ_BE_UINT32_UNALIGNED(foir.obim + 4);
  	flob_size = obcd_size + obim_size + 8;
  





More information about the Scummvm-git-logs mailing list