don't typecast constant strings
authorThomas Bluemel <thomas@reactsoft.com>
Sun, 18 Dec 2005 11:04:04 +0000 (11:04 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Sun, 18 Dec 2005 11:04:04 +0000 (11:04 +0000)
svn path=/trunk/; revision=20243

reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
reactos/boot/freeldr/freeldr/reactos/reactos.c
reactos/boot/freeldr/freeldr/reactos/registry.c

index d58fb3f..acac5dc 100644 (file)
@@ -237,6 +237,7 @@ DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
 #if 0
   FRLDRHKEY BusKey;
   ULONG i;
+  WCHAR szPci[] = L"PCI";
 #endif
 
   /* Report the PCI BIOS */
@@ -345,8 +346,8 @@ DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
          Error = RegSetValue(BusKey,
                              L"Identifier",
                              REG_SZ,
-                             (PUCHAR)"PCI",
-                             4 * sizeof(WCHAR));
+                             (PCSTR)szPci,
+                             sizeof(szPci));
          if (Error != ERROR_SUCCESS)
            {
              DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
index b79eaac..158d721 100644 (file)
@@ -31,6 +31,8 @@ char                                  reactos_module_strings[64][256];        // Array to hold module names
 unsigned long                  reactos_memory_map_descriptor_size;
 memory_map_t                   reactos_memory_map[32];         // Memory map
 
+static CHAR szLoadingMsg[] = "Loading ReactOS...";
+
 static BOOL
 STDCALL
 FrLdrLoadKernel(PCHAR szFileName,
@@ -75,7 +77,7 @@ FrLdrLoadKernel(PCHAR szFileName,
     FrLdrMapKernel(FilePointer);
 
     /* Update Processbar and return success */
-    UiDrawProgressBarCenter(nPos, 100, (PCHAR)"Loading ReactOS...");
+    UiDrawProgressBarCenter(nPos, 100, szLoadingMsg);
     return(TRUE);
 }
 
@@ -331,7 +333,7 @@ FrLdrLoadDriver(PCHAR szFileName,
     FrLdrLoadModule(FilePointer, szFileName, NULL);
 
     /* Update status and return */
-    UiDrawProgressBarCenter(nPos, 100, (PCHAR)"Loading ReactOS...");
+    UiDrawProgressBarCenter(nPos, 100, szLoadingMsg);
     return(TRUE);
 }
 
@@ -687,7 +689,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName)
        if (AcpiPresent) LoaderBlock.Flags |= MB_FLAGS_ACPI_TABLE;
 
        UiDrawStatusText("Loading...");
-       UiDrawProgressBarCenter(0, 100, (PCHAR)"Loading ReactOS...");
+       UiDrawProgressBarCenter(0, 100, szLoadingMsg);
 
        /*
         * Try to open system drive
@@ -821,7 +823,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName)
         */
        RegInitCurrentControlSet(FALSE);
 
-       UiDrawProgressBarCenter(15, 100, (PCHAR)"Loading ReactOS...");
+       UiDrawProgressBarCenter(15, 100, szLoadingMsg);
 
        /*
         * Export the hardware hive
@@ -830,7 +832,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName)
        RegExportBinaryHive (L"\\Registry\\Machine\\HARDWARE", (PCHAR)Base, &Size);
        FrLdrCloseModule (Base, Size);
 
-       UiDrawProgressBarCenter(20, 100, (PCHAR)"Loading ReactOS...");
+       UiDrawProgressBarCenter(20, 100, szLoadingMsg);
 
        /*
         * Load NLS files
@@ -840,13 +842,13 @@ LoadAndBootReactOS(PCSTR OperatingSystemName)
                UiMessageBox(MsgBuffer);
                return;
        }
-       UiDrawProgressBarCenter(30, 100, (PCHAR)"Loading ReactOS...");
+       UiDrawProgressBarCenter(30, 100, szLoadingMsg);
 
        /*
         * Load kernel symbols
         */
        LoadKernelSymbols(szKernelName, 30);
-       UiDrawProgressBarCenter(40, 100, (PCHAR)"Loading ReactOS...");
+       UiDrawProgressBarCenter(40, 100, szLoadingMsg);
 
        /*
         * Load boot drivers
index ada49a2..92e0954 100644 (file)
@@ -31,6 +31,7 @@ RegInitializeRegistry (VOID)
 {
 #if 0
   FRLDRHKEY TestKey;
+  WCHAR szTestString[] = L"TestString";
 #endif
 
   /* Create root key */
@@ -85,8 +86,8 @@ RegInitializeRegistry (VOID)
   RegSetValue (TestKey,
               L"TestValue",
               REG_SZ,
-              (PUCHAR)"TestString",
-              11);
+              szTestString,
+              sizeof(szTestString));
 #endif
 }