[Scummvm-cvs-logs] SF.net SVN: scummvm: [28945] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Sep 18 22:16:33 CEST 2007


Revision: 28945
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28945&view=rev
Author:   fingolfin
Date:     2007-09-18 13:16:33 -0700 (Tue, 18 Sep 2007)

Log Message:
-----------
Code formatting fixes

Modified Paths:
--------------
    scummvm/trunk/backends/fs/dc/dc-fs.cpp
    scummvm/trunk/backends/fs/gp32/gp32-fs.cpp
    scummvm/trunk/backends/fs/palmos/palmos-fs.cpp
    scummvm/trunk/backends/fs/posix/posix-fs.cpp
    scummvm/trunk/backends/fs/symbian/symbian-fs.cpp
    scummvm/trunk/backends/platform/PalmOS/Src/args.cpp
    scummvm/trunk/backends/platform/PalmOS/Src/base_event.cpp
    scummvm/trunk/backends/platform/PalmOS/Src/base_gfx.cpp
    scummvm/trunk/backends/platform/PalmOS/Src/extend.cpp
    scummvm/trunk/backends/platform/PalmOS/Src/init_sony.cpp
    scummvm/trunk/backends/platform/PalmOS/Src/os5_mouse.cpp
    scummvm/trunk/backends/platform/PalmOS/Src/snd_pa1.cpp
    scummvm/trunk/backends/platform/dc/audio.cpp
    scummvm/trunk/backends/platform/dc/dcloader.cpp
    scummvm/trunk/backends/platform/dc/dcmain.cpp
    scummvm/trunk/backends/platform/dc/display.cpp
    scummvm/trunk/backends/platform/dc/icon.cpp
    scummvm/trunk/backends/platform/dc/input.cpp
    scummvm/trunk/backends/platform/dc/label.cpp
    scummvm/trunk/backends/platform/dc/selector.cpp
    scummvm/trunk/backends/platform/dc/softkbd.cpp
    scummvm/trunk/backends/platform/dc/time.cpp
    scummvm/trunk/backends/platform/dc/vmsave.cpp
    scummvm/trunk/backends/platform/ds/arm7/source/main.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/blitters.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/compressor/lz.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
    scummvm/trunk/backends/platform/gp2x/events.cpp
    scummvm/trunk/backends/platform/gp2x/gp2x-hw.cpp
    scummvm/trunk/backends/platform/gp32/debug-gdbstub-usb.cpp
    scummvm/trunk/backends/platform/gp32/gp32std_input.cpp
    scummvm/trunk/backends/platform/gp32/gp32std_memory.cpp
    scummvm/trunk/backends/platform/psp/osys_psp.cpp
    scummvm/trunk/backends/platform/psp/osys_psp_gu.cpp
    scummvm/trunk/backends/platform/psp/trace.cpp
    scummvm/trunk/backends/platform/symbian/src/ScummVMApp.cpp
    scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp
    scummvm/trunk/backends/platform/wince/missing/missing.cpp
    scummvm/trunk/backends/platform/wince/wince-sdl.cpp
    scummvm/trunk/backends/saves/compressed/compressed-saves.cpp
    scummvm/trunk/base/commandLine.cpp
    scummvm/trunk/common/file.cpp
    scummvm/trunk/common/fs.cpp
    scummvm/trunk/common/md5.cpp
    scummvm/trunk/engines/agi/op_cmd.cpp
    scummvm/trunk/engines/agi/picture.cpp
    scummvm/trunk/engines/agi/preagi_winnie.cpp
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/agos/items.cpp
    scummvm/trunk/engines/agos/saveload.cpp
    scummvm/trunk/engines/cruise/background.cpp
    scummvm/trunk/engines/cruise/backgroundIncrust.cpp
    scummvm/trunk/engines/cruise/cell.cpp
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/ctp.cpp
    scummvm/trunk/engines/cruise/decompiler.cpp
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/gfxModule.cpp
    scummvm/trunk/engines/cruise/mainDraw.cpp
    scummvm/trunk/engines/cruise/menu.cpp
    scummvm/trunk/engines/cruise/mouse.cpp
    scummvm/trunk/engines/cruise/overlay.cpp
    scummvm/trunk/engines/cruise/volume.cpp
    scummvm/trunk/engines/gob/coktelvideo.cpp
    scummvm/trunk/engines/gob/inter_v3.cpp
    scummvm/trunk/engines/kyra/sequences_v2.cpp
    scummvm/trunk/engines/queen/queen.cpp
    scummvm/trunk/engines/saga/actor_walk.cpp
    scummvm/trunk/engines/saga/saveload.cpp
    scummvm/trunk/engines/scumm/saveload.cpp
    scummvm/trunk/engines/scumm/script_v5.cpp
    scummvm/trunk/engines/scumm/verbs.cpp
    scummvm/trunk/engines/touche/touche.cpp
    scummvm/trunk/engines/touche/ui.cpp
    scummvm/trunk/gui/options.cpp
    scummvm/trunk/tools/skycpt/cptcompiler.cpp

