1
0
Fork 0
forked from fte/fteqw

fixed a few warnings and errors

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4399 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2013-06-23 03:59:48 +00:00
parent 1e423d106f
commit b6252d940c
44 changed files with 124 additions and 151 deletions

View file

@ -381,6 +381,7 @@ void AAS_Accelerate(vec3_t velocity, float frametime, vec3_t wishdir, float wish
velocity[i] += accelspeed*wishdir[i]; velocity[i] += accelspeed*wishdir[i];
} }
} //end of the function AAS_Accelerate } //end of the function AAS_Accelerate
/*
//=========================================================================== //===========================================================================
// //
// Parameter: - // Parameter: -
@ -393,6 +394,7 @@ void AAS_AirControl(vec3_t start, vec3_t end, vec3_t velocity, vec3_t cmdmove)
VectorSubtract(end, start, dir); VectorSubtract(end, start, dir);
} //end of the function AAS_AirControl } //end of the function AAS_AirControl
*/
//=========================================================================== //===========================================================================
// applies ground friction to the given velocity // 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 phys_maxstep, phys_maxsteepness, phys_jumpvel, friction;
float gravity, delta, maxvel, wishspeed, accelerate; float gravity, delta, maxvel, wishspeed, accelerate;
//float velchange, newvel; //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; int areas[20], numareas;
vec3_t points[20]; vec3_t points[20];
vec3_t org, end, feet, start, stepend, lastorg, wishdir; vec3_t org, end, feet, start, stepend, lastorg, wishdir;
@ -574,7 +576,6 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
//apply command movement //apply command movement
if (n < cmdframes) if (n < cmdframes)
{ {
ax = 0;
maxvel = phys_maxwalkvelocity; maxvel = phys_maxwalkvelocity;
accelerate = phys_airaccelerate; accelerate = phys_airaccelerate;
VectorCopy(cmdmove, wishdir); VectorCopy(cmdmove, wishdir);
@ -598,13 +599,11 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
{ {
accelerate = phys_walkaccelerate; accelerate = phys_walkaccelerate;
} //end else } //end else
ax = 2;
} //end if } //end if
if (swimming) if (swimming)
{ {
maxvel = phys_maxswimvelocity; maxvel = phys_maxswimvelocity;
accelerate = phys_swimaccelerate; accelerate = phys_swimaccelerate;
ax = 3;
} //end if } //end if
else else
{ {

View file

@ -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 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; float volume, bestareavolume;
vec3_t areastart, cmdmove, bboxmins, bboxmaxs; vec3_t areastart, cmdmove, bboxmins, bboxmaxs;
vec3_t absmins, absmaxs, velocity; 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); VectorSet(cmdmove, 0, 0, 0);
Com_Memset(&move, 0, sizeof(aas_clientmove_t)); Com_Memset(&move, 0, sizeof(aas_clientmove_t));
area2num = 0;
AAS_ClientMovementHitBBox(&move, -1, areastart, PRESENCE_NORMAL, qfalse, AAS_ClientMovementHitBBox(&move, -1, areastart, PRESENCE_NORMAL, qfalse,
velocity, cmdmove, 0, 30, 0.1f, bboxmins, bboxmaxs, bot_visualizejumppads); velocity, cmdmove, 0, 30, 0.1f, bboxmins, bboxmaxs, bot_visualizejumppads);
if (move.frames < 30) if (move.frames < 30)
@ -837,7 +836,6 @@ int AAS_Reachability_Swim(int area1num, int area2num)
{ {
int i, j, face1num, face2num, side1; int i, j, face1num, face2num, side1;
aas_area_t *area1, *area2; aas_area_t *area1, *area2;
aas_areasettings_t *areasettings;
aas_lreachability_t *lreach; aas_lreachability_t *lreach;
aas_face_t *face1; aas_face_t *face1;
aas_plane_t *plane; aas_plane_t *plane;
@ -875,7 +873,6 @@ int AAS_Reachability_Swim(int area1num, int area2num)
{ {
// //
face1 = &aasworld.faces[face1num]; face1 = &aasworld.faces[face1num];
areasettings = &aasworld.areasettings[area1num];
//create a new reachability link //create a new reachability link
lreach = AAS_AllocReachability(); lreach = AAS_AllocReachability();
if (!lreach) return qfalse; 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 ground_bestarea2groundedgenum, ground_foundreach;
int water_bestarea2groundedgenum, water_foundreach; int water_bestarea2groundedgenum, water_foundreach;
int side1, area1swim, faceside1, groundface1num; 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 x1, x2, x3, x4, y1, y2, y3, y4, tmp, y;
float length, ground_bestlength, water_bestlength, ground_bestdist, water_bestdist; float length, ground_bestlength, water_bestlength, ground_bestdist, water_bestdist;
vec3_t v1, v2, v3, v4, tmpv, p1area1, p1area2, p2area1, p2area2; 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; vec3_t testpoint;
aas_plane_t *plane; aas_plane_t *plane;
aas_area_t *area1, *area2; 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_edge_t *edge1, *edge2;
aas_lreachability_t *lreach; aas_lreachability_t *lreach;
aas_trace_t trace; 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 //edges if they overlap in the direction orthogonal to
//the gravity direction //the gravity direction
CrossProduct(invgravity, normal, ort); CrossProduct(invgravity, normal, ort);
invgravitydot = DotProduct(invgravity, invgravity); //invgravitydot = DotProduct(invgravity, invgravity);
ortdot = DotProduct(ort, ort); ortdot = DotProduct(ort, ort);
//projection into the step plane //projection into the step plane
//NOTE: since gravity is vertical this is just the z coordinate //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_bestlength = length;
ground_foundreach = qtrue; ground_foundreach = qtrue;
ground_bestarea2groundedgenum = edge1num; ground_bestarea2groundedgenum = edge1num;
ground_bestface1 = groundface1;
//best point towards area1 //best point towards area1
VectorCopy(start, ground_beststart); VectorCopy(start, ground_beststart);
//normal is pointing into area2 //normal is pointing into area2
@ -1323,7 +1319,6 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
water_bestlength = length; water_bestlength = length;
water_foundreach = qtrue; water_foundreach = qtrue;
water_bestarea2groundedgenum = edge1num; water_bestarea2groundedgenum = edge1num;
water_bestface1 = groundface1;
//best point towards area1 //best point towards area1
VectorCopy(start, water_beststart); VectorCopy(start, water_beststart);
//normal is pointing into area2 //normal is pointing into area2
@ -3492,7 +3487,7 @@ void AAS_Reachability_JumpPad(void)
int face2num, i, ret, area2num, visualize, ent, bot_visualizejumppads; int face2num, i, ret, area2num, visualize, ent, bot_visualizejumppads;
//int modelnum, ent2; //int modelnum, ent2;
//float dist, time, height, gravity, forward; //float dist, time, height, gravity, forward;
float speed, zvel, hordist; float speed, zvel;
aas_face_t *face2; aas_face_t *face2;
aas_area_t *area2; aas_area_t *area2;
aas_lreachability_t *lreach; aas_lreachability_t *lreach;
@ -3714,7 +3709,7 @@ void AAS_Reachability_JumpPad(void)
//direction towards the face center //direction towards the face center
VectorSubtract(facecenter, areastart, dir); VectorSubtract(facecenter, areastart, dir);
dir[2] = 0; dir[2] = 0;
hordist = VectorNormalize(dir); //hordist = VectorNormalize(dir);
//if (hordist < 1.6 * facecenter[2] - areastart[2]) //if (hordist < 1.6 * facecenter[2] - areastart[2])
{ {
//get command movement //get command movement
@ -3997,7 +3992,7 @@ void AAS_SetWeaponJumpAreaFlags(void)
int AAS_Reachability_WeaponJump(int area1num, int area2num) int AAS_Reachability_WeaponJump(int area1num, int area2num)
{ {
int face2num, i, n, ret, visualize; int face2num, i, n, ret, visualize;
float speed, zvel, hordist; float speed, zvel;
aas_face_t *face2; aas_face_t *face2;
aas_area_t *area1, *area2; aas_area_t *area1, *area2;
aas_lreachability_t *lreach; aas_lreachability_t *lreach;
@ -4057,7 +4052,7 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num)
//direction towards the face center //direction towards the face center
VectorSubtract(facecenter, areastart, dir); VectorSubtract(facecenter, areastart, dir);
dir[2] = 0; dir[2] = 0;
hordist = VectorNormalize(dir); //hordist = VectorNormalize(dir);
//if (hordist < 1.6 * (facecenter[2] - areastart[2])) //if (hordist < 1.6 * (facecenter[2] - areastart[2]))
{ {
//get command movement //get command movement

View file

@ -887,7 +887,7 @@ void AAS_InitRoutingUpdate(void)
//=========================================================================== //===========================================================================
void AAS_CreateAllRoutingCache(void) void AAS_CreateAllRoutingCache(void)
{ {
int i, j, t; int i, j;
aasworld.initialized = qtrue; aasworld.initialized = qtrue;
botimport.Print(PRT_MESSAGE, "AAS_CreateAllRoutingCache\n"); botimport.Print(PRT_MESSAGE, "AAS_CreateAllRoutingCache\n");
@ -898,7 +898,7 @@ void AAS_CreateAllRoutingCache(void)
{ {
if (i == j) continue; if (i == j) continue;
if (!AAS_AreaReachability(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); //Log_Write("traveltime from %d to %d is %d", i, j, t);
} //end for } //end for
} //end for } //end for

View file

@ -2939,7 +2939,7 @@ int BotAllocChatState(void)
//======================================================================== //========================================================================
void BotFreeChatState(int handle) void BotFreeChatState(int handle)
{ {
bot_chatstate_t *cs; //bot_chatstate_t *cs;
bot_consolemessage_t m; bot_consolemessage_t m;
int h; int h;
@ -2953,7 +2953,7 @@ void BotFreeChatState(int handle)
botimport.Print(PRT_FATAL, "invalid chat state %d\n", handle); botimport.Print(PRT_FATAL, "invalid chat state %d\n", handle);
return; return;
} //end if } //end if
cs = botchatstates[handle]; //cs = botchatstates[handle];
if (LibVarGetValue("bot_reloadcharacters")) if (LibVarGetValue("bot_reloadcharacters"))
{ {
BotFreeChatFile(handle); BotFreeChatFile(handle);

View file

@ -51,7 +51,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================================== //===========================================================================
int GeneticSelection(int numranks, float *rankings) int GeneticSelection(int numranks, float *rankings)
{ {
float sum, select; float sum;
int i, index; int i, index;
sum = 0; sum = 0;
@ -64,7 +64,7 @@ int GeneticSelection(int numranks, float *rankings)
{ {
//select a bot where the ones with the higest rankings have //select a bot where the ones with the higest rankings have
//the highest chance of being selected //the highest chance of being selected
select = random() * sum; // select = random() * sum;
for (i = 0; i < numranks; i++) for (i = 0; i < numranks; i++)
{ {
if (rankings[i] < 0) continue; if (rankings[i] < 0) continue;

View file

@ -230,6 +230,7 @@ void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child)
InterbreedWeightConfigs(p1->itemweightconfig, p2->itemweightconfig, InterbreedWeightConfigs(p1->itemweightconfig, p2->itemweightconfig,
c->itemweightconfig); c->itemweightconfig);
} //end of the function BotInterbreedingGoalFuzzyLogic } //end of the function BotInterbreedingGoalFuzzyLogic
//=========================================================================== //===========================================================================
// //
// Parameter: - // Parameter: -
@ -238,12 +239,13 @@ void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child)
//=========================================================================== //===========================================================================
void BotSaveGoalFuzzyLogic(int goalstate, char *filename) void BotSaveGoalFuzzyLogic(int goalstate, char *filename)
{ {
bot_goalstate_t *gs; //bot_goalstate_t *gs;
gs = BotGoalStateFromHandle(goalstate); //gs = BotGoalStateFromHandle(goalstate);
//WriteWeightConfig(filename, gs->itemweightconfig); //WriteWeightConfig(filename, gs->itemweightconfig);
} //end of the function BotSaveGoalFuzzyLogic } //end of the function BotSaveGoalFuzzyLogic
//=========================================================================== //===========================================================================
// //
// Parameter: - // Parameter: -

View file

@ -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) bot_moveresult_t BotFinishTravel_BarrierJump(bot_movestate_t *ms, aas_reachability_t *reach)
{ {
float dist;
vec3_t hordir; vec3_t hordir;
bot_moveresult_t_cleared( result ); 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[0] = reach->end[0] - ms->origin[0];
hordir[1] = reach->end[1] - ms->origin[1]; hordir[1] = reach->end[1] - ms->origin[1];
hordir[2] = 0; hordir[2] = 0;
dist = VectorNormalize(hordir); VectorNormalize(hordir);
// //
BotCheckBlocked(ms, hordir, qtrue, &result); 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) bot_moveresult_t BotFinishTravel_WaterJump(bot_movestate_t *ms, aas_reachability_t *reach)
{ {
vec3_t dir, pnt; vec3_t dir, pnt;
float dist;
bot_moveresult_t_cleared( result ); bot_moveresult_t_cleared( result );
//botimport.Print(PRT_MESSAGE, "BotFinishTravel_WaterJump\n"); //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[0] += crandom() * 10;
dir[1] += crandom() * 10; dir[1] += crandom() * 10;
dir[2] += 70 + crandom() * 10; dir[2] += 70 + crandom() * 10;
dist = VectorNormalize(dir); VectorNormalize(dir);
//elemantary actions //elemantary actions
EA_Move(ms->client, dir, 400); EA_Move(ms->client, dir, 400);
//set the ideal view angles //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) bot_moveresult_t BotTravel_JumpPad(bot_movestate_t *ms, aas_reachability_t *reach)
{ {
float dist, speed; float speed;
vec3_t hordir; vec3_t hordir;
bot_moveresult_t_cleared( result ); 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[0] = reach->start[0] - ms->origin[0];
hordir[1] = reach->start[1] - ms->origin[1]; hordir[1] = reach->start[1] - ms->origin[1];
hordir[2] = 0; hordir[2] = 0;
dist = VectorNormalize(hordir); VectorNormalize(hordir);
// //
BotCheckBlocked(ms, hordir, qtrue, &result); BotCheckBlocked(ms, hordir, qtrue, &result);
speed = 400; speed = 400;

View file

@ -348,7 +348,7 @@ int BotExportTest(int parm0, char *parm1, vec3_t parm2, vec3_t parm3)
static int line[2]; static int line[2];
int newarea, i, highlightarea, flood; int newarea, i, highlightarea, flood;
// int reachnum; // int reachnum;
vec3_t eye, forward, right, end, origin; vec3_t eye, forward, right, origin;
// vec3_t bottomcenter; // vec3_t bottomcenter;
// aas_trace_t trace; // aas_trace_t trace;
// aas_face_t *face; // aas_face_t *face;
@ -358,8 +358,8 @@ int BotExportTest(int parm0, char *parm1, vec3_t parm2, vec3_t parm3)
// bot_goal_t goal; // bot_goal_t goal;
// clock_t start_time, end_time; // clock_t start_time, end_time;
vec3_t mins = {-16, -16, -24}; //vec3_t mins = {-16, -16, -24};
vec3_t maxs = {16, 16, 32}; //vec3_t maxs = {16, 16, 32};
// int areas[10], numareas; // 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 //get the eye 24 units up
eye[2] += 24; eye[2] += 24;
//get the end point for the line to be traced //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); // AAS_TestMovementPrediction(1, parm2, forward);
/* /*

View file

@ -1704,7 +1704,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
int questmarkintvalue = 0; int questmarkintvalue = 0;
float questmarkfloatvalue = 0; float questmarkfloatvalue = 0;
int gotquestmarkvalue = qfalse; int gotquestmarkvalue = qfalse;
int lastoperatortype = 0; //int lastoperatortype = 0;
// //
operator_t operator_heap[MAX_OPERATORS]; operator_t operator_heap[MAX_OPERATORS];
int numoperators = 0; 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); else Log_Write("result value = %f", v1->floatvalue);
#endif //DEBUG_EVAL #endif //DEBUG_EVAL
if (error) break; if (error) break;
lastoperatortype = o->operator; //lastoperatortype = o->operator;
//if not an operator with arity 1 //if not an operator with arity 1
if (o->operator != P_LOGIC_NOT if (o->operator != P_LOGIC_NOT
&& o->operator != P_BIN_NOT) && o->operator != P_BIN_NOT)

View file

@ -276,7 +276,7 @@ void CL_UpdateWindowTitle(void)
default: default:
#ifndef CLIENTONLY #ifndef CLIENTONLY
if (sv.state) if (sv.state)
VID_SetWindowCaption(va("%s", fs_gamename.string, sv.name)); VID_SetWindowCaption(va("%s: %s", fs_gamename.string, sv.name));
else else
#endif #endif
VID_SetWindowCaption(va("%s: %s", fs_gamename.string, cls.servername)); VID_SetWindowCaption(va("%s: %s", fs_gamename.string, cls.servername));

View file

@ -429,7 +429,7 @@ void M_Media_Draw (void)
char compleatenamepath[MAX_OSPATH]; char compleatenamepath[MAX_OSPATH];
char compleatenamename[MAX_OSPATH]; char compleatenamename[MAX_OSPATH];
qboolean compleatenamemultiple; 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) if (*compleatenamename)
compleatenamemultiple = true; compleatenamemultiple = true;

View file

@ -188,7 +188,7 @@ typedef struct {
int match; int match;
} q2skinsearch_t; } 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]; char blah[MAX_QPATH];
q2skinsearch_t *s = parm; q2skinsearch_t *s = parm;

View file

@ -498,7 +498,7 @@ static qboolean M_DemoKey(menucustom_t *control, menu_t *menu, int key)
return false; 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; int extnum;
demomenu_t *menu = parm; demomenu_t *menu = parm;
@ -660,7 +660,7 @@ static void ShowDemoMenu (menu_t *menu, const char *path)
{ {
info->fsroot = FS_ROOT; info->fsroot = FS_ROOT;
FS_NativePath("", FS_ROOT, info->path, sizeof(info->path)); FS_NativePath("", FS_ROOT, info->path, sizeof(info->path));
while(s = strchr(info->path, '\\')) while((s = strchr(info->path, '\\')))
*s = '/'; *s = '/';
} }
} }
@ -700,7 +700,7 @@ static void ShowDemoMenu (menu_t *menu, const char *path)
} }
else if (info->fsroot == FS_GAME) else if (info->fsroot == FS_GAME)
{ {
Q_snprintfz(match, sizeof(match), "../", info->path); Q_snprintfz(match, sizeof(match), "../");
DemoAddItem(match, 0, info, NULL); DemoAddItem(match, 0, info, NULL);
} }
if (info->fsroot == FS_ROOT) if (info->fsroot == FS_ROOT)

View file

@ -1242,7 +1242,7 @@ static void QCBUILTIN PF_R_ClearScene (pubprogfuncs_t *prinst, struct globalvars
CL_ClearEntityLists(); CL_ClearEntityLists();
V_ClearRefdef(csqc_playerview); 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; csqc_addcrosshair = false;
V_CalcRefdef(csqc_playerview); //set up the defaults V_CalcRefdef(csqc_playerview); //set up the defaults

View file

@ -474,14 +474,13 @@ void S_Voip_Decode(unsigned int sender, unsigned int codec, unsigned int gen, un
{ {
unsigned char *start; unsigned char *start;
short decodebuf[8192]; short decodebuf[8192];
unsigned int decodesamps, len, newseq, drops; unsigned int decodesamps, len, drops;
int r; int r;
if (sender >= MAX_CLIENTS) if (sender >= MAX_CLIENTS)
return; return;
decodesamps = 0; decodesamps = 0;
newseq = 0;
drops = 0; drops = 0;
start = data; start = data;

View file

@ -394,7 +394,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
return 1; 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; DIR *dir;
char apath[MAX_OSPATH]; char apath[MAX_OSPATH];

View file

@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h" #include "quakedef.h"
#include "winquake.h" #include "winquake.h"
#include "glquake.h"
#include <ctype.h> // for isdigit(); #include <ctype.h> // for isdigit();
@ -1441,7 +1442,6 @@ void R_DrawNameTags(void)
#ifdef GLQUAKE #ifdef GLQUAKE
if (qrenderer == QR_OPENGL) if (qrenderer == QR_OPENGL)
{ {
void GL_Set2D (qboolean flipped);
GL_Set2D(false); GL_Set2D(false);
} }
#endif #endif

View file

@ -2181,7 +2181,7 @@ static qboolean VARGS Mod_TryAddSkin(const char *skinname, ...)
return true; 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); Mod_TryAddSkin(name);
return true; return true;

View file

@ -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++) for (j = 0; j < sizeof(man->package[i].mirrors) / sizeof(man->package[i].mirrors[0]); j++)
if (man->package[i].mirrors[j]) if (man->package[i].mirrors[j])
Con_Printf(" \"%s\"", 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; searchpath_t *s;
for (s=com_searchpaths ; s ; s=s->next) 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) if (*crc)
{ {
Q_strncatz(local, ".", llen); 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); Q_strncatz(local, hex, llen);
} }
return true; 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; 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; FILE *f;
DWORD resultlen; 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; FILE *f;
DWORD resultlen; DWORD resultlen;
@ -2893,7 +2892,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base
{ {
#ifdef __linux__ #ifdef __linux__
struct stat sb; struct stat sb;
if (!strcmp(gamename, "q1")) if (!strcmp(gamename, "quake"))
{ {
if (stat("/usr/share/quake/", &sb) == 0) 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 //fixme: cope with windows paths
qboolean baseisurl = !!strchr(base, ':'); qboolean baseisurl = !!strchr(base, ':');
qboolean fileisurl = !!strchr(file, ':'); qboolean fileisurl = !!strchr(file, ':');
qboolean baseisabsolute = (*base == '/' || *base == '\\'); //qboolean baseisabsolute = (*base == '/' || *base == '\\');
qboolean fileisabsolute = (*file == '/' || *file == '\\'); qboolean fileisabsolute = (*file == '/' || *file == '\\');
char *ebase; char *ebase;

View file

@ -63,9 +63,9 @@ static void QDECL FSPAK_GetPathDetails(searchpathfuncs_t *handle, char *out, uns
if (pak->references != 1) if (pak->references != 1)
Q_snprintfz(out, outlen, "(%i)", 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--; pak->references--;
if (pak->references > 0) if (pak->references > 0)
@ -77,9 +77,9 @@ static void QDECL FSPAK_ClosePath(void *handle)
Z_Free(pak->files); Z_Free(pak->files);
Z_Free(pak); 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; int i;
for (i = 0; i < pak->numfiles; 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]); 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; mpackfile_t *pf = hashedresult;
int i; int i;
pack_t *pak = handle; pack_t *pak = (void*)handle;
// look through all the pak file elements // look through all the pak file elements
@ -142,9 +142,9 @@ static int QDECL FSPAK_EnumerateFiles (searchpathfuncs_t *handle, const char *ma
return true; 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 result;
int *filecrcs; int *filecrcs;
@ -228,10 +228,10 @@ unsigned long QDECL VFSPAK_GetLen (struct vfsfile_s *vfs)
void QDECL VFSPAK_Close(vfsfile_t *vfs) void QDECL VFSPAK_Close(vfsfile_t *vfs)
{ {
vfspack_t *vfsp = (vfspack_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. 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; pack_t *pack = (pack_t*)handle;
vfspack_t *vfs; vfspack_t *vfs;
@ -261,7 +261,7 @@ vfsfile_t *QDECL FSPAK_OpenVFS(void *handle, flocation_t *loc, const char *mode)
return (vfsfile_t *)vfs; 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; vfsfile_t *f;
f = FSPAK_OpenVFS(handle, loc, "rb"); f = FSPAK_OpenVFS(handle, loc, "rb");

View file

@ -197,11 +197,10 @@ vfsfile_t *VFSOS_Open(const char *osname, const char *mode)
#endif #endif
#ifndef WEBSVONLY #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; vfsfile_t *f;
stdiopath_t *sp = handle; stdiopath_t *sp = (void*)handle;
char diskname[MAX_OSPATH];
qboolean needsflush; qboolean needsflush;
f = VFSSTDIO_Open(loc->rawname, mode, &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; return f;
} }
static void QDECL FSSTDIO_ClosePath(void *handle) static void QDECL FSSTDIO_ClosePath(searchpathfuncs_t *handle)
{ {
Z_Free(handle); Z_Free(handle);
} }
static qboolean QDECL FSSTDIO_PollChanges(void *handle) static qboolean QDECL FSSTDIO_PollChanges(searchpathfuncs_t *handle)
{ {
// stdiopath_t *np = handle; // stdiopath_t *np = handle;
return true; //can't verify that or not, so we have to assume the worst 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; void (QDECL *AddFileHash)(int depth, const char *fname, fsbucket_t *filehandle, void *pathhandle) = data;
if (filename[strlen(filename)-1] == '/') if (filename[strlen(filename)-1] == '/')
{ //this is actually a directory { //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); AddFileHash(sp->depth, filename, NULL, sp);
return true; 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->depth = depth;
sp->AddFileHash = AddFileHash; sp->AddFileHash = AddFileHash;
Sys_EnumerateFiles(sp->rootpath, "*", FSSTDIO_RebuildFSHash, AddFileHash, handle); 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; int len;
char netpath[MAX_OSPATH]; char netpath[MAX_OSPATH];
if (hashedresult && (void *)hashedresult != handle) if (hashedresult && (void *)hashedresult != handle)
return false; return false;
@ -288,10 +286,9 @@ static qboolean QDECL FSSTDIO_FLocate(void *handle, flocation_t *loc, const char
loc->index = 0; loc->index = 0;
Q_strncpyz(loc->rawname, netpath, sizeof(loc->rawname)); Q_strncpyz(loc->rawname, netpath, sizeof(loc->rawname));
} }
return true; 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; FILE *f;
size_t result; 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; stdiopath_t *np;
int dlen = strlen(desc); 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.EnumerateFiles = FSSTDIO_EnumerateFiles;
np->pub.OpenVFS = FSSTDIO_OpenVFS; np->pub.OpenVFS = FSSTDIO_OpenVFS;
np->pub.PollChanges = FSSTDIO_PollChanges; np->pub.PollChanges = FSSTDIO_PollChanges;
return np; return &np->pub;
} }
#endif #endif

View file

@ -247,18 +247,18 @@ typedef struct zipfile_s
} zipfile_t; } 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) if (zip->references != 1)
Q_snprintfz(out, outlen, "(%i)", zip->references-1); Q_snprintfz(out, outlen, "(%i)", zip->references-1);
else else
*out = '\0'; *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) if (--zip->references > 0)
return; //not yet time return; //not yet time
@ -268,9 +268,9 @@ static void QDECL FSZIP_ClosePath(void *handle)
Z_Free(zip->files); Z_Free(zip->files);
Z_Free(zip); 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; int i;
for (i = 0; i < zip->numfiles; 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]); 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; zpackfile_t *pf = hashedresult;
int i; int i;
zipfile_t *zip = handle; zipfile_t *zip = (void*)handle;
// look through all the pak file elements // 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; 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; int err;
unzLocateFileMy (zip->handle, loc->index, zip->files[loc->index].filepos); 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; 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; int num;
for (num = 0; num<(int)zip->numfiles; 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; 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; unz_file_info file_info;
int result; int result;
@ -578,14 +578,14 @@ static void QDECL VFSZIP_Close (struct vfsfile_s *file)
if (vfsz->defer) if (vfsz->defer)
VFS_CLOSE(vfsz->defer); VFS_CLOSE(vfsz->defer);
FSZIP_ClosePath(vfsz->parent); FSZIP_ClosePath(&vfsz->parent->pub);
Z_Free(vfsz); 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; int rawofs;
zipfile_t *zip = handle; zipfile_t *zip = (void*)handle;
vfszip_t *vfsz; vfszip_t *vfsz;
if (strcmp(mode, "rb")) if (strcmp(mode, "rb"))

View file

@ -2426,8 +2426,10 @@ ftenet_generic_connection_t *FTENET_Generic_EstablishConnection(int adrfamily, i
setsockopt(newsocket, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&_true, sizeof(_true)); setsockopt(newsocket, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&_true, sizeof(_true));
#endif #endif
#ifdef _WIN32
//win32 is so fucked up
setsockopt(newsocket, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *)&_true, sizeof(_true)); setsockopt(newsocket, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *)&_true, sizeof(_true));
#endif
bufsz = 1<<18; bufsz = 1<<18;
setsockopt(newsocket, SOL_SOCKET, SO_RCVBUF, (void*)&bufsz, sizeof(bufsz)); 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); strcpy(stunmsg.uname, username);
stunmsg.unattr.attrtype = BigShort(0x6); stunmsg.unattr.attrtype = BigShort(0x6);
stunmsg.unattr.attrlen = BigShort(strlen(stunmsg.uname)); 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); 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) switch(e)
{ {
case ECONNABORTED: case ECONNABORTED:
Sys_Printf("connection aborted\n", e); Sys_Printf("connection aborted\n");
break; break;
case ECONNREFUSED: case ECONNREFUSED:
Sys_Printf("connection refused\n", e); Sys_Printf("connection refused\n");
break; break;
case ECONNRESET: case ECONNRESET:
Sys_Printf("connection reset\n", e); Sys_Printf("connection reset\n");
break; break;
default: default:
Sys_Printf("socket error %i\n", e); Sys_Printf("socket error %i\n", e);

View file

@ -375,7 +375,7 @@ plugin_t *Plug_Load(char *file, int type)
return newplug; 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]; char vmname[MAX_QPATH];
Q_strncpyz(vmname, name, sizeof(vmname)); 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; 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]; char vmname[MAX_QPATH];
int len; int len;

View file

@ -1661,7 +1661,7 @@ void search_close_progs(pubprogfuncs_t *prinst, qboolean complain)
prvm_nextsearchhandle = 0; //might as well. 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; prvmsearch_t *s = parm;
@ -2815,7 +2815,7 @@ void QCBUILTIN PF_buf_sort (pubprogfuncs_t *prinst, struct globalvars_s *pr_glo
return; return;
if (sortprefixlen <= 0) if (sortprefixlen <= 0)
sortprefixlen = INT_MAX; sortprefixlen = 0x7fffffff;
//take out the nulls first, to avoid weird/crashy sorting //take out the nulls first, to avoid weird/crashy sorting
for (s = 0, d = 0, strings = strbuflist[bufno].strings; s < strbuflist[bufno].used; ) for (s = 0, d = 0, strings = strbuflist[bufno].strings; s < strbuflist[bufno].used; )

View file

@ -186,7 +186,7 @@ typedef struct {
int bufferleft; int bufferleft;
int skip; int skip;
} vmsearch_t; } 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; char *check;
int newlen; int newlen;
@ -210,13 +210,13 @@ static int QDECL VMEnum(const char *match, int size, void *args, void *spath)
return true; 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; *(qboolean*)args = true;
return 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 *check;
char desc[1024]; char desc[1024];

View file

@ -87,7 +87,7 @@ void Sys_ServerActivity(void);
void Sys_SendKeyEvents (void); void Sys_SendKeyEvents (void);
// Perform Key_Event () callbacks until the input que is empty // 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); void Sys_Vibrate(int count);

View file

@ -4700,7 +4700,7 @@ typedef struct {
short xpos; short xpos;
short ypos; short ypos;
} doomimage_t; } 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) if (*(int *)param + strlen(name)+1 > 16000)
Sys_Error("Too many doom sprites\n"); Sys_Error("Too many doom sprites\n");

View file

@ -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); strcpy(shaderbuf+shaderbuflen, name);
Shader_MakeCache(shaderbuf+shaderbuflen); Shader_MakeCache(shaderbuf+shaderbuflen);

View file

@ -1801,9 +1801,9 @@ void DumpGLState(void)
qglGetIntegerv(GL_BLEND, &glint); qglGetIntegerv(GL_BLEND, &glint);
Sys_Printf("GL_BLEND: %i\n", glint); Sys_Printf("GL_BLEND: %i\n", glint);
qglGetIntegerv(GL_BLEND_SRC, &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); 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); qglGetIntegerv(GL_DEPTH_WRITEMASK, &glint);
Sys_Printf("GL_DEPTH_WRITEMASK: %i\n", glint); Sys_Printf("GL_DEPTH_WRITEMASK: %i\n", glint);

View file

@ -1141,7 +1141,7 @@ static Cursor CreateNullCursor(Display *display, Window root)
qboolean GLVID_ApplyGammaRamps(unsigned short *ramps) qboolean GLVID_ApplyGammaRamps(unsigned short *ramps)
{ {
extern qboolean gammaworks; 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 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) if (!vm.originalapplied)
@ -1652,8 +1652,6 @@ qboolean X11VID_Init (rendererstate_t *info, unsigned char *palette, int psl)
if (fullscreenflags) if (fullscreenflags)
fullscreenflags |= FULLSCREEN_ACTIVE; fullscreenflags |= FULLSCREEN_ACTIVE;
vid.recalc_refdef = 1; // force a surface cache flush
// TODO: make this into a cvar, like "in_dgamouse", instead of parameters // TODO: make this into a cvar, like "in_dgamouse", instead of parameters
if (!COM_CheckParm("-noxi2") && XI2_Init()) if (!COM_CheckParm("-noxi2") && XI2_Init())
{ {

View file

@ -134,7 +134,7 @@ void FTP_ServerShutdown(void)
} }
//we ought to filter this to remove duplicates. //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 socket = *(int*)param;
// int i; // int i;

View file

@ -341,7 +341,7 @@ struct http_dl_ctx_s {
int chunksize; int chunksize;
int chunked; int chunked;
enum {HC_REQUESTING, HC_GETTINGHEADER, HC_GETTING, HC_DECOMPRESSING} state; enum {HC_REQUESTING, HC_GETTINGHEADER, HC_GETTING} state;
int contentlength; int contentlength;
}; };

View file

@ -524,14 +524,13 @@ spx_int32_t *seed
VARDECL(int *ind); VARDECL(int *ind);
VARDECL(int *signs); VARDECL(int *signs);
const signed char *shape_cb; const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect; int subvect_size, nb_subvect;
const split_cb_params *params; const split_cb_params *params;
int have_sign; int have_sign;
params = (const split_cb_params *) par; params = (const split_cb_params *) par;
subvect_size = params->subvect_size; subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect; nb_subvect = params->nb_subvect;
shape_cb_size = 1<<params->shape_bits;
shape_cb = params->shape_cb; shape_cb = params->shape_cb;
have_sign = params->have_sign; have_sign = params->have_sign;

View file

@ -466,7 +466,6 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
{ {
int i; int i;
unsigned int j; unsigned int j;
int incomplete = 0;
spx_int16_t opt; spx_int16_t opt;
if (start_offset != NULL) if (start_offset != NULL)
@ -571,7 +570,6 @@ EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, s
if (found) if (found)
{ {
i=besti; 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);*/ /*fprintf (stderr, "incomplete: %d %d %d %d\n", jitter->packets[i].timestamp, jitter->pointer_timestamp, chunk_size, jitter->packets[i].span);*/
} }
} }

View file

@ -1300,7 +1300,6 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{ {
int offset; int offset;
spx_word16_t *exc; spx_word16_t *exc;
spx_word16_t *sp;
spx_word16_t *innov_save = NULL; spx_word16_t *innov_save = NULL;
spx_word16_t tmp; spx_word16_t tmp;
@ -1309,7 +1308,6 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
/* Excitation */ /* Excitation */
exc=st->exc+offset; exc=st->exc+offset;
/* Original signal */ /* Original signal */
sp=out+offset;
if (st->innov_save) if (st->innov_save)
innov_save = st->innov_save+offset; innov_save = st->innov_save+offset;
@ -1502,13 +1500,11 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{ {
int offset; int offset;
spx_word16_t *sp; spx_word16_t *sp;
spx_word16_t *exc;
/* Offset relative to start of frame */ /* Offset relative to start of frame */
offset = st->subframeSize*sub; offset = st->subframeSize*sub;
/* Original signal */ /* Original signal */
sp=out+offset; sp=out+offset;
/* Excitation */ /* Excitation */
exc=st->exc+offset;
/* LSP interpolation (quantized and unquantized) */ /* LSP interpolation (quantized and unquantized) */
lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes); lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes);

View file

@ -148,7 +148,6 @@ EXPORT void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_i
for (ch=0;ch<st->channels;ch++) for (ch=0;ch<st->channels;ch++)
{ {
int i; int i;
int N=2*st->frame_size;
float beta, beta2; float beta, beta2;
float *x; float *x;
float max_alpha = 0; float max_alpha = 0;

View file

@ -126,7 +126,6 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
int i; int i;
float ener=0, ener1=0, ener2=0; float ener=0, ener1=0, ener2=0;
float qual=7; float qual=7;
int va;
float log_energy; float log_energy;
float non_st=0; float non_st=0;
float voicing; 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)) || (voicing<0 && non_st < .05))
{ {
float tmp; float tmp;
va = 0;
vbr->consec_noise++; vbr->consec_noise++;
if (pow_ener > 3*vbr->noise_level) if (pow_ener > 3*vbr->noise_level)
tmp = 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; vbr->noise_accum_count = .95*vbr->noise_accum_count + .05;
} }
} else { } else {
va = 1;
vbr->consec_noise=0; vbr->consec_noise=0;
} }

View file

@ -294,7 +294,7 @@ typedef struct QCC_function_s QCC_function_t;
#define MAX_PARMS 8 #define MAX_PARMS 8
typedef struct QCC_typeparam_s struct QCC_typeparam_s
{ {
struct QCC_type_s *type; struct QCC_type_s *type;
pbool optional; pbool optional;

View file

@ -2892,7 +2892,7 @@ QCC_def_t *QCC_PR_GenerateAddressOf(int expressionstart, QCC_def_t *operand)
operand->type = QCC_PR_PointerType(operand->type); operand->type = QCC_PR_PointerType(operand->type);
return operand; 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; statements[numstatements-1].op = OP_GLOBALADDRESS;
operand->type = QCC_PR_PointerType(operand->type); 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 *ed;
QCC_def_t *constructor = NULL; QCC_def_t *constructor = NULL;
pbool constructed = false;
int basictypefield[ev_union+1]; int basictypefield[ev_union+1];
// int func; // int func;
@ -8962,7 +8961,6 @@ QCC_def_t *QCC_PR_GetDef (QCC_type_t *type, char *name, QCC_def_t *scope, pbool
} }
else 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_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); QCC_PR_ParsePrintDef(WARN_DUPLICATEDEFINITION, def);

View file

@ -3642,7 +3642,7 @@ int recursivefunctiontype;
//expects a ( to have already been parsed. //expects a ( to have already been parsed.
QCC_type_t *QCC_PR_ParseFunctionType (int newtype, QCC_type_t *returntype) QCC_type_t *QCC_PR_ParseFunctionType (int newtype, QCC_type_t *returntype)
{ {
QCC_type_t *ftype, *ptype; QCC_type_t *ftype;
char *name; char *name;
int definenames = !recursivefunctiontype; int definenames = !recursivefunctiontype;
int optional = 0; 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->aux_type = returntype; // return type
ftype->num_parms = 0; ftype->num_parms = 0;
ptype = NULL;
if (!QCC_PR_CheckToken (")")) 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 *QCC_PR_ParseFunctionTypeReacc (int newtype, QCC_type_t *returntype)
{ {
QCC_type_t *ftype, *ptype; QCC_type_t *ftype;
// char *name; // char *name;
// char argname[64]; // char argname[64];
int definenames = !recursivefunctiontype; // int definenames = !recursivefunctiontype;
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->aux_type = returntype; // return type
ftype->num_parms = 0; ftype->num_parms = 0;
ptype = NULL;
if (!QCC_PR_CheckToken (")")) 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. //static members are technically funny-named globals, and do not generate fields.
if (isstatic || (newparm->type == ev_function && !arraysize)) if (isstatic || (newparm->type == ev_function && !arraysize))
{ {
QCC_def_t *def;
sprintf(membername, "%s::%s", classname, parmname); 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) if (isstatic)
continue; continue;

View file

@ -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 if (name[5] == 'b' && name[6] == '_') //skip box models
return true; return true;
@ -1899,7 +1899,7 @@ void SV_User_f (void)
for (u = 0; u < 32; u++) for (u = 0; u < 32; u++)
if (cl->fteprotocolextensions2 & (1u<<u)) if (cl->fteprotocolextensions2 & (1u<<u))
Con_Printf(" %s", pext2names[u]); Con_Printf(" %s", pext2names[u]);
Con_Printf("\n", pext1names[u]); Con_Printf("\n");
Con_Printf("ip: %s\n", NET_AdrToString(buf, sizeof(buf), &cl->netchan.remote_address)); Con_Printf("ip: %s\n", NET_AdrToString(buf, sizeof(buf), &cl->netchan.remote_address));
switch(cl->realip_status) switch(cl->realip_status)

View file

@ -683,7 +683,7 @@ typedef struct
#define SORT_NO 0 #define SORT_NO 0
#define SORT_BY_DATE 1 #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; file_t *f;
dir_t *dir = uptr; dir_t *dir = uptr;

View file

@ -55,7 +55,7 @@ void *SVQ2_GetGameAPI (void *parms)
snprintf(name, sizeof(name), "%s%s", searchpath, gamename[o]); snprintf(name, sizeof(name), "%s%s", searchpath, gamename[o]);
q2gamedll = Sys_LoadLibrary(name, funcs); q2gamedll = Sys_LoadLibrary(name, funcs);
if (q2gamedll && gamename) if (q2gamedll)
{ {
ret = GetGameAPI(parms); ret = GetGameAPI(parms);
if (ret) if (ret)