]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix some warnings found by cppcheck
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Jun 2020 21:32:00 +0000 (21:32 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Jun 2020 21:32:00 +0000 (21:32 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12746 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
clvm_cmds.c
csprogs.c
fs.c

index 0ecfb69301d24188bad84db91ff9861f7c468ac9..2d8f04ab6f97a331f3c123d537b1c60d27cd6f57 100644 (file)
@@ -270,8 +270,6 @@ static void CL_ParseStartSoundPacket(int largesoundindex)
                        sound_num = MSG_ReadByte(&cl_message);
        }
 
-       channel = CHAN_NET2ENGINE(channel);
-
        MSG_ReadVector(&cl_message, pos, cls.protocol);
 
        if (sound_num < 0 || sound_num >= MAX_SOUNDS)
index dd8842df4189357f5103610f0935c1132361473a..ba1555d396bf23c96d4af2224ee344b5b24b2621 100644 (file)
@@ -219,8 +219,6 @@ static void VM_CL_sound (prvm_prog_t *prog)
        else
                startposition = 0;
 
-       channel = CHAN_USER2ENGINE(channel);
-
        if (!IS_CHAN(channel))
        {
                VM_Warning(prog, "VM_CL_sound: channel must be in range 0-127\n");
index 07087c9761ac0bf48dfe584f902d90d4e959d12a..665d4887269c1637ae4f5a7b9ee692138ced6328 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -562,12 +562,10 @@ void CL_VM_Parse_StuffCmd (const char *msg)
                // temporarily so that it can be set by the cvar command,
                // and then reprotect it afterwards
                int crcflags = csqc_progcrc.flags;
-               int sizeflags = csqc_progcrc.flags;
                csqc_progcrc.flags &= ~CVAR_READONLY;
                csqc_progsize.flags &= ~CVAR_READONLY;
                Cmd_ExecuteString(&cmd_client, msg, src_command, true);
-               csqc_progcrc.flags = crcflags;
-               csqc_progsize.flags = sizeflags;
+               csqc_progcrc.flags = csqc_progsize.flags = crcflags;
                return;
        }
 
diff --git a/fs.c b/fs.c
index a5130fbb3a29761d6fdf9eec2e336f352bd4bbe8..c15b8ba00f4f235225ea7c9a650903b5788104d4 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -2891,7 +2891,7 @@ fs_offset_t FS_Read (qfile_t* file, void* buffer, size_t buffersize)
 {
        fs_offset_t count, done;
 
-       if (buffersize == 0)
+       if (buffersize == 0 || !buffer)
                return 0;
 
        // Get rid of the ungetc character