[MKHIVE] Remove key name in our custom registry tree; use cell index instead
[reactos.git] / reactos / tools / obj2bin / obj2bin.c
index 4784874..07b0767 100644 (file)
@@ -1,7 +1,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "../pecoff.h"
+#include <typedefs.h>
+#include <pecoff.h>
 
 static
 void
@@ -51,8 +52,8 @@ RelocateSection(
                 break;
 
             default:
-                printf("Unknown relocatation type %ld address %ld\n",
-                       pReloc->Type, pReloc->VirtualAddress);
+                printf("Unknown relocation type %u, address 0x%x\n",
+                       pReloc->Type, (unsigned)pReloc->VirtualAddress);
         }
 
         pReloc++;
@@ -98,7 +99,7 @@ int main(int argc, char *argv[])
     if (!pData)
     {
         fclose(pSourceFile);
-        fprintf(stderr, "Failed to allocate %ld bytes\n", nFileSize);
+        fprintf(stderr, "Failed to allocate %lu bytes\n", nFileSize);
         return -3;
     }
 
@@ -107,7 +108,7 @@ int main(int argc, char *argv[])
     {
         free(pData);
         fclose(pSourceFile);
-        fprintf(stderr, "Failed to read source file: %ld\n", nFileSize);
+        fprintf(stderr, "Failed to read %lu bytes from source file\n", nFileSize);
         return -4;
     }
 
@@ -119,7 +120,7 @@ int main(int argc, char *argv[])
     if (!pDestFile)
     {
         free(pData);
-        fprintf(stderr, "Couldn't open dest file '%s'\n", pszDestFile);
+        fprintf(stderr, "Couldn't open destination file '%s'\n", pszDestFile);
         return -5;
     }
 
@@ -132,7 +133,7 @@ int main(int argc, char *argv[])
     for (i = 0; i < pFileHeader->NumberOfSections; i++)
     {
         /* Check if this is '.text' section */
-        if ((strcmp(pSectionHeader->Name, ".text") == 0) &&
+        if ((strcmp((char*)pSectionHeader->Name, ".text") == 0) &&
             (pSectionHeader->SizeOfRawData != 0))
         {
             RelocateSection(pData,
@@ -146,8 +147,8 @@ int main(int argc, char *argv[])
             {
                 free(pData);
                 fclose(pDestFile);
-                fprintf(stderr, "Failed to write data %ld\n",
-                        pSectionHeader->SizeOfRawData);
+                fprintf(stderr, "Failed to write %u bytes to destination file\n",
+                        (unsigned int)pSectionHeader->SizeOfRawData);
                 return -6;
             }
 
@@ -162,4 +163,3 @@ int main(int argc, char *argv[])
 
     return 0;
 }
-