From 8333a933e4bf7cf69c952b5768678850cd6df9dd Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 8 Aug 2024 11:36:14 -0600 Subject: [PATCH] BUG: static_cast the enum to an int for printing --- src/openSeaChest_LogParser.cpp | 4 +-- utils/src/seachest_parser_util_options.cpp | 34 +++++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/openSeaChest_LogParser.cpp b/src/openSeaChest_LogParser.cpp index a5c7a2a..dc7ce2a 100644 --- a/src/openSeaChest_LogParser.cpp +++ b/src/openSeaChest_LogParser.cpp @@ -707,7 +707,7 @@ int32_t main(int argc, char *argv[]) break; default: { - printf("\n %d failure", retStatus); + printf("\n %d failure", static_cast(retStatus)); } break; } @@ -882,7 +882,7 @@ static void UtilityHeader(JSONNODE *masterData) inline void Echo_Command_Line(int argc, char *argv[]) { - for (int commandLineIter = 1; commandLineIter < static_cast(argc); commandLineIter++) + for (int commandLineIter = 1; commandLineIter < static_cast(argc); commandLineIter++) { if (strncmp(argv[commandLineIter], "--echoCommandLine", strlen(argv[commandLineIter])) == 0) { diff --git a/utils/src/seachest_parser_util_options.cpp b/utils/src/seachest_parser_util_options.cpp index c7b4d7a..82d9ed5 100644 --- a/utils/src/seachest_parser_util_options.cpp +++ b/utils/src/seachest_parser_util_options.cpp @@ -174,23 +174,23 @@ void print_Final_newline(void) void print_SeaChest_Util_Exit_Codes(void) { printf("\tGeneric/Common error codes\n"); - printf("\t%d = No Error Found\n", eUtilExitCodes::UTIL_EXIT_NO_ERROR); - printf("\t%d = Error in command line options\n", eUtilExitCodes::UTIL_EXIT_ERROR_IN_COMMAND_LINE); - printf("\t%d = Invalid Device Handle or Missing Device Handle\n", eUtilExitCodes::UTIL_EXIT_INVALID_DEVICE_HANDLE); - printf("\t%d = Operation Failure\n", eUtilExitCodes::UTIL_EXIT_OPERATION_FAILURE); - printf("\t%d = Operation not supported\n", eUtilExitCodes::UTIL_EXIT_OPERATION_NOT_SUPPORTED); - printf("\t%d = Operation Failed and was still in progress \n", eUtilExitCodes::UTIL_EXIT_OPERATION_STILL_IN_PROGRESS); - printf("\t%d = Operation Aborted\n", eUtilExitCodes::UTIL_EXIT_OPERATION_ABORTED); - printf("\t%d = Operation Failed for Bad Parameter in the log \n", eUtilExitCodes::UTIL_EXIT_OPERATION_BAD_PARAMETER); - printf("\t%d = Operation had Memory Failures\n", eUtilExitCodes::UTIL_EXIT_OPERATION_MEMORY_FAILURE); - printf("\t%d = Operation Failed for Invaild Lengths in the log\n", eUtilExitCodes::UTIL_EXIT_OPERATION_INVALID_LENGTH); - printf("\t%d = File Path Not Found\n", eUtilExitCodes::UTIL_EXIT_PATH_NOT_FOUND); - printf("\t%d = Cannot Open File\n", eUtilExitCodes::UTIL_EXIT_CANNOT_OPEN_FILE); - printf("\t%d = File Already Exists\n", eUtilExitCodes::UTIL_EXIT_FILE_ALREADY_EXISTS); - printf("\t%d = Not Valid for this parser\n", eUtilExitCodes::UTIL_EXIT_FILE_NOT_VALID); - printf("\t%d = Validation Failed\n", eUtilExitCodes::UTIL_EXIT_VALIDATION_FAILURE); - printf("\t%d = Error in Header and Footer validation\n", eUtilExitCodes::UTIL_EXIT_STRIP_HDR_FOOTER_FAILURE); - printf("\t%d = Parsing Failure\n", eUtilExitCodes::UTIL_EXIT_PARSE_FAILURE); + printf("\t%d = No Error Found\n", static_cast(eUtilExitCodes::UTIL_EXIT_NO_ERROR)); + printf("\t%d = Error in command line options\n", static_cast(eUtilExitCodes::UTIL_EXIT_ERROR_IN_COMMAND_LINE)); + printf("\t%d = Invalid Device Handle or Missing Device Handle\n", static_cast(eUtilExitCodes::UTIL_EXIT_INVALID_DEVICE_HANDLE)); + printf("\t%d = Operation Failure\n", static_cast(eUtilExitCodes::UTIL_EXIT_OPERATION_FAILURE)); + printf("\t%d = Operation not supported\n", static_cast(eUtilExitCodes::UTIL_EXIT_OPERATION_NOT_SUPPORTED)); + printf("\t%d = Operation Failed and was still in progress \n", static_cast(eUtilExitCodes::UTIL_EXIT_OPERATION_STILL_IN_PROGRESS)); + printf("\t%d = Operation Aborted\n", static_cast(eUtilExitCodes::UTIL_EXIT_OPERATION_ABORTED)); + printf("\t%d = Operation Failed for Bad Parameter in the log \n", static_cast(eUtilExitCodes::UTIL_EXIT_OPERATION_BAD_PARAMETER)); + printf("\t%d = Operation had Memory Failures\n", static_cast(eUtilExitCodes::UTIL_EXIT_OPERATION_MEMORY_FAILURE)); + printf("\t%d = Operation Failed for Invaild Lengths in the log\n", static_cast(eUtilExitCodes::UTIL_EXIT_OPERATION_INVALID_LENGTH)); + printf("\t%d = File Path Not Found\n", static_cast(eUtilExitCodes::UTIL_EXIT_PATH_NOT_FOUND)); + printf("\t%d = Cannot Open File\n", static_cast(eUtilExitCodes::UTIL_EXIT_CANNOT_OPEN_FILE)); + printf("\t%d = File Already Exists\n", static_cast(eUtilExitCodes::UTIL_EXIT_FILE_ALREADY_EXISTS)); + printf("\t%d = Not Valid for this parser\n", static_cast(eUtilExitCodes::UTIL_EXIT_FILE_NOT_VALID)); + printf("\t%d = Validation Failed\n", static_cast(eUtilExitCodes::UTIL_EXIT_VALIDATION_FAILURE)); + printf("\t%d = Error in Header and Footer validation\n", static_cast(eUtilExitCodes::UTIL_EXIT_STRIP_HDR_FOOTER_FAILURE)); + printf("\t%d = Parsing Failure\n", static_cast(eUtilExitCodes::UTIL_EXIT_PARSE_FAILURE)); printf("\tAnything else = unknown error\n\n"); }