Skip to content

Add cppcheck and sync common code#23

Merged
Yamagi merged 7 commits into
yquake2:masterfrom
0lvin:master
Feb 28, 2026
Merged

Add cppcheck and sync common code#23
Yamagi merged 7 commits into
yquake2:masterfrom
0lvin:master

Conversation

@0lvin

@0lvin 0lvin commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Sync shared/spawn/savegame.

Part of yquake2/yquake2#1289

@github-advanced-security

Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment thread src/g_spawn.c
break;
case F_FLOAT:
*(float *)(b + f->ofs) = atof(value);
*(float *)(b + f->ofs) = (float)strtod(value, (char **)NULL);

Check warning

Code scanning / CppCheck

Casting between unsigned char * and float * which have an incompatible binary data representation. Medium

Casting between unsigned char * and float * which have an incompatible binary data representation.
Comment thread src/g_spawn.c
edict_t *ent;
int inhibit;
char *com_token;
const char *com_token;

Check warning

Code scanning / CppCheck

The scope of the variable 'com_token' can be reduced. Medium

The scope of the variable 'com_token' can be reduced.
Comment thread src/header/shared.h
int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, struct cplane_s *plane);
void AngleVectors(const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
void AngleVectors2(const vec3_t value1, vec3_t angles);
int BoxOnPlaneSide(const vec3_t emins, const vec3_t emaxs, const struct cplane_s *plane);

Check warning

Code scanning / CppCheck

Function 'BoxOnPlaneSide' argument 3 names different: declaration 'plane' definition 'p'. Medium

Function 'BoxOnPlaneSide' argument 3 names different: declaration 'plane' definition 'p'.
Comment thread src/header/shared.h
int Q_strncasecmp(char *s1, char *s2, int n);
int Q_strcasecmp(const char *s1, const char *s2);
int Q_strncasecmp(const char *s1, const char *s2, int n);
char *Q_strcasestr(const char *s1, const char *s2);

Check warning

Code scanning / CppCheck

Function 'Q_strcasestr' argument 1 names different: declaration 's1' definition 'haystack'. Medium

Function 'Q_strcasestr' argument 1 names different: declaration 's1' definition 'haystack'.
Comment thread src/header/shared.h
int Q_strncasecmp(char *s1, char *s2, int n);
int Q_strcasecmp(const char *s1, const char *s2);
int Q_strncasecmp(const char *s1, const char *s2, int n);
char *Q_strcasestr(const char *s1, const char *s2);

Check warning

Code scanning / CppCheck

Function 'Q_strcasestr' argument 2 names different: declaration 's2' definition 'needle'. Medium

Function 'Q_strcasestr' argument 2 names different: declaration 's2' definition 'needle'.
Comment thread src/shared/shared.c
static char value[2][MAX_INFO_VALUE];
static int valueindex = 0;

const char *kstart, *vstart;

Check warning

Code scanning / CppCheck

The scope of the variable 'kstart' can be reduced. Medium

The scope of the variable 'kstart' can be reduced.
Comment thread src/shared/shared.c
* =======================================================================
*/

#include <ctype.h>

Check notice

Code scanning / CppCheck

Include file: <ctype.h> not found. Please note: Standard library headers do not need to be provided to get proper results. Note

Include file: <ctype.h> not found. Please note: Standard library headers do not need to be provided to get proper results.
Comment thread src/shared/shared.c
#include <ctype.h>

#ifndef _MSC_VER
#include <strings.h>

Check notice

Code scanning / CppCheck

Include file: <strings.h> not found. Please note: Standard library headers do not need to be provided to get proper results. Note

Include file: <strings.h> not found. Please note: Standard library headers do not need to be provided to get proper results.
Comment thread src/shared/shared.c
return NULL;
}
#else
#include <sys/stat.h>

Check notice

Code scanning / CppCheck

Include file: <sys/stat.h> not found. Please note: Standard library headers do not need to be provided to get proper results. Note

Include file: <sys/stat.h> not found. Please note: Standard library headers do not need to be provided to get proper results.
Comment thread src/shared/shared.c
}
#else
#include <sys/stat.h>
#include <errno.h>

Check notice

Code scanning / CppCheck

Include file: <errno.h> not found. Please note: Standard library headers do not need to be provided to get proper results. Note

Include file: <errno.h> not found. Please note: Standard library headers do not need to be provided to get proper results.
@Yamagi Yamagi merged commit 2f0e015 into yquake2:master Feb 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants