Skip to content

Commit

Permalink
Introduce EXIT_CODE_SUCCESS to standardize successful exit status
Browse files Browse the repository at this point in the history
Added the definition for EXIT_CODE_SUCCESS in src/error.h and updated the initial value of exit_code in src/stub.c from 0 to EXIT_CODE_SUCCESS. This change standardizes the representation of a successful exit across the application, enhancing code readability and maintainability.
  • Loading branch information
shinokaro committed Apr 25, 2024
1 parent da26256 commit cf94e8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/error.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Exit code definitions
#define EXIT_CODE_SUCCESS ((DWORD)0)
#define EXIT_CODE_FAILURE ((DWORD)-1)

/**
Expand Down
2 changes: 1 addition & 1 deletion src/stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ BOOL WINAPI ConsoleHandleRoutine(DWORD dwCtrlType)

int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
DWORD exit_code = 0;
DWORD exit_code = EXIT_CODE_SUCCESS;
MappedFile mapped_file = NULL;
OperationModes flags = 0;

Expand Down

0 comments on commit cf94e8e

Please sign in to comment.