Created attachment 2856[details]
Fix some warnings, remove/disable some unused code.
Fixed many warnings shown by GCC 4.6 and clang static analyzer. Also removed/disabled some other code that was not used.
Created attachment 2857[details]
Fix some warnings, remove/disable some unused code.
Removed setting challenge to 0 in CL_ConnectionlessPacket, Thilo already fixed it in r2090.
Thilo: you have been recently working on the VM and the networking code. take a particular look at these hunks (taken from the above patch), and assert that nothing logical has been overlooked around them:
Index: code/qcommon/vm_x86.c
===================================================================
--- code/qcommon/vm_x86.c (revision 2095)
+++ code/qcommon/vm_x86.c (working copy)
@@ -1716,7 +1716,6 @@
{
byte stack[OPSTACK_SIZE + 15];
void *entryPoint;
- int programCounter;
int programStack, stackOnEntry;
byte *image;
int *opStack;
@@ -1733,8 +1732,6 @@
// set up the stack frame
image = vm->dataBase;
- programCounter = 0;
-
programStack -= 48;
*(int *)&image[ programStack + 44] = args[9];
Index: code/qcommon/net_chan.c
===================================================================
--- code/qcommon/net_chan.c (revision 2095)
+++ code/qcommon/net_chan.c (working copy)
@@ -243,7 +243,6 @@
*/
qboolean Netchan_Process( netchan_t *chan, msg_t *msg ) {
int sequence;
- int qport;
int fragmentStart, fragmentLength;
qboolean fragmented;
@@ -264,7 +263,7 @@
// read the qport if we are a server
if ( chan->sock == NS_SERVER ) {
- qport = MSG_ReadShort( msg );
+ MSG_ReadShort( msg );
}
#ifdef LEGACY_PROTOCOL
Created attachment 2858[details]
refactoring amendments
i propose these amendments to the above patch (this patch is to be applied after the above patch).
I have a few questions to your patch, Zack:
You're removing
UI_DemosMenu_Key
Are you sure there is no chance of this function ever being called?
- s_demos.menu.key = UI_DemosMenu_Key;
What makes you so sure that this callback is not triggered from some other function in another C-file?
Why are you removing:
+ //sfxHandle_t sfx_chghit;
+ //sfxHandle_t sfx_chghitflesh;
+ //sfxHandle_t sfx_chghitmetal;
when it's being used here:
case WP_CHAINGUN:
mod = cgs.media.bulletFlashModel;
- if( soundType == IMPACTSOUND_FLESH ) {
+ /*if( soundType == IMPACTSOUND_FLESH ) {
sfx = cgs.media.sfx_chghitflesh;
and why do you disable the use of sfx_chghitflesh?
Aside from that I guess most is fine. Also the variables devhc mentions can be safely removed.
Also, ZTurtleMan: Can you please remove the comment lines? Many lines were just commented with //
I say get rid of them, except for cases where surrounding code is already commented or it really makes sense to keep them.
I noticed you also fixed the "noreturn" warnings, even when I did in r2100.. I didn't know you'd tackle this in your patch.
Please keep the changes to con_tty.c in a separate patch.
Is there a way the two of you can somehow consolidate the amandments from devhc into one patch?
s_demos.menu.key can safely be NULL, it is NULL in most menus. q3_ui uses Menu_DefaultKey if menu key handling function is NULL. Which is all demos menu custom key handler function was doing.
Chaingun sfx gets set to bullet sound after that. The chaingun sounds are never played. I haven't tested Team Arena using them.
Thilo: I'll merge DevHC's patch and do the other things you requested.
Created attachment 2868[details]
Fix some warnings, remove/disable some unused code. (v3)
Merged DevHC's patch. Removed con_tty.c changes. I removed a few lines of commented code, I think the rest fall under the exceptions Thilo stated.
There are still three noreturn function declarations added by the patch.
(In reply to comment #8)
> Created attachment 2868[details]
> Fix some warnings, remove/disable some unused code. (v3)
>
> Merged DevHC's patch. Removed con_tty.c changes. I removed a few lines of
> commented code, I think the rest fall under the exceptions Thilo stated.
>
> There are still three noreturn function declarations added by the patch.
Thanks alot you for your work! I'll look at this later.
(In reply to comment #11)
> Created attachment 2876[details]
> Remove two lines of unused code.
>
> Sorry, I forgot to include these in the previous patches.
Fixed r2110
Created attachment 2856 [details] Fix some warnings, remove/disable some unused code. Fixed many warnings shown by GCC 4.6 and clang static analyzer. Also removed/disabled some other code that was not used.
Created attachment 2857 [details] Fix some warnings, remove/disable some unused code. Removed setting challenge to 0 in CL_ConnectionlessPacket, Thilo already fixed it in r2090.
Created attachment 2858 [details] refactoring amendments i propose these amendments to the above patch (this patch is to be applied after the above patch).
Created attachment 2859 [details] use some some previously unused sound effects? i don't have TA to test, but is using sfx_chghit* appropriate?
Created attachment 2868 [details] Fix some warnings, remove/disable some unused code. (v3) Merged DevHC's patch. Removed con_tty.c changes. I removed a few lines of commented code, I think the rest fall under the exceptions Thilo stated. There are still three noreturn function declarations added by the patch.
Created attachment 2876 [details] Remove two lines of unused code. Sorry, I forgot to include these in the previous patches.