Merge pull request #1175 from 0lvin/1173_crash

Make more function local and use const with names
This commit is contained in:
Yamagi 2024-12-22 19:28:16 +01:00 committed by GitHub
commit 9e127cf71f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 209 additions and 238 deletions

View file

@ -146,7 +146,8 @@ static void SetExecutablePath(char* exePath)
#endif
}
qboolean Sys_GetCwd(char *buf, size_t size)
static qboolean
Sys_GetCwd(char *buf, size_t size)
{
#ifdef _WIN32
WCHAR wpath[PATH_MAX];

View file

@ -800,7 +800,7 @@ NET_SendPacket(netsrc_t sock, int length, void *data, netadr_t to)
/* ============================================================================= */
int
static int
NET_IPSocket(char *net_interface, int port, netsrc_t type, int family)
{
char Buf[BUFSIZ], *Host, *Service;
@ -1040,7 +1040,7 @@ NET_OpenIP(void)
}
}
int
static int
NET_IPXSocket(int port)
{
int newsocket;

View file

@ -472,7 +472,7 @@ Con_DrawInput(void)
float scale;
char *text;
char ch;
int txtlen;
size_t txtlen;
int linepos;
int draw_icon;
@ -630,7 +630,7 @@ Con_DrawConsole(float frac)
{
int i, j, x, y, n;
int rows;
int verLen;
size_t verLen;
char *text;
int row;
int lines;

View file

@ -269,7 +269,7 @@ keyname_t keynames[] = {
/* ------------------------------------------------------------------ */
void
static void
CompleteCommand(void)
{
char *cmd;
@ -301,7 +301,7 @@ CompleteCommand(void)
key_lines[edit_line][key_linepos] = '\0';
}
void
static void
CompleteMapNameCommand(void)
{
char *s, *cmdArg;
@ -339,7 +339,7 @@ IsInConsole(void)
(cls.state == ca_disconnected || cls.state == ca_connecting));
}
void
static void
Key_Console(int key)
{
char txt[2];
@ -607,7 +607,7 @@ char chat_buffer[MAXCMDLINE];
int chat_bufferlen = 0;
int chat_cursorpos = 0;
void
static void
Key_Message(int key)
{
char last;
@ -735,7 +735,7 @@ Key_Message(int key)
* Single ascii characters return themselves, while
* the K_* names are matched up.
*/
int
static int
Key_StringToKeynum(char *str)
{
keyname_t *kn;
@ -822,7 +822,7 @@ Key_SetBinding(int keynum, char *binding)
keybindings[keynum] = new;
}
void
static void
Key_Unbind_f(void)
{
int b;
@ -844,7 +844,7 @@ Key_Unbind_f(void)
Key_SetBinding(b, "");
}
void
static void
Key_Unbindall_f(void)
{
int i;
@ -862,7 +862,7 @@ Key_Unbindall_f(void)
* (=> default.cfg is done) */
extern qboolean doneWithDefaultCfg;
void
static void
Key_Bind_f(void)
{
int i, c, b;
@ -1049,7 +1049,7 @@ Key_ReadConsoleHistory()
fclose(f);
}
void
static void
Key_Bindlist_f(void)
{
int i;

View file

@ -33,6 +33,7 @@ void CL_Changing_f(void);
void CL_Reconnect_f(void);
void CL_Connect_f(void);
void CL_Rcon_f(void);
void CL_Packet_f(void);
void CL_CheckForResend(void);
cvar_t *rcon_client_password;
@ -598,6 +599,7 @@ CL_InitLocal(void)
Cmd_AddCommand("reconnect", CL_Reconnect_f);
Cmd_AddCommand("rcon", CL_Rcon_f);
Cmd_AddCommand("packet", CL_Packet_f);
Cmd_AddCommand("setenv", CL_Setenv_f);

View file

@ -109,7 +109,7 @@ CL_Drop(void)
* We have gotten a challenge from the server, so try and
* connect.
*/
void
static void
CL_SendConnectPacket(void)
{
netadr_t adr;
@ -378,7 +378,7 @@ void
CL_Packet_f(void)
{
char send[2048];
int i, l;
size_t i, l;
char *in, *out;
netadr_t adr;
@ -567,7 +567,7 @@ CL_PingServers_f(void)
/*
* Responses to broadcasts, etc
*/
void
static void
CL_ConnectionlessPacket(void)
{
char *s;

View file

@ -30,9 +30,9 @@
void CL_DownloadFileName(char *dest, int destlen, char *fn);
void CL_ParseDownload(void);
int bitcounts[32]; /* just for protocol profiling */
static int bitcounts[32]; /* just for protocol profiling */
char *svc_strings[256] = {
static const char *svc_strings[256] = {
"svc_bad",
"svc_muzzleflash",
@ -83,7 +83,7 @@ CL_RegisterSounds(void)
/*
* Returns the entity number and the header bits
*/
int
static int
CL_ParseEntityBits(unsigned *bits)
{
unsigned b, total;
@ -137,8 +137,8 @@ CL_ParseEntityBits(unsigned *bits)
/*
* Can go from either a baseline or a previous packet_entity
*/
void
CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
static void
CL_ParseDelta(const entity_state_t *from, entity_state_t *to, int number, int bits)
{
/* set everything to the state we are delta'ing from */
*to = *from;
@ -275,7 +275,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
* Parses deltas from the given base and adds the resulting entity to
* the current frame
*/
void
static void
CL_DeltaEntity(frame_t *frame, int newnum, entity_state_t *old, int bits)
{
centity_t *ent;
@ -339,13 +339,12 @@ CL_DeltaEntity(frame_t *frame, int newnum, entity_state_t *old, int bits)
* parsed, deal with the rest of the
* data stream.
*/
void
static void
CL_ParsePacketEntities(frame_t *oldframe, frame_t *newframe)
{
unsigned int newnum;
unsigned bits;
entity_state_t
*oldstate = NULL;
entity_state_t *oldstate = NULL;
int oldindex, oldnum;
newframe->parse_entities = cl.parse_entities;
@ -518,13 +517,11 @@ CL_ParsePacketEntities(frame_t *oldframe, frame_t *newframe)
}
}
void
static void
CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
{
int flags;
int flags, i, statbits;
player_state_t *state;
int i;
int statbits;
state = &newframe->playerstate;
@ -656,14 +653,16 @@ CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
}
}
void
static void
CL_FireEntityEvents(frame_t *frame)
{
entity_state_t *s1;
int pnum, num;
int pnum;
for (pnum = 0; pnum < frame->num_entities; pnum++)
{
entity_state_t *s1;
int num;
num = (frame->parse_entities + pnum) & (MAX_PARSE_ENTITIES - 1);
s1 = &cl_parse_entities[num];
@ -679,7 +678,16 @@ CL_FireEntityEvents(frame_t *frame)
}
}
void
static void
SHOWNET(const char *s)
{
if (cl_shownet->value >= 2)
{
Com_Printf("%3i:%s\n", net_message.readcount - 1, s);
}
}
static void
CL_ParseFrame(void)
{
int cmd;
@ -823,7 +831,7 @@ CL_ParseFrame(void)
}
}
void
static void
CL_ParseServerData(void)
{
extern cvar_t *fs_gamedirvar;
@ -891,7 +899,7 @@ CL_ParseServerData(void)
}
}
void
static void
CL_ParseBaseline(void)
{
entity_state_t *es;
@ -1061,10 +1069,11 @@ CL_ParseClientinfo(int player)
CL_LoadClientinfo(ci, s);
}
void
static void
CL_ParseConfigString(void)
{
int i, length;
size_t length;
int i;
char *s;
char olds[MAX_QPATH];
@ -1072,7 +1081,7 @@ CL_ParseConfigString(void)
if ((i < 0) || (i >= MAX_CONFIGSTRINGS))
{
Com_Error(ERR_DROP, "configstring > MAX_CONFIGSTRINGS");
Com_Error(ERR_DROP, "%s: configstring > MAX_CONFIGSTRINGS", __func__);
}
s = MSG_ReadString(&net_message);
@ -1080,9 +1089,9 @@ CL_ParseConfigString(void)
Q_strlcpy(olds, cl.configstrings[i], sizeof(olds));
length = strlen(s);
if (length > sizeof(cl.configstrings) - sizeof(cl.configstrings[0])*i - 1)
if (length > sizeof(cl.configstrings) - sizeof(cl.configstrings[0]) * i - 1)
{
Com_Error(ERR_DROP, "CL_ParseConfigString: oversize configstring");
Com_Error(ERR_DROP, "%s: oversize configstring", __func__);
}
strcpy(cl.configstrings[i], s);
@ -1140,7 +1149,7 @@ CL_ParseConfigString(void)
}
}
void
static void
CL_ParseStartSoundPacket(void)
{
vec3_t pos_v;
@ -1227,15 +1236,6 @@ CL_ParseStartSoundPacket(void)
volume, attenuation, ofs);
}
void
SHOWNET(char *s)
{
if (cl_shownet->value >= 2)
{
Com_Printf("%3i:%s\n", net_message.readcount - 1, s);
}
}
void
CL_ParseServerMessage(void)
{

View file

@ -421,12 +421,7 @@ void CL_Widowbeamout (cl_sustain_t *self);
void CL_Nukeblast (cl_sustain_t *self);
void CL_WidowSplash (vec3_t org);
int CL_ParseEntityBits (unsigned *bits);
void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int number, int bits);
void CL_ParseFrame (void);
void CL_ParseTEnt (void);
void CL_ParseConfigString (void);
void CL_AddMuzzleFlash (void);
void CL_AddMuzzleFlash2 (void);
void SmokeAndFlash(vec3_t origin);
@ -498,11 +493,8 @@ void CL_WriteDemoMessage (void);
void CL_Stop_f (void);
void CL_Record_f (void);
extern char *svc_strings[256];
void CL_ParseServerMessage (void);
void CL_LoadClientinfo (clientinfo_t *ci, char *s);
void SHOWNET(char *s);
void CL_ParseClientinfo (int player);
void CL_Download_f (void);

View file

@ -2147,6 +2147,9 @@ IN_Controller_Init(qboolean notify_user)
for (int i = 0; i < SDL_NumJoysticks(); i++)
{
const char* joystick_name;
size_t name_len;
joystick = SDL_JoystickOpen(i);
if (!joystick)
{
@ -2154,8 +2157,8 @@ IN_Controller_Init(qboolean notify_user)
continue; // try next joystick
}
const char* joystick_name = SDL_JoystickName(joystick);
const int name_len = strlen(joystick_name);
joystick_name = SDL_JoystickName(joystick);
name_len = strlen(joystick_name);
Com_Printf ("Trying joystick %d, '%s'\n", i+1, joystick_name);

View file

@ -99,7 +99,7 @@ M_IsGame(const char *gamename)
}
static void
M_Banner(char *name)
M_Banner(const char *name)
{
int w, h;
float scale = SCR_GetMenuScale();
@ -753,7 +753,7 @@ M_Main_Draw(void)
( int )(cls.realtime / 100) % NUM_CURSOR_FRAMES);
}
const char *
static const char *
M_Main_Key(int key)
{
return Default_MenuKey(&s_main, key);
@ -1545,7 +1545,7 @@ DrawControllerAltButtonBindingFunc(void *self)
}
else
{
int x;
size_t x;
const char *name;
name = Key_KeynumToString(keys[0]);
@ -5277,7 +5277,7 @@ AddressBook_MenuInit(void)
}
}
const char *
static const char *
AddressBook_MenuKey(int key)
{
if (key == K_ESCAPE)
@ -5684,7 +5684,8 @@ HasSkinsInDir(const char *dirname, int *num)
{
char **list_png, **list_pcx;
char **curr = NULL, **list = NULL;
int num_png, num_pcx, dirname_size;
int num_png, num_pcx;
size_t dirname_size;
*num = 0;
/* dir name size plus one for skip slash */
@ -5934,7 +5935,8 @@ PlayerConfig_ScanDirectories(void)
return result;
}
void ListModels_f(void)
static void
ListModels_f(void)
{
PlayerConfig_ScanDirectories();

View file

@ -67,7 +67,8 @@ ClampCvar(float min, float max, float value)
Bitmap_Draw
=================
*/
void Bitmap_Draw(menubitmap_s * item)
static void
Bitmap_Draw(menubitmap_s * item)
{
float scale = SCR_GetMenuScale();
int x = 0;
@ -132,19 +133,7 @@ Action_Draw(menuaction_s *a)
}
}
qboolean
Field_DoEnter(menufield_s *f)
{
if (f->generic.callback)
{
f->generic.callback(f);
return true;
}
return false;
}
void
static void
Field_Draw(menufield_s *f)
{
int i, n;

View file

@ -84,13 +84,13 @@ RDraw_CharScaled(int x, int y, int num, float scale)
}
image_t *
RDraw_FindPic(char *name)
RDraw_FindPic(const char *name)
{
return R_FindPic(name, (findimage_t)R_FindImage);
}
void
RDraw_GetPicSize(int *w, int *h, char *pic)
RDraw_GetPicSize(int *w, int *h, const char *pic)
{
image_t *gl;
@ -107,7 +107,7 @@ RDraw_GetPicSize(int *w, int *h, char *pic)
}
void
RDraw_StretchPic(int x, int y, int w, int h, char *pic)
RDraw_StretchPic(int x, int y, int w, int h, const char *pic)
{
image_t *gl;
@ -152,7 +152,7 @@ RDraw_StretchPic(int x, int y, int w, int h, char *pic)
}
void
RDraw_PicScaled(int x, int y, char *pic, float factor)
RDraw_PicScaled(int x, int y, const char *pic, float factor)
{
image_t *gl;
@ -210,7 +210,7 @@ RDraw_PicScaled(int x, int y, char *pic, float factor)
* refresh window.
*/
void
RDraw_TileClear(int x, int y, int w, int h, char *pic)
RDraw_TileClear(int x, int y, int w, int h, const char *pic)
{
image_t *image;

View file

@ -470,7 +470,7 @@ R_ImageList_f(void)
/*
* Fill background pixels so mipmapping doesn't have haloes
*/
void
static void
R_FloodFillSkin(byte *skin, int skinwidth, int skinheight)
{
byte fillcolor = *skin; /* assume this is the pixel to fill */
@ -536,7 +536,7 @@ R_FloodFillSkin(byte *skin, int skinwidth, int skinheight)
* texture to increase the
* lighting range
*/
void
static void
R_LightScaleTexture(unsigned *in, int inwidth,
int inheight, qboolean only_gamma)
{
@ -577,7 +577,7 @@ R_LightScaleTexture(unsigned *in, int inwidth,
/*
* Operates in place, quartering the size of the texture
*/
void
static void
R_MipMap(byte *in, int width, int height)
{
int i, j;
@ -602,7 +602,7 @@ R_MipMap(byte *in, int width, int height)
/*
* Returns has_alpha
*/
void
static void
R_BuildPalettedTexture(unsigned char *paletted_texture, unsigned char *scaled,
int scaled_width, int scaled_height)
{
@ -624,7 +624,7 @@ R_BuildPalettedTexture(unsigned char *paletted_texture, unsigned char *scaled,
}
}
qboolean
static qboolean
R_Upload32Native(unsigned *data, int width, int height, qboolean mipmap)
{
// This is for GL 2.x so no palettes, no scaling, no messing around with the data here. :)
@ -660,7 +660,7 @@ R_Upload32Native(unsigned *data, int width, int height, qboolean mipmap)
}
qboolean
static qboolean
R_Upload32Soft(unsigned *data, int width, int height, qboolean mipmap)
{
int samples;
@ -1126,7 +1126,8 @@ image_t *
R_FindImage(const char *name, imagetype_t type)
{
image_t *image;
int i, len;
size_t len;
int i;
char *ptr;
char namewe[256];
const char* ext;
@ -1185,7 +1186,7 @@ R_FindImage(const char *name, imagetype_t type)
}
struct image_s *
RI_RegisterSkin(char *name)
RI_RegisterSkin(const char *name)
{
return R_FindImage(name, it_skin);
}

View file

@ -2105,9 +2105,9 @@ extern int RI_InitContext(void* win);
extern void RI_BeginRegistration(char *model);
extern struct model_s * RI_RegisterModel(char *name);
extern struct image_s * RI_RegisterSkin(char *name);
extern struct image_s * RI_RegisterSkin(const char *name);
extern void RI_SetSky(char *name, float rotate, vec3_t axis);
extern void RI_SetSky(const char *name, float rotate, vec3_t axis);
extern void RI_EndRegistration(void);
extern void RI_RenderFrame(refdef_t *fd);

View file

@ -708,7 +708,7 @@ R_DrawSkyBox(void)
}
void
RI_SetSky(char *name, float rotate, vec3_t axis)
RI_SetSky(const char *name, float rotate, vec3_t axis)
{
char skyname[MAX_QPATH];
int i;

View file

@ -508,12 +508,12 @@ void RI_GetDrawableSize(int* width, int* height);
int RI_GetSDLVersion();
/* g11_draw */
extern image_t * RDraw_FindPic(char *name);
extern void RDraw_GetPicSize(int *w, int *h, char *pic);
extern void RDraw_PicScaled(int x, int y, char *pic, float factor);
extern void RDraw_StretchPic(int x, int y, int w, int h, char *pic);
extern image_t * RDraw_FindPic(const char *name);
extern void RDraw_GetPicSize(int *w, int *h, const char *pic);
extern void RDraw_PicScaled(int x, int y, const char *pic, float factor);
extern void RDraw_StretchPic(int x, int y, int w, int h, const char *pic);
extern void RDraw_CharScaled(int x, int y, int num, float scale);
extern void RDraw_TileClear(int x, int y, int w, int h, char *pic);
extern void RDraw_TileClear(int x, int y, int w, int h, const char *pic);
extern void RDraw_Fill(int x, int y, int w, int h, int c);
extern void RDraw_FadeScreen(void);
extern void RDraw_StretchRaw(int x, int y, int w, int h, int cols, int rows, const byte *data, int bits);

View file

@ -161,13 +161,13 @@ GL3_Draw_CharScaled(int x, int y, int num, float scale)
}
gl3image_t *
GL3_Draw_FindPic(char *name)
GL3_Draw_FindPic(const char *name)
{
return R_FindPic(name, (findimage_t)GL3_FindImage);
}
void
GL3_Draw_GetPicSize(int *w, int *h, char *pic)
GL3_Draw_GetPicSize(int *w, int *h, const char *pic)
{
gl3image_t *gl;
@ -184,7 +184,7 @@ GL3_Draw_GetPicSize(int *w, int *h, char *pic)
}
void
GL3_Draw_StretchPic(int x, int y, int w, int h, char *pic)
GL3_Draw_StretchPic(int x, int y, int w, int h, const char *pic)
{
gl3image_t *gl = R_FindPic(pic, (findimage_t)GL3_FindImage);
@ -201,7 +201,7 @@ GL3_Draw_StretchPic(int x, int y, int w, int h, char *pic)
}
void
GL3_Draw_PicScaled(int x, int y, char *pic, float factor)
GL3_Draw_PicScaled(int x, int y, const char *pic, float factor)
{
gl3image_t *gl = R_FindPic(pic, (findimage_t)GL3_FindImage);
if (!gl)
@ -222,7 +222,7 @@ GL3_Draw_PicScaled(int x, int y, char *pic, float factor)
* refresh window.
*/
void
GL3_Draw_TileClear(int x, int y, int w, int h, char *pic)
GL3_Draw_TileClear(int x, int y, int w, int h, const char *pic)
{
gl3image_t *image = R_FindPic(pic, (findimage_t)GL3_FindImage);
if (!image)

View file

@ -186,7 +186,7 @@ GL3_BindLightmap(int lightmapnum)
/*
* Returns has_alpha
*/
qboolean
static qboolean
GL3_Upload32(unsigned *data, int width, int height, qboolean mipmap)
{
qboolean res;
@ -237,7 +237,7 @@ GL3_Upload32(unsigned *data, int width, int height, qboolean mipmap)
/*
* Returns has_alpha
*/
qboolean
static qboolean
GL3_Upload8(byte *data, int width, int height, qboolean mipmap, qboolean is_sky)
{
int s = width * height;
@ -605,7 +605,8 @@ gl3image_t *
GL3_FindImage(const char *name, imagetype_t type)
{
gl3image_t *image;
int i, len;
size_t len;
int i;
char *ptr;
char namewe[256];
const char* ext;
@ -664,7 +665,7 @@ GL3_FindImage(const char *name, imagetype_t type)
}
gl3image_t *
GL3_RegisterSkin(char *name)
GL3_RegisterSkin(const char *name)
{
return GL3_FindImage(name, it_skin);
}

View file

@ -327,7 +327,7 @@ int vec_to_st[6][3] = {
void
GL3_SetSky(char *name, float rotate, vec3_t axis)
GL3_SetSky(const char *name, float rotate, vec3_t axis)
{
char skyname[MAX_QPATH];
int i;

View file

@ -414,13 +414,13 @@ extern const byte* GL3_Mod_ClusterPVS(int cluster, const gl3model_t *model);
// gl3_draw.c
extern void GL3_Draw_InitLocal(void);
extern void GL3_Draw_ShutdownLocal(void);
extern gl3image_t * GL3_Draw_FindPic(char *name);
extern void GL3_Draw_GetPicSize(int *w, int *h, char *pic);
extern gl3image_t * GL3_Draw_FindPic(const char *name);
extern void GL3_Draw_GetPicSize(int *w, int *h, const char *pic);
extern void GL3_Draw_PicScaled(int x, int y, char *pic, float factor);
extern void GL3_Draw_StretchPic(int x, int y, int w, int h, char *pic);
extern void GL3_Draw_PicScaled(int x, int y, const char *pic, float factor);
extern void GL3_Draw_StretchPic(int x, int y, int w, int h, const char *pic);
extern void GL3_Draw_CharScaled(int x, int y, int num, float scale);
extern void GL3_Draw_TileClear(int x, int y, int w, int h, char *pic);
extern void GL3_Draw_TileClear(int x, int y, int w, int h, const char *pic);
extern void GL3_DrawFrameBufferObject(int x, int y, int w, int h, GLuint fboTexture, const float v_blend[4]);
extern void GL3_Draw_Fill(int x, int y, int w, int h, int c);
extern void GL3_Draw_FadeScreen(void);
@ -446,7 +446,7 @@ extern gl3image_t *GL3_LoadPic(char *name, byte *pic, int width, int realwidth,
int height, int realheight, size_t data_size,
imagetype_t type, int bits);
extern gl3image_t *GL3_FindImage(const char *name, imagetype_t type);
extern gl3image_t *GL3_RegisterSkin(char *name);
extern gl3image_t *GL3_RegisterSkin(const char *name);
extern void GL3_ShutdownImages(void);
extern void GL3_FreeUnusedImages(void);
extern qboolean GL3_ImageHasFreeSpace(void);
@ -475,7 +475,7 @@ extern void GL3_LM_EndBuildingLightmaps(void);
extern void GL3_EmitWaterPolys(msurface_t *fa);
extern void GL3_SubdivideSurface(msurface_t *fa, gl3model_t* loadmodel);
extern void GL3_SetSky(char *name, float rotate, vec3_t axis);
extern void GL3_SetSky(const char *name, float rotate, vec3_t axis);
extern void GL3_DrawSkyBox(void);
extern void GL3_ClearSkyBox(void);
extern void GL3_AddSkySurface(msurface_t *fa);

View file

@ -577,14 +577,14 @@ void RE_BeginRegistration (char *model);
struct model_s *RE_RegisterModel (char *name);
void RE_EndRegistration (void);
struct image_s *RE_Draw_FindPic (char *name);
struct image_s *RE_Draw_FindPic (const char *name);
void RE_Draw_GetPicSize (int *w, int *h, char *name);
void RE_Draw_PicScaled (int x, int y, char *name, float scale);
void RE_Draw_StretchPic (int x, int y, int w, int h, char *name);
void RE_Draw_GetPicSize (int *w, int *h, const char *name);
void RE_Draw_PicScaled (int x, int y, const char *name, float scale);
void RE_Draw_StretchPic (int x, int y, int w, int h, const char *name);
void RE_Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, const byte *data, int bits);
void RE_Draw_CharScaled (int x, int y, int c, float scale);
void RE_Draw_TileClear (int x, int y, int w, int h, char *name);
void RE_Draw_TileClear (int x, int y, int w, int h, const char *name);
void RE_Draw_Fill (int x, int y, int w, int h, int c);
void RE_Draw_FadeScreen (void);

View file

@ -33,7 +33,7 @@ RE_Draw_FindPic
================
*/
image_t *
RE_Draw_FindPic (char *name)
RE_Draw_FindPic (const char *name)
{
return R_FindPic(name, (findimage_t)R_FindImage);
}
@ -144,7 +144,7 @@ RE_Draw_GetPicSize
=============
*/
void
RE_Draw_GetPicSize (int *w, int *h, char *name)
RE_Draw_GetPicSize (int *w, int *h, const char *name)
{
image_t *image;
@ -302,7 +302,7 @@ RE_Draw_StretchPic
=============
*/
void
RE_Draw_StretchPic (int x, int y, int w, int h, char *name)
RE_Draw_StretchPic (int x, int y, int w, int h, const char *name)
{
image_t *pic;
@ -380,7 +380,7 @@ Draw_Pic
=============
*/
void
RE_Draw_PicScaled(int x, int y, char *name, float scale)
RE_Draw_PicScaled(int x, int y, const char *name, float scale)
{
image_t *pic;
@ -406,7 +406,7 @@ refresh window.
=============
*/
void
RE_Draw_TileClear (int x, int y, int w, int h, char *name)
RE_Draw_TileClear (int x, int y, int w, int h, const char *name)
{
int i, j;
byte *psrc;

View file

@ -492,7 +492,8 @@ image_t *
R_FindImage(const char *name, imagetype_t type)
{
image_t *image;
int i, len;
size_t len;
int i;
char *ptr;
char namewe[256];
const char* ext;

View file

@ -1726,7 +1726,7 @@ static const int r_skysideimage[6] = {5, 2, 4, 1, 0, 3};
extern mtexinfo_t r_skytexinfo[6];
static void
RE_SetSky (char *name, float rotate, vec3_t axis)
RE_SetSky (const char *name, float rotate, vec3_t axis)
{
char skyname[MAX_QPATH];
int i;
@ -1758,7 +1758,7 @@ RE_RegisterSkin
===============
*/
static struct image_s *
RE_RegisterSkin (char *name)
RE_RegisterSkin (const char *name)
{
return R_FindImage (name, it_skin);
}
@ -2183,7 +2183,7 @@ RE_BufferDifferenceStart(int vmin, int vmax)
return (pixel_t*)back_buffer - swap_frames[0];
}
static int
static size_t
RE_BufferDifferenceEnd(int vmin, int vmax)
{
int *front_buffer, *back_buffer, *back_min;

View file

@ -104,6 +104,8 @@ R_DrawSurfaceBlock_Light (pixel_t *prowdest, pixel_t *psource, size_t size,
for (b=(size-1); b>=0; b--)
{
pixel_t pix;
int j;
pix = psource[b];
prowdest[b] = R_ApplyLight(pix, light);

View file

@ -185,20 +185,20 @@ typedef struct
// slash will not use the "pics/" prefix or the ".pcx" postfix)
void (EXPORT *BeginRegistration) (char *map);
struct model_s * (EXPORT *RegisterModel) (char *name);
struct image_s * (EXPORT *RegisterSkin) (char *name);
struct image_s * (EXPORT *RegisterSkin) (const char *name);
void (EXPORT *SetSky) (char *name, float rotate, vec3_t axis);
void (EXPORT *SetSky) (const char *name, float rotate, vec3_t axis);
void (EXPORT *EndRegistration) (void);
void (EXPORT *RenderFrame) (refdef_t *fd);
struct image_s * (EXPORT *DrawFindPic)(char *name);
struct image_s * (EXPORT *DrawFindPic)(const char *name);
void (EXPORT *DrawGetPicSize) (int *w, int *h, char *name); // will return 0 0 if not found
void (EXPORT *DrawPicScaled) (int x, int y, char *pic, float factor);
void (EXPORT *DrawStretchPic) (int x, int y, int w, int h, char *name);
void (EXPORT *DrawGetPicSize) (int *w, int *h, const char *name); // will return 0 0 if not found
void (EXPORT *DrawPicScaled) (int x, int y, const char *pic, float factor);
void (EXPORT *DrawStretchPic) (int x, int y, int w, int h, const char *name);
void (EXPORT *DrawCharScaled)(int x, int y, int num, float scale);
void (EXPORT *DrawTileClear) (int x, int y, int w, int h, char *name);
void (EXPORT *DrawTileClear) (int x, int y, int w, int h, const char *name);
void (EXPORT *DrawFill) (int x, int y, int w, int h, int c);
void (EXPORT *DrawFadeScreen) (void);
@ -272,18 +272,18 @@ extern refimport_t ri;
void R_BeginRegistration(char *map);
void R_Clear(void);
struct model_s *R_RegisterModel(char *name);
struct image_s *R_RegisterSkin(char *name);
void R_SetSky(char *name, float rotate, vec3_t axis);
struct image_s *R_RegisterSkin(const char *name);
void R_SetSky(const char *name, float rotate, vec3_t axis);
void R_EndRegistration(void);
struct image_s *Draw_FindPic(char *name);
struct image_s *Draw_FindPic(const char *name);
void R_RenderFrame(refdef_t *fd);
void Draw_GetPicSize(int *w, int *h, char *name);
void Draw_GetPicSize(int *w, int *h, const char *name);
void Draw_StretchPic(int x, int y, int w, int h, char *name);
void Draw_PicScaled(int x, int y, char *pic, float factor);
void Draw_StretchPic(int x, int y, int w, int h, const char *name);
void Draw_PicScaled(int x, int y, const char *pic, float factor);
void Draw_CharScaled(int x, int y, int num, float scale);
void Draw_TileClear(int x, int y, int w, int h, char *name);
void Draw_TileClear(int x, int y, int w, int h, const char *name);
void Draw_Fill(int x, int y, int w, int h, int c);
void Draw_FadeScreen(void);
void Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, const byte *data, int bits);

View file

@ -105,7 +105,7 @@ void VID_WriteScreenshot(int width, int height, int comp, const void* data)
if (argc > 2)
{
const char* q = Cmd_Argv(2);
int qualityStrLen = strlen(q);
size_t qualityStrLen = strlen(q);
for (i = 0; i < qualityStrLen; ++i)
{
@ -247,7 +247,7 @@ vidmode_t vid_modes[] = {
/*
* Callback function for the 'vid_listmodes' cmd.
*/
void
static void
VID_ListModes_f(void)
{
int i;
@ -264,7 +264,7 @@ VID_ListModes_f(void)
/*
* Returns informations about the given mode.
*/
qboolean
static qboolean
VID_GetModeInfo(int *width, int *height, int mode)
{
if ((mode < 0) || (mode >= VID_NUM_MODES))
@ -341,7 +341,7 @@ VID_HasRenderer(const char *renderer)
/*
* Called by the renderer to request a restart.
*/
void
static void
VID_RequestRestart(ref_restart_t rs)
{
restart_state = rs;
@ -350,7 +350,7 @@ VID_RequestRestart(ref_restart_t rs)
/*
* Restarts the renderer.
*/
void
static void
VID_Restart_f(void)
{
if (restart_state == RESTART_UNDEF)
@ -364,7 +364,7 @@ VID_Restart_f(void)
/*
* Shuts the renderer down and unloads it.
*/
void
static void
VID_ShutdownRenderer(void)
{
if (ref_active)
@ -384,7 +384,7 @@ VID_ShutdownRenderer(void)
/*
* Loads and initializes a renderer.
*/
qboolean
static qboolean
VID_LoadRenderer(void)
{
refimport_t ri;
@ -642,7 +642,7 @@ R_RegisterModel(char *name)
}
struct image_s*
R_RegisterSkin(char *name)
R_RegisterSkin(const char *name)
{
if (ref_active)
{
@ -653,7 +653,7 @@ R_RegisterSkin(char *name)
}
void
R_SetSky(char *name, float rotate, vec3_t axis)
R_SetSky(const char *name, float rotate, vec3_t axis)
{
if (ref_active)
{
@ -680,7 +680,7 @@ R_RenderFrame(refdef_t *fd)
}
struct image_s*
Draw_FindPic(char *name)
Draw_FindPic(const char *name)
{
if (ref_active)
{
@ -692,7 +692,7 @@ Draw_FindPic(char *name)
void
Draw_GetPicSize(int *w, int *h, char *name)
Draw_GetPicSize(int *w, int *h, const char *name)
{
if (ref_active)
{
@ -701,7 +701,7 @@ Draw_GetPicSize(int *w, int *h, char *name)
}
void
Draw_StretchPic(int x, int y, int w, int h, char *name)
Draw_StretchPic(int x, int y, int w, int h, const char *name)
{
if (ref_active)
{
@ -710,7 +710,7 @@ Draw_StretchPic(int x, int y, int w, int h, char *name)
}
void
Draw_PicScaled(int x, int y, char *pic, float factor)
Draw_PicScaled(int x, int y, const char *pic, float factor)
{
if (ref_active)
{
@ -728,7 +728,7 @@ Draw_CharScaled(int x, int y, int num, float scale)
}
void
Draw_TileClear(int x, int y, int w, int h, char *name)
Draw_TileClear(int x, int y, int w, int h, const char *name)
{
if (ref_active)
{

View file

@ -67,7 +67,7 @@ char defer_text_buf[32768];
* until next frame. This allows commands like: bind g "impulse 5 ;
* +attack ; wait ; -attack ; impulse 2"
*/
void
static void
Cmd_Wait_f(void)
{
cmd_wait = Sys_Milliseconds();
@ -85,7 +85,7 @@ Cbuf_Init(void)
void
Cbuf_AddText(char *text)
{
int l;
size_t l;
l = strlen(text);
@ -299,7 +299,7 @@ qboolean
Cbuf_AddLateCommands(void)
{
int i, j;
int s;
size_t s;
char *text, c;
int argc;
qboolean has_args = false;
@ -362,7 +362,7 @@ Cbuf_AddLateCommands(void)
/*
* Execute a script file
*/
void
static void
Cmd_Exec_f(void)
{
char *f, *f2;
@ -400,7 +400,9 @@ Cmd_Exec_f(void)
/*
* Inserts the current value of a variable as command text
*/
void Cmd_Vstr_f( void ) {
static void
Cmd_Vstr_f(void)
{
const char *v;
if (Cmd_Argc() != 2) {
@ -415,7 +417,7 @@ void Cmd_Vstr_f( void ) {
/*
* Just prints the rest of the line to the console
*/
void
static void
Cmd_Echo_f(void)
{
int i;
@ -432,7 +434,7 @@ Cmd_Echo_f(void)
* Creates a new command that executes
* a command string (possibly ; seperated)
*/
void
static void
Cmd_Alias_f(void)
{
cmdalias_t *a;
@ -524,10 +526,11 @@ Cmd_Args(void)
return cmd_args;
}
char *
static char *
Cmd_MacroExpandString(char *text)
{
int i, j, count, len;
size_t len;
int i, count;
qboolean inquote;
char *scan;
static char expanded[MAX_STRING_CHARS];
@ -549,6 +552,8 @@ Cmd_MacroExpandString(char *text)
for (i = 0; i < len; i++)
{
size_t j;
if (scan[i] == '"')
{
inquote ^= 1;
@ -783,7 +788,8 @@ char *
Cmd_CompleteCommand(char *partial)
{
cmd_function_t *cmd;
int len, i, o, p;
size_t len;
int i, o, p;
cmdalias_t *a;
cvar_t *cvar;
char *pmatch[1024];
@ -907,13 +913,15 @@ char *
Cmd_CompleteMapCommand(char *partial)
{
char **mapNames;
int i, j, k, nbMatches, len, nMaps;
int i, j, k, nbMatches, nMaps;
char *mapName, *lastsep;
char *pmatch[1024];
qboolean partialFillContinue = true;
if ((mapNames = FS_ListFiles2("maps/*.bsp", &nMaps, 0, 0)) != NULL)
{
size_t len;
len = strlen(partial);
nbMatches = 0;
memset(retval, 0, strlen(retval));
@ -1094,7 +1102,7 @@ Cmd_ExecuteString(char *text)
#endif
}
void
static void
Cmd_List_f(void)
{
cmd_function_t *cmd;

View file

@ -1624,7 +1624,8 @@ CMod_LoadEntityString(const lump_t *l, const char *name)
if (sv_entfile->value)
{
char *buffer = NULL, entname[256];
int nameLen, bufLen = -1;
size_t nameLen;
int bufLen = -1;
nameLen = strlen(name);
if (strcmp(name + nameLen - 4, ".bsp") || nameLen > (MAX_QPATH - 1))

View file

@ -1431,7 +1431,8 @@ Q_sort_modcmp(const void *p1, const void *p2)
char**
FS_ListMods(int *nummods)
{
int nmods = 0, numdirchildren, numpacksinchilddir, searchpathlength;
int nmods = 0, numdirchildren, numpacksinchilddir;
size_t searchpathlength;
char findnamepattern[MAX_OSPATH], modname[MAX_QPATH], searchpath[MAX_OSPATH];
char **dirchildren, **packsinchilddir, **modnames;

View file

@ -117,7 +117,7 @@ static void
Qcommon_Buildstring(void)
{
int i;
int verLen;
size_t verLen;
const char* versionString;

View file

@ -211,7 +211,7 @@ ValidateSelectedItem(edict_t *ent)
/*
* Give items to a client
*/
void
static void
Cmd_Give_f(edict_t *ent)
{
char *name;
@ -423,7 +423,7 @@ Cmd_Give_f(edict_t *ent)
/*
* Sets client to godmode
*/
void
static void
Cmd_God_f(edict_t *ent)
{
char *msg;
@ -457,7 +457,7 @@ Cmd_God_f(edict_t *ent)
/*
* Sets client to notarget
*/
void
static void
Cmd_Notarget_f(edict_t *ent)
{
char *msg;
@ -491,7 +491,7 @@ Cmd_Notarget_f(edict_t *ent)
/*
* argv(0) noclip
*/
void
static void
Cmd_Noclip_f(edict_t *ent)
{
char *msg;
@ -525,7 +525,7 @@ Cmd_Noclip_f(edict_t *ent)
/*
* Use an inventory item
*/
void
static void
Cmd_Use_f(edict_t *ent)
{
int index;
@ -566,7 +566,7 @@ Cmd_Use_f(edict_t *ent)
/*
* Drop an inventory item
*/
void
static void
Cmd_Drop_f(edict_t *ent)
{
int index;
@ -661,7 +661,7 @@ Cmd_Help_f(edict_t *ent)
gi.unicast(ent, true);
}
void
static void
Cmd_Inven_f(edict_t *ent)
{
gclient_t *cl;
@ -688,7 +688,7 @@ Cmd_Inven_f(edict_t *ent)
gi.unicast(ent, true);
}
void
static void
Cmd_InvUse_f(edict_t *ent)
{
gitem_t *it;
@ -717,7 +717,7 @@ Cmd_InvUse_f(edict_t *ent)
it->use(ent, it);
}
void
static void
Cmd_WeapPrev_f(edict_t *ent)
{
gclient_t *cl;
@ -779,7 +779,7 @@ Cmd_WeapPrev_f(edict_t *ent)
}
}
void
static void
Cmd_WeapNext_f(edict_t *ent)
{
gclient_t *cl;
@ -841,7 +841,7 @@ Cmd_WeapNext_f(edict_t *ent)
}
}
void
static void
Cmd_WeapLast_f(edict_t *ent)
{
gclient_t *cl;
@ -882,7 +882,7 @@ Cmd_WeapLast_f(edict_t *ent)
it->use(ent, it);
}
void
static void
Cmd_InvDrop_f(edict_t *ent)
{
gitem_t *it;
@ -911,7 +911,7 @@ Cmd_InvDrop_f(edict_t *ent)
it->drop(ent, it);
}
void
static void
Cmd_Kill_f(edict_t *ent)
{
if (!ent)
@ -931,7 +931,7 @@ Cmd_Kill_f(edict_t *ent)
player_die(ent, ent, ent, 100000, vec3_origin);
}
void
static void
Cmd_PutAway_f(edict_t *ent)
{
if (!ent)
@ -973,7 +973,7 @@ PlayerSort(void const *a, void const *b)
return 0;
}
void
static void
Cmd_Players_f(edict_t *ent)
{
int i;
@ -1023,7 +1023,7 @@ Cmd_Players_f(edict_t *ent)
gi.cprintf(ent, PRINT_HIGH, "%s\n%i players\n", large, count);
}
void
static void
Cmd_Wave_f(edict_t *ent)
{
int i;
@ -1147,7 +1147,7 @@ flooded(edict_t *ent)
return false;
}
void
static void
Cmd_Say_f(edict_t *ent, qboolean team, qboolean arg0)
{
int j;
@ -1242,7 +1242,7 @@ Cmd_Say_f(edict_t *ent, qboolean team, qboolean arg0)
}
}
void
static void
Cmd_PlayerList_f(edict_t *ent)
{
int i;

View file

@ -2280,7 +2280,8 @@ void
target_string_use(edict_t *self, edict_t *other /* unused */, edict_t *activator /* unused */)
{
edict_t *e;
int n, l;
size_t l;
int n;
char c;
if (!self)

View file

@ -327,7 +327,7 @@ char *
ED_NewString(const char *string)
{
char *newb, *new_p;
int i, l;
size_t i, l;
if (!string)
{

View file

@ -218,7 +218,7 @@ DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer)
{
char entry[1024];
char string[1400];
int stringlength;
size_t stringlength;
int i;
int sorted[MAX_CLIENTS];
int sortedscores[MAX_CLIENTS];
@ -279,7 +279,8 @@ DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer)
for (i = 0; i < total; i++)
{
char *tag;
int x, y, j;
int x, y;
size_t j;
gclient_t *cl;
edict_t *cl_ent;

View file

@ -370,7 +370,7 @@ void
WriteField1(FILE *f, field_t *field, byte *base)
{
void *p;
int len;
size_t len;
int index;
functionList_t *func;
mmoveList_t *mmove;
@ -492,7 +492,7 @@ WriteField1(FILE *f, field_t *field, byte *base)
void
WriteField2(FILE *f, field_t *field, byte *base)
{
int len;
size_t len;
void *p;
functionList_t *func;
mmoveList_t *mmove;

View file

@ -1013,27 +1013,9 @@ extern void SpawnDamage ( int type , vec3_t origin , vec3_t normal ) ;
extern void Killed ( edict_t * targ , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern qboolean CanDamage ( edict_t * targ , edict_t * inflictor ) ;
extern void ClientCommand ( edict_t * ent ) ;
extern void Cmd_PlayerList_f ( edict_t * ent ) ;
extern void Cmd_Say_f ( edict_t * ent , qboolean team , qboolean arg0 ) ;
extern void Cmd_Wave_f ( edict_t * ent ) ;
extern void Cmd_Players_f ( edict_t * ent ) ;
extern int PlayerSort ( void const * a , void const * b ) ;
extern void Cmd_PutAway_f ( edict_t * ent ) ;
extern void Cmd_Kill_f ( edict_t * ent ) ;
extern void Cmd_InvDrop_f ( edict_t * ent ) ;
extern void Cmd_WeapLast_f ( edict_t * ent ) ;
extern void Cmd_WeapNext_f ( edict_t * ent ) ;
extern void Cmd_WeapPrev_f ( edict_t * ent ) ;
extern void Cmd_InvUse_f ( edict_t * ent ) ;
extern void Cmd_Inven_f ( edict_t * ent ) ;
extern void Cmd_Help_f ( edict_t * ent ) ;
extern void Cmd_Score_f ( edict_t * ent ) ;
extern void Cmd_Drop_f ( edict_t * ent ) ;
extern void Cmd_Use_f ( edict_t * ent ) ;
extern void Cmd_Noclip_f ( edict_t * ent ) ;
extern void Cmd_Notarget_f ( edict_t * ent ) ;
extern void Cmd_God_f ( edict_t * ent ) ;
extern void Cmd_Give_f ( edict_t * ent ) ;
extern void ValidateSelectedItem ( edict_t * ent ) ;
extern void SelectPrevItem ( edict_t * ent , int itflags ) ;
extern void SelectNextItem ( edict_t * ent , int itflags ) ;

View file

@ -1012,27 +1012,9 @@
{"Killed", (byte *)Killed},
{"CanDamage", (byte *)CanDamage},
{"ClientCommand", (byte *)ClientCommand},
{"Cmd_PlayerList_f", (byte *)Cmd_PlayerList_f},
{"Cmd_Say_f", (byte *)Cmd_Say_f},
{"Cmd_Wave_f", (byte *)Cmd_Wave_f},
{"Cmd_Players_f", (byte *)Cmd_Players_f},
{"PlayerSort", (byte *)PlayerSort},
{"Cmd_PutAway_f", (byte *)Cmd_PutAway_f},
{"Cmd_Kill_f", (byte *)Cmd_Kill_f},
{"Cmd_InvDrop_f", (byte *)Cmd_InvDrop_f},
{"Cmd_WeapLast_f", (byte *)Cmd_WeapLast_f},
{"Cmd_WeapNext_f", (byte *)Cmd_WeapNext_f},
{"Cmd_WeapPrev_f", (byte *)Cmd_WeapPrev_f},
{"Cmd_InvUse_f", (byte *)Cmd_InvUse_f},
{"Cmd_Inven_f", (byte *)Cmd_Inven_f},
{"Cmd_Help_f", (byte *)Cmd_Help_f},
{"Cmd_Score_f", (byte *)Cmd_Score_f},
{"Cmd_Drop_f", (byte *)Cmd_Drop_f},
{"Cmd_Use_f", (byte *)Cmd_Use_f},
{"Cmd_Noclip_f", (byte *)Cmd_Noclip_f},
{"Cmd_Notarget_f", (byte *)Cmd_Notarget_f},
{"Cmd_God_f", (byte *)Cmd_God_f},
{"Cmd_Give_f", (byte *)Cmd_Give_f},
{"ValidateSelectedItem", (byte *)ValidateSelectedItem},
{"SelectPrevItem", (byte *)SelectPrevItem},
{"SelectNextItem", (byte *)SelectNextItem},

View file

@ -381,7 +381,8 @@ SV_Kick_f(void)
void
SV_Status_f(void)
{
int i, j, l;
int i, j;
size_t l;
client_t *cl;
char *s;
int ping;

View file

@ -492,7 +492,7 @@ SV_Map(qboolean attractloop, char *levelstring, qboolean loadgame, qboolean isau
{
char level[MAX_QPATH];
char *ch;
int l;
size_t l;
char spawnpoint[MAX_QPATH];
sv.loadgame = loadgame;