Skip to content

Commit

Permalink
BUG: static_cast the enum to an int for printing
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiss3003 committed Aug 8, 2024
1 parent 1f01505 commit 8333a93
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/openSeaChest_LogParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ int32_t main(int argc, char *argv[])
break;
default:
{
printf("\n %d failure", retStatus);
printf("\n %d failure", static_cast<int>(retStatus));
}
break;
}
Expand Down Expand Up @@ -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<uint64_t>(argc); commandLineIter++)
for (int commandLineIter = 1; commandLineIter < static_cast<int>(argc); commandLineIter++)
{
if (strncmp(argv[commandLineIter], "--echoCommandLine", strlen(argv[commandLineIter])) == 0)
{
Expand Down
34 changes: 17 additions & 17 deletions utils/src/seachest_parser_util_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(eUtilExitCodes::UTIL_EXIT_NO_ERROR));
printf("\t%d = Error in command line options\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_ERROR_IN_COMMAND_LINE));
printf("\t%d = Invalid Device Handle or Missing Device Handle\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_INVALID_DEVICE_HANDLE));
printf("\t%d = Operation Failure\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_OPERATION_FAILURE));
printf("\t%d = Operation not supported\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_OPERATION_NOT_SUPPORTED));
printf("\t%d = Operation Failed and was still in progress \n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_OPERATION_STILL_IN_PROGRESS));
printf("\t%d = Operation Aborted\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_OPERATION_ABORTED));
printf("\t%d = Operation Failed for Bad Parameter in the log \n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_OPERATION_BAD_PARAMETER));
printf("\t%d = Operation had Memory Failures\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_OPERATION_MEMORY_FAILURE));
printf("\t%d = Operation Failed for Invaild Lengths in the log\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_OPERATION_INVALID_LENGTH));
printf("\t%d = File Path Not Found\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_PATH_NOT_FOUND));
printf("\t%d = Cannot Open File\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_CANNOT_OPEN_FILE));
printf("\t%d = File Already Exists\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_FILE_ALREADY_EXISTS));
printf("\t%d = Not Valid for this parser\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_FILE_NOT_VALID));
printf("\t%d = Validation Failed\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_VALIDATION_FAILURE));
printf("\t%d = Error in Header and Footer validation\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_STRIP_HDR_FOOTER_FAILURE));
printf("\t%d = Parsing Failure\n", static_cast<int>(eUtilExitCodes::UTIL_EXIT_PARSE_FAILURE));
printf("\tAnything else = unknown error\n\n");

}
Expand Down

0 comments on commit 8333a93

Please sign in to comment.