mirror of
https://github.com/bkaradzic/bimg.git
synced 2026-02-17 20:52:38 +01:00
Added kExitSuccess/Failure constants.
This commit is contained in:
@@ -575,27 +575,27 @@ int main(int _argc, const char* _argv[])
|
||||
, BIMG_TEXTUREC_VERSION_MINOR
|
||||
, BIMG_API_VERSION
|
||||
);
|
||||
return EXIT_SUCCESS;
|
||||
return bx::kExitSuccess;
|
||||
}
|
||||
|
||||
if (cmdLine.hasArg('h', "help") )
|
||||
{
|
||||
help();
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
const char* inputFileName = cmdLine.findOption('f');
|
||||
if (NULL == inputFileName)
|
||||
{
|
||||
help("Input file must be specified.");
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
const char* outputFileName = cmdLine.findOption('o');
|
||||
if (NULL == outputFileName)
|
||||
{
|
||||
help("Output file must be specified.");
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
const char* saveAs = cmdLine.findOption("as");
|
||||
@@ -604,7 +604,7 @@ int main(int _argc, const char* _argv[])
|
||||
if (NULL == saveAs)
|
||||
{
|
||||
help("Output file format must be specified.");
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
Options options;
|
||||
@@ -644,7 +644,7 @@ int main(int _argc, const char* _argv[])
|
||||
if (!bimg::isValid(options.format) )
|
||||
{
|
||||
help("Invalid format specified.");
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ int main(int _argc, const char* _argv[])
|
||||
case 'd': options.quality = bimg::Quality::Default; break;
|
||||
default:
|
||||
help("Invalid quality specified.");
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -667,14 +667,14 @@ int main(int _argc, const char* _argv[])
|
||||
if (!bx::open(&reader, inputFileName, &err) )
|
||||
{
|
||||
help("Failed to open input file.", err);
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
uint32_t inputSize = (uint32_t)bx::getSize(&reader);
|
||||
if (0 == inputSize)
|
||||
{
|
||||
help("Failed to read input file.", err);
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
bx::DefaultAllocator allocator;
|
||||
@@ -686,7 +686,7 @@ int main(int _argc, const char* _argv[])
|
||||
if (!err.isOk() )
|
||||
{
|
||||
help("Failed to read input file.", err);
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
bimg::ImageContainer* output = convert(&allocator, inputData, inputSize, options, &err);
|
||||
@@ -712,13 +712,13 @@ int main(int _argc, const char* _argv[])
|
||||
if (!err.isOk() )
|
||||
{
|
||||
help(NULL, err);
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
help("Failed to open output file.", err);
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
bimg::imageFree(output);
|
||||
@@ -726,8 +726,8 @@ int main(int _argc, const char* _argv[])
|
||||
else
|
||||
{
|
||||
help(NULL, err);
|
||||
return EXIT_FAILURE;
|
||||
return bx::kExitFailure;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return bx::kExitSuccess;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user