projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
95564d5
)
[FREELDR] Minor code formatting; constify some non-mutable data.
author
Hermès Bélusca-Maïto
<hermes.belusca-maito@reactos.org>
Sun, 6 Jan 2019 17:34:49 +0000
(18:34 +0100)
committer
Hermès Bélusca-Maïto
<hermes.belusca-maito@reactos.org>
Sun, 6 Jan 2019 17:42:01 +0000
(18:42 +0100)
boot/freeldr/freeldr/arch/i386/hwdisk.c
patch
|
blob
|
history
boot/freeldr/freeldr/arch/i386/i386bug.c
patch
|
blob
|
history
boot/freeldr/freeldr/arch/powerpc/mach.c
patch
|
blob
|
history
boot/freeldr/freeldr/arch/realmode/amd64.S
patch
|
blob
|
history
boot/freeldr/freeldr/arch/realmode/i386.S
patch
|
blob
|
history
boot/freeldr/freeldr/bootmgr.c
patch
|
blob
|
history
boot/freeldr/freeldr/custom.c
patch
|
blob
|
history
boot/freeldr/freeldr/include/ver.h
patch
|
blob
|
history
boot/freeldr/freeldr/ntldr/wlmemory.c
patch
|
blob
|
history
boot/freeldr/freeldr/options.c
patch
|
blob
|
history
boot/freeldr/freeldr/version.c
patch
|
blob
|
history
diff --git
a/boot/freeldr/freeldr/arch/i386/hwdisk.c
b/boot/freeldr/freeldr/arch/i386/hwdisk.c
index
6123fc1
..
a254aee
100644
(file)
--- a/
boot/freeldr/freeldr/arch/i386/hwdisk.c
+++ b/
boot/freeldr/freeldr/arch/i386/hwdisk.c
@@
-38,7
+38,7
@@
typedef struct tagDISKCONTEXT
ULONGLONG SectorNumber;
} DISKCONTEXT;
ULONGLONG SectorNumber;
} DISKCONTEXT;
-static CHAR Hex[] = "0123456789abcdef";
+static
const
CHAR Hex[] = "0123456789abcdef";
/* Data cache for BIOS disks pre-enumeration */
UCHAR PcBiosDiskCount = 0;
/* Data cache for BIOS disks pre-enumeration */
UCHAR PcBiosDiskCount = 0;
diff --git
a/boot/freeldr/freeldr/arch/i386/i386bug.c
b/boot/freeldr/freeldr/arch/i386/i386bug.c
index
c5c82af
..
6d42279
100644
(file)
--- a/
boot/freeldr/freeldr/arch/i386/i386bug.c
+++ b/
boot/freeldr/freeldr/arch/i386/i386bug.c
@@
-9,7
+9,7
@@
typedef struct _FRAME
void *Address;
} FRAME;
void *Address;
} FRAME;
-char *i386ExceptionDescriptionText[] =
+
static const
char *i386ExceptionDescriptionText[] =
{
"Exception 00: DIVIDE BY ZERO\n\n",
"Exception 01: DEBUG EXCEPTION\n\n",
{
"Exception 00: DIVIDE BY ZERO\n\n",
"Exception 01: DEBUG EXCEPTION\n\n",
diff --git
a/boot/freeldr/freeldr/arch/powerpc/mach.c
b/boot/freeldr/freeldr/arch/powerpc/mach.c
index
552b75f
..
c00604e
100644
(file)
--- a/
boot/freeldr/freeldr/arch/powerpc/mach.c
+++ b/
boot/freeldr/freeldr/arch/powerpc/mach.c
@@
-24,7
+24,7
@@
#include "compat.h"
extern void BootMain( LPSTR CmdLine );
#include "compat.h"
extern void BootMain( LPSTR CmdLine );
-extern
PCHAR GetFreeLoaderVersionString(
);
+extern
const PCSTR GetFreeLoaderVersionString(VOID
);
extern ULONG CacheSizeLimit;
of_proxy ofproxy;
void *PageDirectoryStart, *PageDirectoryEnd;
extern ULONG CacheSizeLimit;
of_proxy ofproxy;
void *PageDirectoryStart, *PageDirectoryEnd;
diff --git
a/boot/freeldr/freeldr/arch/realmode/amd64.S
b/boot/freeldr/freeldr/arch/realmode/amd64.S
index
0de7bf4
..
528fd4b
100644
(file)
--- a/
boot/freeldr/freeldr/arch/realmode/amd64.S
+++ b/
boot/freeldr/freeldr/arch/realmode/amd64.S
@@
-6,7
+6,6
@@
#define IMAGE_FILE_HEADER_SIZE 20
#define IMAGE_OPTIONAL_HEADER_AddressOfEntryPoint 16
#define IMAGE_FILE_HEADER_SIZE 20
#define IMAGE_OPTIONAL_HEADER_AddressOfEntryPoint 16
-
.code16
/* fat helper code */
.code16
/* fat helper code */
@@
-292,7
+291,7
@@
ExitToLongMode:
mov gs,ax
mov ss,ax
mov gs,ax
mov ss,ax
- /* Sa
f
e current stack pointer */
+ /* Sa
v
e current stack pointer */
mov word ptr ds:[stack16], sp
/* Set PAE and PGE: 10100000b */
mov word ptr ds:[stack16], sp
/* Set PAE and PGE: 10100000b */
diff --git
a/boot/freeldr/freeldr/arch/realmode/i386.S
b/boot/freeldr/freeldr/arch/realmode/i386.S
index
0c79ae1
..
4f47f4b
100644
(file)
--- a/
boot/freeldr/freeldr/arch/realmode/i386.S
+++ b/
boot/freeldr/freeldr/arch/realmode/i386.S
@@
-30,7
+30,7
@@
RealModeEntryPoint:
/* Enable A20 address line */
call EnableA20
/* Enable A20 address line */
call EnableA20
- /* Sa
f
e real mode entry point in shared memory */
+ /* Sa
v
e real mode entry point in shared memory */
mov dword ptr ds:[BSS_RealModeEntry], offset switch_to_real16
/* Address the image with es segment */
mov dword ptr ds:[BSS_RealModeEntry], offset switch_to_real16
/* Address the image with es segment */
@@
-116,7
+116,7
@@
exit_to_protected:
cli
cli
- /* Sa
f
e current stack pointer */
+ /* Sa
v
e current stack pointer */
mov word ptr ds:[stack16], sp
/* Load the GDT */
mov word ptr ds:[stack16], sp
/* Load the GDT */
diff --git
a/boot/freeldr/freeldr/bootmgr.c
b/boot/freeldr/freeldr/bootmgr.c
index
e370c28
..
ed506ae
100644
(file)
--- a/
boot/freeldr/freeldr/bootmgr.c
+++ b/
boot/freeldr/freeldr/bootmgr.c
@@
-29,9
+29,9
@@
VOID
(*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,
IN USHORT OperatingSystemVersion);
(*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,
IN USHORT OperatingSystemVersion);
-struct
+st
atic const st
ruct
{
{
-
CHAR BootType[80]
;
+
PCHAR BootType
;
USHORT OperatingSystemVersion;
OS_LOADING_METHOD Load;
} OSLoadingMethods[] =
USHORT OperatingSystemVersion;
OS_LOADING_METHOD Load;
} OSLoadingMethods[] =
diff --git
a/boot/freeldr/freeldr/custom.c
b/boot/freeldr/freeldr/custom.c
index
802d295
..
02e55b6
100644
(file)
--- a/
boot/freeldr/freeldr/custom.c
+++ b/
boot/freeldr/freeldr/custom.c
@@
-51,13
+51,12
@@
VOID OptionMenuCustomBoot(VOID)
#endif
"ReactOS"
};
#endif
"ReactOS"
};
- ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
ULONG SelectedMenuItem;
if (!UiDisplayMenu("Please choose a boot method:", "",
FALSE,
CustomBootMenuList,
ULONG SelectedMenuItem;
if (!UiDisplayMenu("Please choose a boot method:", "",
FALSE,
CustomBootMenuList,
-
CustomBootMenuCount
,
+
sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0])
,
0, -1,
&SelectedMenuItem,
TRUE,
0, -1,
&SelectedMenuItem,
TRUE,
diff --git
a/boot/freeldr/freeldr/include/ver.h
b/boot/freeldr/freeldr/include/ver.h
index
ad5c02a
..
d796f7a
100644
(file)
--- a/
boot/freeldr/freeldr/include/ver.h
+++ b/
boot/freeldr/freeldr/include/ver.h
@@
-36,4
+36,4
@@
#define FREELOADER_MINOR_VERSION 0
#define FREELOADER_PATCH_VERSION 0
#define FREELOADER_MINOR_VERSION 0
#define FREELOADER_PATCH_VERSION 0
-
PCHA
R GetFreeLoaderVersionString(VOID);
+
const PCST
R GetFreeLoaderVersionString(VOID);
diff --git
a/boot/freeldr/freeldr/ntldr/wlmemory.c
b/boot/freeldr/freeldr/ntldr/wlmemory.c
index
99a1c9d
..
8259c38
100644
(file)
--- a/
boot/freeldr/freeldr/ntldr/wlmemory.c
+++ b/
boot/freeldr/freeldr/ntldr/wlmemory.c
@@
-17,7
+17,7
@@
DBG_DEFAULT_CHANNEL(WINDOWS);
extern ULONG LoaderPagesSpanned;
extern ULONG LoaderPagesSpanned;
-
PCHAR MemTypeDesc[]
= {
+
static const PCSTR MemTypeDesc[]
= {
"ExceptionBlock ", // ?
"SystemBlock ", // ?
"Free ",
"ExceptionBlock ", // ?
"SystemBlock ", // ?
"Free ",
diff --git
a/boot/freeldr/freeldr/options.c
b/boot/freeldr/freeldr/options.c
index
ebb7709
..
0300b02
100644
(file)
--- a/
boot/freeldr/freeldr/options.c
+++ b/
boot/freeldr/freeldr/options.c
@@
-50,6
+50,7
@@
PCSTR OptionsMenuList[] =
#endif
};
#endif
};
+const
PCSTR FrldrDbgMsg = "Enable FreeLdr debug channels\n"
"Acceptable syntax: [level1]#channel1[,[level2]#channel2]\n"
"level can be one of: trace,warn,fixme,err\n"
PCSTR FrldrDbgMsg = "Enable FreeLdr debug channels\n"
"Acceptable syntax: [level1]#channel1[,[level2]#channel2]\n"
"level can be one of: trace,warn,fixme,err\n"
@@
-78,8
+79,6
@@
enum BootOption
DIRECTORY_SERVICES_RESTORE_MODE,
};
DIRECTORY_SERVICES_RESTORE_MODE,
};
-ULONG OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
-
static enum BootOption BootOptionChoice = NO_OPTION;
static BOOLEAN BootLogging = FALSE;
static BOOLEAN VgaMode = FALSE;
static enum BootOption BootOptionChoice = NO_OPTION;
static BOOLEAN BootLogging = FALSE;
static BOOLEAN VgaMode = FALSE;
@@
-95,7
+94,7
@@
VOID DoOptionsMenu(VOID)
if (!UiDisplayMenu("Select an option:", "",
TRUE,
OptionsMenuList,
if (!UiDisplayMenu("Select an option:", "",
TRUE,
OptionsMenuList,
-
OptionsMenuItemCount
,
+
sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0])
,
11, // Use "Start ReactOS normally" as default; see the switch below.
-1,
&SelectedMenuItem,
11, // Use "Start ReactOS normally" as default; see the switch below.
-1,
&SelectedMenuItem,
diff --git
a/boot/freeldr/freeldr/version.c
b/boot/freeldr/freeldr/version.c
index
e64864d
..
fcd2521
100644
(file)
--- a/
boot/freeldr/freeldr/version.c
+++ b/
boot/freeldr/freeldr/version.c
@@
-19,15
+19,17
@@
#include <freeldr.h>
#include <freeldr.h>
-CHAR FreeLoaderVersionString[80];
+#define TOSTRING_(X) #X
+#define TOSTRING(X) TOSTRING_(X)
-PCHAR GetFreeLoaderVersionString(VOID)
-{
+static const PCSTR FreeLoaderVersionString =
#if (FREELOADER_PATCH_VERSION == 0)
#if (FREELOADER_PATCH_VERSION == 0)
-
sprintf(FreeLoaderVersionString, "FreeLoader v%d.%d", FREELOADER_MAJOR_VERSION,
FREELOADER_MINOR_VERSION);
+
"FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(
FREELOADER_MINOR_VERSION);
#else
#else
-
sprintf(FreeLoaderVersionString, "FreeLoader v%d.%d.%d", FREELOADER_MAJOR_VERSION, FREELOADER_MINOR_VERSION,
FREELOADER_PATCH_VERSION);
+
"FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION) "." TOSTRING(
FREELOADER_PATCH_VERSION);
#endif
#endif
+const PCSTR GetFreeLoaderVersionString(VOID)
+{
return FreeLoaderVersionString;
}
return FreeLoaderVersionString;
}