]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
prvm_edict: Add missing typecasts to fix alignment problem
authorCloudwalk <cloudwalk009@gmail.com>
Tue, 21 Jul 2020 19:07:24 +0000 (15:07 -0400)
committerCloudwalk <cloudwalk009@gmail.com>
Tue, 21 Jul 2020 19:09:12 +0000 (15:09 -0400)
prvm_edict.c

index fa6ecbc34efcf0def3d7f19272c30fad20b26688..1f8700c9b39cea4f6e3816c41e0eb92a707692db 100644 (file)
@@ -2126,8 +2126,8 @@ void PRVM_Prog_Load(prvm_prog_t *prog, const char * filename, unsigned char * da
        default:
                for (i=0 ; i<prog->numglobaldefs ; i++)
                {
-                       prog->globaldefs[i].type = LittleShort(inglobaldefs16[i].type);
-                       prog->globaldefs[i].ofs = LittleShort(inglobaldefs16[i].ofs);
+                       prog->globaldefs[i].type = (unsigned short)LittleShort(inglobaldefs16[i].type);
+                       prog->globaldefs[i].ofs = (unsigned short)LittleShort(inglobaldefs16[i].ofs);
                        prog->globaldefs[i].s_name = LittleLong(inglobaldefs16[i].s_name);
                        // TODO bounds check ofs, s_name
                }