Skip to content

Commit 26e26d2

Browse files
HBeluscabinarymaster
authored andcommitted
[FREELDR] Minor code formatting / renaming some variables.
1 parent 3eecc42 commit 26e26d2

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

boot/freeldr/freeldr/ntldr/setupldr.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,20 @@ LoadReactOSSetup(
138138
ARC_STATUS Status;
139139
PCSTR ArgValue;
140140
PCSTR SystemPartition;
141-
PCHAR File;
142-
CHAR FileName[MAX_PATH];
143-
CHAR BootPath[MAX_PATH];
144-
CHAR BootOptions2[256];
145-
PCSTR LoadOptions;
146-
PSTR BootOptions;
141+
PCSTR SystemPath;
142+
PSTR FileName;
147143
BOOLEAN BootFromFloppy;
148144
BOOLEAN Success;
149-
ULONG i, ErrorLine;
150145
HINF InfHandle;
151146
INFCONTEXT InfContext;
147+
ULONG i, ErrorLine;
152148
PLOADER_PARAMETER_BLOCK LoaderBlock;
153149
PSETUP_LOADER_BLOCK SetupBlock;
154-
PCSTR SystemPath;
150+
CHAR BootPath[MAX_PATH];
151+
CHAR FilePath[MAX_PATH];
152+
CHAR BootOptions2[256];
153+
PSTR BootOptions;
154+
PCSTR LoadOptions;
155155

156156
static PCSTR SourcePaths[] =
157157
{
@@ -208,17 +208,17 @@ LoadReactOSSetup(
208208
if (strrchr(BootPath, ')') == NULL)
209209
{
210210
/* Temporarily save the boot path */
211-
RtlStringCbCopyA(FileName, sizeof(FileName), BootPath);
211+
RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
212212

213213
/* This is not a full path: prepend the SystemPartition */
214214
RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
215215

216216
/* Append a path separator if needed */
217-
if (*FileName != '\\' && *FileName != '/')
217+
if (*FilePath != '\\' && *FilePath != '/')
218218
RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
219219

220220
/* Append the remaining path */
221-
RtlStringCbCatA(BootPath, sizeof(BootPath), FileName);
221+
RtlStringCbCatA(BootPath, sizeof(BootPath), FilePath);
222222
}
223223

224224
/* Append a path separator if needed */
@@ -235,26 +235,26 @@ LoadReactOSSetup(
235235

236236
TRACE("BootOptions: '%s'\n", BootOptions2);
237237

238-
/* Check if a ramdisk file was given */
239-
File = strstr(BootOptions2, "/RDPATH=");
240-
if (File)
238+
/* Check if a RAM disk file was given */
239+
FileName = strstr(BootOptions2, "/RDPATH=");
240+
if (FileName)
241241
{
242-
/* Load the ramdisk */
242+
/* Load the RAM disk */
243243
Status = RamDiskInitialize(FALSE, BootOptions2, SystemPartition);
244244
if (Status != ESUCCESS)
245245
{
246-
File += 8;
246+
FileName += 8;
247247
UiMessageBox("Failed to load RAM disk file '%.*s'",
248-
strcspn(File, " \t"), File);
248+
strcspn(FileName, " \t"), FileName);
249249
return Status;
250250
}
251251
}
252252

253253
/* Check if we booted from floppy */
254254
BootFromFloppy = strstr(BootPath, "fdisk") != NULL;
255255

256-
/* Open 'txtsetup.sif' from any of source paths */
257-
File = BootPath + strlen(BootPath);
256+
/* Open 'txtsetup.sif' from any of the source paths */
257+
FileName = BootPath + strlen(BootPath);
258258
for (i = BootFromFloppy ? 0 : 1; ; i++)
259259
{
260260
SystemPath = SourcePaths[i];
@@ -263,10 +263,10 @@ LoadReactOSSetup(
263263
UiMessageBox("Failed to open txtsetup.sif");
264264
return ENOENT;
265265
}
266-
RtlStringCbCopyA(File, sizeof(BootPath) - (File - BootPath)*sizeof(CHAR), SystemPath);
267-
RtlStringCbCopyA(FileName, sizeof(FileName), BootPath);
268-
RtlStringCbCatA(FileName, sizeof(FileName), "txtsetup.sif");
269-
if (InfOpenFile(&InfHandle, FileName, &ErrorLine))
266+
RtlStringCbCopyA(FileName, sizeof(BootPath) - (FileName - BootPath)*sizeof(CHAR), SystemPath);
267+
RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
268+
RtlStringCbCatA(FilePath, sizeof(FilePath), "txtsetup.sif");
269+
if (InfOpenFile(&InfHandle, FilePath, &ErrorLine))
270270
{
271271
break;
272272
}
@@ -308,14 +308,14 @@ LoadReactOSSetup(
308308
/* Allocate and minimalist-initialize LPB */
309309
AllocateAndInitLPB(&LoaderBlock);
310310

311-
/* Allocate and initialize setup loader block */
311+
/* Allocate and initialize the setup loader block */
312312
SetupBlock = &WinLdrSystemBlock->SetupBlock;
313313
LoaderBlock->SetupLdrBlock = SetupBlock;
314314

315315
/* Set textmode setup flag */
316316
SetupBlock->Flags = SETUPLDR_TEXT_MODE;
317317

318-
/* Load the system hive "setupreg.hiv" for setup */
318+
/* Load the "setupreg.hiv" setup system hive */
319319
UiDrawBackdrop();
320320
UiDrawProgressBarCenter(15, 100, "Loading setup system hive...");
321321
Success = WinLdrInitSystemHive(LoaderBlock, BootPath, TRUE);
@@ -325,9 +325,9 @@ LoadReactOSSetup(
325325
return ENOEXEC;
326326

327327
/* Load NLS data, they are in the System32 directory of the installation medium */
328-
RtlStringCbCopyA(FileName, sizeof(FileName), BootPath);
329-
RtlStringCbCatA(FileName, sizeof(FileName), "system32\\");
330-
SetupLdrLoadNlsData(LoaderBlock, InfHandle, FileName);
328+
RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
329+
RtlStringCbCatA(FilePath, sizeof(FilePath), "system32\\");
330+
SetupLdrLoadNlsData(LoaderBlock, InfHandle, FilePath);
331331

332332
// UiDrawStatusText("Press F6 if you need to install a 3rd-party SCSI or RAID driver...");
333333

boot/freeldr/freeldr/ntldr/winldr.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -659,12 +659,12 @@ LoadAndBootWindows(
659659
ARC_STATUS Status;
660660
PCSTR ArgValue;
661661
PCSTR SystemPartition;
662-
PCHAR File;
662+
PCSTR FileName;
663663
BOOLEAN Success;
664664
USHORT OperatingSystemVersion;
665665
PLOADER_PARAMETER_BLOCK LoaderBlock;
666666
CHAR BootPath[MAX_PATH];
667-
CHAR FileName[MAX_PATH];
667+
CHAR FilePath[MAX_PATH];
668668
CHAR BootOptions[256];
669669

670670
/* Retrieve the (mandatory) boot type */
@@ -717,17 +717,17 @@ LoadAndBootWindows(
717717
if (strrchr(BootPath, ')') == NULL)
718718
{
719719
/* Temporarily save the boot path */
720-
RtlStringCbCopyA(FileName, sizeof(FileName), BootPath);
720+
RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
721721

722722
/* This is not a full path: prepend the SystemPartition */
723723
RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
724724

725725
/* Append a path separator if needed */
726-
if (*FileName != '\\' && *FileName != '/')
726+
if (*FilePath != '\\' && *FilePath != '/')
727727
RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
728728

729729
/* Append the remaining path */
730-
RtlStringCbCatA(BootPath, sizeof(BootPath), FileName);
730+
RtlStringCbCatA(BootPath, sizeof(BootPath), FilePath);
731731
}
732732

733733
/* Append a path separator if needed */
@@ -780,17 +780,17 @@ LoadAndBootWindows(
780780

781781
TRACE("BootOptions: '%s'\n", BootOptions);
782782

783-
/* Check if a ramdisk file was given */
784-
File = strstr(BootOptions, "/RDPATH=");
785-
if (File)
783+
/* Check if a RAM disk file was given */
784+
FileName = strstr(BootOptions, "/RDPATH=");
785+
if (FileName)
786786
{
787-
/* Load the ramdisk */
787+
/* Load the RAM disk */
788788
Status = RamDiskInitialize(FALSE, BootOptions, SystemPartition);
789789
if (Status != ESUCCESS)
790790
{
791-
File += 8;
791+
FileName += 8;
792792
UiMessageBox("Failed to load RAM disk file '%.*s'",
793-
strcspn(File, " \t"), File);
793+
strcspn(FileName, " \t"), FileName);
794794
return Status;
795795
}
796796
}

0 commit comments

Comments
 (0)