Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with Q2PRO: Error stuff from common #378

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions inc/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,8 @@ void Com_EndRedirect(void);

void Com_AbortFunc(void (*func)(void *), void *arg);

#ifdef _WIN32
void Com_AbortFrame(void);
#endif

char *Com_GetLastError(void);
void Com_SetLastError(const char *msg);
const char *Com_GetLastError(void);

void Com_Quit(const char *reason, error_type_t type) q_noreturn;

Expand Down
15 changes: 3 additions & 12 deletions src/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,13 @@ void Com_SetLastError(const char *msg)
if (msg) {
Q_strlcpy(com_errorMsg, msg, sizeof(com_errorMsg));
} else {
strcpy(com_errorMsg, "No error");
com_errorMsg[0] = 0;
}
}

char *Com_GetLastError(void)
const char *Com_GetLastError(void)
{
return com_errorMsg;
return com_errorMsg[0] ? com_errorMsg : "No error";
}

/*
Expand Down Expand Up @@ -582,13 +582,6 @@ void Com_AbortFunc(void (*func)(void *), void *arg)
com_abort_arg = arg;
}

#ifdef _WIN32
void Com_AbortFrame(void)
{
longjmp(com_abortframe, -1);
}
#endif

/*
=============
Com_Quit
Expand Down Expand Up @@ -863,8 +856,6 @@ void Qcommon_Init(int argc, char **argv)
com_argc = argc;
com_argv = argv;

Com_SetLastError(NULL);

Q_srand(time(NULL));

// prepare enough of the subsystems to handle
Expand Down
Loading