From 1478dcd9c992b92aa9c322895588d40b13674fe6 Mon Sep 17 00:00:00 2001 From: Ragnvald Maartmann-Moe IV Date: Tue, 2 Jul 2002 21:37:22 +0000 Subject: [PATCH] Prune dead code. --- nq/source/cl_main.c | 4 +--- nq/source/cl_parse.c | 1 - nq/source/cl_view.c | 3 --- nq/source/pr_cmds.c | 5 ----- nq/source/sv_user.c | 2 -- qw/source/cl_cam.c | 1 - qw/source/cl_demo.c | 13 ++----------- qw/source/cl_ents.c | 14 +------------- qw/source/cl_main.c | 10 ---------- qw/source/cl_parse.c | 28 ++++++---------------------- qw/source/cl_slist.c | 3 --- qw/source/cl_view.c | 2 -- qw/source/net_udp.c | 13 ++++++------- qw/source/net_udp6.c | 18 ++++++++---------- qw/source/sv_phys.c | 3 +-- 15 files changed, 25 insertions(+), 95 deletions(-) diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 074b74bfb..594a1a778 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -484,19 +484,17 @@ CL_LerpPoint (void) f = 0.1; } frac = (cl.time - cl.mtime[1]) / f; -// Con_Printf ("frac: %f\n",frac); + if (frac < 0) { if (frac < -0.01) { SetPal (1); cl.time = cl.mtime[1]; -// Con_Printf ("low frac\n"); } frac = 0; } else if (frac > 1) { if (frac > 1.01) { SetPal (2); cl.time = cl.mtime[0]; -// Con_Printf ("high frac\n"); } frac = 1; } else diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index bbb69fcf7..c872986d5 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -692,7 +692,6 @@ CL_ParseServerMessage (void) break; case svc_nop: -// Con_Printf ("svc_nop\n"); break; case svc_time: diff --git a/nq/source/cl_view.c b/nq/source/cl_view.c index f3081f78e..7709f50ba 100644 --- a/nq/source/cl_view.c +++ b/nq/source/cl_view.c @@ -110,7 +110,6 @@ V_CalcBob (void) bob = sqrt (cl.velocity[0] * cl.velocity[0] + cl.velocity[1] * cl.velocity[1]) * cl_bob->value; -// Con_Printf ("speed: %5.1f\n", Length(cl.velocity)); bob = bob * 0.3 + bob * 0.7 * sin (cycle); if (bob > 4) bob = 4; @@ -187,8 +186,6 @@ V_DriftPitch (void) move = host_frametime * cl.pitchvel; cl.pitchvel += host_frametime * v_centerspeed->value; -// Con_Printf ("move: %f (%f)\n", move, host_frametime); - if (delta > 0) { if (move > delta) { cl.pitchvel = 0; diff --git a/nq/source/pr_cmds.c b/nq/source/pr_cmds.c index 4f4757692..a73d1d184 100644 --- a/nq/source/pr_cmds.c +++ b/nq/source/pr_cmds.c @@ -1315,7 +1315,6 @@ PF_rotate_bbox (progs_t *pr) VectorCopy (v[0], ch->mins); VectorCopy (v[0], ch->maxs); for (i = 0; i < 8; i++) { - //Con_Printf ("'%0.1f %0.1f %0.1f'\n", v[i][0], v[i][1], v[i][2]); for (j = 0; j < 3; j++) { ch->mins[j] = min (ch->mins[j], v[i][j]); ch->maxs[j] = max (ch->maxs[j], v[i][j]); @@ -1333,10 +1332,6 @@ PF_rotate_bbox (progs_t *pr) offsets[j]); hull->planes[i].type = 4; VectorCopy (dir[i / 2], hull->planes[i].normal); - //Con_Printf ("%f %f %f %f\n", - // hull->planes[i].dist, - // hull->planes[i].normal[0], hull->planes[i].normal[1], - // hull->planes[i].normal[2]); } } } diff --git a/nq/source/sv_user.c b/nq/source/sv_user.c index 48df396b5..a0d9f34c6 100644 --- a/nq/source/sv_user.c +++ b/nq/source/sv_user.c @@ -482,7 +482,6 @@ SV_ReadClientMessage (void) return false; case clc_nop: -// Con_Printf ("clc_nop\n"); break; case clc_stringcmd: @@ -538,7 +537,6 @@ SV_ReadClientMessage (void) break; case clc_disconnect: -// Con_Printf ("SV_ReadClientMessage: client disconnected\n"); return false; case clc_move: diff --git a/qw/source/cl_cam.c b/qw/source/cl_cam.c index 824a45554..9768986f9 100644 --- a/qw/source/cl_cam.c +++ b/qw/source/cl_cam.c @@ -478,7 +478,6 @@ adjustang (float current, float ideal, float speed) move = -speed; } -//Con_Printf("c/i: %4.2f/%4.2f move: %4.2f\n", current, ideal, move); return anglemod (current + move); } #endif diff --git a/qw/source/cl_demo.c b/qw/source/cl_demo.c index 272bc1670..03386e76c 100644 --- a/qw/source/cl_demo.c +++ b/qw/source/cl_demo.c @@ -131,8 +131,6 @@ CL_WriteDemoCmd (usercmd_t *pcmd) int i; usercmd_t cmd; -// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); - fl = LittleFloat ((float) realtime); Qwrite (cls.demofile, &fl, sizeof (fl)); @@ -170,8 +168,6 @@ CL_WriteDemoMessage (sizebuf_t *msg) float fl; int len; -// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); - if (!cls.demorecording) return; @@ -277,7 +273,6 @@ CL_GetDemoMessage (void) Qread (cls.demofile, &net_message->message->cursize, 4); net_message->message->cursize = LittleLong (net_message->message->cursize); -// Con_Printf("read: %ld bytes\n", net_message->message->cursize); if (net_message->message->cursize > MAX_MSGLEN + 8) //+8 for header Host_Error ("Demo message > MAX_MSGLEN + 8: %d/%d", net_message->message->cursize, MAX_MSGLEN + 8); @@ -362,8 +357,6 @@ CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq) float fl; int len, i; -// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); - if (!cls.demorecording) return; @@ -392,8 +385,6 @@ CL_WriteSetDemoMessage (void) float fl; int len; -// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); - if (!cls.demorecording) return; @@ -718,8 +709,8 @@ void CL_Record_f (void) { if (Cmd_Argc () > 2) { - /* we use a demo name like year-month-day-hours-minutes-mapname.qwd - if there is no argument */ + // we use a demo name like year-month-day-hours-minutes-mapname.qwd + // if there is no argument Con_Printf ("record [demoname]\n"); return; } diff --git a/qw/source/cl_ents.c b/qw/source/cl_ents.c index 342fcb98b..347e77452 100644 --- a/qw/source/cl_ents.c +++ b/qw/source/cl_ents.c @@ -154,9 +154,7 @@ CL_NewDlight (int key, vec3_t org, int effects, byte glow_size, } } -/* PACKET ENTITY PARSING / LINKING */ - -int bitcounts[32]; // / just for protocol profiling +// PACKET ENTITY PARSING / LINKING ============================================ /* CL_ParseDelta @@ -178,12 +176,6 @@ CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits) i = MSG_ReadByte (net_message); bits |= i; } - // count the bits for net profiling -#if 0 - for (i=0 ; i<16 ; i++) - if (bits&(1<num_entities) { -// Con_Printf ("copy %i\n", oldp->entities[oldindex].number); if (newindex >= MAX_PACKET_ENTITIES) Host_Error ("CL_ParsePacketEntities: newindex == " "MAX_PACKET_ENTITIES"); @@ -364,7 +355,6 @@ CL_ParsePacketEntities (qboolean delta) FlushEntityPacket (); return; } -// Con_Printf ("copy %i\n", oldnum); // copy one of the old entities over to the new packet unchanged if (newindex >= MAX_PACKET_ENTITIES) Host_Error ("CL_ParsePacketEntities: newindex == " @@ -377,7 +367,6 @@ CL_ParsePacketEntities (qboolean delta) } if (newnum < oldnum) { // new from baseline -// Con_Printf ("baseline %i\n", newnum); if (word & U_REMOVE) { if (full) { cl.validsequence = 0; @@ -408,7 +397,6 @@ CL_ParsePacketEntities (qboolean delta) oldindex++; continue; } -// Con_Printf ("delta %i\n", newnum); CL_ParseDelta (&oldp->entities[oldindex], &newp->entities[newindex], word); newindex++; diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 1c2d1fdac..83490034e 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -286,14 +286,6 @@ CL_SendConnectPacket (void) cls.qport = qport->int_val; - // Arrgh, this was not in the old binary only release, and eats up - // far too much of the 196 chars in the userinfo space, leaving nothing - // for player use, thus, its commented out for the moment.. - // - // Info_SetValueForStarKey (cls.userinfo, "*ip", NET_AdrToString(adr), - // MAX_INFO_STRING); - -// Con_Printf ("Connecting to %s...\n", cls.servername); snprintf (data, sizeof (data), "%c%c%c%cconnect %i %i %i \"%s\"\n", 255, 255, 255, 255, PROTOCOL_VERSION, cls.qport, cls.challenge, Info_MakeString (cls.userinfo, 0)); @@ -816,7 +808,6 @@ CL_NextDemo (void) if (!cls.demos[cls.demonum][0] || cls.demonum == MAX_DEMOS) { cls.demonum = 0; if (!cls.demos[cls.demonum][0]) { -// Con_Printf ("No demos listed with startdemos\n"); cls.demonum = -1; return; } @@ -896,7 +887,6 @@ CL_ConnectionlessPacket (void) && (cl_paranoid->int_val || !NET_CompareAdr (net_from, cls.server_addr))) Con_Printf ("%s: ", NET_AdrToString (net_from)); -// Con_DPrintf ("%s", net_message.data + 5); if (c == S2C_CONNECTION) { Con_Printf ("connection\n"); if (cls.state >= ca_connected) { diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 6cead7f8a..f4354b775 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -467,15 +467,7 @@ CL_ParseDownload (void) net_message->readcount += size; if (percent != 100) { - // change display routines by zoid // request next block -#if 0 - Con_Printf ("."); - if (10 * (percent / 10) != cls.downloadpercent) { - cls.downloadpercent = 10 * (percent / 10); - Con_Printf ("%i%%", cls.downloadpercent); - } -#endif if (percent != cls.downloadpercent) VID_SetCaption (va ("Downloading %s %d%%", cls.downloadname, percent)); @@ -487,10 +479,6 @@ CL_ParseDownload (void) char oldn[MAX_OSPATH]; char newn[MAX_OSPATH]; -#if 0 - Con_Printf ("100%%\n"); -#endif - Qclose (cls.download); VID_SetCaption (va ("Connecting to %s", cls.servername)); @@ -517,7 +505,6 @@ CL_ParseDownload (void) cls.downloadpercent = 0; // get another file if needed - CL_RequestNextDownload (); } } @@ -923,9 +910,7 @@ CL_ParseClientdata (void) // calculate latency latency = frame->receivedtime - frame->senttime; - if (latency < 0 || latency > 1.0) { -// Con_Printf ("Odd latency: %5.2f\n", latency); - } else { + if (!(latency < 0 || latency > 1.0)) { // drift the average latency towards the observed latency if (latency < cls.latency) cls.latency = latency; @@ -941,7 +926,7 @@ CL_ProcessUserInfo (int slot, player_info_t *player) const char *s; s = Info_ValueForKey (player->userinfo, "skin"); - COM_StripExtension (s, skin); // FIXME buffer overflow + COM_StripExtension (s, skin); // FIXME: buffer overflow if (!strequal (s, skin)) Info_SetValueForKey (player->userinfo, "skin", skin, 1); strncpy (player->name, Info_ValueForKey (player->userinfo, "name"), @@ -965,7 +950,6 @@ CL_ProcessUserInfo (int slot, player_info_t *player) Skin_Find (player); Sbar_Changed (); - //XXX CL_NewTranslation (slot); } void @@ -1164,7 +1148,6 @@ CL_ParseServerMessage (void) break; case svc_nop: -// Con_Printf ("svc_nop\n"); break; case svc_disconnect: @@ -1348,11 +1331,12 @@ CL_ParseServerMessage (void) Con_DPrintf ("\n"); VectorCopy (vec3_origin, cl.simvel); - /* + /* automatic fraglogging (by elmex) - XXX: Should this _really_ called here? + XXX: Should this _really_ called here? */ - if(!cls.demoplayback) Sbar_LogFrags(); + if (!cls.demoplayback) + Sbar_LogFrags(); break; case svc_finale: diff --git a/qw/source/cl_slist.c b/qw/source/cl_slist.c index 776911d65..446dbbad2 100644 --- a/qw/source/cl_slist.c +++ b/qw/source/cl_slist.c @@ -486,9 +486,6 @@ SL_Con_Details (server_entry_t *sldata, int slitemno) playercount++; Con_Printf("Players: %i/%s\n", playercount, Info_ValueForKey(cp->status, "maxclients")); - - // For Debug of Server Info - // Con_Printf("%s\n",cp->status); } else Con_Printf("No Details Available\n"); } diff --git a/qw/source/cl_view.c b/qw/source/cl_view.c index b3123006e..a08ab4de5 100644 --- a/qw/source/cl_view.c +++ b/qw/source/cl_view.c @@ -220,8 +220,6 @@ V_DriftPitch (void) move = host_frametime * cl.pitchvel; cl.pitchvel += host_frametime * v_centerspeed->value; -// Con_Printf ("move: %f (%f)\n", move, host_frametime); - if (delta > 0) { if (move > delta) { cl.pitchvel = 0; diff --git a/qw/source/net_udp.c b/qw/source/net_udp.c index f457effd6..f7c47e2d7 100644 --- a/qw/source/net_udp.c +++ b/qw/source/net_udp.c @@ -268,12 +268,12 @@ NET_GetPacket (void) Con_DPrintf ("error 10054 from %s\n", NET_AdrToString (net_from)); return false; } -#else /* _WIN32 */ +#else // _WIN32 int err = errno; if (err == ECONNREFUSED) return false; -#endif /* _WIN32 */ +#endif // _WIN32 if (err == EWOULDBLOCK) return false; Con_Printf ("NET_GetPacket: %d: %s\n", err, strerror (err)); @@ -315,9 +315,8 @@ NET_SendPacket (int length, void *data, netadr_t to) if (net_packetlog->int_val) Log_Outgoing_Packet(data,length); - ret = - sendto (net_socket, data, length, 0, (struct sockaddr *) &addr, - sizeof (addr)); + ret = sendto (net_socket, data, length, 0, (struct sockaddr *) &addr, + sizeof (addr)); if (ret == -1) { #ifdef _WIN32 int err = WSAGetLastError (); @@ -328,12 +327,12 @@ NET_SendPacket (int length, void *data, netadr_t to) else Con_Printf ("NET_SendPacket ERROR: %i\n", err); } -#else /* _WIN32 */ +#else // _WIN32 int err = errno; if (err == ECONNREFUSED) return; -#endif /* _WIN32 */ +#endif // _WIN32 if (err == EWOULDBLOCK) return; diff --git a/qw/source/net_udp6.c b/qw/source/net_udp6.c index e9567688c..c25518cbb 100644 --- a/qw/source/net_udp6.c +++ b/qw/source/net_udp6.c @@ -278,12 +278,10 @@ NET_StringToAdr (const char *s, netadr_t *a) } } -// Con_Printf ("NET_StringToAdr: addrs %s ports %s\n",addrs, ports); - if ((err = getaddrinfo (addrs, ports, &hints, &resultp))) { // Error - Con_Printf ("NET_StringToAdr: string %s:\n%s\n", s, gai_strerror - (err)); + Con_Printf ("NET_StringToAdr: string %s:\n%s\n", s, + gai_strerror (err)); return 0; } @@ -307,11 +305,11 @@ NET_StringToAdr (const char *s, netadr_t *a) break; default: - Con_Printf - ("NET_StringToAdr: string %s:\nprotocol family %d not supported\n", - s, resultp->ai_family); - return 0; + Con_Printf ("NET_StringToAdr: string %s:\nprotocol family %d not " + "supported\n", s, resultp->ai_family); + return 0; } + SockadrToNetadr ((struct sockaddr_in6 *) &ss, a); return true; @@ -371,12 +369,12 @@ NET_GetPacket (void) NET_AdrToString (net_from)); return false; } -#else /* _WIN32 */ +#else // _WIN32 int err = errno; if (err == ECONNREFUSED) return false; -#endif /* _WIN32 */ +#endif // _WIN32 if (err == EWOULDBLOCK) return false; Con_Printf ("NET_GetPacket: %s\n", strerror (err)); diff --git a/qw/source/sv_phys.c b/qw/source/sv_phys.c index 7651ac6ed..044755a96 100644 --- a/qw/source/sv_phys.c +++ b/qw/source/sv_phys.c @@ -546,8 +546,7 @@ SV_Physics_Pusher (edict_t *ent) VectorSubtract (SVvector (ent, origin), oldorg, move); l = Length (move); - if (l > 1.0 / 64) { -// Con_Printf ("**** snap: %f\n", Length (l)); + if (l > (1.0 / 64.0)) { VectorCopy (oldorg, SVvector (ent, origin)); SV_Push (ent, move); }