Cleanup: reduce scope, quiet unused variable warnings

When building without thumbnails some variables weren't used,
reduce their scope as well as the BlPath sub-string.
This commit is contained in:
Campbell Barton 2022-08-31 14:26:47 +10:00
parent 876d1bfe4e
commit 0f8ebd21e3
1 changed files with 16 additions and 17 deletions

View File

@ -63,23 +63,17 @@ bool BLI_windows_register_blend_extension(const bool background)
char buffer[256];
char BlPath[MAX_PATH];
char InstallDir[FILE_MAXDIR];
char SysDir[FILE_MAXDIR];
const char *ThumbHandlerDLL;
char RegCmd[MAX_PATH * 2];
char MBox[256];
char *blender_app;
# ifndef _WIN64
BOOL IsWOW64;
# endif
printf("Registering file extension...");
GetModuleFileName(0, BlPath, MAX_PATH);
/* Replace the actual app name with the wrapper. */
blender_app = strstr(BlPath, "blender.exe");
if (blender_app != NULL) {
strcpy(blender_app, "blender-launcher.exe");
{
char *blender_app = strstr(BlPath, "blender.exe");
if (blender_app != NULL) {
strcpy(blender_app, "blender-launcher.exe");
}
}
/* root is HKLM by default */
@ -157,12 +151,17 @@ bool BLI_windows_register_blend_extension(const bool background)
}
# ifdef WITH_BLENDER_THUMBNAILER
BLI_windows_get_executable_dir(InstallDir);
GetSystemDirectory(SysDir, FILE_MAXDIR);
ThumbHandlerDLL = "BlendThumb.dll";
snprintf(
RegCmd, MAX_PATH * 2, "%s\\regsvr32 /s \"%s\\%s\"", SysDir, InstallDir, ThumbHandlerDLL);
system(RegCmd);
{
char RegCmd[MAX_PATH * 2];
char InstallDir[FILE_MAXDIR];
char SysDir[FILE_MAXDIR];
BLI_windows_get_executable_dir(InstallDir);
GetSystemDirectory(SysDir, FILE_MAXDIR);
const char *ThumbHandlerDLL = "BlendThumb.dll";
snprintf(
RegCmd, MAX_PATH * 2, "%s\\regsvr32 /s \"%s\\%s\"", SysDir, InstallDir, ThumbHandlerDLL);
system(RegCmd);
}
# endif
RegCloseKey(root);