diff --git a/engine/Makefile b/engine/Makefile index 75146bd4c..dd07bdafb 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -319,7 +319,6 @@ CLIENT_OBJS = $(CLIENT_ASM_OBJS) \ p_null.o \ p_classic.o \ r_partset.o \ - r_efrag.o \ renderer.o \ renderque.o \ sbar.o \ diff --git a/engine/client/merged.h b/engine/client/merged.h index 96a23c3e9..a8c8fceb2 100644 --- a/engine/client/merged.h +++ b/engine/client/merged.h @@ -146,9 +146,9 @@ int Mod_GetBoneRelations(struct model_s *model, int firstbone, int lastbone, fra int Mod_GetBoneParent(struct model_s *model, int bonenum); char *Mod_GetBoneName(struct model_s *model, int bonenum); -void Draw_FunString(int x, int y, const unsigned char *str); -void Draw_AltFunString(int x, int y, const unsigned char *str); -void Draw_FunStringWidth(int x, int y, const unsigned char *str, int width); +void Draw_FunString(int x, int y, const void *str); +void Draw_AltFunString(int x, int y, const void *str); +void Draw_FunStringWidth(int x, int y, const void *str, int width); #ifdef SERVERONLY diff --git a/engine/client/quakedef.h b/engine/client/quakedef.h index 81c71802b..6d7bb3e5b 100644 --- a/engine/client/quakedef.h +++ b/engine/client/quakedef.h @@ -269,8 +269,6 @@ extern qboolean isDedicated; -void FTE_DEPRECATED R_RenderMeshBuffer(struct meshbuffer_s *mb, qboolean shadowpass); - #ifdef __cplusplus } #endif diff --git a/engine/client/r_surf.c b/engine/client/r_surf.c index fbb3f73f7..6ae41e2c6 100644 --- a/engine/client/r_surf.c +++ b/engine/client/r_surf.c @@ -2303,7 +2303,7 @@ void Surf_DrawWorld (void) else #endif { - extern cvar_t temp1; + //extern cvar_t temp1; if (0)//temp1.value) vis = R_MarkLeafSurfaces_Q1(); else diff --git a/engine/client/render.h b/engine/client/render.h index cd8a840b6..ad2e719b5 100644 --- a/engine/client/render.h +++ b/engine/client/render.h @@ -30,9 +30,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern int r_framecount; struct msurface_s; +struct batch_s; typedef union { - int num; + unsigned int num; #ifdef D3DQUAKE void *ptr; #endif @@ -294,7 +295,7 @@ enum uploadfmt #define R_AllocNewTexture(w,h) GL_AllocNewTexture() #define R_Upload GL_UploadFmt #define R_LoadTexture GL_LoadTextureFmt - #define R_DestroyTexture(tno) 0 + #define R_DestroyTexture GL_DestroyTexture #endif #define R_LoadTexture8(id,w,h,d,f,t) R_LoadTexture(id,w,h,t?TF_TRANS8:TF_SOLID8,d,f) @@ -511,4 +512,4 @@ extern void (_stdcall *qglFinish) (void); #else #define RSpeedEnd(spt) rspeeds[spt] += r_speeds.value?Sys_DoubleTime()*1000000 - rsp:0 #endif -#endif \ No newline at end of file +#endif diff --git a/engine/client/sbar.c b/engine/client/sbar.c index f2bdb3eb2..473d06b92 100644 --- a/engine/client/sbar.c +++ b/engine/client/sbar.c @@ -165,7 +165,7 @@ void Draw_ExpandedString(int x, int y, conchar_t *str) } //Draws a marked-up string using the regular char set with no width limit. doesn't support new lines -void Draw_FunString(int x, int y, const unsigned char *str) +void Draw_FunString(int x, int y, const void *str) { conchar_t buffer[2048]; COM_ParseFunString(CON_WHITEMASK, str, buffer, sizeof(buffer), false); @@ -173,7 +173,7 @@ void Draw_FunString(int x, int y, const unsigned char *str) Draw_ExpandedString(x, y, buffer); } //Draws a marked up string using the alt char set (legacy mode would be |128) -void Draw_AltFunString(int x, int y, const unsigned char *str) +void Draw_AltFunString(int x, int y, const void *str) { conchar_t buffer[2048]; COM_ParseFunString(CON_ALTMASK, str, buffer, sizeof(buffer), false); @@ -182,7 +182,7 @@ void Draw_AltFunString(int x, int y, const unsigned char *str) } //Draws a marked up string no wider than $width virtual pixels. -void Draw_FunStringWidth(int x, int y, const unsigned char *str, int width) +void Draw_FunStringWidth(int x, int y, const void *str, int width) { conchar_t buffer[2048]; conchar_t *w = buffer; @@ -203,7 +203,7 @@ void Draw_FunStringWidth(int x, int y, const unsigned char *str, int width) } //Draws a marked up string with at most $numchars characters. obsolete -FTE_DEPRECATED void Draw_FunStringLen(int x, int y, unsigned char *str, int numchars) +FTE_DEPRECATED void Draw_FunStringLen(int x, int y, void *str, int numchars) { conchar_t buffer[2048]; diff --git a/engine/client/sys_linux.c b/engine/client/sys_linux.c index e7bc9a029..18614dda2 100644 --- a/engine/client/sys_linux.c +++ b/engine/client/sys_linux.c @@ -483,10 +483,10 @@ int main (int c, char **v) memset(&parms, 0, sizeof(parms)); - COM_InitArgv(c, v); + parms.argc = c; + parms.argv = v; + COM_InitArgv(parms.argc, parms.argv); TL_InitLanguages(); - parms.argc = com_argc; - parms.argv = com_argv; parms.memsize = 16*1024*1024; diff --git a/engine/common/cmd.c b/engine/common/cmd.c index 6201ed512..d505c350e 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -2631,7 +2631,7 @@ void Cmd_set_f(void) end = strstr(text, "//"); if (end) { - *end--; + end--; while (end >= text) { if (*end == ' ') diff --git a/engine/common/common.c b/engine/common/common.c index 313a2f6dc..badca233e 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -3018,7 +3018,7 @@ void COM_Version_f (void) #endif #ifdef __GNUC__ - Con_Printf("Compiled with GCC version: %i.%i.%i (%i)\n",__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__, __VERSION__); + Con_Printf("Compiled with GCC version: %i.%i.%i (%s)\n",__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__, __VERSION__); #ifdef __OPTIMIZE__ #ifdef __OPTIMIZE_SIZE__ diff --git a/engine/common/common.h b/engine/common/common.h index 00fd3b88f..391ea7f24 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -78,7 +78,7 @@ void InsertLinkAfter (link_t *l, link_t *after); // (type *)STRUCT_FROM_LINK(link_t *link, type, member) // ent = STRUCT_FROM_LINK(link,entity_t,order) // FIXME: remove this mess! -#define STRUCT_FROM_LINK(l,t,m) ((t *)((qbyte *)l - (int)&(((t *)0)->m))) +#define STRUCT_FROM_LINK(l,t,m) ((t *)((qbyte *)l - (qbyte*)&(((t *)0)->m))) //============================================================================ diff --git a/engine/common/fs.c b/engine/common/fs.c index 2ca347964..3b6455e79 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -135,7 +135,6 @@ int fs_hash_files; -static int COM_FileOpenRead (char *path, FILE **hndl); static const char *FS_GetCleanPath(const char *pattern, char *outbuf, int outlen); void FS_RegisterDefaultFileSystems(void); @@ -833,8 +832,8 @@ vfsfile_t *FS_DecompressGZip(vfsfile_t *infile, gzheader_t *header) { - char inbuffer[16384]; - char outbuffer[16384]; + unsigned char inbuffer[16384]; + unsigned char outbuffer[16384]; int ret; z_stream strm = { @@ -1749,7 +1748,7 @@ void COM_Gamedir (const char *dir) if (strchr(dir, ';')) { //separate case because parsestringset splits by whitespace too - while (dir = COM_ParseStringSet(dir)) + while ((dir = COM_ParseStringSet(dir))) { if (!strcmp(dir, ";")) continue; @@ -2558,6 +2557,10 @@ extern searchpathfuncs_t doomwadfilefuncs; void FS_RegisterDefaultFileSystems(void) { FS_RegisterFileSystemType("pak", &packfilefuncs); +#ifndef _WIN32 + /*for systems that have case sensitive paths, also include *.PAK */ + FS_RegisterFileSystemType("PAK", &packfilefuncs); +#endif #ifdef AVAIL_ZLIB FS_RegisterFileSystemType("pk3", &zipfilefuncs); FS_RegisterFileSystemType("pk4", &zipfilefuncs); diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index ccf1fd9bb..a04c97640 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -1599,7 +1599,7 @@ void PF_strdecolorize (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *in = PR_GetStringOfs(prinst, OFS_PARM0); char result[8192]; - unsigned long flagged[8192]; + unsigned int flagged[8192]; COM_ParseFunString(CON_WHITEMASK, in, flagged, sizeof(flagged), false); COM_DeFunString(flagged, result, sizeof(result), true); @@ -1741,8 +1741,8 @@ void PF_buf_copy (progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_buf_sort (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; - int sortpower = G_FLOAT(OFS_PARM1); - int backwards = G_FLOAT(OFS_PARM2); + //int sortpower = G_FLOAT(OFS_PARM1); + //int backwards = G_FLOAT(OFS_PARM2); if ((unsigned int)bufno >= NUMSTRINGBUFS) return; @@ -1755,7 +1755,7 @@ void PF_buf_sort (progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_buf_implode (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; - char *glue = PR_GetStringOfs(prinst, OFS_PARM1); + //char *glue = PR_GetStringOfs(prinst, OFS_PARM1); if ((unsigned int)bufno >= NUMSTRINGBUFS) return; @@ -1821,8 +1821,8 @@ void PF_bufstr_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_bufstr_add (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; - char *string = PR_GetStringOfs(prinst, OFS_PARM1); - int order = G_FLOAT(OFS_PARM2); + //char *string = PR_GetStringOfs(prinst, OFS_PARM1); + //int order = G_FLOAT(OFS_PARM2); if ((unsigned int)bufno >= NUMSTRINGBUFS) return; @@ -1837,7 +1837,7 @@ void PF_bufstr_add (progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_bufstr_free (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; - int index = G_FLOAT(OFS_PARM1); + //int index = G_FLOAT(OFS_PARM1); if ((unsigned int)bufno >= NUMSTRINGBUFS) return; @@ -1850,8 +1850,8 @@ void PF_bufstr_free (progfuncs_t *prinst, struct globalvars_s *pr_globals) void PF_buf_cvarlist (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; - char *pattern = PR_GetStringOfs(prinst, OFS_PARM1); - char *antipattern = PR_GetStringOfs(prinst, OFS_PARM2); + //char *pattern = PR_GetStringOfs(prinst, OFS_PARM1); + //char *antipattern = PR_GetStringOfs(prinst, OFS_PARM2); if ((unsigned int)bufno >= NUMSTRINGBUFS) return; diff --git a/engine/gl/gl_alias.c b/engine/gl/gl_alias.c index 26fe3c963..d13e380fd 100644 --- a/engine/gl/gl_alias.c +++ b/engine/gl/gl_alias.c @@ -27,8 +27,6 @@ #define MAX_BONES 256 -static model_t *loadmodel; - #include "com_mesh.h" //FIXME @@ -881,10 +879,6 @@ static qboolean R_CalcModelLighting(entity_t *e, model_t *clmodel, unsigned int static shader_t reskinnedmodelshader; void R_DrawGAliasModel (entity_t *e, unsigned int rmode) { -#ifndef GLQUAKE -#pragma message("DISABLED MODEL RENDERING") -#else - extern cvar_t r_drawflat; model_t *clmodel; galiasinfo_t *inf; mesh_t mesh; @@ -1157,7 +1151,6 @@ void R_DrawGAliasModel (entity_t *e, unsigned int rmode) qglDepthRange (gldepthmin, gldepthmax); BE_SelectMode(rmode, 0); -#endif } //returns the rotated offset of the two points in result diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index be8850e50..dbd7fe14a 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -857,19 +857,19 @@ static float *FTableForFunc ( unsigned int func ) void Shader_LightPass_Std(char *shortname, shader_t *s, const void *args) { char shadertext[8192*2]; - sprintf(shadertext, LIGHTPASS_SHADER, args, LIGHTPASS_GLSL_SHARED LIGHTPASS_GLSL_VERTEX LIGHTPASS_GLSL_FRAGMENT); + sprintf(shadertext, LIGHTPASS_SHADER, (char*)args, LIGHTPASS_GLSL_SHARED LIGHTPASS_GLSL_VERTEX LIGHTPASS_GLSL_FRAGMENT); Shader_DefaultScript(shortname, s, shadertext); } void Shader_LightPass_PCF(char *shortname, shader_t *s, const void *args) { char shadertext[8192*2]; - sprintf(shadertext, PCFPASS_SHADER, args, "", LIGHTPASS_GLSL_SHARED LIGHTPASS_GLSL_VERTEX LIGHTPASS_GLSL_FRAGMENT); + sprintf(shadertext, PCFPASS_SHADER, (char*)args, "", LIGHTPASS_GLSL_SHARED LIGHTPASS_GLSL_VERTEX LIGHTPASS_GLSL_FRAGMENT); Shader_DefaultScript(shortname, s, shadertext); } void Shader_LightPass_Spot(char *shortname, shader_t *s, const void *args) { char shadertext[8192*2]; - sprintf(shadertext, PCFPASS_SHADER, args, "#define SPOT\n", LIGHTPASS_GLSL_SHARED LIGHTPASS_GLSL_VERTEX LIGHTPASS_GLSL_FRAGMENT); + sprintf(shadertext, PCFPASS_SHADER, (char*)args, "#define SPOT\n", LIGHTPASS_GLSL_SHARED LIGHTPASS_GLSL_VERTEX LIGHTPASS_GLSL_FRAGMENT); Shader_DefaultScript(shortname, s, shadertext); } @@ -1145,7 +1145,7 @@ static void GenerateTCMods(const shaderpass_t *pass, int passnum) //source is always packed //dest is packed too -static void colourgen(const shaderpass_t *pass, int cnt, const avec4_t *src, avec4_t *dst, const mesh_t *mesh) +static void colourgen(const shaderpass_t *pass, int cnt, const vec4_t *src, vec4_t *dst, const mesh_t *mesh) { switch (pass->rgbgen) { @@ -1299,14 +1299,14 @@ static void deformgen(const deformv_t *deformv, int cnt, const vecV_t *src, vecV { default: case DEFORMV_NONE: - if (src != dst) + if (src != (const avec4_t*)dst) memcpy(dst, src, sizeof(*src)*cnt); break; case DEFORMV_WAVE: if (!mesh->normals_array) { - if (src != dst) + if (src != (const avec4_t*)dst) memcpy(dst, src, sizeof(*src)*cnt); return; } @@ -1328,7 +1328,7 @@ static void deformgen(const deformv_t *deformv, int cnt, const vecV_t *src, vecV case DEFORMV_NORMAL: //normal does not actually move the verts, but it does change the normals array //we don't currently support that. - if (src != dst) + if (src != (const avec4_t*)dst) memcpy(dst, src, sizeof(*src)*cnt); /* args[0] = deformv->args[1] * shaderstate.curtime; @@ -2612,7 +2612,6 @@ static void BaseBrushTextures(entity_t *ent) #ifdef RTLIGHTS void BE_BaseEntShadowDepth(void) { - extern model_t *currentmodel; int i; if (!r_drawentities.value) @@ -2643,7 +2642,6 @@ void BE_BaseEntShadowDepth(void) void BE_BaseEntTextures(void) { - extern model_t *currentmodel; int i; unsigned int bef; diff --git a/engine/gl/gl_draw.c b/engine/gl/gl_draw.c index e1f0f44aa..22ac1780a 100644 --- a/engine/gl/gl_draw.c +++ b/engine/gl/gl_draw.c @@ -80,11 +80,9 @@ void GL_UploadFmt(texid_t tex, char *name, enum uploadfmt fmt, void *data, void GL_Upload8Pal32(data, palette, width, height, flags); break; -#ifdef _MSC_VER default: Sys_Error("Unsupported image format type\n"); break; -#endif } } @@ -114,11 +112,9 @@ texid_t GL_LoadTextureFmt (char *name, int width, int height, enum uploadfmt fmt case TF_HEIGHT8: return GL_LoadTexture8Bump(name, width, height, data, flags, r_shadow_bumpscale_basetexture.value); -#ifdef _MSC_VER default: Sys_Error("Unsupported image format type\n"); - break; -#endif + return r_nulltex; } } diff --git a/engine/gl/gl_rlight.c b/engine/gl/gl_rlight.c index 6c755819e..12022bb59 100644 --- a/engine/gl/gl_rlight.c +++ b/engine/gl/gl_rlight.c @@ -119,7 +119,7 @@ void R_InitBubble(void) avec4_t flashblend_colours[FLASHBLEND_VERTS+1]; vecV_t flashblend_vcoords[FLASHBLEND_VERTS+1]; vec2_t flashblend_tccoords[FLASHBLEND_VERTS+1]; -int flashblend_indexes[FLASHBLEND_VERTS*3]; +index_t flashblend_indexes[FLASHBLEND_VERTS*3]; mesh_t flashblend_mesh; shader_t *flashblend_shader; void R_InitFlashblends(void) diff --git a/engine/gl/gl_rmisc.c b/engine/gl/gl_rmisc.c index c2713a67d..b72e60b66 100644 --- a/engine/gl/gl_rmisc.c +++ b/engine/gl/gl_rmisc.c @@ -908,10 +908,10 @@ static void R_SaveRTLights_f(void) , (light->flags & LFLAG_NOSHADOWS)?"!":"", light->origin[0], light->origin[1], light->origin[2], light->radius, light->color[0], light->color[1], light->color[2], - light->style-1, - "", 0, + light->style-1 + /*, "", 0, 0, 0, 0, - 0, 0, 0, light->flags&(LFLAG_NORMALMODE|LFLAG_REALTIMEMODE) + 0, 0, 0, light->flags&(LFLAG_NORMALMODE|LFLAG_REALTIMEMODE*/ )); } VFS_CLOSE(f); diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 253522628..4c4afb8aa 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -31,9 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include -#include -#include "glsupp.h" - extern texid_t missing_texture; diff --git a/engine/gl/gl_shadow.c b/engine/gl/gl_shadow.c index eba44db3a..39544700f 100644 --- a/engine/gl/gl_shadow.c +++ b/engine/gl/gl_shadow.c @@ -844,7 +844,7 @@ void SHM_RecursiveWorldNodeQ3_r (dlight_t *dl, mnode_t *node) } #endif -static SHM_ComposeVolume_BruteForce(dlight_t *dl) +static void SHM_ComposeVolume_BruteForce(dlight_t *dl) { shadowmeshsurfs_t *sms; unsigned int tno; diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index 592b4cb3f..90a25043d 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -226,6 +226,11 @@ texid_t GL_AllocNewTexture(void) return r; } +void GL_DestroyTexture(texid_t tex) +{ + qglDeleteTextures(1, &tex.num); +} + void APIENTRY GL_DrawRangeElementsEmul(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) { qglDrawElements(mode, count, type, indices); diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index 3409bce67..fc2b0f9ae 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -778,22 +778,22 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette) // set vid parameters if ((i = COM_CheckParm("-conwidth")) != 0) - vid.conwidth = Q_atoi(com_argv[i+1]); + vid.width = Q_atoi(com_argv[i+1]); else - vid.conwidth = 640; + vid.width = 640; - vid.conwidth &= ~7; // make it a multiple of eight + vid.width &= ~7; // make it a multiple of eight - if (vid.conwidth < 320) - vid.conwidth = 320; + if (vid.width < 320) + vid.width = 320; // pick a conheight that matches with correct aspect - vid.conheight = vid.conwidth*3 / 4; + vid.height = vid.width*3 / 4; if ((i = COM_CheckParm("-conheight")) != 0) - vid.conheight = Q_atoi(com_argv[i+1]); - if (vid.conheight < 200) - vid.conheight = 200; + vid.height = Q_atoi(com_argv[i+1]); + if (vid.height < 200) + vid.height = 200; if (!vid_dpy) vid_dpy = XOpenDisplay(NULL); if (!vid_dpy) @@ -946,12 +946,10 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette) vid.pixelwidth = info->width; vid.pixelheight = info->height; - if (vid.conheight > info->height) - vid.conheight = info->height; - if (vid.conwidth > info->width) - vid.conwidth = info->width; - vid.width = vid.conwidth; - vid.height = vid.conheight; + if (vid.height > info->height) + vid.height = info->height; + if (vid.width > info->width) + vid.width = info->width; vid.aspect = ((float)vid.height / (float)vid.width) * (320.0 / 240.0); vid.numpages = 2; diff --git a/engine/qclib/hash.c b/engine/qclib/hash.c index 46607f2e1..143a4372a 100644 --- a/engine/qclib/hash.c +++ b/engine/qclib/hash.c @@ -85,7 +85,7 @@ void *Hash_GetKey(hashtable_t *table, int key) } return NULL; } -void *Hash_GetNext(hashtable_t *table, char *name, void *old) +void *Hash_GetNext(hashtable_t *table, const char *name, void *old) { int bucknum = Hash_Key(name, table->numbuckets); bucket_t *buck; @@ -115,7 +115,7 @@ void *Hash_GetNext(hashtable_t *table, char *name, void *old) } return NULL; } -void *Hash_GetNextInsensative(hashtable_t *table, char *name, void *old) +void *Hash_GetNextInsensative(hashtable_t *table, const char *name, void *old) { int bucknum = Hash_KeyInsensative(name, table->numbuckets); bucket_t *buck; @@ -147,7 +147,7 @@ void *Hash_GetNextInsensative(hashtable_t *table, char *name, void *old) } -void *Hash_Add(hashtable_t *table, char *name, void *data, bucket_t *buck) +void *Hash_Add(hashtable_t *table, const char *name, void *data, bucket_t *buck) { int bucknum = Hash_Key(name, table->numbuckets); @@ -158,7 +158,7 @@ void *Hash_Add(hashtable_t *table, char *name, void *data, bucket_t *buck) return buck; } -void *Hash_AddInsensative(hashtable_t *table, char *name, void *data, bucket_t *buck) +void *Hash_AddInsensative(hashtable_t *table, const char *name, void *data, bucket_t *buck) { int bucknum = Hash_KeyInsensative(name, table->numbuckets); @@ -181,7 +181,7 @@ void *Hash_AddKey(hashtable_t *table, int key, void *data, bucket_t *buck) return buck; } -void Hash_Remove(hashtable_t *table, char *name) +void Hash_Remove(hashtable_t *table, const char *name) { int bucknum = Hash_Key(name, table->numbuckets); bucket_t *buck; @@ -208,7 +208,7 @@ void Hash_Remove(hashtable_t *table, char *name) return; } -void Hash_RemoveData(hashtable_t *table, char *name, void *data) +void Hash_RemoveData(hashtable_t *table, const char *name, void *data) { int bucknum = Hash_Key(name, table->numbuckets); bucket_t *buck; diff --git a/engine/qclib/hash.h b/engine/qclib/hash.h index 3eda7f6ed..fbc8474c2 100644 --- a/engine/qclib/hash.h +++ b/engine/qclib/hash.h @@ -26,12 +26,12 @@ int Hash_Key(const char *name, int modulus); void *Hash_Get(hashtable_t *table, const char *name); void *Hash_GetInsensative(hashtable_t *table, const char *name); void *Hash_GetKey(hashtable_t *table, int key); -void *Hash_GetNext(hashtable_t *table, char *name, void *old); -void *Hash_GetNextInsensative(hashtable_t *table, char *name, void *old); -void *Hash_Add(hashtable_t *table, char *name, void *data, bucket_t *buck); -void *Hash_AddInsensative(hashtable_t *table, char *name, void *data, bucket_t *buck); -void Hash_Remove(hashtable_t *table, char *name); -void Hash_RemoveData(hashtable_t *table, char *name, void *data); +void *Hash_GetNext(hashtable_t *table, const char *name, void *old); +void *Hash_GetNextInsensative(hashtable_t *table, const char *name, void *old); +void *Hash_Add(hashtable_t *table, const char *name, void *data, bucket_t *buck); +void *Hash_AddInsensative(hashtable_t *table, const char *name, void *data, bucket_t *buck); +void Hash_Remove(hashtable_t *table, const char *name); +void Hash_RemoveData(hashtable_t *table, const char *name, void *data); void Hash_RemoveKey(hashtable_t *table, int key); void *Hash_AddKey(hashtable_t *table, int key, void *data, bucket_t *buck); diff --git a/engine/qclib/pr_comp.h b/engine/qclib/pr_comp.h index 13b93bce2..59ea8654f 100644 --- a/engine/qclib/pr_comp.h +++ b/engine/qclib/pr_comp.h @@ -507,7 +507,7 @@ typedef struct int secondaryversion; //Constant - to say that any version 7 progs are actually ours, not someone else's alterations. } dprograms_t; -#define standard_dprograms_t_size ((int)&((dprograms_t*)NULL)->ofsfiles) +#define standard_dprograms_t_size ((size_t)&((dprograms_t*)NULL)->ofsfiles) #endif @@ -536,5 +536,5 @@ typedef struct typeinfo_s int ofs; //inside a structure. int size; - char *name; + string_t name; } typeinfo_t; diff --git a/engine/qclib/pr_edict.c b/engine/qclib/pr_edict.c index 966de4d8d..d6c4d57d6 100644 --- a/engine/qclib/pr_edict.c +++ b/engine/qclib/pr_edict.c @@ -2688,7 +2688,7 @@ retry: pr_types[i].num_parms = PRLittleLong(current_progstate->types[i].num_parms); pr_types[i].ofs = PRLittleLong(current_progstate->types[i].ofs); pr_types[i].size = PRLittleLong(current_progstate->types[i].size); - pr_types[i].name = (char *)PRLittleLong((long)current_progstate->types[i].name); + pr_types[i].name = PRLittleLong(current_progstate->types[i].name); #endif pr_types[i].name += stringadjust; } diff --git a/engine/qclib/pr_multi.c b/engine/qclib/pr_multi.c index 7a47d3ce6..e26c83d7d 100644 --- a/engine/qclib/pr_multi.c +++ b/engine/qclib/pr_multi.c @@ -205,7 +205,7 @@ void QC_FlushProgsOffsets(progfuncs_t *progfuncs) //origionaloffs is used to track matching field offsets. fields with the same progs offset overlap //note: we probably suffer from progs with renamed system globals. -int QC_RegisterFieldVar(progfuncs_t *progfuncs, unsigned int type, char *name, int engineofs, int progsofs) +int QC_RegisterFieldVar(progfuncs_t *progfuncs, unsigned int type, char *name, size_t engineofs, size_t progsofs) { // progstate_t *p; // int pnum; @@ -296,7 +296,7 @@ int QC_RegisterFieldVar(progfuncs_t *progfuncs, unsigned int type, char *name, i } }*/ if (engineofs&3) - Sys_Error("field %s is %i&3", name, engineofs); + Sys_Error("field %s is %i&3", name, (int)engineofs); field[fnum].ofs = ofs = engineofs/4; } else diff --git a/engine/qclib/progsint.h b/engine/qclib/progsint.h index 60e38e5a1..0b2de713c 100644 --- a/engine/qclib/progsint.h +++ b/engine/qclib/progsint.h @@ -101,7 +101,7 @@ void QC_InitShares(progfuncs_t *progfuncs); void QC_StartShares(progfuncs_t *progfuncs); void QC_AddSharedVar(progfuncs_t *progfuncs, int num, int type); void QC_AddSharedFieldVar(progfuncs_t *progfuncs, int num, char *stringtable); -int QC_RegisterFieldVar(progfuncs_t *progfuncs, unsigned int type, char *name, int requestedpos, int originalofs); +int QC_RegisterFieldVar(progfuncs_t *progfuncs, unsigned int type, char *name, size_t requestedpos, size_t originalofs); pbool Decompile(progfuncs_t *progfuncs, char *fname); int PR_ToggleBreakpoint(progfuncs_t *progfuncs, char *filename, int linenum, int flag); void StripExtension (char *path); diff --git a/engine/qclib/progslib.h b/engine/qclib/progslib.h index f3f4488a4..3554f3606 100644 --- a/engine/qclib/progslib.h +++ b/engine/qclib/progslib.h @@ -132,7 +132,7 @@ struct progfuncs_s { int lastcalledbuiltinnumber; //useful with non-implemented opcodes. - int (*RegisterFieldVar) (progfuncs_t *prinst, unsigned int type, char *name, int requestedpos, int originalofs); + int (*RegisterFieldVar) (progfuncs_t *prinst, unsigned int type, char *name, size_t requestedpos, size_t originalofs); char *tempstringbase; //for engine's use. Store your base tempstring pointer here. int tempstringnum; //for engine's use. diff --git a/engine/qclib/qcc.h b/engine/qclib/qcc.h index dff915274..a7fb406ad 100644 --- a/engine/qclib/qcc.h +++ b/engine/qclib/qcc.h @@ -900,6 +900,6 @@ char *TypeName(QCC_type_t *type); void QCC_PR_IncludeChunk (char *data, pbool duplicate, char *filename); void QCC_PR_IncludeChunkEx(char *data, pbool duplicate, char *filename, CompilerConstant_t *cnst); pbool QCC_PR_UnInclude(void); -extern void *(*pHash_Get)(hashtable_t *table, char *name); -extern void *(*pHash_GetNext)(hashtable_t *table, char *name, void *old); -extern void *(*pHash_Add)(hashtable_t *table, char *name, void *data, bucket_t *); +extern void *(*pHash_Get)(hashtable_t *table, const char *name); +extern void *(*pHash_GetNext)(hashtable_t *table, const char *name, void *old); +extern void *(*pHash_Add)(hashtable_t *table, const char *name, void *data, bucket_t *); diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index e1ba6a032..ca50f65fc 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -125,9 +125,9 @@ int optres_logicops; int optres_test1; int optres_test2; -void *(*pHash_Get)(hashtable_t *table, char *name); -void *(*pHash_GetNext)(hashtable_t *table, char *name, void *old); -void *(*pHash_Add)(hashtable_t *table, char *name, void *data, bucket_t *); +void *(*pHash_Get)(hashtable_t *table, const char *name); +void *(*pHash_GetNext)(hashtable_t *table, const char *name, void *old); +void *(*pHash_Add)(hashtable_t *table, const char *name, void *data, bucket_t *); QCC_def_t *QCC_PR_DummyDef(QCC_type_t *type, char *name, QCC_def_t *scope, int arraysize, unsigned int ofs, int referable, pbool saved); QCC_type_t *QCC_PR_NewType (char *name, int basictype); @@ -3016,7 +3016,6 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could QCC_type_t *t, *p; int extraparms=false; int np; - int laststatement = numstatements; int callconvention; diff --git a/engine/qclib/qccmain.c b/engine/qclib/qccmain.c index cba08da52..123d7f79e 100644 --- a/engine/qclib/qccmain.c +++ b/engine/qclib/qccmain.c @@ -1123,7 +1123,7 @@ strofs = (strofs+3)&~3; qcc_typeinfo[i].aux_type = (QCC_type_t*)(qcc_typeinfo[i].aux_type - qcc_typeinfo); if (qcc_typeinfo[i].next) qcc_typeinfo[i].next = (QCC_type_t*)(qcc_typeinfo[i].next - qcc_typeinfo); - qcc_typeinfo[i].name = (char *)QCC_CopyDupBackString(qcc_typeinfo[i].name); + qcc_typeinfo[i].name = QCC_CopyDupBackString(qcc_typeinfo[i].name); } progs.ofsfiles = 0; diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 55ec20176..d54de34cc 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -8377,7 +8377,7 @@ void PF_setattachment(progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_DPrintf("setattachment(edict %i, edict %i, string \"%s\"): tried to find tag named \"%s\" on entity %i (model \"%s\") but could not find it\n", NUM_FOR_EDICT(prinst, e), NUM_FOR_EDICT(prinst, tagentity), tagname, tagname, NUM_FOR_EDICT(prinst, tagentity), sv.models[modelindex]->name); } else - Con_DPrintf("setattachment(edict %i, edict %i, string \"%s\"): Couldn't load model %s\n", NUM_FOR_EDICT(prinst, e), NUM_FOR_EDICT(prinst, tagentity), tagname, sv.modelname[modelindex]); + Con_DPrintf("setattachment(edict %i, edict %i, string \"%s\"): Couldn't load model %s\n", NUM_FOR_EDICT(prinst, e), NUM_FOR_EDICT(prinst, tagentity), tagname, sv.strings.model_precache[modelindex]); } else Con_DPrintf("setattachment(edict %i, edict %i, string \"%s\"): tried to find tag named \"%s\" on entity %i but it has no model\n", NUM_FOR_EDICT(prinst, e), NUM_FOR_EDICT(prinst, tagentity), tagname, tagname, NUM_FOR_EDICT(prinst, tagentity)); @@ -9796,11 +9796,11 @@ int pr_numbuiltins = sizeof(pr_builtin)/sizeof(pr_builtin[0]); void PR_RegisterFields(void) //it's just easier to do it this way. { -#define comfieldfloat(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_float, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) -#define comfieldvector(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_vector, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) -#define comfieldentity(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_entity, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) -#define comfieldstring(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_string, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) -#define comfieldfunction(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_function, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldfloat(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_float, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldvector(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_vector, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldentity(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_entity, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldstring(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_string, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldfunction(ssqcname,sharedname,csqcname) PR_RegisterFieldVar(svprogfuncs, ev_function, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) comqcfields #undef comfieldfloat #undef comfieldvector @@ -9808,17 +9808,17 @@ comqcfields #undef comfieldstring #undef comfieldfunction #ifdef VM_Q1 -#define comfieldfloat(name) PR_RegisterFieldVar(svprogfuncs, ev_float, #name, sizeof(stdentvars_t) + (int)&((extentvars_t*)0)->name, -1) -#define comfieldvector(name) PR_RegisterFieldVar(svprogfuncs, ev_vector, #name, sizeof(stdentvars_t) + (int)&((extentvars_t*)0)->name, -1) -#define comfieldentity(name) PR_RegisterFieldVar(svprogfuncs, ev_entity, #name, sizeof(stdentvars_t) + (int)&((extentvars_t*)0)->name, -1) -#define comfieldstring(name) PR_RegisterFieldVar(svprogfuncs, ev_string, #name, sizeof(stdentvars_t) + (int)&((extentvars_t*)0)->name, -1) -#define comfieldfunction(name) PR_RegisterFieldVar(svprogfuncs, ev_function, #name, sizeof(stdentvars_t) + (int)&((extentvars_t*)0)->name, -1) +#define comfieldfloat(name) PR_RegisterFieldVar(svprogfuncs, ev_float, #name, sizeof(stdentvars_t) + (size_t)&((extentvars_t*)0)->name, -1) +#define comfieldvector(name) PR_RegisterFieldVar(svprogfuncs, ev_vector, #name, sizeof(stdentvars_t) + (size_t)&((extentvars_t*)0)->name, -1) +#define comfieldentity(name) PR_RegisterFieldVar(svprogfuncs, ev_entity, #name, sizeof(stdentvars_t) + (size_t)&((extentvars_t*)0)->name, -1) +#define comfieldstring(name) PR_RegisterFieldVar(svprogfuncs, ev_string, #name, sizeof(stdentvars_t) + (size_t)&((extentvars_t*)0)->name, -1) +#define comfieldfunction(name) PR_RegisterFieldVar(svprogfuncs, ev_function, #name, sizeof(stdentvars_t) + (size_t)&((extentvars_t*)0)->name, -1) #else -#define comfieldfloat(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_float, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) -#define comfieldvector(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_vector, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) -#define comfieldentity(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_entity, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) -#define comfieldstring(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_string, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) -#define comfieldfunction(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_function, #ssqcname, (int)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldfloat(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_float, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldvector(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_vector, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldentity(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_entity, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldstring(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_string, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) +#define comfieldfunction(ssqcname) PR_RegisterFieldVar(svprogfuncs, ev_function, #ssqcname, (size_t)&((stdentvars_t*)0)->ssqcname, -1) #endif comextqcfields diff --git a/engine/server/server.h b/engine/server/server.h index 8936dbc26..13960d3d9 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -991,16 +991,14 @@ qboolean SVQ3_Command(void); // // sv_phys.c // -void SV_ProgStartFrame (void); +void SV_SetMoveVars(void); +void SV_RunNewmis (void); qboolean SV_Physics (void); void SV_CheckVelocity (edict_t *ent); -void SV_AddGravity (edict_t *ent, float scale); +trace_t SV_Trace_Toss (edict_t *ent, edict_t *ignore); +void SV_ProgStartFrame (void); +void SV_RunEntity (edict_t *ent); qboolean SV_RunThink (edict_t *ent); -void SV_Physics_Toss (edict_t *ent); -void SV_RunNewmis (void); -void SV_Impact (edict_t *e1, edict_t *e2); -void SV_SetMoveVars(void); - // // sv_send.c // diff --git a/engine/server/sv_ccmds.c b/engine/server/sv_ccmds.c index b2ab2b0c0..e86696bc1 100644 --- a/engine/server/sv_ccmds.c +++ b/engine/server/sv_ccmds.c @@ -808,7 +808,6 @@ void SV_BanIP_f (void) netadr_t banadr; netadr_t banmask; char *reason = NULL; - int reasonsize = 0; if (Cmd_Argc() < 2) { diff --git a/engine/server/sv_chat.c b/engine/server/sv_chat.c index fe1d478ab..637ce50e3 100644 --- a/engine/server/sv_chat.c +++ b/engine/server/sv_chat.c @@ -331,10 +331,8 @@ void SV_SendChat(void) text++; s2++; } - *s2='\n'; - *s2++; - *s2='\n'; - *s2++; + *s2++='\n'; + *s2++='\n'; *s2='\0'; for (i = 0; i < host_client->chat.options; i++) { diff --git a/engine/server/sv_ents.c b/engine/server/sv_ents.c index 1ee27b154..c29db2b97 100644 --- a/engine/server/sv_ents.c +++ b/engine/server/sv_ents.c @@ -1705,7 +1705,7 @@ void SV_WritePlayersToClient (client_t *client, client_frame_t *frame, edict_t * continue; // ignore if not touching a PV leaf - if (!sv.world.worldmodel->funcs.EdictInFatPVS(sv.world.worldmodel, (wedict_t*)ent, pvs)) + if (!sv.world.worldmodel->funcs.EdictInFatPVS(sv.world.worldmodel, &((wedict_t*)ent)->pvsinfo, pvs)) continue; if (!((int)clent->xv->dimension_see & ((int)ent->xv->dimension_seen | (int)ent->xv->dimension_ghost))) diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index b462e80b8..9839836ae 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -70,14 +70,14 @@ extern cvar_t sv_nomsec; #define MOVE_EPSILON 0.01 -void SV_Physics_Toss (edict_t *ent); +static void SV_Physics_Toss (edict_t *ent); /* ================ SV_CheckAllEnts ================ */ -void SV_CheckAllEnts (void) +static void SV_CheckAllEnts (void) { int e; edict_t *check; @@ -210,7 +210,7 @@ SV_Impact Two entities have touched, so run their touch functions ================== */ -void SV_Impact (edict_t *e1, edict_t *e2) +static void SV_Impact (edict_t *e1, edict_t *e2) { int old_self, old_other; @@ -256,7 +256,7 @@ Slide off of the impacting object */ #define STOP_EPSILON 0.1 //courtesy of darkplaces, it's just more efficient. -void ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce) +static void ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce) { int i; float backoff; @@ -284,7 +284,7 @@ If steptrace is not NULL, the trace of any vertical wall hit will be stored ============ */ #define MAX_CLIP_PLANES 5 -int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace) +static int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace) { int bumpcount, numbumps; vec3_t dir; @@ -452,7 +452,7 @@ SV_AddGravity ============ */ -void SV_AddGravity (edict_t *ent, float scale) +static void SV_AddGravity (edict_t *ent, float scale) { if (!scale && progstype != PROG_QW) scale = 1; @@ -474,7 +474,7 @@ SV_PushEntity Does not change the entities velocity at all ============ */ -trace_t SV_PushEntity (edict_t *ent, vec3_t push, unsigned int traceflags) +static trace_t SV_PushEntity (edict_t *ent, vec3_t push, unsigned int traceflags) { trace_t trace; vec3_t end; @@ -514,7 +514,7 @@ typedef struct vec3_t angles; // float deltayaw; } pushed_t; -pushed_t pushed[MAX_EDICTS], *pushed_p; +static pushed_t pushed[MAX_EDICTS], *pushed_p; /* ============ @@ -524,7 +524,7 @@ Objects need to be moved back on a failed push, otherwise riders would continue to slide. ============ */ -qboolean SV_PushAngles (edict_t *pusher, vec3_t move, vec3_t amove) +static qboolean SV_PushAngles (edict_t *pusher, vec3_t move, vec3_t amove) { int i, e; edict_t *check, *block; @@ -704,7 +704,7 @@ SV_Push ============ */ -qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove) +static qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove) { int i, e; edict_t *check, *block; @@ -848,7 +848,7 @@ SV_PushMove ============ */ -void SV_PushMove (edict_t *pusher, float movetime) +static void SV_PushMove (edict_t *pusher, float movetime) { int i; vec3_t move; @@ -878,7 +878,7 @@ SV_Physics_Pusher ================ */ -void SV_Physics_Pusher (edict_t *ent) +static void SV_Physics_Pusher (edict_t *ent) { float thinktime; float oldltime; @@ -943,7 +943,7 @@ SV_Physics_Follow Entities that are "stuck" to another entity ============= */ -void SV_Physics_Follow (edict_t *ent) +static void SV_Physics_Follow (edict_t *ent) { vec3_t vf, vr, vu, angles, v; edict_t *e; @@ -987,7 +987,7 @@ SV_Physics_Noclip A moving object that doesn't obey physics ============= */ -void SV_Physics_Noclip (edict_t *ent) +static void SV_Physics_Noclip (edict_t *ent) { // regular thinking if (!SV_RunThink (ent)) @@ -1013,7 +1013,7 @@ SV_CheckWaterTransition ============= */ -void SV_CheckWaterTransition (edict_t *ent) +static void SV_CheckWaterTransition (edict_t *ent) { int cont; @@ -1063,7 +1063,7 @@ SV_Physics_Toss Toss, bounce, and fly movement. When onground, do nothing. ============= */ -void SV_Physics_Toss (edict_t *ent) +static void SV_Physics_Toss (edict_t *ent) { trace_t trace; vec3_t move; @@ -1168,7 +1168,7 @@ will fall if the floor is pulled out from under them. FIXME: is this true? ============= */ -void SV_Physics_Step (edict_t *ent) +static void SV_Physics_Step (edict_t *ent) { qboolean hitsound; @@ -1240,7 +1240,7 @@ This is a big hack to try and fix the rare case of getting stuck in the world clipping hull. ============= */ -void SV_CheckStuck (edict_t *ent) +static void SV_CheckStuck (edict_t *ent) { int i, j; int z; @@ -1285,7 +1285,7 @@ void SV_CheckStuck (edict_t *ent) SV_CheckWater ============= */ -qboolean SV_CheckWater (edict_t *ent) +static qboolean SV_CheckWater (edict_t *ent) { vec3_t point; int cont; @@ -1330,7 +1330,7 @@ SV_WallFriction ============ */ -void SV_WallFriction (edict_t *ent, trace_t *trace) +static void SV_WallFriction (edict_t *ent, trace_t *trace) { vec3_t forward, right, up; float d, i; @@ -1364,7 +1364,7 @@ Try fixing by pushing one pixel in each direction. This is a hack, but in the interest of good gameplay... ====================== */ -int SV_TryUnstick (edict_t *ent, vec3_t oldvel) +static int SV_TryUnstick (edict_t *ent, vec3_t oldvel) { int i; vec3_t oldorg; @@ -1422,7 +1422,7 @@ Only used by players */ #if 0 #define SMSTEPSIZE 4 -void SV_WalkMove (edict_t *ent) +static void SV_WalkMove (edict_t *ent) { vec3_t upmove, downmove; vec3_t oldorg, oldvel; @@ -1581,7 +1581,7 @@ void SV_WalkMove (edict_t *ent) // 1/32 epsilon to keep floating point happy #define DIST_EPSILON (0.03125) -int SV_SetOnGround (edict_t *ent) +static int SV_SetOnGround (edict_t *ent) { vec3_t end; trace_t trace; @@ -1599,7 +1599,7 @@ int SV_SetOnGround (edict_t *ent) } return 0; } -void SV_WalkMove (edict_t *ent) +static void SV_WalkMove (edict_t *ent) { int clip, oldonground, originalmove_clip, originalmove_flags, originalmove_groundentity; vec3_t upmove, downmove, start_origin, start_velocity, originalmove_origin, originalmove_velocity; @@ -1732,7 +1732,7 @@ void SV_WalkMove (edict_t *ent) } #endif -void SV_MoveChain(edict_t *ent, edict_t *movechain, float *initial_origin, float *initial_angle) +static void SV_MoveChain(edict_t *ent, edict_t *movechain, float *initial_origin, float *initial_angle) { qboolean callfunc; if ((callfunc=DotProduct(ent->v->origin, initial_origin)) || DotProduct(ent->v->angles, initial_angle)) diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 887740055..03ba4de25 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -189,7 +189,7 @@ qboolean SV_CheckRealIP(client_t *client, qboolean force) } ClientReliableWrite_Begin(client, svc_stufftext, 256); - ClientReliableWrite_String(client, va("packet %s \"realip %i %i\"\n", serverip, client-svs.clients, client->realip_num)); + ClientReliableWrite_String(client, va("packet %s \"realip %i %i\"\n", serverip, (int)(client-svs.clients), client->realip_num)); } return false; }