Remove debugOptions from internal classes

The debug options passed down from the public ShConstruct* functions to
internal code is unused. This change removes the internal debugOptions
fields and attempts to make it more obvious these fields are not used.

This change does not change the public-facing interface.

This change also adds the -Wshorten-64-to-32 warning to the StandAlone
build in order to avoid unwanted 64-to-32 bit conversions in the future.

Closes #3348.
This commit is contained in:
Nathaniel Cesario 2023-10-20 17:56:16 -06:00 committed by arcady-lunarg
parent a9e698322e
commit 8fa46582ec
6 changed files with 30 additions and 37 deletions

View file

@ -516,7 +516,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi
if (set) {
errno = 0;
int setVal = ::strtol(argv[curArg], nullptr, 10);
int setVal = static_cast<int>(::strtol(argv[curArg], nullptr, 10));
if (errno || setVal < 0) {
printf("%s: invalid set\n", argv[curArg]);
usage();
@ -528,7 +528,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi
if (binding) {
errno = 0;
int bindingVal = ::strtol(argv[curArg], nullptr, 10);
int bindingVal = static_cast<int>(::strtol(argv[curArg], nullptr, 10));
if (errno || bindingVal < 0) {
printf("%s: invalid binding\n", argv[curArg]);
usage();
@ -611,7 +611,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
exit(EFailUsage);
}
errno = 0;
int location = ::strtol(split + 1, nullptr, 10);
int location = static_cast<int>(::strtol(split + 1, nullptr, 10));
if (errno) {
printf("%s: invalid location\n", arg);
exit(EFailUsage);
@ -638,7 +638,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
} else if (lowerword == "uniform-base") {
if (argc <= 1)
Error("no <base> provided", lowerword.c_str());
uniformBase = ::strtol(argv[1], nullptr, 10);
uniformBase = static_cast<int>(::strtol(argv[1], nullptr, 10));
bumpArg();
break;
} else if (lowerword == "client") {
@ -1172,7 +1172,7 @@ void CompileShaders(glslang::TWorklist& worklist)
glslang::TWorkItem* workItem;
if (Options & EOptionStdin) {
if (worklist.remove(workItem)) {
ShHandle compiler = ShConstructCompiler(FindLanguage("stdin"), Options);
ShHandle compiler = ShConstructCompiler(FindLanguage("stdin"), 0);
if (compiler == nullptr)
return;
@ -1185,7 +1185,7 @@ void CompileShaders(glslang::TWorklist& worklist)
}
} else {
while (worklist.remove(workItem)) {
ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), Options);
ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), 0);
if (compiler == nullptr)
return;
@ -1876,7 +1876,8 @@ void CompileFile(const char* fileName, ShHandle compiler)
for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) {
for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) {
// ret = ShCompile(compiler, shaderStrings, NumShaderStrings, lengths, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, GetResources(), Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, GetResources(), 0,
(Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
// const char* multi[12] = { "# ve", "rsion", " 300 e", "s", "\n#err",
// "or should be l", "ine 1", "string 5\n", "float glo", "bal",
// ";\n#error should be line 2\n void main() {", "global = 2.3;}" };