"W007: '&array' may not produce intended result" Watcom warning fixes.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1504 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2017-09-17 08:00:32 +00:00
parent 3cefb58d5d
commit daf5ebec2f
3 changed files with 12 additions and 12 deletions

View file

@ -376,8 +376,9 @@ void Draw_NewGame (void)
int i; int i;
// empty scrap and reallocate gltextures // empty scrap and reallocate gltextures
memset(&scrap_allocated, 0, sizeof(scrap_allocated)); memset(scrap_allocated, 0, sizeof(scrap_allocated));
memset(&scrap_texels, 255, sizeof(scrap_texels)); memset(scrap_texels, 255, sizeof(scrap_texels));
Scrap_Upload (); //creates 2 empty gltextures Scrap_Upload (); //creates 2 empty gltextures
// reload wad pics // reload wad pics
@ -402,8 +403,9 @@ void Draw_Init (void)
Cvar_RegisterVariable (&scr_conalpha); Cvar_RegisterVariable (&scr_conalpha);
// clear scrap and allocate gltextures // clear scrap and allocate gltextures
memset(&scrap_allocated, 0, sizeof(scrap_allocated)); memset(scrap_allocated, 0, sizeof(scrap_allocated));
memset(&scrap_texels, 255, sizeof(scrap_texels)); memset(scrap_texels, 255, sizeof(scrap_texels));
Scrap_Upload (); //creates 2 empty textures Scrap_Upload (); //creates 2 empty textures
// create internal pics // create internal pics
@ -687,7 +689,7 @@ void GL_SetCanvas (canvastype newcanvas)
currentcanvas = newcanvas; currentcanvas = newcanvas;
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity (); glLoadIdentity ();
switch(newcanvas) switch(newcanvas)
{ {
@ -749,7 +751,7 @@ void GL_SetCanvas (canvastype newcanvas)
} }
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glLoadIdentity (); glLoadIdentity ();
} }
/* /*

View file

@ -156,7 +156,7 @@ qboolean Image_WriteTGA (const char *name, byte *data, int width, int height, in
if (handle == -1) if (handle == -1)
return false; return false;
Q_memset (&header, 0, TARGAHEADERSIZE); Q_memset (header, 0, TARGAHEADERSIZE);
header[2] = 2; // uncompressed type header[2] = 2; // uncompressed type
header[12] = width&255; header[12] = width&255;
header[13] = width>>8; header[13] = width>>8;
@ -176,7 +176,7 @@ qboolean Image_WriteTGA (const char *name, byte *data, int width, int height, in
data[i+2] = temp; data[i+2] = temp;
} }
Sys_FileWrite (handle, &header, TARGAHEADERSIZE); Sys_FileWrite (handle, header, TARGAHEADERSIZE);
Sys_FileWrite (handle, data, size); Sys_FileWrite (handle, data, size);
Sys_FileClose (handle); Sys_FileClose (handle);

View file

@ -96,8 +96,7 @@ model and pose.
*/ */
static void *GLARB_GetXYZOffset (aliashdr_t *hdr, int pose) static void *GLARB_GetXYZOffset (aliashdr_t *hdr, int pose)
{ {
meshxyz_t dummy; const int xyzoffs = offsetof (meshxyz_t, xyz);
int xyzoffs = ((char*)&dummy.xyz - (char*)&dummy);
return (void *) (currententity->model->vboxyzofs + (hdr->numverts_vbo * pose * sizeof (meshxyz_t)) + xyzoffs); return (void *) (currententity->model->vboxyzofs + (hdr->numverts_vbo * pose * sizeof (meshxyz_t)) + xyzoffs);
} }
@ -111,8 +110,7 @@ given model and pose.
*/ */
static void *GLARB_GetNormalOffset (aliashdr_t *hdr, int pose) static void *GLARB_GetNormalOffset (aliashdr_t *hdr, int pose)
{ {
meshxyz_t dummy; const int normaloffs = offsetof (meshxyz_t, normal);
int normaloffs = ((char*)&dummy.normal - (char*)&dummy);
return (void *)(currententity->model->vboxyzofs + (hdr->numverts_vbo * pose * sizeof (meshxyz_t)) + normaloffs); return (void *)(currententity->model->vboxyzofs + (hdr->numverts_vbo * pose * sizeof (meshxyz_t)) + normaloffs);
} }