[MPlayer-dev-eng] [PATCH] trivial warning fix - loader/pe_image.c [NOVIRUS]

Pierre Lombard p_l at gmx.fr
Fri May 5 11:18:54 CEST 2006


Hi,

Some if- blocks are sometimes empty, which gcc warns of.

An unnecessary double return is also removed.
-- 
Pierre Lombard
GPG: 0x1AF0803C
-------------- next part --------------
Index: pe_image.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/pe_image.c,v
retrieving revision 1.10
diff -u -r1.10 pe_image.c
--- pe_image.c	25 May 2005 08:48:31 -0000	1.10
+++ pe_image.c	5 May 2006 08:51:47 -0000
@@ -107,8 +107,9 @@
               DPRINTF( "  %s", (char*)RVA(name[j]) );
               break;
           }
-	if ((*function >= rva_start) && (*function <= rva_end))
+	if ((*function >= rva_start) && (*function <= rva_end)) {
 	  DPRINTF(" (forwarded -> %s)", (char *)RVA(*function));
+	}
 	DPRINTF("\n");
       }
   }
@@ -138,10 +139,11 @@
 	u_long				rva_start, rva_end, addr;
 	char				* forward;
 
-	if (HIWORD(funcName))
+	if (HIWORD(funcName)) {
 		TRACE("(%s)\n",funcName);
-	else
+	} else {
 		TRACE("(%d)\n",(int)funcName);
+	}
 	if (!exports) {
 		/* Not a fatal problem, some apps do
 		 * GetProcAddress(0,"RegisterPenApp") which triggers this
@@ -528,11 +530,12 @@
 
     
     aoep = nt->OptionalHeader.AddressOfEntryPoint;
-    if (aoep && (aoep < lowest_va))
+    if (aoep && (aoep < lowest_va)) {
         FIXME("VIRUS WARNING: '%s' has an invalid entrypoint (0x%08lx) "
                       "below the first virtual address (0x%08x) "
                       "(possibly infected by Tchernobyl/SpaceFiller virus)!\n",
                        filename, aoep, lowest_va );
+    }
 
 
     /* FIXME:  Hack!  While we don't really support shared sections yet,
@@ -719,33 +722,47 @@
         pe_resource = (PIMAGE_RESOURCE_DIRECTORY)RVA(dir->VirtualAddress);
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_EXCEPTION;
-    if (dir->Size) FIXME("Exception directory ignored\n" );
+    if (dir->Size) {
+	FIXME("Exception directory ignored\n" );
+    }
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_SECURITY;
-    if (dir->Size) FIXME("Security directory ignored\n" );
+    if (dir->Size) {
+	FIXME("Security directory ignored\n" );
+    }
 
     
     
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_DEBUG;
-    if (dir->Size) TRACE("Debug directory ignored\n" );
+    if (dir->Size) {
+	TRACE("Debug directory ignored\n" );
+    }
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_COPYRIGHT;
-    if (dir->Size) FIXME("Copyright string ignored\n" );
+    if (dir->Size) {
+	FIXME("Copyright string ignored\n" );
+    }
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_GLOBALPTR;
-    if (dir->Size) FIXME("Global Pointer (MIPS) ignored\n" );
-
-    
+    if (dir->Size) {
+	FIXME("Global Pointer (MIPS) ignored\n" );
+    }
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG;
-    if (dir->Size) FIXME("Load Configuration directory ignored\n" );
+    if (dir->Size) {
+	FIXME("Load Configuration directory ignored\n" );
+    }
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT;
-    if (dir->Size) TRACE("Bound Import directory ignored\n" );
+    if (dir->Size) {
+	TRACE("Bound Import directory ignored\n" );
+    }
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_IAT;
-    if (dir->Size) TRACE("Import Address Table directory ignored\n" );
+    if (dir->Size) {
+	TRACE("Import Address Table directory ignored\n" );
+    }
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT;
     if (dir->Size)
@@ -775,10 +792,14 @@
 	}
 
     dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR;
-    if (dir->Size) FIXME("Unknown directory 14 ignored\n" );
+    if (dir->Size) {
+	FIXME("Unknown directory 14 ignored\n" );
+    }
 
     dir = nt->OptionalHeader.DataDirectory+15;
-    if (dir->Size) FIXME("Unknown directory 15 ignored\n" );
+    if (dir->Size) {
+	FIXME("Unknown directory 15 ignored\n" );
+    }
 
 
     
@@ -821,8 +842,6 @@
     }
 
     return wm;
-
-    return wm;
 }
 
 /******************************************************************************


More information about the MPlayer-dev-eng mailing list