From b6252d940c1ba3ec10cb14a1fceaf2c7c5706e01 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 23 Jun 2013 03:59:48 +0000 Subject: [PATCH] fixed a few warnings and errors git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4399 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/botlib/be_aas_move.c | 7 +++--- engine/botlib/be_aas_reach.c | 21 ++++++---------- engine/botlib/be_aas_route.c | 4 +-- engine/botlib/be_ai_chat.c | 4 +-- engine/botlib/be_ai_gen.c | 4 +-- engine/botlib/be_ai_goal.c | 6 +++-- engine/botlib/be_ai_move.c | 10 +++----- engine/botlib/be_interface.c | 8 +++--- engine/botlib/l_precomp.c | 4 +-- engine/client/cl_main.c | 2 +- engine/client/m_mp3.c | 2 +- engine/client/m_multi.c | 2 +- engine/client/m_single.c | 6 ++--- engine/client/pr_csqc.c | 2 +- engine/client/snd_dma.c | 3 +-- engine/client/sys_linux.c | 2 +- engine/client/view.c | 2 +- engine/common/com_mesh.c | 2 +- engine/common/fs.c | 17 ++++++------- engine/common/fs_pak.c | 22 ++++++++--------- engine/common/fs_stdio.c | 29 ++++++++++------------ engine/common/fs_zip.c | 34 +++++++++++++------------- engine/common/net_wins.c | 12 +++++---- engine/common/plugin.c | 4 +-- engine/common/pr_bgcmd.c | 4 +-- engine/common/q3common.c | 6 ++--- engine/common/sys.h | 2 +- engine/gl/gl_model.c | 2 +- engine/gl/gl_shader.c | 2 +- engine/gl/gl_vidcommon.c | 4 +-- engine/gl/gl_vidlinuxglx.c | 4 +-- engine/http/ftpserver.c | 2 +- engine/http/httpclient.c | 2 +- engine/libs/speex/libspeex/cb_search.c | 3 +-- engine/libs/speex/libspeex/jitter.c | 2 -- engine/libs/speex/libspeex/nb_celp.c | 4 --- engine/libs/speex/libspeex/scal.c | 1 - engine/libs/speex/libspeex/vbr.c | 3 --- engine/qclib/qcc.h | 2 +- engine/qclib/qcc_pr_comp.c | 4 +-- engine/qclib/qcc_pr_lex.c | 11 +++------ engine/server/sv_ccmds.c | 4 +-- engine/server/sv_mvd.c | 2 +- engine/server/svq2_game.c | 2 +- 44 files changed, 124 insertions(+), 151 deletions(-) diff --git a/engine/botlib/be_aas_move.c b/engine/botlib/be_aas_move.c index 91f3e9e5b..f230d9c1f 100644 --- a/engine/botlib/be_aas_move.c +++ b/engine/botlib/be_aas_move.c @@ -381,6 +381,7 @@ void AAS_Accelerate(vec3_t velocity, float frametime, vec3_t wishdir, float wish velocity[i] += accelspeed*wishdir[i]; } } //end of the function AAS_Accelerate +/* //=========================================================================== // // Parameter: - @@ -393,6 +394,7 @@ void AAS_AirControl(vec3_t start, vec3_t end, vec3_t velocity, vec3_t cmdmove) VectorSubtract(end, start, dir); } //end of the function AAS_AirControl +*/ //=========================================================================== // applies ground friction to the given velocity // @@ -518,7 +520,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, float phys_maxstep, phys_maxsteepness, phys_jumpvel, friction; float gravity, delta, maxvel, wishspeed, accelerate; //float velchange, newvel; - int n, i, j, pc, step, swimming, ax, crouch, event, jump_frame, areanum; + int n, i, j, pc, step, swimming, crouch, event, jump_frame, areanum; int areas[20], numareas; vec3_t points[20]; vec3_t org, end, feet, start, stepend, lastorg, wishdir; @@ -574,7 +576,6 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, //apply command movement if (n < cmdframes) { - ax = 0; maxvel = phys_maxwalkvelocity; accelerate = phys_airaccelerate; VectorCopy(cmdmove, wishdir); @@ -598,13 +599,11 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, { accelerate = phys_walkaccelerate; } //end else - ax = 2; } //end if if (swimming) { maxvel = phys_maxswimvelocity; accelerate = phys_swimaccelerate; - ax = 3; } //end if else { diff --git a/engine/botlib/be_aas_reach.c b/engine/botlib/be_aas_reach.c index fc3db8b59..3949b64b5 100644 --- a/engine/botlib/be_aas_reach.c +++ b/engine/botlib/be_aas_reach.c @@ -289,7 +289,7 @@ int AAS_GetJumpPadInfo(int ent, vec3_t areastart, vec3_t absmins, vec3_t absmaxs //=========================================================================== int AAS_BestReachableFromJumpPadArea(vec3_t origin, vec3_t mins, vec3_t maxs) { - int area2num, ent, bot_visualizejumppads, bestareanum; + int ent, bot_visualizejumppads, bestareanum; float volume, bestareavolume; vec3_t areastart, cmdmove, bboxmins, bboxmaxs; vec3_t absmins, absmaxs, velocity; @@ -327,7 +327,6 @@ int AAS_BestReachableFromJumpPadArea(vec3_t origin, vec3_t mins, vec3_t maxs) // VectorSet(cmdmove, 0, 0, 0); Com_Memset(&move, 0, sizeof(aas_clientmove_t)); - area2num = 0; AAS_ClientMovementHitBBox(&move, -1, areastart, PRESENCE_NORMAL, qfalse, velocity, cmdmove, 0, 30, 0.1f, bboxmins, bboxmaxs, bot_visualizejumppads); if (move.frames < 30) @@ -837,7 +836,6 @@ int AAS_Reachability_Swim(int area1num, int area2num) { int i, j, face1num, face2num, side1; aas_area_t *area1, *area2; - aas_areasettings_t *areasettings; aas_lreachability_t *lreach; aas_face_t *face1; aas_plane_t *plane; @@ -875,7 +873,6 @@ int AAS_Reachability_Swim(int area1num, int area2num) { // face1 = &aasworld.faces[face1num]; - areasettings = &aasworld.areasettings[area1num]; //create a new reachability link lreach = AAS_AllocReachability(); if (!lreach) return qfalse; @@ -1062,7 +1059,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 int ground_bestarea2groundedgenum, ground_foundreach; int water_bestarea2groundedgenum, water_foundreach; int side1, area1swim, faceside1, groundface1num; - float dist, dist1, dist2, diff, invgravitydot, ortdot; + float dist, dist1, dist2, diff, ortdot; float x1, x2, x3, x4, y1, y2, y3, y4, tmp, y; float length, ground_bestlength, water_bestlength, ground_bestdist, water_bestdist; vec3_t v1, v2, v3, v4, tmpv, p1area1, p1area2, p2area1, p2area2; @@ -1073,7 +1070,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 vec3_t testpoint; aas_plane_t *plane; aas_area_t *area1, *area2; - aas_face_t *groundface1, *groundface2, *ground_bestface1, *water_bestface1; + aas_face_t *groundface1, *groundface2; aas_edge_t *edge1, *edge2; aas_lreachability_t *lreach; aas_trace_t trace; @@ -1172,7 +1169,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 //edges if they overlap in the direction orthogonal to //the gravity direction CrossProduct(invgravity, normal, ort); - invgravitydot = DotProduct(invgravity, invgravity); + //invgravitydot = DotProduct(invgravity, invgravity); ortdot = DotProduct(ort, ort); //projection into the step plane //NOTE: since gravity is vertical this is just the z coordinate @@ -1302,7 +1299,6 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 ground_bestlength = length; ground_foundreach = qtrue; ground_bestarea2groundedgenum = edge1num; - ground_bestface1 = groundface1; //best point towards area1 VectorCopy(start, ground_beststart); //normal is pointing into area2 @@ -1323,7 +1319,6 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 water_bestlength = length; water_foundreach = qtrue; water_bestarea2groundedgenum = edge1num; - water_bestface1 = groundface1; //best point towards area1 VectorCopy(start, water_beststart); //normal is pointing into area2 @@ -3492,7 +3487,7 @@ void AAS_Reachability_JumpPad(void) int face2num, i, ret, area2num, visualize, ent, bot_visualizejumppads; //int modelnum, ent2; //float dist, time, height, gravity, forward; - float speed, zvel, hordist; + float speed, zvel; aas_face_t *face2; aas_area_t *area2; aas_lreachability_t *lreach; @@ -3714,7 +3709,7 @@ void AAS_Reachability_JumpPad(void) //direction towards the face center VectorSubtract(facecenter, areastart, dir); dir[2] = 0; - hordist = VectorNormalize(dir); + //hordist = VectorNormalize(dir); //if (hordist < 1.6 * facecenter[2] - areastart[2]) { //get command movement @@ -3997,7 +3992,7 @@ void AAS_SetWeaponJumpAreaFlags(void) int AAS_Reachability_WeaponJump(int area1num, int area2num) { int face2num, i, n, ret, visualize; - float speed, zvel, hordist; + float speed, zvel; aas_face_t *face2; aas_area_t *area1, *area2; aas_lreachability_t *lreach; @@ -4057,7 +4052,7 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num) //direction towards the face center VectorSubtract(facecenter, areastart, dir); dir[2] = 0; - hordist = VectorNormalize(dir); + //hordist = VectorNormalize(dir); //if (hordist < 1.6 * (facecenter[2] - areastart[2])) { //get command movement diff --git a/engine/botlib/be_aas_route.c b/engine/botlib/be_aas_route.c index 25a848bbe..3ab9f1215 100644 --- a/engine/botlib/be_aas_route.c +++ b/engine/botlib/be_aas_route.c @@ -887,7 +887,7 @@ void AAS_InitRoutingUpdate(void) //=========================================================================== void AAS_CreateAllRoutingCache(void) { - int i, j, t; + int i, j; aasworld.initialized = qtrue; botimport.Print(PRT_MESSAGE, "AAS_CreateAllRoutingCache\n"); @@ -898,7 +898,7 @@ void AAS_CreateAllRoutingCache(void) { if (i == j) continue; if (!AAS_AreaReachability(j)) continue; - t = AAS_AreaTravelTimeToGoalArea(i, aasworld.areas[i].center, j, TFL_DEFAULT); + /*t =*/ AAS_AreaTravelTimeToGoalArea(i, aasworld.areas[i].center, j, TFL_DEFAULT); //Log_Write("traveltime from %d to %d is %d", i, j, t); } //end for } //end for diff --git a/engine/botlib/be_ai_chat.c b/engine/botlib/be_ai_chat.c index 9438377ab..8377aa6fe 100644 --- a/engine/botlib/be_ai_chat.c +++ b/engine/botlib/be_ai_chat.c @@ -2939,7 +2939,7 @@ int BotAllocChatState(void) //======================================================================== void BotFreeChatState(int handle) { - bot_chatstate_t *cs; + //bot_chatstate_t *cs; bot_consolemessage_t m; int h; @@ -2953,7 +2953,7 @@ void BotFreeChatState(int handle) botimport.Print(PRT_FATAL, "invalid chat state %d\n", handle); return; } //end if - cs = botchatstates[handle]; + //cs = botchatstates[handle]; if (LibVarGetValue("bot_reloadcharacters")) { BotFreeChatFile(handle); diff --git a/engine/botlib/be_ai_gen.c b/engine/botlib/be_ai_gen.c index 286d98952..65b331a34 100644 --- a/engine/botlib/be_ai_gen.c +++ b/engine/botlib/be_ai_gen.c @@ -51,7 +51,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA //=========================================================================== int GeneticSelection(int numranks, float *rankings) { - float sum, select; + float sum; int i, index; sum = 0; @@ -64,7 +64,7 @@ int GeneticSelection(int numranks, float *rankings) { //select a bot where the ones with the higest rankings have //the highest chance of being selected - select = random() * sum; +// select = random() * sum; for (i = 0; i < numranks; i++) { if (rankings[i] < 0) continue; diff --git a/engine/botlib/be_ai_goal.c b/engine/botlib/be_ai_goal.c index 5432e1c6d..085284d29 100644 --- a/engine/botlib/be_ai_goal.c +++ b/engine/botlib/be_ai_goal.c @@ -230,6 +230,7 @@ void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child) InterbreedWeightConfigs(p1->itemweightconfig, p2->itemweightconfig, c->itemweightconfig); } //end of the function BotInterbreedingGoalFuzzyLogic + //=========================================================================== // // Parameter: - @@ -238,12 +239,13 @@ void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child) //=========================================================================== void BotSaveGoalFuzzyLogic(int goalstate, char *filename) { - bot_goalstate_t *gs; + //bot_goalstate_t *gs; - gs = BotGoalStateFromHandle(goalstate); + //gs = BotGoalStateFromHandle(goalstate); //WriteWeightConfig(filename, gs->itemweightconfig); } //end of the function BotSaveGoalFuzzyLogic + //=========================================================================== // // Parameter: - diff --git a/engine/botlib/be_ai_move.c b/engine/botlib/be_ai_move.c index f8ea8ebe8..92f2e9279 100644 --- a/engine/botlib/be_ai_move.c +++ b/engine/botlib/be_ai_move.c @@ -1480,7 +1480,6 @@ bot_moveresult_t BotTravel_BarrierJump(bot_movestate_t *ms, aas_reachability_t * //=========================================================================== bot_moveresult_t BotFinishTravel_BarrierJump(bot_movestate_t *ms, aas_reachability_t *reach) { - float dist; vec3_t hordir; bot_moveresult_t_cleared( result ); @@ -1490,7 +1489,7 @@ bot_moveresult_t BotFinishTravel_BarrierJump(bot_movestate_t *ms, aas_reachabili hordir[0] = reach->end[0] - ms->origin[0]; hordir[1] = reach->end[1] - ms->origin[1]; hordir[2] = 0; - dist = VectorNormalize(hordir); + VectorNormalize(hordir); // BotCheckBlocked(ms, hordir, qtrue, &result); // @@ -1567,7 +1566,6 @@ bot_moveresult_t BotTravel_WaterJump(bot_movestate_t *ms, aas_reachability_t *re bot_moveresult_t BotFinishTravel_WaterJump(bot_movestate_t *ms, aas_reachability_t *reach) { vec3_t dir, pnt; - float dist; bot_moveresult_t_cleared( result ); //botimport.Print(PRT_MESSAGE, "BotFinishTravel_WaterJump\n"); @@ -1583,7 +1581,7 @@ bot_moveresult_t BotFinishTravel_WaterJump(bot_movestate_t *ms, aas_reachability dir[0] += crandom() * 10; dir[1] += crandom() * 10; dir[2] += 70 + crandom() * 10; - dist = VectorNormalize(dir); + VectorNormalize(dir); //elemantary actions EA_Move(ms->client, dir, 400); //set the ideal view angles @@ -2867,7 +2865,7 @@ bot_moveresult_t BotFinishTravel_WeaponJump(bot_movestate_t *ms, aas_reachabilit //=========================================================================== bot_moveresult_t BotTravel_JumpPad(bot_movestate_t *ms, aas_reachability_t *reach) { - float dist, speed; + float speed; vec3_t hordir; bot_moveresult_t_cleared( result ); @@ -2875,7 +2873,7 @@ bot_moveresult_t BotTravel_JumpPad(bot_movestate_t *ms, aas_reachability_t *reac hordir[0] = reach->start[0] - ms->origin[0]; hordir[1] = reach->start[1] - ms->origin[1]; hordir[2] = 0; - dist = VectorNormalize(hordir); + VectorNormalize(hordir); // BotCheckBlocked(ms, hordir, qtrue, &result); speed = 400; diff --git a/engine/botlib/be_interface.c b/engine/botlib/be_interface.c index 9808ac852..d279cef39 100644 --- a/engine/botlib/be_interface.c +++ b/engine/botlib/be_interface.c @@ -348,7 +348,7 @@ int BotExportTest(int parm0, char *parm1, vec3_t parm2, vec3_t parm3) static int line[2]; int newarea, i, highlightarea, flood; // int reachnum; - vec3_t eye, forward, right, end, origin; + vec3_t eye, forward, right, origin; // vec3_t bottomcenter; // aas_trace_t trace; // aas_face_t *face; @@ -358,8 +358,8 @@ int BotExportTest(int parm0, char *parm1, vec3_t parm2, vec3_t parm3) // bot_goal_t goal; // clock_t start_time, end_time; - vec3_t mins = {-16, -16, -24}; - vec3_t maxs = {16, 16, 32}; + //vec3_t mins = {-16, -16, -24}; + //vec3_t maxs = {16, 16, 32}; // int areas[10], numareas; @@ -589,7 +589,7 @@ int BotExportTest(int parm0, char *parm1, vec3_t parm2, vec3_t parm3) //get the eye 24 units up eye[2] += 24; //get the end point for the line to be traced - VectorMA(eye, 800, forward, end); + //VectorMA(eye, 800, forward, end); // AAS_TestMovementPrediction(1, parm2, forward); /* diff --git a/engine/botlib/l_precomp.c b/engine/botlib/l_precomp.c index 9f3de6074..9c967ddc6 100644 --- a/engine/botlib/l_precomp.c +++ b/engine/botlib/l_precomp.c @@ -1704,7 +1704,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval int questmarkintvalue = 0; float questmarkfloatvalue = 0; int gotquestmarkvalue = qfalse; - int lastoperatortype = 0; + //int lastoperatortype = 0; // operator_t operator_heap[MAX_OPERATORS]; int numoperators = 0; @@ -2093,7 +2093,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval else Log_Write("result value = %f", v1->floatvalue); #endif //DEBUG_EVAL if (error) break; - lastoperatortype = o->operator; + //lastoperatortype = o->operator; //if not an operator with arity 1 if (o->operator != P_LOGIC_NOT && o->operator != P_BIN_NOT) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 8adc916ed..8cf49c101 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -276,7 +276,7 @@ void CL_UpdateWindowTitle(void) default: #ifndef CLIENTONLY if (sv.state) - VID_SetWindowCaption(va("%s", fs_gamename.string, sv.name)); + VID_SetWindowCaption(va("%s: %s", fs_gamename.string, sv.name)); else #endif VID_SetWindowCaption(va("%s: %s", fs_gamename.string, cls.servername)); diff --git a/engine/client/m_mp3.c b/engine/client/m_mp3.c index 761a6a25a..14571b81f 100644 --- a/engine/client/m_mp3.c +++ b/engine/client/m_mp3.c @@ -429,7 +429,7 @@ void M_Media_Draw (void) char compleatenamepath[MAX_OSPATH]; char compleatenamename[MAX_OSPATH]; qboolean compleatenamemultiple; -int QDECL Com_CompleatenameCallback(const char *name, int size, void *data, void *spath) +int QDECL Com_CompleatenameCallback(const char *name, int size, void *data, searchpathfuncs_t *spath) { if (*compleatenamename) compleatenamemultiple = true; diff --git a/engine/client/m_multi.c b/engine/client/m_multi.c index 862fb8726..bf250320c 100644 --- a/engine/client/m_multi.c +++ b/engine/client/m_multi.c @@ -188,7 +188,7 @@ typedef struct { int match; } q2skinsearch_t; -int QDECL q2skin_enumerate(const char *name, int fsize, void *parm, void *spath) +int QDECL q2skin_enumerate(const char *name, int fsize, void *parm, searchpathfuncs_t *spath) { char blah[MAX_QPATH]; q2skinsearch_t *s = parm; diff --git a/engine/client/m_single.c b/engine/client/m_single.c index 236d1db6b..834a3ac1e 100644 --- a/engine/client/m_single.c +++ b/engine/client/m_single.c @@ -498,7 +498,7 @@ static qboolean M_DemoKey(menucustom_t *control, menu_t *menu, int key) return false; } -static int QDECL DemoAddItem(const char *filename, int size, void *parm, void *spath) +static int QDECL DemoAddItem(const char *filename, int size, void *parm, searchpathfuncs_t *spath) { int extnum; demomenu_t *menu = parm; @@ -660,7 +660,7 @@ static void ShowDemoMenu (menu_t *menu, const char *path) { info->fsroot = FS_ROOT; FS_NativePath("", FS_ROOT, info->path, sizeof(info->path)); - while(s = strchr(info->path, '\\')) + while((s = strchr(info->path, '\\'))) *s = '/'; } } @@ -700,7 +700,7 @@ static void ShowDemoMenu (menu_t *menu, const char *path) } else if (info->fsroot == FS_GAME) { - Q_snprintfz(match, sizeof(match), "../", info->path); + Q_snprintfz(match, sizeof(match), "../"); DemoAddItem(match, 0, info, NULL); } if (info->fsroot == FS_ROOT) diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 54f89a76b..1c442b6e9 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -1242,7 +1242,7 @@ static void QCBUILTIN PF_R_ClearScene (pubprogfuncs_t *prinst, struct globalvars CL_ClearEntityLists(); V_ClearRefdef(csqc_playerview); - csqc_playerview->drawsbar = false; //csqc defaults to no sbar. + r_refdef.drawsbar = false; //csqc defaults to no sbar. csqc_addcrosshair = false; V_CalcRefdef(csqc_playerview); //set up the defaults diff --git a/engine/client/snd_dma.c b/engine/client/snd_dma.c index a27f5e35a..80c0c8a3f 100644 --- a/engine/client/snd_dma.c +++ b/engine/client/snd_dma.c @@ -474,14 +474,13 @@ void S_Voip_Decode(unsigned int sender, unsigned int codec, unsigned int gen, un { unsigned char *start; short decodebuf[8192]; - unsigned int decodesamps, len, newseq, drops; + unsigned int decodesamps, len, drops; int r; if (sender >= MAX_CLIENTS) return; decodesamps = 0; - newseq = 0; drops = 0; start = data; diff --git a/engine/client/sys_linux.c b/engine/client/sys_linux.c index 03b340038..559d2e196 100644 --- a/engine/client/sys_linux.c +++ b/engine/client/sys_linux.c @@ -394,7 +394,7 @@ int Sys_DebugLog(char *file, char *fmt, ...) return 1; } -int Sys_EnumerateFiles (const char *gpath, const char *match, int (*func)(const char *, int, void *, void *), void *parm, void *spath) +int Sys_EnumerateFiles (const char *gpath, const char *match, int (*func)(const char *, int, void *, searchpathfuncs_t *), void *parm, searchpathfuncs_t *spath) { DIR *dir; char apath[MAX_OSPATH]; diff --git a/engine/client/view.c b/engine/client/view.c index 93da315ec..f125a501c 100644 --- a/engine/client/view.c +++ b/engine/client/view.c @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "winquake.h" +#include "glquake.h" #include // for isdigit(); @@ -1441,7 +1442,6 @@ void R_DrawNameTags(void) #ifdef GLQUAKE if (qrenderer == QR_OPENGL) { - void GL_Set2D (qboolean flipped); GL_Set2D(false); } #endif diff --git a/engine/common/com_mesh.c b/engine/common/com_mesh.c index 5fe845cb3..44c731f87 100644 --- a/engine/common/com_mesh.c +++ b/engine/common/com_mesh.c @@ -2181,7 +2181,7 @@ static qboolean VARGS Mod_TryAddSkin(const char *skinname, ...) return true; } -int QDECL Mod_EnumerateSkins(const char *name, int size, void *param, void *spath) +int QDECL Mod_EnumerateSkins(const char *name, int size, void *param, searchpathfuncs_t *spath) { Mod_TryAddSkin(name); return true; diff --git a/engine/common/fs.c b/engine/common/fs.c index 982caffee..f824eb6eb 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -265,7 +265,7 @@ void FS_Manifest_Print(ftemanifest_t *man) for (j = 0; j < sizeof(man->package[i].mirrors) / sizeof(man->package[i].mirrors[0]); j++) if (man->package[i].mirrors[j]) Con_Printf(" \"%s\"", man->package[i].mirrors[j]); - Con_Printf("\n", man->package[i].path, man->package[i].crc); + Con_Printf("\n"); } } } @@ -498,9 +498,8 @@ COM_Dir_f ============ */ -static int QDECL COM_Dir_List(const char *name, int size, void *parm, void *spath) +static int QDECL COM_Dir_List(const char *name, int size, void *parm, searchpathfuncs_t *spath) { - char pbuf[MAX_OSPATH] = "??"; searchpath_t *s; for (s=com_searchpaths ; s ; s=s->next) { @@ -2178,7 +2177,7 @@ qboolean FS_GenCachedPakName(char *pname, char *crc, char *local, int llen) if (*crc) { Q_strncatz(local, ".", llen); - snprintf(hex, sizeof(hex), "%x", strtoul(crc, NULL, 0)); + snprintf(hex, sizeof(hex), "%x", (unsigned int)strtoul(crc, NULL, 0)); Q_strncatz(local, hex, llen); } return true; @@ -2704,7 +2703,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base } - if (!strcmp(gamename, "q1")) + if (!strcmp(gamename, "quake")) { FILE *f; @@ -2726,7 +2725,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base } } - if (!strcmp(gamename, "q2")) + if (!strcmp(gamename, "quake2")) { FILE *f; DWORD resultlen; @@ -2770,7 +2769,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base } } - if (!strcmp(gamename, "q3")) + if (!strcmp(gamename, "quake3")) { FILE *f; DWORD resultlen; @@ -2893,7 +2892,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base { #ifdef __linux__ struct stat sb; - if (!strcmp(gamename, "q1")) + if (!strcmp(gamename, "quake")) { if (stat("/usr/share/quake/", &sb) == 0) { @@ -3253,7 +3252,7 @@ static char *FS_RelativeURL(char *base, char *file, char *buffer, int bufferlen) //fixme: cope with windows paths qboolean baseisurl = !!strchr(base, ':'); qboolean fileisurl = !!strchr(file, ':'); - qboolean baseisabsolute = (*base == '/' || *base == '\\'); + //qboolean baseisabsolute = (*base == '/' || *base == '\\'); qboolean fileisabsolute = (*file == '/' || *file == '\\'); char *ebase; diff --git a/engine/common/fs_pak.c b/engine/common/fs_pak.c index 3dd9238e4..08670b93f 100644 --- a/engine/common/fs_pak.c +++ b/engine/common/fs_pak.c @@ -63,9 +63,9 @@ static void QDECL FSPAK_GetPathDetails(searchpathfuncs_t *handle, char *out, uns if (pak->references != 1) Q_snprintfz(out, outlen, "(%i)", pak->references-1); } -static void QDECL FSPAK_ClosePath(void *handle) +static void QDECL FSPAK_ClosePath(searchpathfuncs_t *handle) { - pack_t *pak = handle; + pack_t *pak = (void*)handle; pak->references--; if (pak->references > 0) @@ -77,9 +77,9 @@ static void QDECL FSPAK_ClosePath(void *handle) Z_Free(pak->files); Z_Free(pak); } -void QDECL FSPAK_BuildHash(void *handle, int depth, void (QDECL *AddFileHash)(int depth, const char *fname, fsbucket_t *filehandle, void *pathhandle)) +void QDECL FSPAK_BuildHash(searchpathfuncs_t *handle, int depth, void (QDECL *AddFileHash)(int depth, const char *fname, fsbucket_t *filehandle, void *pathhandle)) { - pack_t *pak = handle; + pack_t *pak = (void*)handle; int i; for (i = 0; i < pak->numfiles; i++) @@ -87,11 +87,11 @@ void QDECL FSPAK_BuildHash(void *handle, int depth, void (QDECL *AddFileHash)(in AddFileHash(depth, pak->files[i].name, &pak->files[i].bucket, &pak->files[i]); } } -qboolean QDECL FSPAK_FLocate(void *handle, flocation_t *loc, const char *filename, void *hashedresult) +qboolean QDECL FSPAK_FLocate(searchpathfuncs_t *handle, flocation_t *loc, const char *filename, void *hashedresult) { mpackfile_t *pf = hashedresult; int i; - pack_t *pak = handle; + pack_t *pak = (void*)handle; // look through all the pak file elements @@ -142,9 +142,9 @@ static int QDECL FSPAK_EnumerateFiles (searchpathfuncs_t *handle, const char *ma return true; } -int QDECL FSPAK_GeneratePureCRC(void *handle, int seed, int crctype) +int QDECL FSPAK_GeneratePureCRC(searchpathfuncs_t *handle, int seed, int crctype) { - pack_t *pak = handle; + pack_t *pak = (void*)handle; int result; int *filecrcs; @@ -228,10 +228,10 @@ unsigned long QDECL VFSPAK_GetLen (struct vfsfile_s *vfs) void QDECL VFSPAK_Close(vfsfile_t *vfs) { vfspack_t *vfsp = (vfspack_t*)vfs; - FSPAK_ClosePath(vfsp->parentpak); //tell the parent that we don't need it open any more (reference counts) + FSPAK_ClosePath(&vfsp->parentpak->pub); //tell the parent that we don't need it open any more (reference counts) Z_Free(vfsp); //free ourselves. } -vfsfile_t *QDECL FSPAK_OpenVFS(void *handle, flocation_t *loc, const char *mode) +vfsfile_t *QDECL FSPAK_OpenVFS(searchpathfuncs_t *handle, flocation_t *loc, const char *mode) { pack_t *pack = (pack_t*)handle; vfspack_t *vfs; @@ -261,7 +261,7 @@ vfsfile_t *QDECL FSPAK_OpenVFS(void *handle, flocation_t *loc, const char *mode) return (vfsfile_t *)vfs; } -void QDECL FSPAK_ReadFile(void *handle, flocation_t *loc, char *buffer) +void QDECL FSPAK_ReadFile(searchpathfuncs_t *handle, flocation_t *loc, char *buffer) { vfsfile_t *f; f = FSPAK_OpenVFS(handle, loc, "rb"); diff --git a/engine/common/fs_stdio.c b/engine/common/fs_stdio.c index ca094dd1c..e467e1aca 100644 --- a/engine/common/fs_stdio.c +++ b/engine/common/fs_stdio.c @@ -197,11 +197,10 @@ vfsfile_t *VFSOS_Open(const char *osname, const char *mode) #endif #ifndef WEBSVONLY -static vfsfile_t *QDECL FSSTDIO_OpenVFS(void *handle, flocation_t *loc, const char *mode) +static vfsfile_t *QDECL FSSTDIO_OpenVFS(searchpathfuncs_t *handle, flocation_t *loc, const char *mode) { vfsfile_t *f; - stdiopath_t *sp = handle; - char diskname[MAX_OSPATH]; + stdiopath_t *sp = (void*)handle; qboolean needsflush; f = VFSSTDIO_Open(loc->rawname, mode, &needsflush); @@ -210,18 +209,18 @@ static vfsfile_t *QDECL FSSTDIO_OpenVFS(void *handle, flocation_t *loc, const ch return f; } -static void QDECL FSSTDIO_ClosePath(void *handle) +static void QDECL FSSTDIO_ClosePath(searchpathfuncs_t *handle) { Z_Free(handle); } -static qboolean QDECL FSSTDIO_PollChanges(void *handle) +static qboolean QDECL FSSTDIO_PollChanges(searchpathfuncs_t *handle) { // stdiopath_t *np = handle; return true; //can't verify that or not, so we have to assume the worst } -static int QDECL FSSTDIO_RebuildFSHash(const char *filename, int filesize, void *data, void *spath) +static int QDECL FSSTDIO_RebuildFSHash(const char *filename, int filesize, void *data, searchpathfuncs_t *spath) { - stdiopath_t *sp = spath; + stdiopath_t *sp = (void*)spath; void (QDECL *AddFileHash)(int depth, const char *fname, fsbucket_t *filehandle, void *pathhandle) = data; if (filename[strlen(filename)-1] == '/') { //this is actually a directory @@ -234,20 +233,19 @@ static int QDECL FSSTDIO_RebuildFSHash(const char *filename, int filesize, void AddFileHash(sp->depth, filename, NULL, sp); return true; } -static void QDECL FSSTDIO_BuildHash(void *handle, int depth, void (QDECL *AddFileHash)(int depth, const char *fname, fsbucket_t *filehandle, void *pathhandle)) +static void QDECL FSSTDIO_BuildHash(searchpathfuncs_t *handle, int depth, void (QDECL *AddFileHash)(int depth, const char *fname, fsbucket_t *filehandle, void *pathhandle)) { - stdiopath_t *sp = handle; + stdiopath_t *sp = (void*)handle; sp->depth = depth; sp->AddFileHash = AddFileHash; Sys_EnumerateFiles(sp->rootpath, "*", FSSTDIO_RebuildFSHash, AddFileHash, handle); } -static qboolean QDECL FSSTDIO_FLocate(void *handle, flocation_t *loc, const char *filename, void *hashedresult) +static qboolean QDECL FSSTDIO_FLocate(searchpathfuncs_t *handle, flocation_t *loc, const char *filename, void *hashedresult) { - stdiopath_t *sp = handle; + stdiopath_t *sp = (void*)handle; int len; char netpath[MAX_OSPATH]; - if (hashedresult && (void *)hashedresult != handle) return false; @@ -288,10 +286,9 @@ static qboolean QDECL FSSTDIO_FLocate(void *handle, flocation_t *loc, const char loc->index = 0; Q_strncpyz(loc->rawname, netpath, sizeof(loc->rawname)); } - return true; } -static void QDECL FSSTDIO_ReadFile(void *handle, flocation_t *loc, char *buffer) +static void QDECL FSSTDIO_ReadFile(searchpathfuncs_t *handle, flocation_t *loc, char *buffer) { FILE *f; size_t result; @@ -314,7 +311,7 @@ static int QDECL FSSTDIO_EnumerateFiles (searchpathfuncs_t *handle, const char * } -void *QDECL FSSTDIO_OpenPath(vfsfile_t *mustbenull, const char *desc) +searchpathfuncs_t *QDECL FSSTDIO_OpenPath(vfsfile_t *mustbenull, const char *desc) { stdiopath_t *np; int dlen = strlen(desc); @@ -335,7 +332,7 @@ void *QDECL FSSTDIO_OpenPath(vfsfile_t *mustbenull, const char *desc) np->pub.EnumerateFiles = FSSTDIO_EnumerateFiles; np->pub.OpenVFS = FSSTDIO_OpenVFS; np->pub.PollChanges = FSSTDIO_PollChanges; - return np; + return &np->pub; } #endif diff --git a/engine/common/fs_zip.c b/engine/common/fs_zip.c index 0a1f4a638..5ae4530c2 100644 --- a/engine/common/fs_zip.c +++ b/engine/common/fs_zip.c @@ -247,18 +247,18 @@ typedef struct zipfile_s } zipfile_t; -static void QDECL FSZIP_GetPathDetails(void *handle, char *out, unsigned int outlen) +static void QDECL FSZIP_GetPathDetails(searchpathfuncs_t *handle, char *out, unsigned int outlen) { - zipfile_t *zip = handle; + zipfile_t *zip = (void*)handle; if (zip->references != 1) Q_snprintfz(out, outlen, "(%i)", zip->references-1); else *out = '\0'; } -static void QDECL FSZIP_ClosePath(void *handle) +static void QDECL FSZIP_ClosePath(searchpathfuncs_t *handle) { - zipfile_t *zip = handle; + zipfile_t *zip = (void*)handle; if (--zip->references > 0) return; //not yet time @@ -268,9 +268,9 @@ static void QDECL FSZIP_ClosePath(void *handle) Z_Free(zip->files); Z_Free(zip); } -static void QDECL FSZIP_BuildHash(void *handle, int depth, void (QDECL *AddFileHash)(int depth, const char *fname, fsbucket_t *filehandle, void *pathhandle)) +static void QDECL FSZIP_BuildHash(searchpathfuncs_t *handle, int depth, void (QDECL *AddFileHash)(int depth, const char *fname, fsbucket_t *filehandle, void *pathhandle)) { - zipfile_t *zip = handle; + zipfile_t *zip = (void*)handle; int i; for (i = 0; i < zip->numfiles; i++) @@ -278,11 +278,11 @@ static void QDECL FSZIP_BuildHash(void *handle, int depth, void (QDECL *AddFileH AddFileHash(depth, zip->files[i].name, &zip->files[i].bucket, &zip->files[i]); } } -static qboolean QDECL FSZIP_FLocate(void *handle, flocation_t *loc, const char *filename, void *hashedresult) +static qboolean QDECL FSZIP_FLocate(searchpathfuncs_t *handle, flocation_t *loc, const char *filename, void *hashedresult) { zpackfile_t *pf = hashedresult; int i; - zipfile_t *zip = handle; + zipfile_t *zip = (void*)handle; // look through all the pak file elements @@ -325,9 +325,9 @@ static qboolean QDECL FSZIP_FLocate(void *handle, flocation_t *loc, const char * return false; } -static void QDECL FSZIP_ReadFile(void *handle, flocation_t *loc, char *buffer) +static void QDECL FSZIP_ReadFile(searchpathfuncs_t *handle, flocation_t *loc, char *buffer) { - zipfile_t *zip = handle; + zipfile_t *zip = (void*)handle; int err; unzLocateFileMy (zip->handle, loc->index, zip->files[loc->index].filepos); @@ -344,9 +344,9 @@ static void QDECL FSZIP_ReadFile(void *handle, flocation_t *loc, char *buffer) return; } -static int QDECL FSZIP_EnumerateFiles (void *handle, const char *match, int (QDECL *func)(const char *, int, void *, searchpathfuncs_t *spath), void *parm) +static int QDECL FSZIP_EnumerateFiles (searchpathfuncs_t *handle, const char *match, int (QDECL *func)(const char *, int, void *, searchpathfuncs_t *spath), void *parm) { - zipfile_t *zip = handle; + zipfile_t *zip = (void*)handle; int num; for (num = 0; num<(int)zip->numfiles; num++) @@ -361,9 +361,9 @@ static int QDECL FSZIP_EnumerateFiles (void *handle, const char *match, int (QDE return true; } -static int QDECL FSZIP_GeneratePureCRC(void *handle, int seed, int crctype) +static int QDECL FSZIP_GeneratePureCRC(searchpathfuncs_t *handle, int seed, int crctype) { - zipfile_t *zip = handle; + zipfile_t *zip = (void*)handle; unz_file_info file_info; int result; @@ -578,14 +578,14 @@ static void QDECL VFSZIP_Close (struct vfsfile_s *file) if (vfsz->defer) VFS_CLOSE(vfsz->defer); - FSZIP_ClosePath(vfsz->parent); + FSZIP_ClosePath(&vfsz->parent->pub); Z_Free(vfsz); } -static vfsfile_t *QDECL FSZIP_OpenVFS(void *handle, flocation_t *loc, const char *mode) +static vfsfile_t *QDECL FSZIP_OpenVFS(searchpathfuncs_t *handle, flocation_t *loc, const char *mode) { int rawofs; - zipfile_t *zip = handle; + zipfile_t *zip = (void*)handle; vfszip_t *vfsz; if (strcmp(mode, "rb")) diff --git a/engine/common/net_wins.c b/engine/common/net_wins.c index 962d91ae4..6b0f1a8e3 100644 --- a/engine/common/net_wins.c +++ b/engine/common/net_wins.c @@ -2426,8 +2426,10 @@ ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, i setsockopt(newsocket, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&_true, sizeof(_true)); #endif - +#ifdef _WIN32 + //win32 is so fucked up setsockopt(newsocket, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *)&_true, sizeof(_true)); +#endif bufsz = 1<<18; setsockopt(newsocket, SOL_SOCKET, SO_RCVBUF, (void*)&bufsz, sizeof(bufsz)); @@ -5230,7 +5232,7 @@ static qboolean NET_WasStun(netsrc_t netsrc) strcpy(stunmsg.uname, username); stunmsg.unattr.attrtype = BigShort(0x6); stunmsg.unattr.attrlen = BigShort(strlen(stunmsg.uname)); - stunmsg.hdr.msglen = BigShort(sizeof(stunmsg.unattr)+(strlen(stunmsg.uname)+3)&~3); + stunmsg.hdr.msglen = BigShort(sizeof(stunmsg.unattr)+((strlen(stunmsg.uname)+3)&~3)); NET_SendPacket(netsrc, sizeof(stunmsg.hdr) + BigShort(stunmsg.hdr.msglen), &stunmsg, &net_from); } @@ -5621,13 +5623,13 @@ int QDECL VFSTCP_ReadBytes (struct vfsfile_s *file, void *buffer, int bytestorea switch(e) { case ECONNABORTED: - Sys_Printf("connection aborted\n", e); + Sys_Printf("connection aborted\n"); break; case ECONNREFUSED: - Sys_Printf("connection refused\n", e); + Sys_Printf("connection refused\n"); break; case ECONNRESET: - Sys_Printf("connection reset\n", e); + Sys_Printf("connection reset\n"); break; default: Sys_Printf("socket error %i\n", e); diff --git a/engine/common/plugin.c b/engine/common/plugin.c index 0f935fa2a..547f1f130 100644 --- a/engine/common/plugin.c +++ b/engine/common/plugin.c @@ -375,7 +375,7 @@ plugin_t *Plug_Load(char *file, int type) return newplug; } -static int QDECL Plug_Emumerated (const char *name, int size, void *param, void *spath) +static int QDECL Plug_Emumerated (const char *name, int size, void *param, searchpathfuncs_t *spath) { char vmname[MAX_QPATH]; Q_strncpyz(vmname, name, sizeof(vmname)); @@ -385,7 +385,7 @@ static int QDECL Plug_Emumerated (const char *name, int size, void *param, void return true; } -static int QDECL Plug_EnumeratedRoot (const char *name, int size, void *param, void *spath) +static int QDECL Plug_EnumeratedRoot (const char *name, int size, void *param, searchpathfuncs_t *spath) { char vmname[MAX_QPATH]; int len; diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index c7445153d..2c4e7f183 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -1661,7 +1661,7 @@ void search_close_progs(pubprogfuncs_t *prinst, qboolean complain) prvm_nextsearchhandle = 0; //might as well. } -int QDECL search_enumerate(const char *name, int fsize, void *parm, void *spath) +int QDECL search_enumerate(const char *name, int fsize, void *parm, searchpathfuncs_t *spath) { prvmsearch_t *s = parm; @@ -2815,7 +2815,7 @@ void QCBUILTIN PF_buf_sort (pubprogfuncs_t *prinst, struct globalvars_s *pr_glo return; if (sortprefixlen <= 0) - sortprefixlen = INT_MAX; + sortprefixlen = 0x7fffffff; //take out the nulls first, to avoid weird/crashy sorting for (s = 0, d = 0, strings = strbuflist[bufno].strings; s < strbuflist[bufno].used; ) diff --git a/engine/common/q3common.c b/engine/common/q3common.c index df8a76aee..7f689a2ca 100644 --- a/engine/common/q3common.c +++ b/engine/common/q3common.c @@ -186,7 +186,7 @@ typedef struct { int bufferleft; int skip; } vmsearch_t; -static int QDECL VMEnum(const char *match, int size, void *args, void *spath) +static int QDECL VMEnum(const char *match, int size, void *args, searchpathfuncs_t *spath) { char *check; int newlen; @@ -210,13 +210,13 @@ static int QDECL VMEnum(const char *match, int size, void *args, void *spath) return true; } -static int QDECL IfFound(const char *match, int size, void *args, void *spath) +static int QDECL IfFound(const char *match, int size, void *args, searchpathfuncs_t *spath) { *(qboolean*)args = true; return true; } -static int QDECL VMEnumMods(const char *match, int size, void *args, void *spath) +static int QDECL VMEnumMods(const char *match, int size, void *args, searchpathfuncs_t *spath) { char *check; char desc[1024]; diff --git a/engine/common/sys.h b/engine/common/sys.h index 7bd4dd0b1..6069e396f 100644 --- a/engine/common/sys.h +++ b/engine/common/sys.h @@ -87,7 +87,7 @@ void Sys_ServerActivity(void); void Sys_SendKeyEvents (void); // Perform Key_Event () callbacks until the input que is empty -int Sys_EnumerateFiles (const char *gpath, const char *match, int (QDECL *func)(const char *fname, int fsize, void *parm, void *spath), void *parm, void *spath); +int Sys_EnumerateFiles (const char *gpath, const char *match, int (QDECL *func)(const char *fname, int fsize, void *parm, searchpathfuncs_t *spath), void *parm, searchpathfuncs_t *spath); void Sys_Vibrate(int count); diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index 3e4483da3..8eb488e3a 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -4700,7 +4700,7 @@ typedef struct { short xpos; short ypos; } doomimage_t; -static int QDECL FindDoomSprites(const char *name, int size, void *param, void *spath) +static int QDECL FindDoomSprites(const char *name, int size, void *param, searchpathfuncs_t *spath) { if (*(int *)param + strlen(name)+1 > 16000) Sys_Error("Too many doom sprites\n"); diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index dd310e660..e8330976b 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -3003,7 +3003,7 @@ void Shader_Free (shader_t *shader) -int QDECL Shader_InitCallback (const char *name, int size, void *param, void *spath) +int QDECL Shader_InitCallback (const char *name, int size, void *param, searchpathfuncs_t *spath) { strcpy(shaderbuf+shaderbuflen, name); Shader_MakeCache(shaderbuf+shaderbuflen); diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index 295832aa2..b6862a99c 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -1801,9 +1801,9 @@ void DumpGLState(void) qglGetIntegerv(GL_BLEND, &glint); Sys_Printf("GL_BLEND: %i\n", glint); qglGetIntegerv(GL_BLEND_SRC, &glint); - Sys_Printf("GL_BLEND_SRC: %i\n", DecodeGLEnum(glint)); + Sys_Printf("GL_BLEND_SRC: %s\n", DecodeGLEnum(glint)); qglGetIntegerv(GL_BLEND_DST, &glint); - Sys_Printf("GL_BLEND_DST: %i\n", DecodeGLEnum(glint)); + Sys_Printf("GL_BLEND_DST: %s\n", DecodeGLEnum(glint)); qglGetIntegerv(GL_DEPTH_WRITEMASK, &glint); Sys_Printf("GL_DEPTH_WRITEMASK: %i\n", glint); diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index 7b9a7d09a..c1de27c4c 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -1141,7 +1141,7 @@ static Cursor CreateNullCursor(Display *display, Window root) qboolean GLVID_ApplyGammaRamps(unsigned short *ramps) { extern qboolean gammaworks; - extern cvar_t vid_hardwaregamma; + //extern cvar_t vid_hardwaregamma; //if we don't know the original ramps yet, don't allow changing them, because we're probably invalid anyway, and even if it worked, it'll break something later. if (!vm.originalapplied) @@ -1652,8 +1652,6 @@ qboolean X11VID_Init (rendererstate_t *info, unsigned char *palette, int psl) if (fullscreenflags) fullscreenflags |= FULLSCREEN_ACTIVE; - vid.recalc_refdef = 1; // force a surface cache flush - // TODO: make this into a cvar, like "in_dgamouse", instead of parameters if (!COM_CheckParm("-noxi2") && XI2_Init()) { diff --git a/engine/http/ftpserver.c b/engine/http/ftpserver.c index e6ed08935..8dbf127ea 100644 --- a/engine/http/ftpserver.c +++ b/engine/http/ftpserver.c @@ -134,7 +134,7 @@ void FTP_ServerShutdown(void) } //we ought to filter this to remove duplicates. -static int QDECL SendFileNameTo(const char *rawname, int size, void *param, void *spath) +static int QDECL SendFileNameTo(const char *rawname, int size, void *param, searchpathfuncs_t *spath) { int socket = *(int*)param; // int i; diff --git a/engine/http/httpclient.c b/engine/http/httpclient.c index 8d57fa5b0..6e0636deb 100644 --- a/engine/http/httpclient.c +++ b/engine/http/httpclient.c @@ -341,7 +341,7 @@ struct http_dl_ctx_s { int chunksize; int chunked; - enum {HC_REQUESTING, HC_GETTINGHEADER, HC_GETTING, HC_DECOMPRESSING} state; + enum {HC_REQUESTING, HC_GETTINGHEADER, HC_GETTING} state; int contentlength; }; diff --git a/engine/libs/speex/libspeex/cb_search.c b/engine/libs/speex/libspeex/cb_search.c index 63f4c6a4b..08c1ad79d 100644 --- a/engine/libs/speex/libspeex/cb_search.c +++ b/engine/libs/speex/libspeex/cb_search.c @@ -524,14 +524,13 @@ spx_int32_t *seed VARDECL(int *ind); VARDECL(int *signs); const signed char *shape_cb; - int shape_cb_size, subvect_size, nb_subvect; + int subvect_size, nb_subvect; const split_cb_params *params; int have_sign; params = (const split_cb_params *) par; subvect_size = params->subvect_size; nb_subvect = params->nb_subvect; - shape_cb_size = 1<shape_bits; shape_cb = params->shape_cb; have_sign = params->have_sign; diff --git a/engine/libs/speex/libspeex/jitter.c b/engine/libs/speex/libspeex/jitter.c index 17bd044fc..59c4806a9 100644 --- a/engine/libs/speex/libspeex/jitter.c +++ b/engine/libs/speex/libspeex/jitter.c @@ -466,7 +466,6 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s { int i; unsigned int j; - int incomplete = 0; spx_int16_t opt; if (start_offset != NULL) @@ -571,7 +570,6 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s if (found) { i=besti; - incomplete = 1; /*fprintf (stderr, "incomplete: %d %d %d %d\n", jitter->packets[i].timestamp, jitter->pointer_timestamp, chunk_size, jitter->packets[i].span);*/ } } diff --git a/engine/libs/speex/libspeex/nb_celp.c b/engine/libs/speex/libspeex/nb_celp.c index 9dd726a0c..14906e8ed 100644 --- a/engine/libs/speex/libspeex/nb_celp.c +++ b/engine/libs/speex/libspeex/nb_celp.c @@ -1300,7 +1300,6 @@ int nb_decode(void *state, SpeexBits *bits, void *vout) { int offset; spx_word16_t *exc; - spx_word16_t *sp; spx_word16_t *innov_save = NULL; spx_word16_t tmp; @@ -1309,7 +1308,6 @@ int nb_decode(void *state, SpeexBits *bits, void *vout) /* Excitation */ exc=st->exc+offset; /* Original signal */ - sp=out+offset; if (st->innov_save) innov_save = st->innov_save+offset; @@ -1502,13 +1500,11 @@ int nb_decode(void *state, SpeexBits *bits, void *vout) { int offset; spx_word16_t *sp; - spx_word16_t *exc; /* Offset relative to start of frame */ offset = st->subframeSize*sub; /* Original signal */ sp=out+offset; /* Excitation */ - exc=st->exc+offset; /* LSP interpolation (quantized and unquantized) */ lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes); diff --git a/engine/libs/speex/libspeex/scal.c b/engine/libs/speex/libspeex/scal.c index c6abfd22d..23b83e7a8 100644 --- a/engine/libs/speex/libspeex/scal.c +++ b/engine/libs/speex/libspeex/scal.c @@ -148,7 +148,6 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i for (ch=0;chchannels;ch++) { int i; - int N=2*st->frame_size; float beta, beta2; float *x; float max_alpha = 0; diff --git a/engine/libs/speex/libspeex/vbr.c b/engine/libs/speex/libspeex/vbr.c index 5b7dd9bfa..8e82a7b62 100644 --- a/engine/libs/speex/libspeex/vbr.c +++ b/engine/libs/speex/libspeex/vbr.c @@ -126,7 +126,6 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p int i; float ener=0, ener1=0, ener2=0; float qual=7; - int va; float log_energy; float non_st=0; float voicing; @@ -159,7 +158,6 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p || (voicing<0 && non_st < .05)) { float tmp; - va = 0; vbr->consec_noise++; if (pow_ener > 3*vbr->noise_level) tmp = 3*vbr->noise_level; @@ -171,7 +169,6 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p vbr->noise_accum_count = .95*vbr->noise_accum_count + .05; } } else { - va = 1; vbr->consec_noise=0; } diff --git a/engine/qclib/qcc.h b/engine/qclib/qcc.h index d46f25b44..43650f7cd 100644 --- a/engine/qclib/qcc.h +++ b/engine/qclib/qcc.h @@ -294,7 +294,7 @@ typedef struct QCC_function_s QCC_function_t; #define MAX_PARMS 8 -typedef struct QCC_typeparam_s +struct QCC_typeparam_s { struct QCC_type_s *type; pbool optional; diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index 1c875dcc0..e9785a1e3 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -2892,7 +2892,7 @@ QCC_def_t *QCC_PR_GenerateAddressOf(int expressionstart, QCC_def_t *operand) operand->type = QCC_PR_PointerType(operand->type); return operand; } - else if (OP_LOADA_F <= statements[numstatements-1].op && statements[numstatements-1].op <= OP_LOADA_I || statements[numstatements-1].op == OP_LOADA_STRUCT) + else if ((OP_LOADA_F <= statements[numstatements-1].op && statements[numstatements-1].op <= OP_LOADA_I) || statements[numstatements-1].op == OP_LOADA_STRUCT) { statements[numstatements-1].op = OP_GLOBALADDRESS; operand->type = QCC_PR_PointerType(operand->type); @@ -4437,7 +4437,6 @@ void QCC_PR_EmitClassFromFunction(QCC_def_t *scope, QCC_type_t *basetype) QCC_def_t *ed; QCC_def_t *constructor = NULL; - pbool constructed = false; int basictypefield[ev_union+1]; // int func; @@ -8962,7 +8961,6 @@ QCC_def_t *QCC_PR_GetDef (QCC_type_t *type, char *name, QCC_def_t *scope, pbool } else { - int d=0, t=0; QCC_PR_ParseWarning (WARN_LAXCAST, "Optional arguments differ on redeclaration of %s. %s, should be %s",name, TypeName(type, typebuf1, sizeof(typebuf1)), TypeName(def->type, typebuf2, sizeof(typebuf2))); QCC_PR_ParsePrintDef(WARN_DUPLICATEDEFINITION, def); diff --git a/engine/qclib/qcc_pr_lex.c b/engine/qclib/qcc_pr_lex.c index b0c4bfc48..5b70c8bd8 100644 --- a/engine/qclib/qcc_pr_lex.c +++ b/engine/qclib/qcc_pr_lex.c @@ -3642,7 +3642,7 @@ int recursivefunctiontype; //expects a ( to have already been parsed. QCC_type_t *QCC_PR_ParseFunctionType (int newtype, QCC_type_t *returntype) { - QCC_type_t *ftype, *ptype; + QCC_type_t *ftype; char *name; int definenames = !recursivefunctiontype; int optional = 0; @@ -3655,7 +3655,6 @@ QCC_type_t *QCC_PR_ParseFunctionType (int newtype, QCC_type_t *returntype) ftype->aux_type = returntype; // return type ftype->num_parms = 0; - ptype = NULL; if (!QCC_PR_CheckToken (")")) @@ -3723,10 +3722,10 @@ QCC_type_t *QCC_PR_ParseFunctionType (int newtype, QCC_type_t *returntype) } QCC_type_t *QCC_PR_ParseFunctionTypeReacc (int newtype, QCC_type_t *returntype) { - QCC_type_t *ftype, *ptype; + QCC_type_t *ftype; // char *name; // char argname[64]; - int definenames = !recursivefunctiontype; +// int definenames = !recursivefunctiontype; recursivefunctiontype++; @@ -3734,7 +3733,6 @@ QCC_type_t *QCC_PR_ParseFunctionTypeReacc (int newtype, QCC_type_t *returntype) ftype->aux_type = returntype; // return type ftype->num_parms = 0; - ptype = NULL; if (!QCC_PR_CheckToken (")")) @@ -4111,9 +4109,8 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail) //static members are technically funny-named globals, and do not generate fields. if (isstatic || (newparm->type == ev_function && !arraysize)) { - QCC_def_t *def; sprintf(membername, "%s::%s", classname, parmname); - def = QCC_PR_GetDef(newparm, membername, NULL, true, 0, GDF_CONST); + QCC_PR_GetDef(newparm, membername, NULL, true, 0, GDF_CONST); if (isstatic) continue; diff --git a/engine/server/sv_ccmds.c b/engine/server/sv_ccmds.c index 8133a36be..aa3699fa5 100644 --- a/engine/server/sv_ccmds.c +++ b/engine/server/sv_ccmds.c @@ -374,7 +374,7 @@ void SV_Give_f (void) } } -int QDECL ShowMapList (const char *name, int flags, void *parm, void *spath) +int QDECL ShowMapList (const char *name, int flags, void *parm, searchpathfuncs_t *spath) { if (name[5] == 'b' && name[6] == '_') //skip box models return true; @@ -1899,7 +1899,7 @@ void SV_User_f (void) for (u = 0; u < 32; u++) if (cl->fteprotocolextensions2 & (1u<netchan.remote_address)); switch(cl->realip_status) diff --git a/engine/server/sv_mvd.c b/engine/server/sv_mvd.c index 5fe14859e..0db70eb29 100644 --- a/engine/server/sv_mvd.c +++ b/engine/server/sv_mvd.c @@ -683,7 +683,7 @@ typedef struct #define SORT_NO 0 #define SORT_BY_DATE 1 -int QDECL Sys_listdirFound(const char *fname, int fsize, void *uptr, void *spath) +int QDECL Sys_listdirFound(const char *fname, int fsize, void *uptr, searchpathfuncs_t *spath) { file_t *f; dir_t *dir = uptr; diff --git a/engine/server/svq2_game.c b/engine/server/svq2_game.c index 81c2ca924..20c338759 100644 --- a/engine/server/svq2_game.c +++ b/engine/server/svq2_game.c @@ -55,7 +55,7 @@ void *SVQ2_GetGameAPI (void *parms) snprintf(name, sizeof(name), "%s%s", searchpath, gamename[o]); q2gamedll = Sys_LoadLibrary(name, funcs); - if (q2gamedll && gamename) + if (q2gamedll) { ret = GetGameAPI(parms); if (ret)