Skip to content

Commit 626d306

Browse files
committed
main.cpp: pcstr instead of LPCSTR and const char*
1 parent fc6a52d commit 626d306

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/xrEngine/main.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace
3333
{
3434
HWND logoWindow = nullptr;
3535

36-
void RunBenchmark(const char* name);
36+
void RunBenchmark(pcstr name);
3737
}
3838

3939
void InitEngine()
@@ -52,7 +52,7 @@ struct PathIncludePred
5252

5353
public:
5454
explicit PathIncludePred(const xr_auth_strings_t* ignoredPaths) : ignored(ignoredPaths) {}
55-
bool xr_stdcall IsIncluded(const char* path)
55+
bool xr_stdcall IsIncluded(pcstr path)
5656
{
5757
if (!ignored)
5858
return true;
@@ -163,10 +163,10 @@ void Startup()
163163
execUserScript();
164164
InitSound();
165165
// ...command line for auto start
166-
const char* startArgs = strstr(Core.Params, "-start ");
166+
pcstr startArgs = strstr(Core.Params, "-start ");
167167
if (startArgs)
168168
Console->Execute(startArgs + 1);
169-
const char* loadArgs = strstr(Core.Params, "-load ");
169+
pcstr loadArgs = strstr(Core.Params, "-load ");
170170
if (loadArgs)
171171
Console->Execute(loadArgs + 1);
172172
// Initialize APP
@@ -180,7 +180,7 @@ void Startup()
180180
g_SpatialSpacePhysic = new ISpatial_DB("Spatial phys");
181181
// Destroy LOGO
182182
DestroyWindow(logoWindow);
183-
logoWindow = NULL;
183+
logoWindow = nullptr;
184184
// Main cycle
185185
Memory.mem_usage();
186186
Device.Run();
@@ -290,7 +290,7 @@ class StickyKeyFilter
290290
}
291291
};
292292

293-
int RunApplication(const char* commandLine)
293+
int RunApplication(pcstr commandLine)
294294
{
295295
#ifdef DEDICATED_SERVER
296296
g_dedicated_server = true;
@@ -324,7 +324,8 @@ int RunApplication(const char* commandLine)
324324
UpdateWindow(logoWindow);
325325
*g_sLaunchOnExit_app = 0;
326326
*g_sLaunchOnExit_params = 0;
327-
const char* fsltx = "-fsltx ";
327+
328+
pcstr fsltx = "-fsltx ";
328329
string_path fsgame = "";
329330
if (strstr(commandLine, fsltx))
330331
{
@@ -349,7 +350,8 @@ int RunApplication(const char* commandLine)
349350
InitConsole();
350351
Engine.External.CreateRendererList();
351352
Msg("command line %s", commandLine);
352-
LPCSTR benchName = "-batch_benchmark ";
353+
354+
pcstr benchName = "-batch_benchmark ";
353355
if (strstr(commandLine, benchName))
354356
{
355357
u32 sz = xr_strlen(benchName);
@@ -358,7 +360,8 @@ int RunApplication(const char* commandLine)
358360
RunBenchmark(benchmarkName);
359361
return 0;
360362
}
361-
LPCSTR sashName = "-openautomate ";
363+
364+
pcstr sashName = "-openautomate ";
362365
if (strstr(commandLine, sashName))
363366
{
364367
u32 sz = xr_strlen(sashName);
@@ -368,6 +371,7 @@ int RunApplication(const char* commandLine)
368371
g_SASH.MainLoop();
369372
return 0;
370373
}
374+
371375
#ifndef DEDICATED_SERVER
372376
if (strstr(Core.Params, "-r4"))
373377
Console->Execute("renderer renderer_r4");
@@ -398,15 +402,15 @@ int RunApplication(const char* commandLine)
398402
si.cb = sizeof(si);
399403
PROCESS_INFORMATION pi = {};
400404
// We use CreateProcess to setup working folder
401-
const char* tempDir = xr_strlen(g_sLaunchWorkingFolder) ? g_sLaunchWorkingFolder : nullptr;
405+
pcstr tempDir = xr_strlen(g_sLaunchWorkingFolder) ? g_sLaunchWorkingFolder : nullptr;
402406
CreateProcess(g_sLaunchOnExit_app, g_sLaunchOnExit_params, NULL, NULL, FALSE, 0, NULL, tempDir, &si, &pi);
403407
}
404408
return 0;
405409
}
406410

407411
namespace
408412
{
409-
void RunBenchmark(const char* name)
413+
void RunBenchmark(pcstr name)
410414
{
411415
g_bBenchmark = true;
412416
string_path cfgPath;

0 commit comments

Comments
 (0)