Modified: scummvm/trunk/backends/fs/dc/dc-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/dc/dc-fs.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/fs/dc/dc-fs.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -111,11 +111,11 @@
 	if (verify) {
 		int fd;
 
-		if((fd = open(_path.c_str(), O_RDONLY)) >= 0) {
+		if ((fd = open(_path.c_str(), O_RDONLY)) >= 0) {
 			close(fd);
 			_isDirectory = false;
 		}
-		else if((fd = open(_path.c_str(), O_DIR|O_RDONLY)) >= 0) {
+		else if ((fd = open(_path.c_str(), O_DIR|O_RDONLY)) >= 0) {
 			close(fd);
 		}
 		else {

Modified: scummvm/trunk/backends/fs/gp32/gp32-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/gp32/gp32-fs.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/fs/gp32/gp32-fs.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -241,7 +241,7 @@
 }
 
 AbstractFilesystemNode *GP32FilesystemNode::getParent() const {
-	if(_isRoot)
+	if (_isRoot)
 		return 0;
 
 	const char *start = _path.c_str();

Modified: scummvm/trunk/backends/fs/palmos/palmos-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/palmos/palmos-fs.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/fs/palmos/palmos-fs.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -197,7 +197,7 @@
 	if (error)
 		return false;
 	
-	while(dirIterator != expIteratorStop) {
+	while (dirIterator != expIteratorStop) {
 		error = VFSDirEntryEnumerate(handle, &dirIterator, &desc);
 		if (!error) {
 			addFile(myList, mode, _path.c_str(), &desc);

Modified: scummvm/trunk/backends/fs/posix/posix-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/posix/posix-fs.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/fs/posix/posix-fs.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -178,7 +178,7 @@
 			continue;
 		}
 		// Skip '.' and '..' to avoid cycles
-		if((dp->d_name[0] == '.' && dp->d_name[1] == 0) || (dp->d_name[0] == '.' && dp->d_name[1] == '.')) {
+		if ((dp->d_name[0] == '.' && dp->d_name[1] == 0) || (dp->d_name[0] == '.' && dp->d_name[1] == '.')) {
 			continue;
 		}
 

Modified: scummvm/trunk/backends/fs/symbian/symbian-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/symbian/symbian-fs.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/fs/symbian/symbian-fs.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -157,7 +157,7 @@
 	fname.Copy(ptr);
 	TBool isFolder = EFalse;
 	BaflUtils::IsFolder(CEikonEnv::Static()->FsSession(), fname, isFolder);
-	if(!isFolder)
+	if (!isFolder)
 		return 0;
 
 	return new SymbianFilesystemNode(newPath);
@@ -182,12 +182,12 @@
 			TInt err = fs.Volume(volumeInfo, driveNumber);
 			if (err != KErrNone)
 				continue; 
-			if(fs.DriveToChar(driveNumber,driveLetter) != KErrNone)
+			if (fs.DriveToChar(driveNumber,driveLetter) != KErrNone)
 				continue;
 
 			driveLetterValue = driveLetter;
 
-			if(volumeInfo.iName.Length() > 0) {				
+			if (volumeInfo.iName.Length() > 0) {				
 				driveLabel8.Copy(volumeInfo.iName); // 16 to 8bit des // enabling this line alone gives KERN-EXEC 3 with non-optimized GCC? WHY? grrr
 				driveString8.Format(_L8("Drive %c: (%S)"), driveLetterValue, &driveLabel8);
 			} else {
@@ -211,10 +211,10 @@
 		fname.Copy(ptr);
 		TBuf8<256>nameBuf;
 		CDir* dirPtr;
-		if(CEikonEnv::Static()->FsSession().GetDir(fname,KEntryAttNormal|KEntryAttDir,0,dirPtr)==KErrNone) {
+		if (CEikonEnv::Static()->FsSession().GetDir(fname,KEntryAttNormal|KEntryAttDir,0,dirPtr)==KErrNone) {
 			CleanupStack::PushL(dirPtr);
 			TInt cnt=dirPtr->Count();
-			for(TInt loop=0;loop<cnt;loop++) {
+			for (TInt loop=0;loop<cnt;loop++) {
 				TEntry fileentry=(*dirPtr)[loop];
 				nameBuf.Copy(fileentry.iName);
 				SymbianFilesystemNode entry(false);

Modified: scummvm/trunk/backends/platform/PalmOS/Src/args.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/args.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/PalmOS/Src/args.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -16,7 +16,7 @@
 	// initial position
 	argvP++;
 
-	for(UInt8 count = 0; count < MAX_ARG; count++)
+	for (UInt8 count = 0; count < MAX_ARG; count++)
 		argvP[count] = NULL;
 
 	return argvP;
@@ -49,7 +49,7 @@
 
 	MemHandle oldH;
 
-	for(UInt8 count = 0; count < MAX_ARG; count++)
+	for (UInt8 count = 0; count < MAX_ARG; count++)
 		if (argvP[count]) {
 			oldH = MemPtrRecoverHandle(argvP[count]);
 			MemHandleUnlock(oldH);
@@ -68,7 +68,7 @@
 
 	MemHandle oldH;
 
-	for(UInt8 count = 0; count < MAX_ARG; count++)
+	for (UInt8 count = 0; count < MAX_ARG; count++)
 		if (argvP[count]) {
 			oldH = MemPtrRecoverHandle(argvP[count]);
 			MemHandleSetOwner(oldH, owner);
@@ -81,7 +81,7 @@
 
 void ArgsExportInit(Char **argvP, UInt32 countArg, Boolean arm) {
 	if (arm) {
-		for(UInt8 count = 0; count < MAX_ARG; count++)
+		for (UInt8 count = 0; count < MAX_ARG; count++)
 			if (argvP[count])
 				argvP[count] = (Char *)ByteSwap32(argvP[count]);
 	}
@@ -96,7 +96,7 @@
 		Err e = FtrGet(appFileCreator, ftrArgsData, (UInt32 *)&argvP);
 
 		if (argvP)
-			for(UInt8 count = 0; count < MAX_ARG; count++)
+			for (UInt8 count = 0; count < MAX_ARG; count++)
 				if (argvP[count])
 					argvP[count] = (Char *)ByteSwap32(argvP[count]);
 	}

Modified: scummvm/trunk/backends/platform/PalmOS/Src/base_event.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/base_event.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/PalmOS/Src/base_event.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -92,7 +92,7 @@
 	timer_handler();
 	sound_handler();
 
-	for(;;) {
+	for (;;) {
 		// check for hardkey repeat for mouse emulation
 		keyCurrentState = KeyCurrentState();
 

Modified: scummvm/trunk/backends/platform/PalmOS/Src/base_gfx.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/base_gfx.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/PalmOS/Src/base_gfx.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -95,7 +95,7 @@
 void OSystem_PalmBase::setPalette(const byte *colors, uint start, uint num) {
 	RGBColorType *base = _currentPalette + start;
 
-	for(uint i = 0; i < num; i++) {
+	for (uint i = 0; i < num; i++) {
 		base[i].r = colors[0];
 		base[i].g = colors[1];
 		base[i].b = colors[2];

Modified: scummvm/trunk/backends/platform/PalmOS/Src/extend.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/extend.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/PalmOS/Src/extend.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -52,8 +52,8 @@
 	if (depth == 8) {
 		UInt8 *src = (UInt8 *)BmpGetBits(WinGetBitmap(WinGetDisplayWindow()));
 		src += gVars->screenPitch + 1;
-		for(y=0; y < 4; y++) {
-			for(x=0; x < 4; x++)
+		for (y=0; y < 4; y++) {
+			for (x=0; x < 4; x++)
 				src[x] = color;
 
 			src += gVars->screenPitch;
@@ -62,8 +62,8 @@
 	} else if (depth == 16) {
 		Int16 *src = (Int16 *)BmpGetBits(WinGetBitmap(WinGetDisplayWindow()));
 		src += gVars->screenPitch + 1;
-		for(y=0; y < 4; y++) {
-			for(x=0; x < 4; x++)
+		for (y=0; y < 4; y++) {
+			for (x=0; x < 4; x++)
 				src[x] = color;
 
 			src += gVars->screenPitch;

Modified: scummvm/trunk/backends/platform/PalmOS/Src/init_sony.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/init_sony.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/PalmOS/Src/init_sony.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -46,7 +46,7 @@
 				if (e) {
 					// v1 = NR
 				 	e = SilkLibOpen(slkRefNum);
-					if(!e) version = vskVersionNum1;
+					if (!e) version = vskVersionNum1;
 
 				} else {
 					// v2 = NX/NZ

Modified: scummvm/trunk/backends/platform/PalmOS/Src/os5_mouse.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/os5_mouse.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/PalmOS/Src/os5_mouse.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -26,7 +26,7 @@
 #include "be_os5.h"
 
 void OSystem_PalmOS5::setCursorPalette(const byte *colors, uint start, uint num) {
-	for(uint i = 0; i < num; i++) {
+	for (uint i = 0; i < num; i++) {
 		_mousePal[i + start] = gfxMakeDisplayRGB(colors[0], colors[1], colors[2]);
 		colors += 4;
 	}

Modified: scummvm/trunk/backends/platform/PalmOS/Src/snd_pa1.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/snd_pa1.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/PalmOS/Src/snd_pa1.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -108,6 +108,6 @@
 
 		*dst++ = (UInt8)data;
 
-	} while(--length);
+	} while (--length);
 
 }

Modified: scummvm/trunk/backends/platform/dc/audio.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/audio.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/audio.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -44,28 +44,28 @@
   int n;
   int curr_ring_buffer_samples;
 
-  if(!_mixer)
+  if (!_mixer)
     return;
 
-  if(read_sound_int(&SOUNDSTATUS->mode) != MODE_PLAY)
+  if (read_sound_int(&SOUNDSTATUS->mode) != MODE_PLAY)
     start_sound();
 
   curr_ring_buffer_samples = read_sound_int(&SOUNDSTATUS->ring_length);
 
   n = read_sound_int(&SOUNDSTATUS->samplepos);
 
-  if((n-=fillpos)<0)
+  if ((n-=fillpos)<0)
     n += curr_ring_buffer_samples;
 
   n = ADJUST_BUFFER_SIZE(n-10);
 
-  if(n<100)
+  if (n<100)
     return;
 
   Audio::Mixer::mixCallback(_mixer, (byte*)temp_sound_buffer,
 			    2*SAMPLES_TO_BYTES(n));
 
-  if(fillpos+n > curr_ring_buffer_samples) {
+  if (fillpos+n > curr_ring_buffer_samples) {
     int r = curr_ring_buffer_samples - fillpos;
     memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(r));
     fillpos = 0;
@@ -74,7 +74,7 @@
   } else {
     memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(n));
   }
-  if((fillpos += n) >= curr_ring_buffer_samples)
+  if ((fillpos += n) >= curr_ring_buffer_samples)
     fillpos = 0;
 }
 

Modified: scummvm/trunk/backends/platform/dc/dcloader.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/dcloader.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/dcloader.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -116,14 +116,14 @@
 static void purge_copyback()
 {
   int i;
-  for(i=0; i!=(1<<14); i+=(1<<5))
+  for (i=0; i!=(1<<14); i+=(1<<5))
     *(volatile unsigned int *)(0xf4000000+i) &= ~3;
 }
 
 
 void DLObject::seterror(const char *fmt, ...)
 {
-  if(errbuf) {
+  if (errbuf) {
     va_list va;
     va_start(va, fmt);
     vsnprintf(errbuf, MAXDLERRLEN, fmt, va);
@@ -151,12 +151,12 @@
 {
   Elf32_Rela *rela;
 
-  if(!(rela = (Elf32_Rela *)malloc(size))) {
+  if (!(rela = (Elf32_Rela *)malloc(size))) {
     seterror("Out of memory.");
     return false;
   }
 
-  if(lseek(fd, offset, SEEK_SET)<0 ||
+  if (lseek(fd, offset, SEEK_SET)<0 ||
      read(fd, rela, size) != size) {
     seterror("Relocation table load failed.");
     free(rela);
@@ -164,7 +164,7 @@
   }
 
   int cnt = size / sizeof(*rela);
-  for(int i=0; i<cnt; i++) {
+  for (int i=0; i<cnt; i++) {
 
     Elf32_Sym *sym = (Elf32_Sym *)(((char *)symtab)+(rela[i].r_info>>4));
 
@@ -172,7 +172,7 @@
 
     switch(rela[i].r_info & 0xf) {
     case 1: /* DIR32 */
-      if(sym->st_shndx < 0xff00)
+      if (sym->st_shndx < 0xff00)
 	*(unsigned long *)target += (unsigned long)segment;
       break;
     default:
@@ -195,7 +195,7 @@
   Elf32_Shdr *shdr;
   int symtab_sect = -1;
 
-  if(read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr) ||
+  if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr) ||
      memcmp(ehdr.e_ident, ELFMAG, SELFMAG) ||
      ehdr.e_type != 2 ||  ehdr.e_machine != 42 ||
      ehdr.e_phentsize < sizeof(phdr) || ehdr.e_shentsize != sizeof(*shdr) ||
@@ -207,13 +207,13 @@
   DBG("phoff = %d, phentsz = %d, phnum = %d\n",
       ehdr.e_phoff, ehdr.e_phentsize, ehdr.e_phnum);
 
-  if(lseek(fd, ehdr.e_phoff, SEEK_SET)<0 ||
+  if (lseek(fd, ehdr.e_phoff, SEEK_SET)<0 ||
      read(fd, &phdr, sizeof(phdr)) != sizeof(phdr)) {
     seterror("Program header load failed.");
     return false;
   }
 
-  if(phdr.p_type != 1 || phdr.p_vaddr != 0 || phdr.p_paddr != 0 ||
+  if (phdr.p_type != 1 || phdr.p_vaddr != 0 || phdr.p_paddr != 0 ||
      phdr.p_filesz > phdr.p_memsz) {
     seterror("Invalid program header.");
     return false;
@@ -222,17 +222,17 @@
   DBG("offs = %d, filesz = %d, memsz = %d, align = %d\n",
       phdr.p_offset, phdr.p_filesz, phdr.p_memsz, phdr.p_align);
 
-  if(!(segment = memalign(phdr.p_align, phdr.p_memsz))) {
+  if (!(segment = memalign(phdr.p_align, phdr.p_memsz))) {
     seterror("Out of memory.");
     return false;
   }
 
   DBG("segment @ %p\n", segment);
 
-  if(phdr.p_memsz > phdr.p_filesz)
+  if (phdr.p_memsz > phdr.p_filesz)
     memset(((char *)segment) + phdr.p_filesz, 0, phdr.p_memsz - phdr.p_filesz);
 
-  if(lseek(fd, phdr.p_offset, SEEK_SET)<0 ||
+  if (lseek(fd, phdr.p_offset, SEEK_SET)<0 ||
      read(fd, segment, phdr.p_filesz) != phdr.p_filesz) {
     seterror("Segment load failed.");
     return false;
@@ -241,12 +241,12 @@
   DBG("shoff = %d, shentsz = %d, shnum = %d\n",
       ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shnum);
 
-  if(!(shdr = (Elf32_Shdr *)malloc(ehdr.e_shnum * sizeof(*shdr)))) {
+  if (!(shdr = (Elf32_Shdr *)malloc(ehdr.e_shnum * sizeof(*shdr)))) {
     seterror("Out of memory.");
     return false;
   }
 
-  if(lseek(fd, ehdr.e_shoff, SEEK_SET)<0 ||
+  if (lseek(fd, ehdr.e_shoff, SEEK_SET)<0 ||
      read(fd, shdr, ehdr.e_shnum * sizeof(*shdr)) !=
      ehdr.e_shnum * sizeof(*shdr)) {
     seterror("Section headers load failed.");
@@ -254,41 +254,41 @@
     return false;
   }
 
-  for(int i=0; i<ehdr.e_shnum; i++) {
+  for (int i=0; i<ehdr.e_shnum; i++) {
     DBG("Section %d: type = %d, size = %d, entsize = %d, link = %d\n",
 	i, shdr[i].sh_type, shdr[i].sh_size, shdr[i].sh_entsize, shdr[i].sh_link);
-    if(shdr[i].sh_type == 2 && shdr[i].sh_entsize == sizeof(Elf32_Sym) &&
+    if (shdr[i].sh_type == 2 && shdr[i].sh_entsize == sizeof(Elf32_Sym) &&
        shdr[i].sh_link < ehdr.e_shnum && shdr[shdr[i].sh_link].sh_type == 3 &&
        symtab_sect < 0)
       symtab_sect = i;
   }
 
-  if(symtab_sect < 0) {
+  if (symtab_sect < 0) {
     seterror("No symbol table.");
     free(shdr);
     return false;
   }
 
-  if(!(symtab = malloc(shdr[symtab_sect].sh_size))) {
+  if (!(symtab = malloc(shdr[symtab_sect].sh_size))) {
     seterror("Out of memory.");
     free(shdr);
     return false;
   }
 
-  if(lseek(fd, shdr[symtab_sect].sh_offset, SEEK_SET)<0 ||
+  if (lseek(fd, shdr[symtab_sect].sh_offset, SEEK_SET)<0 ||
      read(fd, symtab, shdr[symtab_sect].sh_size) != shdr[symtab_sect].sh_size){
     seterror("Symbol table load failed.");
     free(shdr);
     return false;
   }
 
-  if(!(strtab = (char *)malloc(shdr[shdr[symtab_sect].sh_link].sh_size))) {
+  if (!(strtab = (char *)malloc(shdr[shdr[symtab_sect].sh_link].sh_size))) {
     seterror("Out of memory.");
     free(shdr);
     return false;
   }
 
-  if(lseek(fd, shdr[shdr[symtab_sect].sh_link].sh_offset, SEEK_SET)<0 ||
+  if (lseek(fd, shdr[shdr[symtab_sect].sh_link].sh_offset, SEEK_SET)<0 ||
      read(fd, strtab, shdr[shdr[symtab_sect].sh_link].sh_size) !=
      shdr[shdr[symtab_sect].sh_link].sh_size){
     seterror("Symbol table strings load failed.");
@@ -300,15 +300,15 @@
   DBG("Loaded %d symbols.\n", symbol_cnt);
 
   Elf32_Sym *s = (Elf32_Sym *)symtab;
-  for(int c = symbol_cnt; c--; s++)
-    if(s->st_shndx < 0xff00)
+  for (int c = symbol_cnt; c--; s++)
+    if (s->st_shndx < 0xff00)
       s->st_value += (Elf32_Addr)segment;
 
-  for(int i=0; i<ehdr.e_shnum; i++)
-    if(shdr[i].sh_type == 4 && shdr[i].sh_entsize == sizeof(Elf32_Rela) &&
+  for (int i=0; i<ehdr.e_shnum; i++)
+    if (shdr[i].sh_type == 4 && shdr[i].sh_entsize == sizeof(Elf32_Rela) &&
        shdr[i].sh_link == symtab_sect && shdr[i].sh_info < ehdr.e_shnum &&
        (shdr[shdr[i].sh_info].sh_flags & 2))
-      if(!relocate(fd, shdr[i].sh_offset, shdr[i].sh_size)) {
+      if (!relocate(fd, shdr[i].sh_offset, shdr[i].sh_size)) {
 	free(shdr);
 	return false;
       }
@@ -325,12 +325,12 @@
 
   DBG("open(\"%s\")\n", path);
 
-  if((fd = ::open(path, O_RDONLY))<0) {
+  if ((fd = ::open(path, O_RDONLY))<0) {
     seterror("%s not found.", path);
     return false;
   }
 
-  if(!load(fd)) {
+  if (!load(fd)) {
     ::close(fd);
     unload();
     return false;
@@ -349,7 +349,7 @@
   dtors_start = symbol("__plugin_dtors");
   dtors_end = symbol("__plugin_dtors_end");
 
-  if(ctors_start == NULL || ctors_end == NULL || dtors_start == NULL ||
+  if (ctors_start == NULL || ctors_end == NULL || dtors_start == NULL ||
      dtors_end == NULL) {
     seterror("Missing ctors/dtors.");
     dtors_start = dtors_end = NULL;
@@ -358,7 +358,7 @@
   }
 
   DBG("Calling constructors.\n");
-  for(void (**f)(void) = (void (**)(void))ctors_start; f != ctors_end; f++)
+  for (void (**f)(void) = (void (**)(void))ctors_start; f != ctors_end; f++)
     (**f)();
 
   DBG("%s opened ok.\n", path);
@@ -367,8 +367,8 @@
 
 bool DLObject::close()
 {
-  if(dtors_start != NULL && dtors_end != NULL)
-    for(void (**f)(void) = (void (**)(void))dtors_start; f != dtors_end; f++)
+  if (dtors_start != NULL && dtors_end != NULL)
+    for (void (**f)(void) = (void (**)(void))dtors_start; f != dtors_end; f++)
       (**f)();
   dtors_start = dtors_end = NULL;
   unload();
@@ -379,14 +379,14 @@
 {
   DBG("symbol(\"%s\")\n", name);
 
-  if(symtab == NULL || strtab == NULL || symbol_cnt < 1) {
+  if (symtab == NULL || strtab == NULL || symbol_cnt < 1) {
     seterror("No symbol table loaded.");
     return NULL;
   }
 
   Elf32_Sym *s = (Elf32_Sym *)symtab;
-  for(int c = symbol_cnt; c--; s++)
-    if((s->st_info>>4 == 1 || s->st_info>>4 == 2) &&
+  for (int c = symbol_cnt; c--; s++)
+    if ((s->st_info>>4 == 1 || s->st_info>>4 == 2) &&
        strtab[s->st_name] == '_' && !strcmp(name, strtab+s->st_name+1)) {
       DBG("=> %p\n", (void*)s->st_value);
       return (void*)s->st_value;
@@ -402,7 +402,7 @@
 void *dlopen(const char *filename, int flags)
 {
   DLObject *obj = new DLObject(dlerr);
-  if(obj->open(filename))
+  if (obj->open(filename))
     return (void *)obj;
   delete obj;
   return NULL;
@@ -411,11 +411,11 @@
 int dlclose(void *handle)
 {
   DLObject *obj = (DLObject *)handle;
-  if(obj == NULL) {
+  if (obj == NULL) {
     strcpy(dlerr, "Handle is NULL.");
     return -1;
   }
-  if(obj->close()) {
+  if (obj->close()) {
     delete obj;
     return 0;
   }
@@ -424,7 +424,7 @@
 
 void *dlsym(void *handle, const char *symbol)
 {
-  if(handle == NULL) {
+  if (handle == NULL) {
     strcpy(dlerr, "Handle is NULL.");
     return NULL;
   }
@@ -438,6 +438,6 @@
 
 void dlforgetsyms(void *handle)
 {
-  if(handle != NULL)
+  if (handle != NULL)
     ((DLObject *)handle)->discard_symtab();
 }

Modified: scummvm/trunk/backends/platform/dc/dcmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/dcmain.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/dcmain.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -64,16 +64,16 @@
 static bool find_track(int track, int &first_sec, int &last_sec)
 {
   struct TOC *toc = cdfs_gettoc();
-  if(!toc)
+  if (!toc)
     return false;
   int i, first, last;
   first = TOC_TRACK(toc->first);
   last = TOC_TRACK(toc->last);
-  if(first < 1 || last > 99 || first > last)
+  if (first < 1 || last > 99 || first > last)
     return false;
-  for(i=first; i<=last; i++)
-    if(!(TOC_CTRL(toc->entry[i-1])&4))
-      if(track==1) {
+  for (i=first; i<=last; i++)
+    if (!(TOC_CTRL(toc->entry[i-1])&4))
+      if (track==1) {
 	first_sec = TOC_LBA(toc->entry[i-1]);
 	last_sec = TOC_LBA(toc->entry[i]);
 	return true;
@@ -86,14 +86,14 @@
 {
   int first_sec, last_sec;
 #if 1
-  if(num_loops)
+  if (num_loops)
     --num_loops;
 #endif
-  if(num_loops>14) num_loops=14;
-  else if(num_loops<0) num_loops=15; // infinity
-  if(!find_track(track, first_sec, last_sec))
+  if (num_loops>14) num_loops=14;
+  else if (num_loops<0) num_loops=15; // infinity
+  if (!find_track(track, first_sec, last_sec))
     return;
-  if(duration)
+  if (duration)
     last_sec = first_sec + start_frame + duration;
   first_sec += start_frame;
   play_cdda_sectors(first_sec, last_sec, num_loops);
@@ -168,7 +168,7 @@
   switch(f) {
   case kFeatureAspectRatioCorrection:
     _aspect_stretch = enable;
-    if(screen)
+    if (screen)
       setScaling();
     break;
   case kFeatureVirtualKeyboard:
@@ -230,12 +230,12 @@
 {
   char *base = NULL, *dir = NULL;
 
-  if(!selectGame(base, dir, icon))
+  if (!selectGame(base, dir, icon))
     exit(0);
 
   // Set the game path.
   ConfMan.addGameDomain(base);
-  if(dir != NULL)
+  if (dir != NULL)
     ConfMan.set("path", dir, base);
 
   // Set the target.

Modified: scummvm/trunk/backends/platform/dc/display.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/display.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/display.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -49,7 +49,7 @@
 #define COPYPIXEL(n) do {			\
   unsigned short _tmp = pal[*s++];		\
   d[n] = _tmp|(pal[*s++]<<16);			\
-} while(0)
+} while (0)
 
 static void texture_memcpy64_pal(void *dest, void *src, int cnt, unsigned short *pal)
 {
@@ -58,7 +58,7 @@
     (0xe0000000 | (((unsigned long)dest) & 0x03ffffc0));
   QACR0 = ((0xa4000000>>26)<<2)&0x1c;
   QACR1 = ((0xa4000000>>26)<<2)&0x1c;
-  while(cnt--) {
+  while (cnt--) {
     COPYPIXEL(0);
     COPYPIXEL(1);
     COPYPIXEL(2);
@@ -91,7 +91,7 @@
     (0xe0000000 | (((unsigned long)dest) & 0x03ffffc0));
   QACR0 = ((0xa4000000>>26)<<2)&0x1c;
   QACR1 = ((0xa4000000>>26)<<2)&0x1c;
-  while(cnt--) {
+  while (cnt--) {
     d[0] = *s++;
     d[1] = *s++;
     d[2] = *s++;
@@ -137,8 +137,8 @@
 void OSystem_Dreamcast::setPalette(const byte *colors, uint start, uint num)
 {
   unsigned short *dst = palette + start;
-  if(num>0)
-    while( num-- ) {
+  if (num>0)
+    while ( num-- ) {
       *dst++ = ((colors[0]<<7)&0x7c00)|
 	((colors[1]<<2)&0x03e0)|
 	((colors[2]>>3)&0x001f);
@@ -150,8 +150,8 @@
 void OSystem_Dreamcast::setCursorPalette(const byte *colors, uint start, uint num)
 {
   unsigned short *dst = cursor_palette + start;
-  if(num>0)
-    while( num-- ) {
+  if (num>0)
+    while ( num-- ) {
       *dst++ = ((colors[0]<<7)&0x7c00)|
 	((colors[1]<<2)&0x03e0)|
 	((colors[2]>>3)&0x001f);
@@ -168,8 +168,8 @@
 void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num)
 {
   const unsigned short *src = palette + start;
-  if(num>0)
-    while( num-- ) {
+  if (num>0)
+    while ( num-- ) {
       unsigned short p = *src++;
       colors[0] = ((p&0x7c00)>>7)|((p&0x7000)>>12);
       colors[1] = ((p&0x03e0)>>2)|((p&0x0380)>>7);
@@ -181,10 +181,10 @@
 
 void OSystem_Dreamcast::setScaling()
 {
-  if(_screen_w > 400) {
+  if (_screen_w > 400) {
     _xscale = _yscale = 1.0;
     _top_offset = (SCREEN_H-_screen_h)>>1;
-  } else if(_aspect_stretch && _screen_w == 320 && _screen_h == 200) {
+  } else if (_aspect_stretch && _screen_w == 320 && _screen_h == 200) {
     _xscale = SCREEN_W/320.0;
     _yscale = SCREEN_H/200.0;
     _top_offset = 0;
@@ -206,22 +206,22 @@
   _screen_h = h;
   _overlay_x = (w-OVL_W)/2;
   _overlay_y = (h-OVL_H)/2;
-  if(_overlay_x<0) _overlay_x = 0;
-  if(_overlay_y<0) _overlay_y = 0;
+  if (_overlay_x<0) _overlay_x = 0;
+  if (_overlay_y<0) _overlay_y = 0;
   setScaling();
   ta_sync();
-  if(!screen)
+  if (!screen)
     screen = new unsigned char[SCREEN_W*SCREEN_H];
-  if(!overlay)
+  if (!overlay)
     overlay = new unsigned short[OVL_W*OVL_H];
-  for(int i=0; i<NUM_BUFFERS; i++)
-    if(!screen_tx[i])
+  for (int i=0; i<NUM_BUFFERS; i++)
+    if (!screen_tx[i])
       screen_tx[i] = ta_txalloc(SCREEN_W*SCREEN_H*2);
-  for(int i=0; i<NUM_BUFFERS; i++)
-    if(!mouse_tx[i])
+  for (int i=0; i<NUM_BUFFERS; i++)
+    if (!mouse_tx[i])
       mouse_tx[i] = ta_txalloc(MOUSE_W*MOUSE_H*2);
-  for(int i=0; i<NUM_BUFFERS; i++)
-    if(!ovl_tx[i])
+  for (int i=0; i<NUM_BUFFERS; i++)
+    if (!ovl_tx[i])
       ovl_tx[i] = ta_txalloc(OVL_TXSTRIDE*OVL_H*2);
   _screen_buffer = 0;
   _mouse_buffer = 0;
@@ -239,7 +239,7 @@
 void OSystem_Dreamcast::copyRectToScreen(const byte *buf, int pitch, int x, int y,
 				  int w, int h)
 {
-  if(w<1 || h<1)
+  if (w<1 || h<1)
     return;
   unsigned char *dst = screen + y*SCREEN_W + x;
   do {
@@ -293,7 +293,7 @@
   struct polygon_list mypoly;
   struct packed_colour_vertex_list myvertex;
 
-  if(_screen_dirty) {
+  if (_screen_dirty) {
 
     _screen_buffer++;
     _screen_buffer &= NUM_BUFFERS-1;
@@ -301,10 +301,10 @@
     unsigned short *dst = (unsigned short *)screen_tx[_screen_buffer];
     unsigned char *src = screen;
 
-    // while((*((volatile unsigned int *)(void*)0xa05f810c) & 0x3ff) != 200);
+    // while ((*((volatile unsigned int *)(void*)0xa05f810c) & 0x3ff) != 200);
     // *((volatile unsigned int *)(void*)0xa05f8040) = 0xff0000;
 
-    for( int y = 0; y<_screen_h; y++ )
+    for ( int y = 0; y<_screen_h; y++ )
     {
       texture_memcpy64_pal( dst, src, _screen_w>>5, palette );
       src += SCREEN_W;
@@ -314,7 +314,7 @@
     _screen_dirty = false;
   }
 
-  if( _overlay_visible && _overlay_dirty ) {
+  if ( _overlay_visible && _overlay_dirty ) {
 
     _overlay_buffer++;
     _overlay_buffer &= NUM_BUFFERS-1;
@@ -322,7 +322,7 @@
     unsigned short *dst = (unsigned short *)ovl_tx[_overlay_buffer];
     unsigned short *src = overlay;
 
-    for( int y = 0; y<OVL_H; y++ )
+    for ( int y = 0; y<OVL_H; y++ )
     {
       texture_memcpy64( dst, src, OVL_W>>5 );
       src += OVL_W;
@@ -378,15 +378,15 @@
 
   ta_commit_end();
 
-  if(_overlay_visible) {
-    if(_overlay_fade < 1.0)
+  if (_overlay_visible) {
+    if (_overlay_fade < 1.0)
       _overlay_fade += 0.125;
   } else {
-    if(_overlay_fade > 0)
+    if (_overlay_fade > 0)
       _overlay_fade -= 0.125;
   }
 
-  if(_overlay_fade > 0.0) {
+  if (_overlay_fade > 0.0) {
 
     mypoly.cmd =
       TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
@@ -432,16 +432,16 @@
     ta_commit_list(&myvertex);
   }
 
-  if(_softkbd_on)
-    if(_softkbd_motion < 120)
+  if (_softkbd_on)
+    if (_softkbd_motion < 120)
       _softkbd_motion += 10;
     else
       ;
   else
-    if(_softkbd_motion > 0)
+    if (_softkbd_motion > 0)
       _softkbd_motion -= 10;
 
-  if(_softkbd_motion)
+  if (_softkbd_motion)
     _softkbd.draw(330.0*sin(0.013*_softkbd_motion) - 320.0, 200.0,
 		  120-_softkbd_motion);
 
@@ -467,11 +467,11 @@
   unsigned short *dst = (unsigned short *)mouse_tx[_mouse_buffer];
   int y=0;
 
-  if(visible && w && h && w<=MOUSE_W && h<=MOUSE_H)
-    for(int y=0; y<h; y++) {
+  if (visible && w && h && w<=MOUSE_W && h<=MOUSE_H)
+    for (int y=0; y<h; y++) {
       int x;
-      for(x=0; x<w; x++)
-	if(*buf == _ms_keycolor) {
+      for (x=0; x<w; x++)
+	if (*buf == _ms_keycolor) {
 	  *dst++ = 0;
 	  buf++;
 	} else
@@ -527,7 +527,7 @@
 
 void OSystem_Dreamcast::mouseToSoftKbd(int x, int y, int &rx, int &ry) const
 {
-  if(_softkbd_motion) {
+  if (_softkbd_motion) {
     rx = (int)(x*_xscale - (330.0*sin(0.013*_softkbd_motion) - 320.0));
     ry = (int)(y*_yscale + TOP_OFFSET - 200.0);
   } else {
@@ -550,7 +550,7 @@
 
 void OSystem_Dreamcast::clearOverlay()
 {
-  if(!_overlay_visible)
+  if (!_overlay_visible)
     return;
 
   memset(overlay, 0, OVL_W*OVL_H*sizeof(unsigned short));
@@ -572,7 +572,7 @@
 void OSystem_Dreamcast::copyRectToOverlay(const int16 *buf, int pitch,
 					  int x, int y, int w, int h)
 {
-  if(w<1 || h<1)
+  if (w<1 || h<1)
     return;
   unsigned short *dst = overlay + y*OVL_W + x;
   do {

Modified: scummvm/trunk/backends/platform/dc/icon.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/icon.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/icon.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -33,7 +33,7 @@
   unsigned short *pal = (unsigned short *)buffer;
   unsigned char *pix = ((unsigned char *)buffer)+32;
 
-  for(int n = 0; n<16; n++) {
+  for (int n = 0; n<16; n++) {
     int p = palette[n];
     pal[n] =
       ((p>>16)&0xf000)|
@@ -42,7 +42,7 @@
       ((p>> 4)&0x000f);
   }
 
-  for(int line = 0; line < 32; line++) {
+  for (int line = 0; line < 32; line++) {
     memcpy(pix, &bitmap[32/2*(31-line)], 32/2);
     pix += 32/2;
   }
@@ -55,9 +55,9 @@
   unsigned short *tex = (unsigned short *)ta_txalloc(512);
   unsigned short *linebase;
   unsigned char *src = bitmap+sizeof(bitmap)-17;
-  for(int y=0; y<16; y++) {
+  for (int y=0; y<16; y++) {
     linebase = tex + (tt[y]<<1);
-    for(int x=0; x<16; x++, --src)
+    for (int x=0; x<16; x++, --src)
       linebase[tt[x]] = src[16]|(src[0]<<8);
     src -= 16;
   }
@@ -67,7 +67,7 @@
 void Icon::setPalette(int pal)
 {
   unsigned int (*hwpal)[64][16] = (unsigned int (*)[64][16])0xa05f9000;
-  for(int n = 0; n<16; n++)
+  for (int n = 0; n<16; n++)
     (*hwpal)[pal][n] = palette[n];
 }
 
@@ -124,13 +124,13 @@
 {
   int use[16];
   memset(use, 0, sizeof(use));
-  for(int n=0; n<32*32/2; n++) {
+  for (int n=0; n<32*32/2; n++) {
     unsigned char pix = bitmap[n];
     use[pix&0xf]++;
     use[pix>>4]++;
   }
-  for(int i=0; i<16; i++)
-    if(!use[i])
+  for (int i=0; i<16; i++)
+    if (!use[i])
       return i;
   return -1;
 }
@@ -142,41 +142,41 @@
     short pla, bitcnt;
     int comp, sizeimg, xres, yres, used, imp;
   } hdr;
-  if(len < 40)
+  if (len < 40)
     return false;
   memcpy(&hdr, data, 40);
-  if(hdr.size != 40 || /* hdr.sizeimg<=0 || */ hdr.w<0 || hdr.h<0 ||
+  if (hdr.size != 40 || /* hdr.sizeimg<=0 || */ hdr.w<0 || hdr.h<0 ||
      hdr.bitcnt<0 || hdr.used<0)
     return false;
-  if(!hdr.used)
+  if (!hdr.used)
     hdr.used = 1<<hdr.bitcnt;
   hdr.h >>= 1;
   /* Fix incorrect sizeimg (The Dig) */
-  if(hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3))
+  if (hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3))
     hdr.sizeimg = ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3);
-  if(hdr.size + (hdr.used<<2) + hdr.sizeimg > len /* ||
+  if (hdr.size + (hdr.used<<2) + hdr.sizeimg > len /* ||
      hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3) */)
     return false;
-  if(hdr.w != 32 || hdr.h != 32 || hdr.bitcnt != 4 || hdr.used > 16)
+  if (hdr.w != 32 || hdr.h != 32 || hdr.bitcnt != 4 || hdr.used > 16)
     return false;
   memcpy(palette, ((const char *)data)+hdr.size, hdr.used<<2);
   memcpy(bitmap, ((const char *)data)+hdr.size+(hdr.used<<2), 32*32/2);
-  for(int i=0; i<16; i++)
+  for (int i=0; i<16; i++)
     palette[i] |= 0xff000000;
-  for(int i=hdr.used; i<16; i++)
+  for (int i=hdr.used; i<16; i++)
     palette[i] = 0;
   int unused = find_unused_pixel();
-  if(unused >= 0) {
+  if (unused >= 0) {
     const unsigned char *mask =
       ((const unsigned char *)data)+hdr.size+(hdr.used<<2)+32*32/2;
     unsigned char *pix = bitmap;
-    for(int y=0; y<32; y++)
-      for(int x=0; x<32/8; x++) {
+    for (int y=0; y<32; y++)
+      for (int x=0; x<32/8; x++) {
 	unsigned char mbits = *mask++;
-	for(int z=0; z<4; z++) {
+	for (int z=0; z<4; z++) {
 	  unsigned char pbits = *pix;
-	  if(mbits & 64) pbits = (pbits & ~0xf) | unused;
-	  if(mbits & 128) pbits = (pbits & 0xf) | (unused << 4);
+	  if (mbits & 64) pbits = (pbits & ~0xf) | unused;
+	  if (mbits & 128) pbits = (pbits & 0xf) | (unused << 4);
 	  *pix++ = pbits;
 	  mbits <<= 2;
 	}
@@ -193,10 +193,10 @@
     short pla, bitcnt;
     int bytes, offs;
   } hdr;
-  if(len < offs+16)
+  if (len < offs+16)
     return false;
   memcpy(&hdr, ((const char *)data)+offs, 16);
-  if(hdr.bytes > 0 && hdr.offs >= 0 && hdr.offs+hdr.bytes <= len)
+  if (hdr.bytes > 0 && hdr.offs >= 0 && hdr.offs+hdr.bytes <= len)
     return load_image2(((const char *)data)+hdr.offs, hdr.bytes);
   else
     return false;
@@ -208,13 +208,13 @@
   memset(bitmap, 0, sizeof(bitmap));
   memset(palette, 0, sizeof(palette));
   texture = NULL;
-  if(len < offs+6)
+  if (len < offs+6)
     return false;
   memcpy(&hdr, ((const char *)data)+offs, 6);
-  if(hdr.type != 1 || hdr.cnt < 1 || offs+6+(hdr.cnt<<4) > len)
+  if (hdr.type != 1 || hdr.cnt < 1 || offs+6+(hdr.cnt<<4) > len)
     return false;
-  for(int i=0; i<hdr.cnt; i++)
-    if(load_image1(data, len, offs+6+(i<<4)))
+  for (int i=0; i<hdr.cnt; i++)
+    if (load_image1(data, len, offs+6+(i<<4)))
       return true;
   return false;
 }
@@ -223,11 +223,11 @@
 {
   char buf[2048];
   int fd;
-  if((fd = open(filename, O_RDONLY))>=0) {
+  if ((fd = open(filename, O_RDONLY))>=0) {
     int sz;
     sz = read(fd, buf, sizeof(buf));
     close(fd);
-    if(sz>0)
+    if (sz>0)
       return load(buf, sz);
   }
   return false;

Modified: scummvm/trunk/backends/platform/dc/input.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/input.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/input.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -39,70 +39,70 @@
   static byte lastlmb = 0, lastrmb = 0;
   static int8 mouse_wheel = 0, lastwheel = 0;
   shiftFlags = 0;
-  for(int i=0; i<4; i++, pad++)
-    if(pad->func & MAPLE_FUNC_CONTROLLER) {
+  for (int i=0; i<4; i++, pad++)
+    if (pad->func & MAPLE_FUNC_CONTROLLER) {
       int buttons = pad->cond.controller.buttons;
 
-      if(!(buttons & 0x060e)) exit(0);
+      if (!(buttons & 0x060e)) exit(0);
 
-      if(!(buttons & 4)) lmb++;
-      if(!(buttons & 2)) rmb++;
+      if (!(buttons & 4)) lmb++;
+      if (!(buttons & 2)) rmb++;
 
-      if(!(buttons & 8)) newkey = Common::KEYCODE_F5;
-      else if(!(buttons & 512)) newkey = ' ';
-      else if(!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
+      if (!(buttons & 8)) newkey = Common::KEYCODE_F5;
+      else if (!(buttons & 512)) newkey = ' ';
+      else if (!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
 
-      if(!(buttons & 128)) if(inter) newkey = 1001; else mouse_x++;
-      if(!(buttons & 64)) if(inter) newkey = 1002; else mouse_x--;
-      if(!(buttons & 32)) if(inter) newkey = 1003; else mouse_y++;
-      if(!(buttons & 16)) if(inter) newkey = 1004; else mouse_y--;
+      if (!(buttons & 128)) if (inter) newkey = 1001; else mouse_x++;
+      if (!(buttons & 64)) if (inter) newkey = 1002; else mouse_x--;
+      if (!(buttons & 32)) if (inter) newkey = 1003; else mouse_y++;
+      if (!(buttons & 16)) if (inter) newkey = 1004; else mouse_y--;
 
       mouse_x += ((int)pad->cond.controller.joyx-128)>>4;
       mouse_y += ((int)pad->cond.controller.joyy-128)>>4;
 
-      if(pad->cond.controller.ltrigger > 200) newkey = 1005;
-      else if(pad->cond.controller.rtrigger > 200) newkey = 1006;
+      if (pad->cond.controller.ltrigger > 200) newkey = 1005;
+      else if (pad->cond.controller.rtrigger > 200) newkey = 1006;
 
-    } else if(pad->func & MAPLE_FUNC_MOUSE) {
+    } else if (pad->func & MAPLE_FUNC_MOUSE) {
       int buttons = pad->cond.mouse.buttons;
 
-      if(!(buttons & 4)) lmb++;
-      if(!(buttons & 2)) rmb++;
+      if (!(buttons & 4)) lmb++;
+      if (!(buttons & 2)) rmb++;
 
-      if(!(buttons & 8)) newkey = Common::KEYCODE_F5;
+      if (!(buttons & 8)) newkey = Common::KEYCODE_F5;
 
       mouse_x += pad->cond.mouse.axis1;
       mouse_y += pad->cond.mouse.axis2;
       mouse_wheel += pad->cond.mouse.axis3;
 
-      if(inter)
+      if (inter)
 	inter->mouse(mouse_x, mouse_y);
 
       pad->cond.mouse.axis1 = 0;
       pad->cond.mouse.axis2 = 0;
       pad->cond.mouse.axis3 = 0;
-    } else if(pad->func & MAPLE_FUNC_KEYBOARD) {
-      for(int p=0; p<6; p++) {
+    } else if (pad->func & MAPLE_FUNC_KEYBOARD) {
+      for (int p=0; p<6; p++) {
 	int shift = pad->cond.kbd.shift;
 	int key = pad->cond.kbd.key[p];
-	if(shift & 0x08) lmb++;
-	if(shift & 0x80) rmb++;
-	if(shift & 0x11) shiftFlags |= Common::KBD_CTRL;
-	if(shift & 0x44) shiftFlags |= Common::KBD_ALT;
-	if(shift & 0x22) shiftFlags |= Common::KBD_SHIFT;
-	if(key >= 4 && key <= 0x1d)
+	if (shift & 0x08) lmb++;
+	if (shift & 0x80) rmb++;
+	if (shift & 0x11) shiftFlags |= Common::KBD_CTRL;
+	if (shift & 0x44) shiftFlags |= Common::KBD_ALT;
+	if (shift & 0x22) shiftFlags |= Common::KBD_SHIFT;
+	if (key >= 4 && key <= 0x1d)
 	  newkey = key+('a'-4);
-	else if(key >= 0x1e && key <= 0x26)
+	else if (key >= 0x1e && key <= 0x26)
 	  newkey = key+((shift & 0x22)? ('!'-0x1e) : ('1'-0x1e));
-	else if(key >= 0x59 && key <= 0x61)
+	else if (key >= 0x59 && key <= 0x61)
 	  newkey = key+('1'-0x59);
-	else if(key >= 0x2d && key <= 0x38 && key != 0x31)
+	else if (key >= 0x2d && key <= 0x38 && key != 0x31)
 	  newkey = ((shift & 0x22)?
 		    "=?`{ }+*?<>?" :
 		    "-^@[ ];:?,./")[key - 0x2d];
-	else if(key >= 0x3a && key <= 0x43)
+	else if (key >= 0x3a && key <= 0x43)
 	  newkey = key+(Common::KEYCODE_F1-0x3a);
-	else if(key >= 0x54 && key <= 0x57)
+	else if (key >= 0x54 && key <= 0x57)
 	  newkey = "/*-+"[key-0x54];
 	else switch(key) {
 	case 0x27: case 0x62:
@@ -118,17 +118,17 @@
 	case 0x2c:
 	  newkey = Common::KEYCODE_SPACE; break;
 	case 0x4c:
-	  if((shift & 0x11) && (shift & 0x44))
+	  if ((shift & 0x11) && (shift & 0x44))
 	    exit(0);
 	  break;
 	case 0x4f:
-	  if(inter) newkey = 1001; else mouse_x++; break;
+	  if (inter) newkey = 1001; else mouse_x++; break;
 	case 0x50:
-	  if(inter) newkey = 1002; else mouse_x--; break;
+	  if (inter) newkey = 1002; else mouse_x--; break;
 	case 0x51:
-	  if(inter) newkey = 1003; else mouse_y++; break;
+	  if (inter) newkey = 1003; else mouse_y++; break;
 	case 0x52:
-	  if(inter) newkey = 1004; else mouse_y--; break;
+	  if (inter) newkey = 1004; else mouse_y--; break;
 	case 0x63:
 	  newkey = '.'; break;
 	case 0x64: case 0x87:
@@ -139,28 +139,28 @@
       }
     }
 
-  if(lmb && inter && !lastlmb) {
+  if (lmb && inter && !lastlmb) {
     newkey = 1000;
     lmb = 0;
   }
 
-  if(lmb && !lastlmb) {
+  if (lmb && !lastlmb) {
     lastlmb = 1;
     return -Common::EVENT_LBUTTONDOWN;
-  } else if(lastlmb && !lmb) {
+  } else if (lastlmb && !lmb) {
     lastlmb = 0;
     return -Common::EVENT_LBUTTONUP;
   }
-  if(rmb && !lastrmb) {
+  if (rmb && !lastrmb) {
     lastrmb = 1;
     return -Common::EVENT_RBUTTONDOWN;
-  } else if(lastrmb && !rmb) {
+  } else if (lastrmb && !rmb) {
     lastrmb = 0;
     return -Common::EVENT_RBUTTONUP;
   }
 
-  if(mouse_wheel != lastwheel)
-    if(((int8)(mouse_wheel - lastwheel)) > 0) {
+  if (mouse_wheel != lastwheel)
+    if (((int8)(mouse_wheel - lastwheel)) > 0) {
       lastwheel++;
       return -Common::EVENT_WHEELDOWN;
     } else {
@@ -168,22 +168,22 @@
       return -Common::EVENT_WHEELUP;
     }
 
-  if(newkey && inter && newkey != lastkey) {
+  if (newkey && inter && newkey != lastkey) {
     int transkey = inter->key(newkey, shiftFlags);
-    if(transkey) {
+    if (transkey) {
       newkey = transkey;
       inter = NULL;
     }
   }
 
-  if(!newkey || (lastkey && newkey != lastkey)) {
+  if (!newkey || (lastkey && newkey != lastkey)) {
     int upkey = lastkey;
     lastkey = 0;
-    if(upkey)
+    if (upkey)
       return upkey | (1<<30);
-  } else if(!lastkey) {
+  } else if (!lastkey) {
     lastkey = newkey;
-    if(newkey >= 1000 || !inter)
+    if (newkey >= 1000 || !inter)
       return newkey;
   }
 
@@ -194,13 +194,13 @@
 {
   unsigned int t = Timer();
 
-  if(_timer != NULL)
+  if (_timer != NULL)
     _timer->handler();
 
-  if(((int)(t-_devpoll))<0)
+  if (((int)(t-_devpoll))<0)
     return false;
   _devpoll += USEC_TO_TIMER(17000);
-  if(((int)(t-_devpoll))>=0)
+  if (((int)(t-_devpoll))>=0)
     _devpoll = t + USEC_TO_TIMER(17000);
 
   int mask = getimask();
@@ -220,25 +220,25 @@
     event.mouse.y -= _overlay_y;
   }
   event.kbd.ascii = event.kbd.keycode = 0;
-  if(e<0) {
+  if (e<0) {
     event.type = (Common::EventType)-e;
     return true;
-  } else if(e>0) {
+  } else if (e>0) {
     bool processed = false, down = !(e&(1<<30));
     e &= ~(1<<30);
-    if(e < 1000) {
+    if (e < 1000) {
       event.type = (down? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP);
       event.kbd.keycode = e;
       event.kbd.ascii = (e>='a' && e<='z' && (event.kbd.flags & Common::KBD_SHIFT)?
 			  e &~ 0x20 : e);
       processed = true;
-    } else if(down) {
-      if(e == 1005)
+    } else if (down) {
+      if (e == 1005)
 	setFeatureState(kFeatureVirtualKeyboard,
 			!getFeatureState(kFeatureVirtualKeyboard));
     }
     return processed;
-  } else if(_ms_cur_x != _ms_old_x || _ms_cur_y != _ms_old_y) {
+  } else if (_ms_cur_x != _ms_old_x || _ms_cur_y != _ms_old_y) {
     event.type = Common::EVENT_MOUSEMOVE;
     _ms_old_x = _ms_cur_x;
     _ms_old_y = _ms_cur_y;

Modified: scummvm/trunk/backends/platform/dc/label.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/label.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/label.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -47,13 +47,13 @@
 {
   unsigned char *src;
   int i, j;
-  if(c<=32 || c>255 || (c>=127 && c<160)) c=160;
-  if(c<128) c -= 32; else c -= 64;
+  if (c<=32 || c>255 || (c>=127 && c<160)) c=160;
+  if (c<128) c -= 32; else c -= 64;
   src = c*36 + (unsigned char *)font_base;
-  for(i=0; i<12; i++) {
+  for (i=0; i<12; i++) {
     int n = (src[0]<<16)|(src[1]<<8)|src[2];
-    for(j=0; j<12; j++, n<<=1)
-      if(n & (1<<23)) {
+    for (j=0; j<12; j++, n<<=1)
+      if (n & (1<<23)) {
 	dst[j] = 0xffff;
 	dst[j+1] = 0xffff;
 	dst[j+2] = 0xa108;
@@ -61,8 +61,8 @@
 	dst[j+mod+1] = 0xa108;
       }
     dst += mod;
-    for(j=0; j<12; j++, n<<=1)
-      if(n & (1<<23)) {
+    for (j=0; j<12; j++, n<<=1)
+      if (n & (1<<23)) {
 	dst[j] = 0xffff;
 	dst[j+1] = 0xffff;
 	dst[j+2] = 0xa108;
@@ -78,15 +78,15 @@
 {
   void *font = get_romfont_address();
   int l = strlen(text);
-  if(l>64) l=64;
+  if (l>64) l=64;
   int w = 14*l;
-  for(tex_u=TA_POLYMODE2_U_SIZE_8, u=8; u<w; u<<=1, tex_u += 1<<3);
+  for (tex_u=TA_POLYMODE2_U_SIZE_8, u=8; u<w; u<<=1, tex_u += 1<<3);
   int tsz = u*32;
   unsigned short *tex = (unsigned short *)ta_txalloc(tsz*2);
-  for(int i=0; i<tsz; i++)
+  for (int i=0; i<tsz; i++)
     tex[i] = 0;
   int p=l*14;
-  while(l>0)
+  while (l>0)
     draw_char(tex+(p-=14), u, text[--l], font);
   texture = tex;
 }

Modified: scummvm/trunk/backends/platform/dc/selector.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/selector.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/selector.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -162,7 +162,7 @@
 static bool isIcon(const FilesystemNode &entry)
 {
   int l = entry.displayName().size();
-  if(l>4 && !strcasecmp(entry.displayName().c_str()+l-4, ".ICO"))
+  if (l>4 && !strcasecmp(entry.displayName().c_str()+l-4, ".ICO"))
     return true;
   else
     return false;
@@ -172,13 +172,13 @@
 {
   char icofn[520];
   sprintf(icofn, "%s%s.ICO", game.dir, game.filename_base);
-  if(game.icon.load(icofn))
+  if (game.icon.load(icofn))
     return true;
-  for(int i=0; i<num_dirs; i++)
-    if(!strcmp(dirs[i].name, game.dir) &&
+  for (int i=0; i<num_dirs; i++)
+    if (!strcmp(dirs[i].name, game.dir) &&
        dirs[i].deficon[0]) {
       sprintf(icofn, "%s%s", game.dir, dirs[i].deficon);
-      if(game.icon.load(icofn))
+      if (game.icon.load(icofn))
 	return true;
       break;
     }
@@ -193,8 +193,8 @@
 
 static bool uniqueGame(const char *base, const char *dir, Game *games, int cnt)
 {
-  while(cnt--)
-    if(!strcmp(dir, games->dir) &&
+  while (cnt--)
+    if (!strcmp(dir, games->dir) &&
        !stricmp(base, games->filename_base))
       return false;
     else
@@ -207,7 +207,7 @@
   Dir *dirs = new Dir[MAX_DIR];
   int curr_game = 0, curr_dir = 0, num_dirs = 1;
   dirs[0].node = FilesystemNode("");
-  while(curr_game < max && curr_dir < num_dirs) {
+  while (curr_game < max && curr_dir < num_dirs) {
     strncpy(dirs[curr_dir].name, dirs[curr_dir].node.path().c_str(), 252);
     dirs[curr_dir].name[251] = '\0';
     dirs[curr_dir].deficon[0] = '\0';
@@ -216,13 +216,13 @@
     for (FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
 	 ++entry) {
       if (entry->isDirectory()) {
-	if(num_dirs < MAX_DIR && strcasecmp(entry->displayName().c_str(),
+	if (num_dirs < MAX_DIR && strcasecmp(entry->displayName().c_str(),
 					    "install")) {
 	  dirs[num_dirs].node = *entry;
 	  num_dirs++;
 	}
       } else
-	if(isIcon(*entry))
+	if (isIcon(*entry))
 	  strcpy(dirs[curr_dir-1].deficon, entry->displayName().c_str());
 	else
 	  files.push_back(*entry);
@@ -231,12 +231,12 @@
     GameList candidates;
     detectGames(files, candidates);
     
-    for(GameList::const_iterator ge = candidates.begin();
+    for (GameList::const_iterator ge = candidates.begin();
 	ge != candidates.end(); ++ge)
-      if(curr_game < max) {
+      if (curr_game < max) {
 	strcpy(games[curr_game].filename_base, ge->gameid().c_str());
 	strcpy(games[curr_game].dir, dirs[curr_dir-1].name);
-	if(uniqueGame(games[curr_game].filename_base,
+	if (uniqueGame(games[curr_game].filename_base,
 		      games[curr_game].dir, games, curr_game)) {
 	  
 	  strcpy(games[curr_game].text, ge->description().c_str());
@@ -251,8 +251,8 @@
       }
   }
 
-  for(int i=0; i<curr_game; i++)
-    if(!loadIcon(games[i], dirs, num_dirs))
+  for (int i=0; i<curr_game; i++)
+    if (!loadIcon(games[i], dirs, num_dirs))
       makeDefIcon(games[i].icon);
   delete[] dirs;
   return curr_game;
@@ -279,11 +279,11 @@
   void *mark = ta_txmark();
   lab.create_texture("Please insert game CD.");
   //printf("waitForDisk, cdstate = %d\n", getCdState());
-  for(;;) {
+  for (;;) {
     int s = getCdState();
-    if(s >= 6)
+    if (s >= 6)
       wasopen = 1;
-    if(s > 0 && s < 6 && wasopen) {
+    if (s > 0 && s < 6 && wasopen) {
       cdfs_reinit();
       chdir("/");
       chdir("/");
@@ -326,12 +326,12 @@
   int top_game = 0, selector_pos = 0;
   int mousex = 0, mousey = 0;
 
-  if(!num_games)
+  if (!num_games)
     return -1;
 
-  for(;;) {
+  for (;;) {
 
-    if(getCdState()>=6)
+    if (getCdState()>=6)
       return -1;
 
     ta_begin_frame();
@@ -341,10 +341,10 @@
     ta_commit_end();
 
     float y = 40.0;
-    for(int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
+    for (int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
       int pal = 48+(i&15);
 
-      if(cnt == selector_pos)
+      if (cnt == selector_pos)
 	draw_trans_quad(100.0, y, 590.0, y+32.0,
 			0x7000ff00, 0x7000ff00, 0x7000ff00, 0x7000ff00);
 
@@ -364,10 +364,10 @@
     event = handleInput(locked_get_pads(), mousex, mousey, shiftFlags);
     setimask(mask);
 
-    if(event==-Common::EVENT_LBUTTONDOWN || event==Common::KEYCODE_ENTER || event==Common::KEYCODE_F5) {
+    if (event==-Common::EVENT_LBUTTONDOWN || event==Common::KEYCODE_ENTER || event==Common::KEYCODE_F5) {
       int selected_game = top_game + selector_pos;
 
-      for(int fade=0; fade<=256; fade+=4) {
+      for (int fade=0; fade<=256; fade+=4) {
 
 	unsigned int fade_colour = 0x00ffffff | ((255-fade)<<24);
 
@@ -379,10 +379,10 @@
 
 	float y = 40.0;
 
-	if(fade < 256)
-	  for(int i=top_game, cnt=0; cnt<10 && i<num_games;
+	if (fade < 256)
+	  for (int i=top_game, cnt=0; cnt<10 && i<num_games;
 	      i++, cnt++, y += 40.0)
-	    if(cnt != selector_pos)
+	    if (cnt != selector_pos)
 	      drawGameLabel(games[i], 48+(i&15), 50.0, y, 0xffffff, fade);
 
 	y = (40.0/256.0 * (selector_pos + 1))*(256-fade) + 80.0/256.0*fade;
@@ -397,16 +397,16 @@
       return selected_game;
     }
 
-    if(mousey>=16) {
-      if(selector_pos + top_game + 1 < num_games)
-	if(++selector_pos >= 10) {
+    if (mousey>=16) {
+      if (selector_pos + top_game + 1 < num_games)
+	if (++selector_pos >= 10) {
 	  --selector_pos;
 	  ++top_game;
 	}
       mousey -= 16;
-    } else if(mousey<=-16) {
-      if(selector_pos + top_game > 0)
-	if(--selector_pos < 0) {
+    } else if (mousey<=-16) {
+      if (selector_pos + top_game > 0)
+	if (--selector_pos < 0) {
 	  ++selector_pos;
 	  --top_game;
 	}
@@ -423,10 +423,10 @@
   ta_sync();
   void *mark = ta_txmark();
 
-  for(;;) {
+  for (;;) {
     num_games = findGames(games, MAX_GAMES);
 
-    for(int i=0; i<num_games; i++) {
+    for (int i=0; i<num_games; i++) {
       games[i].icon.create_texture();
       games[i].label.create_texture(games[i].text);
     }
@@ -436,22 +436,22 @@
     ta_sync();
     ta_txrelease(mark);
 
-    if(selected == -1)
+    if (selected == -1)
       waitForDisk();
     else
       break;
 
   }
 
-  if(selected >= num_games)
+  if (selected >= num_games)
     selected = -1;
 
-  if(selected >= 0)
+  if (selected >= 0)
     the_game = games[selected];
 
   delete games;
 
-  if(selected>=0) {
+  if (selected>=0) {
 #if 0
     chdir(the_game.dir);
 #else

Modified: scummvm/trunk/backends/platform/dc/softkbd.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/softkbd.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/softkbd.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -70,10 +70,10 @@
   assert((sizeof(key_codes)/sizeof(key_codes[0])) == SK_NUM_KEYS);
 
   const char *np = key_names;
-  for(int i=0; i<SK_NUM_KEYS; i++) {
+  for (int i=0; i<SK_NUM_KEYS; i++) {
     labels[0][i].create_texture(np);
     np += strlen(np)+1;
-    if(key_codes[i]>8192) {
+    if (key_codes[i]>8192) {
       labels[1][i].create_texture(np);
       np += strlen(np)+1;
     }
@@ -92,19 +92,19 @@
 		  bg_alpha_mask|0x8080ff, bg_alpha_mask|0x8080ff);
   x0 = x += 4.0;
   y += 4.0;
-  for(int i=0; i<SK_NUM_KEYS; i++) {
+  for (int i=0; i<SK_NUM_KEYS; i++) {
     float w = (i == 58? 164.0 : 24.0);
     unsigned int bg = (i == keySel? bg_alpha_mask|0xffff00 :
 		       bg_alpha_mask|0xc0c0ff);
     draw_trans_quad(x, y, x+w, y+24.0, bg, bg, bg, bg);
-    if(key_codes[i]<0 && (shiftState & ~key_codes[i]))
+    if (key_codes[i]<0 && (shiftState & ~key_codes[i]))
       labels[0][i].draw(x+2, y+5, txt_alpha_mask|0xffffff, 0.5);
-    else if(key_codes[i]>8192 && (shiftState & Common::KBD_SHIFT))
+    else if (key_codes[i]>8192 && (shiftState & Common::KBD_SHIFT))
       labels[1][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
     else
       labels[0][i].draw(x+2, y+5, txt_alpha_mask|0x000000, 0.5);
     x += w+4.0;
-    if(++c == 11) {
+    if (++c == 11) {
       c = 0;
       x = x0;
       y += 28.0;
@@ -116,41 +116,41 @@
 {
   switch(k) {
   case 1001:
-    if(++keySel == SK_NUM_KEYS)
+    if (++keySel == SK_NUM_KEYS)
       keySel = 0;
     break;
   case 1002:
-    if(--keySel < 0)
+    if (--keySel < 0)
       keySel = SK_NUM_KEYS - 1;
     break;
   case 1003:
-    if(keySel >= 55) {
-      if(keySel > 58)
+    if (keySel >= 55) {
+      if (keySel > 58)
 	keySel += 5;
       keySel -= 55;
-    } else if(keySel > 47) {
-      if((keySel += 6) < 59)
+    } else if (keySel > 47) {
+      if ((keySel += 6) < 59)
 	keySel = 59;
     } else
       keySel += 11;
     break;
   case 1004:
-    if(keySel > 58)
+    if (keySel > 58)
       keySel -= 6;
-    else if((keySel -= 11) < 0)
-      if((keySel += 66) > 58)
-	if((keySel -= 5) < 59)
+    else if ((keySel -= 11) < 0)
+      if ((keySel += 66) > 58)
+	if ((keySel -= 5) < 59)
 	  keySel = 59;
     break;
   case 1000:
   case 13:
   case 32:
   case 319:
-    if(key_codes[keySel]<0)
+    if (key_codes[keySel]<0)
       shiftState ^= ~key_codes[keySel];
     else {
       shiftFlags = shiftState;
-      if(key_codes[keySel] > 8192)
+      if (key_codes[keySel] > 8192)
 	return ((shiftState & Common::KBD_SHIFT)? (key_codes[keySel]>>8):
 		key_codes[keySel]) & 0xff;
       else
@@ -164,9 +164,9 @@
 void SoftKeyboard::mouse(int x, int y)
 {
   os->mouseToSoftKbd(x, y, x, y);
-  if(x >= 0 && x < 11*28 && y >= 0 && y < 6*28 &&
+  if (x >= 0 && x < 11*28 && y >= 0 && y < 6*28 &&
      x%28 >= 4 && y%28 >= 4)
-    if((keySel = 11*(y/28)+(x/28)) > 58)
-      if((keySel -= 5) < 59)
+    if ((keySel = 11*(y/28)+(x/28)) > 58)
+      if ((keySel -= 5) < 59)
 	keySel = 58;
 }

Modified: scummvm/trunk/backends/platform/dc/time.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/time.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/time.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -51,8 +51,8 @@
   getMillis();
   unsigned int t, start = Timer();
   int time = (((unsigned int)msecs)*3125U)>>6;
-  while(((int)((t = Timer())-start))<time) {
-    if(_timer != NULL)
+  while (((int)((t = Timer())-start))<time) {
+    if (_timer != NULL)
       _timer->handler();
     checkSound();
   }

Modified: scummvm/trunk/backends/platform/dc/vmsave.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/vmsave.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/dc/vmsave.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -87,14 +87,14 @@
   time_t t;
   unsigned char iconbuffer[512+32];
 
-  if(!vmsfs_check_unit(vm, 0, &info))
+  if (!vmsfs_check_unit(vm, 0, &info))
     return VMSAVE_NOVM;
-  if(!vmsfs_get_superblock(&info, &super))
+  if (!vmsfs_get_superblock(&info, &super))
     return VMSAVE_NOVM;
   int free_cnt = vmsfs_count_free(&super);
-  if(vmsfs_open_file(&super, filename, &file))
+  if (vmsfs_open_file(&super, filename, &file))
     free_cnt += file.blks;
-  if(((128+512+size+511)>>9) > free_cnt)
+  if (((128+512+size+511)>>9) > free_cnt)
     return VMSAVE_NOSPACE;
 
   memset(&header, 0, sizeof(header));
@@ -117,7 +117,7 @@
   vmsfs_beep(&info, 1);
 
   vmsfs_errno = 0;
-  if(!vmsfs_create_file(&super, filename, &header,
+  if (!vmsfs_create_file(&super, filename, &header,
 			iconbuffer+sizeof(header.palette), NULL,
 			data, size, &tstamp)) {
     fprintf(stderr, "%s\n", vmsfs_describe_error());
@@ -140,16 +140,16 @@
   time_t t;
   unsigned char iconbuffer[512+32];
 
-  if(!vmsfs_check_unit(vm, 0, &info))
+  if (!vmsfs_check_unit(vm, 0, &info))
     return false;
-  if(!vmsfs_get_superblock(&info, &super))
+  if (!vmsfs_get_superblock(&info, &super))
     return false;
-  if(!vmsfs_open_file(&super, filename, &file))
+  if (!vmsfs_open_file(&super, filename, &file))
     return false;
 
   buffer = new char[size = file.size];
 
-  if(vmsfs_read_file(&file, (unsigned char *)buffer, size))
+  if (vmsfs_read_file(&file, (unsigned char *)buffer, size))
     return true;
 
   delete[] buffer;
@@ -165,19 +165,19 @@
   struct dir_entry de;
   int pl = strlen(prefix);
 
-  if(!vmsfs_check_unit(vm, 0, &info))
+  if (!vmsfs_check_unit(vm, 0, &info))
     return;
-  if(!vmsfs_get_superblock(&info, &super))
+  if (!vmsfs_get_superblock(&info, &super))
     return;
   vmsfs_open_dir(&super, &iter);
-  while(vmsfs_next_dir_entry(&iter, &de))
-    if(de.entry[0]) {
+  while (vmsfs_next_dir_entry(&iter, &de))
+    if (de.entry[0]) {
       char buf[16], *endp = NULL;
       strncpy(buf, (char *)de.entry+4, 12);
       buf[12] = 0;
       int l = strlen(buf);
       long i = 42;
-      if(l > pl && !strncmp(buf, prefix, pl) &&
+      if (l > pl && !strncmp(buf, prefix, pl) &&
 	 (i = strtol(buf+pl, &endp, 10))>=0 && i<num &&
 	 (endp - buf) == l)
 	marks[i] = true;
@@ -189,15 +189,15 @@
 {
   vmsaveResult r, res = VMSAVE_NOVM;
 
-  if(lastvm >= 0 &&
+  if (lastvm >= 0 &&
      (res = trySave(gamename, data, size, filename, icon, lastvm)) == VMSAVE_OK)
     return res;
 
-  for(int i=0; i<24; i++)
-    if((r = trySave(gamename, data, size, filename, icon, i)) == VMSAVE_OK) {
+  for (int i=0; i<24; i++)
+    if ((r = trySave(gamename, data, size, filename, icon, i)) == VMSAVE_OK) {
       lastvm = i;
       return r;
-    } else if(r > res)
+    } else if (r > res)
       res = r;
 
   return res;
@@ -205,12 +205,12 @@
 
 bool readSaveGame(char *&buffer, int &size, const char *filename)
 {
-  if(lastvm >= 0 &&
+  if (lastvm >= 0 &&
      tryLoad(buffer, size, filename, lastvm))
     return true;
 
-  for(int i=0; i<24; i++)
-    if(tryLoad(buffer, size, filename, i)) {
+  for (int i=0; i<24; i++)
+    if (tryLoad(buffer, size, filename, i)) {
       lastvm = i;
       return true;
     }
@@ -235,7 +235,7 @@
 
   ~InVMSave()
   {
-    if(buffer != NULL)
+    if (buffer != NULL)
       delete[] buffer;
   }
 
@@ -248,11 +248,11 @@
 
   void tryUncompress()
   {
-    if(_size > 0 && buffer[0] != 'S') {
+    if (_size > 0 && buffer[0] != 'S') {
       // Data does not start with "SCVM".  Maybe compressed?
       char *expbuf = new char[MAX_SAVE_SIZE];
       unsigned long destlen = MAX_SAVE_SIZE;
-      if(!uncompress((Bytef*)expbuf, &destlen, (Bytef*)buffer, _size)) {
+      if (!uncompress((Bytef*)expbuf, &destlen, (Bytef*)buffer, _size)) {
 	delete[] buffer;
 	buffer = expbuf;
 	_size = destlen;
@@ -294,7 +294,7 @@
 
   virtual Common::InSaveFile *openForLoading(const char *filename) {
 	InVMSave *s = new InVMSave();
-	if(s->readSaveGame(filename)) {
+	if (s->readSaveGame(filename)) {
 	  s->tryUncompress();
 	  return s;
 	} else {
@@ -311,26 +311,26 @@
   extern const char *gGameName;
   extern Icon icon;
 
-  if(committed >= pos)
+  if (committed >= pos)
     return;
 
   char *data = buffer, *compbuf = NULL;
   int len = pos;
 
-  if(pos) {
+  if (pos) {
     // Try compression
     compbuf = new char[pos];
     unsigned long destlen = pos;
-    if(!compress((Bytef*)compbuf, &destlen, (Bytef*)buffer, pos)) {
+    if (!compress((Bytef*)compbuf, &destlen, (Bytef*)buffer, pos)) {
       data = compbuf;
       len = destlen;
     }
   }
   vmsaveResult r = writeSaveGame(gGameName, data, len, filename, icon);
   committed = pos;
-  if(compbuf != NULL)
+  if (compbuf != NULL)
     delete[] compbuf;
-  if(r != VMSAVE_OK)
+  if (r != VMSAVE_OK)
     iofailed = true;
   displaySaveResult(r);
 }
@@ -375,9 +375,9 @@
     _pos = _size + offs;
     break;
   }
-  if(_pos < 0)
+  if (_pos < 0)
     _pos = 0;
-  else if(_pos > _size)
+  else if (_pos > _size)
     _pos = _size;
 }
 
@@ -399,7 +399,7 @@
 {
   memset(marks, false, num*sizeof(bool));
 
-  for(int i=0; i<24; i++)
+  for (int i=0; i<24; i++)
     tryList(prefix, marks, num, i);
 }
 

Modified: scummvm/trunk/backends/platform/ds/arm7/source/main.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm7/source/main.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/ds/arm7/source/main.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -483,7 +483,7 @@
     IPC->battery   = batt;
     IPC->aux       = aux;
 
-    for(u32 i=0; i<sizeof(ct); i++) {
+    for (u32 i=0; i<sizeof(ct); i++) {
       IPC->curtime[i] = ct[i];
     }
 
@@ -527,7 +527,7 @@
 // interrupt handler to allow incoming notifications from arm9
 void arm7_fifo() { // check incoming fifo messages
    u32 msg = REG_IPC_FIFO_RX;
-   if(msg==0x87654321) Wifi_Sync();
+   if (msg==0x87654321) Wifi_Sync();
 }
 
  
@@ -543,13 +543,13 @@
 	// sync with arm9 and init wifi
 	u32 fifo_temp;
 
-	while(1) { // wait for magic number
-		while(REG_IPC_FIFO_CR&IPC_FIFO_RECV_EMPTY) swiWaitForVBlank();
+	while (1) { // wait for magic number
+		while (REG_IPC_FIFO_CR&IPC_FIFO_RECV_EMPTY) swiWaitForVBlank();
 		fifo_temp=REG_IPC_FIFO_RX;
-		if(fifo_temp==0x12345678) break;
+		if (fifo_temp==0x12345678) break;
    	}
 
-   	while(REG_IPC_FIFO_CR&IPC_FIFO_RECV_EMPTY) swiWaitForVBlank();
+   	while (REG_IPC_FIFO_CR&IPC_FIFO_RECV_EMPTY) swiWaitForVBlank();
    	fifo_temp=REG_IPC_FIFO_RX; // give next value to wifi_init
    	Wifi_Init(fifo_temp);
 

Modified: scummvm/trunk/backends/platform/ds/arm9/source/blitters.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/blitters.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/ds/arm9/source/blitters.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -148,7 +148,7 @@
         return;
     isDivBy5Ready = true;
 
-    for(int i=0; i<160; ++i)
+    for (int i=0; i<160; ++i)
     {
         DIV_BY_5[i] = (2*i+5)/10;
     }                
@@ -311,7 +311,7 @@
 {
     ComputeDivBy5TableIFN();
     
-    for(size_t i=0; i<64; ++i)
+    for (size_t i=0; i<64; ++i)
     {
         u32 s0 = palette[src[5*i+0]];
         u32 s1 = palette[src[5*i+1]];
@@ -325,7 +325,7 @@
 #else
 static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const u8* src, const u16* palette)
 {
-    for(size_t i=0; i<64; ++i)
+    for (size_t i=0; i<64; ++i)
     {
         u16 s0 = palette[src[5*i+0]];
         u16 s1 = palette[src[5*i+1]];
@@ -344,7 +344,7 @@
 {
     ComputeDivBy5TableIFN();
     
-    for(size_t i=0; i<64; ++i)
+    for (size_t i=0; i<64; ++i)
     {
         u16 s0 = src[5*i+0];
         u16 s1 = src[5*i+1];
@@ -362,7 +362,7 @@
 	u32 fastRam[768];
 
     // Palette lookup -> 0_888
-    for(size_t i=0; i<256; ++i)
+    for (size_t i=0; i<256; ++i)
     {
         u32 col = palette[i];
         u32 result = col & 0x0000001F;
@@ -372,7 +372,7 @@
         fastRam[i] = result;
     }
 
-	for(size_t i=0; i<200; ++i)
+	for (size_t i=0; i<200; ++i)
 	{
 		Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);			
 	}
@@ -381,10 +381,10 @@
 void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* palette, int destStride, int srcStride)
 {
 	u16 fastRam[256];
-    for(size_t i=0; i<128; ++i)
+    for (size_t i=0; i<128; ++i)
         ((u32*)fastRam)[i] = ((const u32*)palette)[i];
 
-	for(size_t i=0; i<200; ++i)
+	for (size_t i=0; i<200; ++i)
 	{
 		Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);			
 	}
@@ -393,7 +393,7 @@
 
 void Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStride, int srcStride)
 {
-	for(size_t i=0; i<200; ++i)
+	for (size_t i=0; i<200; ++i)
 	{
 		Rescale_320x1555Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride);
 	}

Modified: scummvm/trunk/backends/platform/ds/arm9/source/compressor/lz.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/compressor/lz.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/ds/arm9/source/compressor/lz.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -105,7 +105,7 @@
 {
     unsigned int len;
 
-    for( len = minlen; (len < maxlen) && (str1[len] == str2[len]); ++ len );
+    for ( len = minlen; (len < maxlen) && (str1[len] == str2[len]); ++ len );
 
     return len;
 }
@@ -123,18 +123,18 @@
 
     /* Determine number of bytes needed to store the number x */
     y = x >> 3;
-    for( num_bytes = 5; num_bytes >= 2; -- num_bytes )
+    for ( num_bytes = 5; num_bytes >= 2; -- num_bytes )
     {
-        if( y & 0xfe000000 ) break;
+        if ( y & 0xfe000000 ) break;
         y <<= 7;
     }
 
     /* Write all bytes, seven bits in each, with 8:th bit set for all */
     /* but the last byte. */
-    for( i = num_bytes-1; i >= 0; -- i )
+    for ( i = num_bytes-1; i >= 0; -- i )
     {
         b = (x >> (i*7)) & 0x0000007f;
-        if( i > 0 )
+        if ( i > 0 )
         {
             b |= 0x00000080;
         }
@@ -164,7 +164,7 @@
         y = (y << 7) | (b & 0x0000007f);
         ++ num_bytes;
     }
-    while( b & 0x00000080 );
+    while ( b & 0x00000080 );
 
     /* Store value in x */
     *x = y;
@@ -200,26 +200,26 @@
     unsigned char *ptr1, *ptr2;
 
     /* Do we have anything to compress? */
-    if( insize < 1 )
+    if ( insize < 1 )
     {
         return 0;
     }
 
     /* Create histogram */
-    for( i = 0; i < 256; ++ i )
+    for ( i = 0; i < 256; ++ i )
     {
         histogram[ i ] = 0;
     }
-    for( i = 0; i < insize; ++ i )
+    for ( i = 0; i < insize; ++ i )
     {
         ++ histogram[ in[ i ] ];
     }
 
     /* Find the least common byte, and use it as the code marker */
     marker = 0;
-    for( i = 1; i < 256; ++ i )
+    for ( i = 1; i < 256; ++ i )
     {
-        if( histogram[ i ] < histogram[ marker ] )
+        if ( histogram[ i ] < histogram[ marker ] )
         {
             marker = i;
         }
@@ -237,7 +237,7 @@
     do
     {
         /* Determine most distant position */
-        if( inpos > LZ_MAX_OFFSET ) maxoffset = LZ_MAX_OFFSET;
+        if ( inpos > LZ_MAX_OFFSET ) maxoffset = LZ_MAX_OFFSET;
         else                        maxoffset = inpos;
 
         /* Get pointer to current position */
@@ -246,13 +246,13 @@
         /* Search history window for maximum length string match */
         bestlength = 3;
         bestoffset = 0;
-        for( offset = 3; offset <= maxoffset; ++ offset )
+        for ( offset = 3; offset <= maxoffset; ++ offset )
         {
             /* Get pointer to candidate string */
             ptr2 = &ptr1[ -offset ];
 
             /* Quickly determine if this is a candidate (for speed) */
-            if( (ptr1[ 0 ] == ptr2[ 0 ]) &&
+            if ( (ptr1[ 0 ] == ptr2[ 0 ]) &&
                 (ptr1[ bestlength ] == ptr2[ bestlength ]) )
             {
                 /* Determine maximum length for this offset */
@@ -262,7 +262,7 @@
                 length = _LZ_StringCompare( ptr1, ptr2, 0, maxlength );
 
                 /* Better match than any previous match? */
-                if( length > bestlength )
+                if ( length > bestlength )
                 {
                     bestlength = length;
                     bestoffset = offset;
@@ -271,7 +271,7 @@
         }
 
         /* Was there a good enough match? */
-        if( (bestlength >= 8) ||
+        if ( (bestlength >= 8) ||
             ((bestlength == 4) && (bestoffset <= 0x0000007f)) ||
             ((bestlength == 5) && (bestoffset <= 0x00003fff)) ||
             ((bestlength == 6) && (bestoffset <= 0x001fffff)) ||
@@ -288,19 +288,19 @@
             /* Output single byte (or two bytes if marker byte) */
             symbol = in[ inpos ++ ];
             out[ outpos ++ ] = symbol;
-            if( symbol == marker )
+            if ( symbol == marker )
             {
                 out[ outpos ++ ] = 0;
             }
             -- bytesleft;
         }
     }
-    while( bytesleft > 3 );
+    while ( bytesleft > 3 );
 
     /* Dump remaining bytes, if any */
-    while( inpos < insize )
+    while ( inpos < insize )
     {
-        if( in[ inpos ] == marker )
+        if ( in[ inpos ] == marker )
         {
             out[ outpos ++ ] = marker;
             out[ outpos ++ ] = 0;
@@ -338,7 +338,7 @@
     unsigned char *ptr1, *ptr2;
 
     /* Do we have anything to compress? */
-    if( insize < 1 )
+    if ( insize < 1 )
     {
         return 0;
     }
@@ -353,11 +353,11 @@
        in[i+1] == in[jumptable[i]+1]. Following the jump table gives a
        dramatic boost for the string search'n'match loop compared to doing
        a brute force search. */
-    for( i = 0; i < 65536; ++ i )
+    for ( i = 0; i < 65536; ++ i )
     {
         lastindex[ i ] = 0xffffffff;
     }
-    for( i = 0; i < insize-1; ++ i )
+    for ( i = 0; i < insize-1; ++ i )
     {
         symbols = (((unsigned int)in[i]) << 8) | ((unsigned int)in[i+1]);
         index = lastindex[ symbols ];
@@ -367,20 +367,20 @@
     jumptable[ insize-1 ] = 0xffffffff;
 
     /* Create histogram */
-    for( i = 0; i < 256; ++ i )
+    for ( i = 0; i < 256; ++ i )
     {
         histogram[ i ] = 0;
     }
-    for( i = 0; i < insize; ++ i )
+    for ( i = 0; i < insize; ++ i )
     {
         ++ histogram[ in[ i ] ];
     }
 
     /* Find the least common byte, and use it as the code marker */
     marker = 0;
-    for( i = 1; i < 256; ++ i )
+    for ( i = 1; i < 256; ++ i )
     {
-        if( histogram[ i ] < histogram[ marker ] )
+        if ( histogram[ i ] < histogram[ marker ] )
         {
             marker = i;
         }
@@ -404,13 +404,13 @@
         bestlength = 3;
         bestoffset = 0;
         index = jumptable[ inpos ];
-        while( index != 0xffffffff )
+        while ( index != 0xffffffff )
         {
             /* Get pointer to candidate string */
             ptr2 = &in[ index ];
 
             /* Quickly determine if this is a candidate (for speed) */
-            if( ptr2[ bestlength ] == ptr1[ bestlength ] )
+            if ( ptr2[ bestlength ] == ptr1[ bestlength ] )
             {
                 /* Determine maximum length for this offset */
                 offset = inpos - index;
@@ -420,7 +420,7 @@
                 length = _LZ_StringCompare( ptr1, ptr2, 2, maxlength );
 
                 /* Better match than any previous match? */
-                if( length > bestlength )
+                if ( length > bestlength )
                 {
                     bestlength = length;
                     bestoffset = offset;
@@ -432,7 +432,7 @@
         }
 
         /* Was there a good enough match? */
-        if( (bestlength >= 8) ||
+        if ( (bestlength >= 8) ||
             ((bestlength == 4) && (bestoffset <= 0x0000007f)) ||
             ((bestlength == 5) && (bestoffset <= 0x00003fff)) ||
             ((bestlength == 6) && (bestoffset <= 0x001fffff)) ||
@@ -449,19 +449,19 @@
             /* Output single byte (or two bytes if marker byte) */
             symbol = in[ inpos ++ ];
             out[ outpos ++ ] = symbol;
-            if( symbol == marker )
+            if ( symbol == marker )
             {
                 out[ outpos ++ ] = 0;
             }
             -- bytesleft;
         }
     }
-    while( bytesleft > 3 );
+    while ( bytesleft > 3 );
 
     /* Dump remaining bytes, if any */
-    while( inpos < insize )
+    while ( inpos < insize )
     {
-        if( in[ inpos ] == marker )
+        if ( in[ inpos ] == marker )
         {
             out[ outpos ++ ] = marker;
             out[ outpos ++ ] = 0;
@@ -492,7 +492,7 @@
     unsigned int  i, inpos, outpos, length, offset;
 
     /* Do we have anything to compress? */
-    if( insize < 1 )
+    if ( insize < 1 )
     {
         return;
     }
@@ -506,10 +506,10 @@
     do
     {
         symbol = in[ inpos ++ ];
-        if( symbol == marker )
+        if ( symbol == marker )
         {
             /* We had a marker byte */
-            if( in[ inpos ] == 0 )
+            if ( in[ inpos ] == 0 )
             {
                 /* It was a single occurrence of the marker byte */
                 out[ outpos ++ ] = marker;
@@ -522,7 +522,7 @@
                 inpos += _LZ_ReadVarSize( &offset, &in[ inpos ] );
 
                 /* Copy corresponding data from history window */
-                for( i = 0; i < length; ++ i )
+                for ( i = 0; i < length; ++ i )
                 {
                     out[ outpos ] = out[ outpos - offset ];
                     ++ outpos;
@@ -535,5 +535,5 @@
             out[ outpos ++ ] = symbol;
         }
     }
-    while( inpos < insize );
+    while ( inpos < insize );
 }

Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -305,14 +305,14 @@
 }
 
 void initSprites() {
-	for(int i = 0; i < 128; i++) {
+	for (int i = 0; i < 128; i++) {
 	   sprites[i].attribute[0] = ATTR0_DISABLED;
 	   sprites[i].attribute[1] = 0;
 	   sprites[i].attribute[2] = 0;
 	   sprites[i].attribute[3] = 0;
     }
 	
-	for(int i = 0; i < 128; i++) {
+	for (int i = 0; i < 128; i++) {
 	   spritesMain[i].attribute[0] = ATTR0_DISABLED;
 	   spritesMain[i].attribute[1] = 0;
 	   spritesMain[i].attribute[2] = 0;

Modified: scummvm/trunk/backends/platform/gp2x/events.cpp
===================================================================
--- scummvm/trunk/backends/platform/gp2x/events.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/gp2x/events.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -183,17 +183,17 @@
 
 	memcpy(stickBtn, _stickBtn, sizeof(stickBtn));
 
-	if((stickBtn[0])||(stickBtn[2])||(stickBtn[4])||(stickBtn[6]))
+	if ((stickBtn[0])||(stickBtn[2])||(stickBtn[4])||(stickBtn[6]))
 		stickBtn[1] = stickBtn[3] = stickBtn[5] = stickBtn[7] = 0;
 
-	if((stickBtn[1])||(stickBtn[2])||(stickBtn[3])){
-		if(_km.x_down_count!=2){
+	if ((stickBtn[1])||(stickBtn[2])||(stickBtn[3])){
+		if (_km.x_down_count!=2){
 			_km.x_vel = -1;
 			_km.x_down_count = 1;
 		}else
 			_km.x_vel = -4;
-	} else if((stickBtn[5])||(stickBtn[6])||(stickBtn[7])){
-		if(_km.x_down_count!=2){
+	} else if ((stickBtn[5])||(stickBtn[6])||(stickBtn[7])){
+		if (_km.x_down_count!=2){
 			_km.x_vel = 1;
 			_km.x_down_count = 1;
 		}else
@@ -205,14 +205,14 @@
 	}
 
 
-	if((stickBtn[0])||(stickBtn[1])||(stickBtn[7])){
-		if(_km.y_down_count!=2){
+	if ((stickBtn[0])||(stickBtn[1])||(stickBtn[7])){
+		if (_km.y_down_count!=2){
 			_km.y_vel = -1;
 			_km.y_down_count = 1;
 		}else
 			_km.y_vel = -4;
-	} else if((stickBtn[3])||(stickBtn[4])||(stickBtn[5])){
-		if(_km.y_down_count!=2){
+	} else if ((stickBtn[3])||(stickBtn[4])||(stickBtn[5])){
+		if (_km.y_down_count!=2){
 			_km.y_vel = 1;
 		 	_km.y_down_count = 1;
 		}else
@@ -302,7 +302,7 @@
 	GP2X_BUTTON_L &	GP2X_BUTTON_A				Common::EVENT_PREDICTIVE_DIALOG for predictive text entry box (AGI games)
 	*/
 
-	while(SDL_PollEvent(&ev)) {
+	while (SDL_PollEvent(&ev)) {
 
 		switch(ev.type) {
 		case SDL_KEYDOWN:{

Modified: scummvm/trunk/backends/platform/gp2x/gp2x-hw.cpp
===================================================================
--- scummvm/trunk/backends/platform/gp2x/gp2x-hw.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/gp2x/gp2x-hw.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -63,18 +63,18 @@
 
 void GP2X_device_init() {
 	// Open devices
-	if(!gp2x_dev[0])  gp2x_dev[0] = open("/dev/mixer", O_RDWR);
-	if(!gp2x_dev[1])  gp2x_dev[1] = open("/dev/batt",   O_RDONLY);
-	if(!gp2x_dev[2])  gp2x_dev[2] = open("/dev/mem",   O_RDWR);
+	if (!gp2x_dev[0])  gp2x_dev[0] = open("/dev/mixer", O_RDWR);
+	if (!gp2x_dev[1])  gp2x_dev[1] = open("/dev/batt",   O_RDONLY);
+	if (!gp2x_dev[2])  gp2x_dev[2] = open("/dev/mem",   O_RDWR);
 }
 
 void GP2X_device_deinit() {
 	// Close devices
 	{
 		int i;
-		for(i=0;i<8;i++)
+		for (i=0;i<8;i++)
 		{
-			if(gp2x_dev[i])
+			if (gp2x_dev[i])
 			{
 				close(gp2x_dev[i]);
 			}
@@ -211,7 +211,7 @@
 void gp2x_video_wait_vsync(void)
 {
 	MEM_REG[0x2846>>1]=(MEM_REG[0x2846>>1] | 0x20) & ~2;
-	while(!(MEM_REG[0x2846>>1] & 2));
+	while (!(MEM_REG[0x2846>>1] & 2));
 }
 
 //char GP2X_get_battery_level() {

Modified: scummvm/trunk/backends/platform/gp32/debug-gdbstub-usb.cpp
===================================================================
--- scummvm/trunk/backends/platform/gp32/debug-gdbstub-usb.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/gp32/debug-gdbstub-usb.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -215,7 +215,7 @@
 	bool bBreak = false;
 	int iResult;
 
-	while(!bBreak) {
+	while (!bBreak) {
 		iResult = g_Comm.comm_recv((unsigned char *)g_SendBuffer, 0x100);
 		if (iResult > 0) {
 			bBreak = true;
@@ -234,7 +234,7 @@
 	g_SendBuffer[iOffset++] = '$';
 
 	iCheckSum = 0;
-	while(*pCommand != 0) {
+	while (*pCommand != 0) {
 		g_SendBuffer[iOffset++] = *pCommand;
 		iCheckSum += *pCommand++;
 	}
@@ -285,7 +285,7 @@
 	g_SendBuffer[iOffset++] = '$';
 
 	iCheckSum = 0;
-	while(*pCommand != 0) {
+	while (*pCommand != 0) {
 		g_SendBuffer[iOffset++] = *pCommand;
 		iCheckSum += *pCommand++;
 	}
@@ -340,7 +340,7 @@
 // equiv to strcat i imagine
 void PrintToString(char *pString, char *pOtherString)
 {
-	while(*pOtherString != 0) {
+	while (*pOtherString != 0) {
 		*pString = *pOtherString;
 		*pString++;
 		*pOtherString++;
@@ -644,7 +644,7 @@
 		uiOffset += 2;
 	}
 	/*
-	while(1);
+	while (1);
 	unsigned int *piData = (unsigned int *)pAddr;
 	*piData = 0xe7ffdefe;//0xfedeffe7;
 	*/
@@ -696,7 +696,7 @@
 {
 	int iRetVal = 0;
 
-	while(*pBuffer != sign) {
+	while (*pBuffer != sign) {
 		iRetVal++;
 		*pBuffer++;
 	}
@@ -830,7 +830,7 @@
 			break;
 		case MODE_DUNNO:
 		default:
-			while(1);
+			while (1);
 	}
 	*/
 	SendBreakPoint();
@@ -928,7 +928,7 @@
 		case MODE_DUNNO:
 		default:
 			//Printf("Dunno!!\n");
-			while(1);
+			while (1);
 	}
 
 
@@ -1035,13 +1035,13 @@
 			Printf("Restore: 0x%x", g_SavedStepInstruction);
 			#endif
 		} else {
-			while(1);
+			while (1);
 		}
 		g_LastWasStep = false;
 	}
 
 
-	while(!bBreakLoop) {
+	while (!bBreakLoop) {
 		iResult = RecvUSB(g_ReadBuffer, 0x100);
 		//Printf("%d\n", iResult);
 
@@ -1061,7 +1061,7 @@
 
 			// I can see that i get a bunch of '+' and '-' in the messages.. lets remove them.
 			iOffsetAdd = 4;
-			while((g_ReadBuffer[iOffsetAdd] == '+') || (g_ReadBuffer[iOffsetAdd] == '-')) iOffsetAdd++;
+			while ((g_ReadBuffer[iOffsetAdd] == '+') || (g_ReadBuffer[iOffsetAdd] == '-')) iOffsetAdd++;
 
 			// Check whether it's legimit command
 			if (g_ReadBuffer[iOffsetAdd] == '$') {
@@ -1608,7 +1608,7 @@
 {
 	unsigned int uiRetval;
 
-	while(uiSteps-- > 0) {
+	while (uiSteps-- > 0) {
 		if (uiValue & 0x01) {
 			uiValue = (uiValue >> 1) | 0x80000000;
 		} else {

Modified: scummvm/trunk/backends/platform/gp32/gp32std_input.cpp
===================================================================
--- scummvm/trunk/backends/platform/gp32/gp32std_input.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/gp32/gp32std_input.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -195,7 +195,7 @@
 bool gp_pollButtonEvent(GP32BtnEvent *ev) {
 	gp_pumpButtonEvent();
 
-	if(eventQueue.isEmpty()) {
+	if (eventQueue.isEmpty()) {
 		return false;
 	}
 

Modified: scummvm/trunk/backends/platform/gp32/gp32std_memory.cpp
===================================================================
--- scummvm/trunk/backends/platform/gp32/gp32std_memory.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/gp32/gp32std_memory.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -114,7 +114,7 @@
 		}
 		blk++;
 	}
-	if(i == NUM_BLOCK) {
+	if (i == NUM_BLOCK) {
 		blk = &block[0];
 		for (i = 0; i < prevBlock; i++) {
 			if (!blk->used) {
@@ -122,7 +122,7 @@
 			}
 			blk++;
 		}
-		if(i == prevBlock) {
+		if (i == prevBlock) {
 			prevBlock = 0;
 			return gm_malloc(size);
 		}
@@ -289,7 +289,7 @@
 	void *ptr = gp_malloc(size);
 
 #if defined(CLEAN_MEMORY_WITH_0xE7)
-	if(ptr != NULL) {
+	if (ptr != NULL) {
 		gp_memset(ptr, 0xE7, size);
 	}
 #endif

Modified: scummvm/trunk/backends/platform/psp/osys_psp.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/osys_psp.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/psp/osys_psp.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -235,13 +235,13 @@
 		}
 	}
 
-	if(_overlayVisible) {
+	if (_overlayVisible) {
 		for (int i = 0; i < _screenHeight; ++i) {
 			for (int j = 0; j < _screenWidth; ++j) {
 
 				OverlayColor pixel = _overlayBuffer[(i * _overlayWidth +j)];
 
-				if(pixel & 0x8000)
+				if (pixel & 0x8000)
 					putPixel(xStart + j, yStart + i, pixel);
 			}
 		}
@@ -362,7 +362,7 @@
 OverlayColor OSystem_PSP::ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
 	OverlayColor color = RGBToColor(r, g, b);
 
-	if(a == 255)
+	if (a == 255)
 		color |= 0x8000;
 
 	return color;
@@ -370,7 +370,7 @@
 
 void OSystem_PSP::colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) {
 		colorToRGB(color, r, g, b);
-		if(color & 0x8000)
+		if (color & 0x8000)
 			a = 255;
 		else
 			a = 0;
@@ -530,7 +530,7 @@
 
 			if (newX < 0) newX = 0;
 			if (newY < 0) newY = 0;
-			if(_overlayVisible)
+			if (_overlayVisible)
 			{
 				if (newX >= _overlayWidth) newX = _overlayWidth - 1;
 				if (newY >= _overlayHeight) newY = _overlayHeight - 1;		

Modified: scummvm/trunk/backends/platform/psp/osys_psp_gu.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/osys_psp_gu.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/psp/osys_psp_gu.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -149,7 +149,7 @@
 	_kbdClut[0] = 0xffff;
 	_kbdClut[246] = 0x4ccc;
 	_kbdClut[247] = 0x0000;
-	for(int i=1;i<31;i++)
+	for (int i=1;i<31;i++)
 		_kbdClut[i] = 0xf888;
 	_mouseVisible = false;
 	sceKernelDcacheWritebackAll();
@@ -167,8 +167,8 @@
 bool OSystem_PSP_GU::setGraphicsMode(const char *name) {
 	int i = 0;
 
-	while(s_supportedGraphicsModes[i].name) {
-		if(!strcmpi(s_supportedGraphicsModes[i].name, name)) {
+	while (s_supportedGraphicsModes[i].name) {
+		if (!strcmpi(s_supportedGraphicsModes[i].name, name)) {
 			_graphicMode = s_supportedGraphicsModes[i].id;
 			return true;
 		}
@@ -196,7 +196,7 @@
 	mouseClut[_mouseKeyColour] = 0;
 	sceKernelDcacheWritebackAll();
 	
-	for(unsigned int i=0;i<h;i++)
+	for (unsigned int i=0;i<h;i++)
 		memcpy(_mouseBuf+i*MOUSE_SIZE, buf+i*w, w);
 }
 
@@ -277,7 +277,7 @@
 	sceGuClutMode(GU_PSM_5551, 0, 0xff, 0);
 	sceGuClutLoad(32, clut256); // upload 32*8 entries (256)
 	sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
-	if(_screenWidth == 320)
+	if (_screenWidth == 320)
 	    	sceGuTexImage(0, 512, 256, _screenWidth, _offscreen);
 	else
 	    	sceGuTexImage(0, 512, 512, _screenWidth, _offscreen);
@@ -315,7 +315,7 @@
 	}
 
 	sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
-	if(_screenWidth == 640) {
+	if (_screenWidth == 640) {
 		sceGuTexImage(0, 512, 512, _screenWidth, _offscreen+512);
 		vertices[0].u = 512 + 0.5; vertices[1].v = _screenHeight - 0.5;
 		vertices[0].x += (vertices[1].x - vertices[0].x) * 511 / 640; vertices[0].y = 0; vertices[0].z = 0;
@@ -324,7 +324,7 @@
 			
 	
 	// draw overlay
-	if(_overlayVisible) {
+	if (_overlayVisible) {
 		vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
 		vertices[1].x = PSP_SCREEN_WIDTH; vertices[1].y = PSP_SCREEN_HEIGHT; vertices[1].z = 0;
 		vertices[0].u = 0.5; vertices[0].v = 0.5;
@@ -340,7 +340,7 @@
 		sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); 
 		sceGuDrawArray(GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,vertices);
 		// need to render twice for textures > 512
-		if( _overlayWidth > 512) {
+		if ( _overlayWidth > 512) {
 			sceGuTexImage(0, 512, 512, _overlayWidth, _overlayBuffer + 512);
 			vertices[0].u = 512 + 0.5; vertices[1].v = _overlayHeight - 0.5;
 			vertices[0].x = PSP_SCREEN_WIDTH * 512 / 640; vertices[0].y = 0; vertices[0].z = 0;
@@ -365,7 +365,7 @@
 		int mX = _mouseX - _mouseHotspotX;
 		int mY = _mouseY - _mouseHotspotY;
 		
-		if(_overlayVisible) {
+		if (_overlayVisible) {
 			float scalex, scaley;
 
 			scalex = (float)PSP_SCREEN_WIDTH /_overlayWidth;
@@ -417,7 +417,7 @@
 		sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
 	}
 
-	if(_keyboardVisible) {
+	if (_keyboardVisible) {
 		sceGuTexMode(GU_PSM_T8, 0, 0, 0); // 8-bit image
 		sceGuClutMode(GU_PSM_4444, 0, 0xff, 0);
 		sceGuClutLoad(32, kbClut); // upload 32*8 entries (256)
@@ -469,13 +469,13 @@
 	uint32 buttonsChanged = pad.Buttons ^ _prevButtons;
 
 	if  ((buttonsChanged & PSP_CTRL_SELECT) || (pad.Buttons & PSP_CTRL_SELECT)) {
-		if( !(pad.Buttons & PSP_CTRL_SELECT) )
+		if ( !(pad.Buttons & PSP_CTRL_SELECT) )
 			_keyboardVisible = !_keyboardVisible;
 		_prevButtons = pad.Buttons;
 		return false;
 	}
 
-	if(!_keyboardVisible)
+	if (!_keyboardVisible)
 		return OSystem_PSP::pollEvent(event);
 
 	if ( (buttonsChanged & PSP_CTRL_RTRIGGER) && !(pad.Buttons & PSP_CTRL_RTRIGGER))
@@ -520,17 +520,17 @@
 	x = pad.Lx-128;
 	y = pad.Ly-128;
 	_kbdClut[_keySelected] = 0xf888;
-	if(x*x + y*y > 10000) {
+	if (x*x + y*y > 10000) {
 		nub_angle = atan2(y, x);
 		_keySelected = (int)(1 + (M_PI + nub_angle) * 30 / (2 * M_PI));
 		_keySelected -= 2;
-		if(_keySelected < 1)
+		if (_keySelected < 1)
 			_keySelected += 30;
 		_kbdClut[_keySelected] = 0xffff;
 	
 		if  (buttonsChanged & PSP_CTRL_CROSS) {
 			event.type = (pad.Buttons & PSP_CTRL_CROSS) ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP;
-			if(_keySelected > 26) {
+			if (_keySelected > 26) {
 				event.kbd.flags = 0;
 				switch(_keySelected) {
 					case 27:
@@ -570,7 +570,7 @@
 						}
 						break;
 					case (SYMBOLS|CAPS_LOCK):
-						if(_keySelected < 21) {
+						if (_keySelected < 21) {
 							event.kbd.flags = 0;
 							event.kbd.ascii = kbd_ascii_cl[_keySelected-1];
 							event.kbd.keycode = kbd_code_cl[ _keySelected-1];

Modified: scummvm/trunk/backends/platform/psp/trace.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/trace.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/psp/trace.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -41,7 +41,7 @@
 
 	fd = sceIoOpen("MS0:/DTRACE.TXT", PSP_O_RDWR | PSP_O_CREAT | PSP_O_APPEND, 0777);
 
-	if(fd <= 0)
+	if (fd <= 0)
 	{
 		return;
 	}
@@ -63,7 +63,7 @@
 
 	fd = sceIoOpen(filename, PSP_O_RDWR | PSP_O_CREAT | PSP_O_APPEND, 0777);
 
-	if(fd <= 0)
+	if (fd <= 0)
 	{
 		return;
 	}

Modified: scummvm/trunk/backends/platform/symbian/src/ScummVMApp.cpp
===================================================================
--- scummvm/trunk/backends/platform/symbian/src/ScummVMApp.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/symbian/src/ScummVMApp.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -55,7 +55,7 @@
 }
 
 void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
-	if(aForeground) {
+	if (aForeground) {
 		BringUpEmulatorL();
 	}
 }
@@ -64,7 +64,7 @@
 }
 
 CScummVMUi::~CScummVMUi() {
-	if(iWatcher) {
+	if (iWatcher) {
 		iThreadWatch.LogonCancel(iWatcher->iStatus);
 		iWatcher->Cancel();
 	}
@@ -109,10 +109,10 @@
 	iExeWgId=exeTask.WgId();
 	exeTask.BringToForeground();
 
-	if(iExeWgId == myTask.WgId()) { // Should n't be the same
+	if (iExeWgId == myTask.WgId()) { // Should n't be the same
 		Exit();
 	}
-	if(iThreadWatch.Open(iThreadId) == KErrNone) {
+	if (iThreadWatch.Open(iThreadId) == KErrNone) {
 		iWatcher = new (ELeave)CScummWatcher;
 		iWatcher->iAppUi = this;
 		iThreadWatch.Logon(iWatcher->iStatus);
@@ -139,7 +139,7 @@
 void CScummVMUi::BringUpEmulatorL() {
 	RThread thread;
 
-	if(thread.Open(iThreadId) == KErrNone) {
+	if (thread.Open(iThreadId) == KErrNone) {
 		thread.Close();
 		TApaTask apaTask(iEikonEnv->WsSession());
 		apaTask.SetWgId(iExeWgId);
@@ -155,7 +155,7 @@
 	case EEikCmdExit:
 		{
 			RThread thread;
-			if(thread.Open(iThreadId) == KErrNone) {
+			if (thread.Open(iThreadId) == KErrNone) {
 				thread.Terminate(0);
 				thread.Close();
 			}

Modified: scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp
===================================================================
--- scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -351,7 +351,7 @@
 			case GUI::ACTION_MULTI: {
 				GUI::Key &key = GUI::Actions::Instance()->getKeyAction(loop);
 				// if key code is pause, then change event to interactive or just fall through
-				if(key.keycode() == SDLK_PAUSE) {
+				if (key.keycode() == SDLK_PAUSE) {
 					event.type = Common::EVENT_PREDICTIVE_DIALOG;
 					return true;
 					}
@@ -371,7 +371,7 @@
 					// Translate from SDL keymod event to Scummvm Key Mod Common::Event. 
 					// This codes is also present in GP32 backend and in SDL backend as a static function
 					// Perhaps it should be shared. 
-					if(key.flags() != 0) {									
+					if (key.flags() != 0) {									
 						event.kbd.flags = 0;
 
 						if (ev.key.keysym.mod & KMOD_SHIFT)

Modified: scummvm/trunk/backends/platform/wince/missing/missing.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/missing.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/wince/missing/missing.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -57,12 +57,12 @@
 	HANDLE handle;
 	int len;
 
-	if(fname == NULL || ss == NULL)
+	if (fname == NULL || ss == NULL)
 		return -1;
 
 	/* Special case (dummy on WinCE) */
 	len = strlen(fname);
-	if(len >= 2 && fname[len-1] == '.' && fname[len-2] == '.' &&
+	if (len >= 2 && fname[len-1] == '.' && fname[len-2] == '.' &&
 		(len == 2 || fname[len-3] == '\\'))
 	{
 		/* That's everything implemented so far */
@@ -74,14 +74,14 @@
 
 	MultiByteToWideChar(CP_ACP, 0, fname, -1, fnameUnc, MAX_PATH);
 	handle = FindFirstFile(fnameUnc, &wfd);
-	if(handle == INVALID_HANDLE_VALUE)
+	if (handle == INVALID_HANDLE_VALUE)
 		return -1;
 	else
 	{
 		/* That's everything implemented so far */
 		memset(ss, 0, sizeof(struct stat));
 		ss->st_size = wfd.nFileSizeLow;
-		if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+		if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
 			ss->st_mode |= S_IFDIR;
 
 		FindClose(handle);
@@ -98,7 +98,7 @@
 
 	t = (time_t)(((((((st.wYear-1970)*12+st.wMonth)*31+st.wDay)*7+st.wDayOfWeek)*24+st.wHour)*60+st.wMinute)*60+st.wSecond);
 
-	if(res)
+	if (res)
 		*res = t;
 	return t;
 }
@@ -131,18 +131,18 @@
 	TCHAR fileUnc[MAX_PATH+1];
 	char* plast;
 
-	if(cwd[0] == 0)
+	if (cwd[0] == 0)
 	{
 		GetModuleFileName(NULL, fileUnc, MAX_PATH);
 		WideCharToMultiByte(CP_ACP, 0, fileUnc, -1, cwd, MAX_PATH, NULL, NULL);
 		plast = strrchr(cwd, '\\');
-		if(plast)
+		if (plast)
 			*plast = 0;
 		/* Special trick to keep start menu clean... */
-		if(_stricmp(cwd, "\\windows\\start menu") == 0)
+		if (_stricmp(cwd, "\\windows\\start menu") == 0)
 			strcpy(cwd, "\\Apps");
 	}
-	if(buffer)
+	if (buffer)
 		strncpy(buffer, cwd, maxlen);
 	return cwd;
 }
@@ -165,9 +165,9 @@
 {
 	char fullname[MAX_PATH+1];
 
-	if(!fname || fname[0] == '\0')
+	if (!fname || fname[0] == '\0')
 		return NULL;
-	if(fname[0] != '\\' && fname[0] != '/')
+	if (fname[0] != '\\' && fname[0] != '/')
 	{
 		getcwd(fullname, MAX_PATH);
 		strncat(fullname, "\\", MAX_PATH-strlen(fullname)-1);
@@ -190,11 +190,11 @@
 	TCHAR fnameUnc[MAX_PATH+1];
 	char nameFound[MAX_PATH+1];
 
-	if(fname == NULL)
+	if (fname == NULL)
 		return NULL;
 
 	strcpy(fnameMask, fname);
-	if(!strlen(fnameMask) || fnameMask[strlen(fnameMask)-1] != '\\')
+	if (!strlen(fnameMask) || fnameMask[strlen(fnameMask)-1] != '\\')
 		strncat(fnameMask, "\\", MAX_PATH-strlen(fnameMask)-1);
 	strncat(fnameMask, "*.*", MAX_PATH-strlen(fnameMask)-4);
 
@@ -209,7 +209,7 @@
 	strcpy(pdir->dd_name, fname); /* it has exactly enough space for fname and nul char */
 
 	MultiByteToWideChar(CP_ACP, 0, fnameMask, -1, fnameUnc, MAX_PATH);
-	if((pdir->dd_handle = (long)FindFirstFile(fnameUnc, &wfd)) == (long)INVALID_HANDLE_VALUE)
+	if ((pdir->dd_handle = (long)FindFirstFile(fnameUnc, &wfd)) == (long)INVALID_HANDLE_VALUE)
 	{
 		free(pdir);
 		return NULL;
@@ -229,35 +229,35 @@
 	char nameFound[MAX_PATH+1];
 	static struct dirent dummy;
 
-	if(dir->dd_stat == 0)
+	if (dir->dd_stat == 0)
 	{
 		dummy.d_name = ".";
 		dummy.d_namlen = 1;
 		dir->dd_stat ++;
 		return &dummy;
 	}
-	else if(dir->dd_stat == 1)
+	else if (dir->dd_stat == 1)
 	{
 		dummy.d_name = "..";
 		dummy.d_namlen = 2;
 		dir->dd_stat ++;
 		return &dummy;
 	}
-	else if(dir->dd_stat == 2)
+	else if (dir->dd_stat == 2)
 	{
 		dir->dd_stat++;
 		return &dir->dd_dir;
 	}
 	else
 	{
-		if(FindNextFile((HANDLE)dir->dd_handle, &wfd) == 0)
+		if (FindNextFile((HANDLE)dir->dd_handle, &wfd) == 0)
 		{
 			dir->dd_stat = -1;
 			return NULL;
 		}
 		WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL);
 
-		if(dir->dd_dir.d_name)
+		if (dir->dd_dir.d_name)
 			free(dir->dd_dir.d_name);
 
 		dir->dd_dir.d_name = strdup(nameFound);
@@ -271,13 +271,13 @@
 
 int closedir(DIR* dir)
 {
-	if(dir == NULL)
+	if (dir == NULL)
 		return 0;
 
-	if(dir->dd_handle)
+	if (dir->dd_handle)
 		FindClose((HANDLE)dir->dd_handle);
 
-	if(dir->dd_dir.d_name)
+	if (dir->dd_dir.d_name)
 		free(dir->dd_dir.d_name);
 	free(dir);
 	return 1;
@@ -304,12 +304,12 @@
 	TCHAR pathUnc[MAX_PATH+1];
 	char* ptr;
 	strncpy(path, dirname, MAX_PATH);
-	if(*path == '/')
+	if (*path == '/')
 		*path = '\\';
 	/* Run through the string and attempt creating all subdirs on the path */
-	for(ptr = path+1; *ptr; ptr ++)
+	for (ptr = path+1; *ptr; ptr ++)
 	{
-		if(*ptr == '\\' || *ptr == '/')
+		if (*ptr == '\\' || *ptr == '/')
 		{
 			*ptr = 0;
 			MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH);
@@ -333,7 +333,7 @@
 	GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp);
 	WideCharToMultiByte(CP_ACP, 0, pTemp, -1, buffer, MAX_PATH, NULL, NULL);
 
-	if(string)
+	if (string)
 	{
 		strcpy(string, buffer);
 		return string;
@@ -345,7 +345,7 @@
 FILE *tmpfile()
 {
 	TCHAR pTemp[MAX_PATH+1];
-	if(!GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp))
+	if (!GetTempFileName(TEXT("."), TEXT("A8_"), 0, pTemp))
 		return _wfopen(pTemp, TEXT("w+b"));
 	else
 		return 0;
@@ -374,7 +374,7 @@
 {
 	char* buffer;
 	buffer = (char*)malloc(strlen(strSource)+1);
-	if(buffer)
+	if (buffer)
 		strcpy(buffer, strSource);
 	return buffer;
 }
@@ -390,7 +390,7 @@
 void usleep(long usec)
 {
 	long msec = usec/1000;
-	if(msec <= 0)
+	if (msec <= 0)
 		Sleep(0);
 	else
 		Sleep(msec);
@@ -417,7 +417,7 @@
 char* getenv(char* name)
 {
 	static char buffer[MAX_PATH+1];
-	if(strcmp(name, "HOME") == 0 || strcmp(name, "HOMEDIR") == 0)
+	if (strcmp(name, "HOME") == 0 || strcmp(name, "HOMEDIR") == 0)
 	{
 		getcwd(buffer, MAX_PATH);
 		return buffer;

Modified: scummvm/trunk/backends/platform/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -172,7 +172,7 @@
 	extern void (*__CTOR_LIST__)() ;
 	void (**constructor)() = &__CTOR_LIST__ ;
 	constructor++ ;
-	while(*constructor) { 
+	while (*constructor) { 
             (*constructor)() ;
             constructor++ ;
         }
@@ -2141,7 +2141,7 @@
 
 	currentTime = GetTickCount();
 
-	while(SDL_PollEvent(&ev)) {
+	while (SDL_PollEvent(&ev)) {
 		switch(ev.type) {
 		case SDL_KEYDOWN:
 			debug(1, "Key down %X %s", ev.key.keysym.sym, SDL_GetKeyName((SDLKey)ev.key.keysym.sym));

Modified: scummvm/trunk/backends/saves/compressed/compressed-saves.cpp
===================================================================
--- scummvm/trunk/backends/saves/compressed/compressed-saves.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/backends/saves/compressed/compressed-saves.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -69,7 +69,7 @@
 		assert(header == 0x1F8B ||
 		       ((header & 0x0F00) == 0x0800 && header % 31 == 0));
 		
-		if(header == 0x1F8B) {
+		if (header == 0x1F8B) {
 			// Retrieve the original file size
 			w->seek(-4, SEEK_END);
 			_origSize = w->readUint32LE();

Modified: scummvm/trunk/base/commandLine.cpp
===================================================================
--- scummvm/trunk/base/commandLine.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/base/commandLine.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -388,9 +388,9 @@
 
 			DO_OPTION('p', "path")
 				FilesystemNode path(option);
-				if(!path.exists()) {
+				if (!path.exists()) {
 					usage("Non-existent game path '%s'", option);
-				} else if(!path.isReadable()) {
+				} else if (!path.isReadable()) {
 					usage("Non-readable game path '%s'", option);
 				}
 			END_OPTION
@@ -431,9 +431,9 @@
 
 			DO_LONG_OPTION("soundfont")
 				FilesystemNode path(option);
-				if(!path.exists()) {
+				if (!path.exists()) {
 					usage("Non-existent soundfont path '%s'", option);
-				} else if(!path.isReadable()) {
+				} else if (!path.isReadable()) {
 					usage("Non-readable soundfont path '%s'", option);
 				}
 			END_OPTION
@@ -461,9 +461,9 @@
 
 			DO_LONG_OPTION("savepath")
 				FilesystemNode path(option);
-				if(!path.exists()) {
+				if (!path.exists()) {
 					usage("Non-existent savegames path '%s'", option);
-				} else if(!path.isWritable()) {
+				} else if (!path.isWritable()) {
 					usage("Non-writable savegames path '%s'", option);
 				}
 			END_OPTION
@@ -479,9 +479,9 @@
 
 			DO_LONG_OPTION("themepath")
 				FilesystemNode path(option);
-				if(!path.exists()) {
+				if (!path.exists()) {
 					usage("Non-existent theme path '%s'", option);
-				} else if(!path.isReadable()) {
+				} else if (!path.isReadable()) {
 					usage("Non-readable theme path '%s'", option);
 				}
 			END_OPTION
@@ -691,9 +691,9 @@
 		const char *dir = getenv("SCUMMVM_SAVEPATH");
 		if (dir && *dir && strlen(dir) < MAXPATHLEN) {
 			FilesystemNode saveDir(dir);
-			if(!saveDir.exists()) {
+			if (!saveDir.exists()) {
 				warning("Non-existent SCUMMVM_SAVEPATH save path. It will be ignored.");
-			} else if(!saveDir.isWritable()) {
+			} else if (!saveDir.isWritable()) {
 				warning("Non-writable SCUMMVM_SAVEPATH save path. It will be ignored.");
 			} else {
 				settings["savepath"] = dir;

Modified: scummvm/trunk/common/file.cpp
===================================================================
--- scummvm/trunk/common/file.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/common/file.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -411,9 +411,9 @@
 
 bool File::remove(const String &filename){
 	if (remove(filename.c_str()) != 0) {
-		if(errno == EACCES)
+		if (errno == EACCES)
 			;//TODO: read-only file
-		if(errno == ENOENT)
+		if (errno == ENOENT)
 			;//TODO: non-existent file
 		
 		return false;
@@ -424,9 +424,9 @@
 
 bool File::remove(const FilesystemNode &node){
 	if (remove(node.getPath()) != 0) {
-		if(errno == EACCES)
+		if (errno == EACCES)
 			;//TODO: read-only file
-		if(errno == ENOENT)
+		if (errno == ENOENT)
 			;//TODO: non-existent file
 				
 		return false;

Modified: scummvm/trunk/common/fs.cpp
===================================================================
--- scummvm/trunk/common/fs.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/common/fs.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -47,7 +47,7 @@
 				if (p) {
 					pat = p;
 					str = ++q;
-					if(!*str)
+					if (!*str)
 						return !*pat;
 					break;
 				}
@@ -56,7 +56,7 @@
 			}
 			// fallthrough
 		case '?':
-			if(!*str)
+			if (!*str)
 				return !*pat;
 			pat++;
 			str++;

Modified: scummvm/trunk/common/md5.cpp
===================================================================
--- scummvm/trunk/common/md5.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/common/md5.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -246,7 +246,7 @@
 }
 
 bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length) {
-	if(!file.exists()) {
+	if (!file.exists()) {
 		warning("md5_file: using an inexistent FilesystemNode");
 		return false;
 	} else if (!file.isReadable()) {

Modified: scummvm/trunk/engines/agi/op_cmd.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_cmd.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/engines/agi/op_cmd.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -994,7 +994,7 @@
 	/* insert our version into the other version */
 	len = strlen(verMsg);
 	gap = r - q;
-	if(gap < 0)
+	if (gap < 0)
 		gap = 0;
 	else
 		gap = (gap - len) / 2;

Modified: scummvm/trunk/engines/agi/picture.cpp
===================================================================
--- scummvm/trunk/engines/agi/picture.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/engines/agi/picture.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -99,7 +99,7 @@
 	int i, x, y, deltaX, deltaY, stepX, stepY, errorX, errorY, detdelta;
 
 	/* CM: Do clipping */
-#define clip(x, y) if((x)>=(y)) (x)=(y)
+#define clip(x, y) if ((x)>=(y)) (x)=(y)
 	clip(x1, _width - 1);
 	clip(x2, _width - 1);
 	clip(y1, _height - 1);

Modified: scummvm/trunk/engines/agi/preagi_winnie.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_winnie.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/engines/agi/preagi_winnie.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -664,14 +664,14 @@
 	do {
 		*iSel += 1;
 		if (*iSel > IDI_WTP_SEL_DROP) *iSel = IDI_WTP_SEL_OPT_1;
-	} while(!fCanSel[*iSel]);
+	} while (!fCanSel[*iSel]);
 }
 
 void Winnie::decMenuSel(int *iSel, int fCanSel[]) {
 	do {
 		*iSel -= 1;
 		if (*iSel < IDI_WTP_SEL_OPT_1) *iSel = IDI_WTP_SEL_DROP;
-	} while(!fCanSel[*iSel]);
+	} while (!fCanSel[*iSel]);
 }
 
 void Winnie::getMenuMouseSel(int *iSel, int fCanSel[], int x, int y) {
@@ -1046,7 +1046,7 @@
 }
 void Winnie::clrMenuSel(int *iSel, int fCanSel[]) {
 	*iSel = IDI_WTP_SEL_OPT_1;
-	while(!fCanSel[*iSel]) {
+	while (!fCanSel[*iSel]) {
 		*iSel += 1;
 	}
 }

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/engines/agos/agos.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -969,7 +969,7 @@
 		(getFeatures() & GF_DEMO)) {
 		int i;
 
-		while(1) {
+		while (1) {
 			for (i = 0; i < 4; i++) {
 				setWindowImage(3, 9902 + i);
 				debug(0, "Displaying image %d", 9902 + i);

Modified: scummvm/trunk/engines/agos/items.cpp
===================================================================
--- scummvm/trunk/engines/agos/items.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/engines/agos/items.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -410,7 +410,7 @@
 
 Item *AGOSEngine::nextInByClass(Item *i, int16 m) {
 	i = _findNextPtr;
-	while(i) {
+	while (i) {
 		if (i->classFlags & m) {
 			_findNextPtr = derefItem(i->next);
 			return i;

Modified: scummvm/trunk/engines/agos/saveload.cpp
===================================================================
--- scummvm/trunk/engines/agos/saveload.cpp	2007-09-18 20:02:04 UTC (rev 28944)
+++ scummvm/trunk/engines/agos/saveload.cpp	2007-09-18 20:16:33 UTC (rev 28945)
@@ -50,14 +50,14 @@
 	memset(marks, false, 256 * sizeof(bool));	//assume no savegames for this title
 	filenames = _saveFileMan->listSavefiles(prefix);
 
-	for(Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list