Fix some warnings gcc 4.x threw in winlayer

git-svn-id: https://svn.eduke32.com/eduke32@348 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-11-19 02:17:47 +00:00
parent 730129aee6
commit 643f4d1e44
2 changed files with 21 additions and 19 deletions

View file

@ -5,7 +5,8 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <winsock.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <unistd.h>
#include <netinet/in.h>
@ -198,7 +199,8 @@ long netread (long *other, char *dabuf, long bufsiz) //0:no packets in buffer
long i;
i = sizeof(ip);
if (recvfrom(mysock,dabuf,bufsiz,0,(struct sockaddr *)&ip,(unsigned int *)&i) == -1) return(0);
if (recvfrom(mysock,dabuf,bufsiz,0,(struct sockaddr *)&ip,(socklen_t *)&i) == -1) return(0);
#if (SIMMIS > 0)
if ((rand()&255) < SIMMIS) return(0);
#endif

View file

@ -1178,7 +1178,7 @@ static void GetKeyNames(void)
if (FAILED(res)) continue;
CharToOem(key.tszName, tbuf);
strncpy(keynames[i], tbuf, sizeof(keynames[i])-1);
strncpy((char *)keynames[i], tbuf, sizeof(keynames[i])-1);
}
}
@ -1193,15 +1193,15 @@ const unsigned char *getjoyname(int what, int num)
switch (what) {
case 0: // axis
if ((unsigned)num > (unsigned)joynumaxes) return NULL;
return axisdefs[num].name;
return (unsigned char *)axisdefs[num].name;
case 1: // button
if ((unsigned)num > (unsigned)joynumbuttons) return NULL;
return buttondefs[num].name;
return (unsigned char *)buttondefs[num].name;
case 2: // hat
if ((unsigned)num > (unsigned)joynumhats) return NULL;
return hatdefs[num].name;
return (unsigned char *)hatdefs[num].name;
default:
return NULL;
@ -2847,36 +2847,36 @@ static int SetupOpenGL(int width, int height, int bitspp)
GLubyte *p,*p2,*p3;
int i;
glinfo.vendor = bglGetString(GL_VENDOR);
glinfo.renderer = bglGetString(GL_RENDERER);
glinfo.version = bglGetString(GL_VERSION);
glinfo.extensions = bglGetString(GL_EXTENSIONS);
glinfo.vendor = (char *)bglGetString(GL_VENDOR);
glinfo.renderer = (char *)bglGetString(GL_RENDERER);
glinfo.version = (char *)bglGetString(GL_VERSION);
glinfo.extensions = (char *)bglGetString(GL_EXTENSIONS);
glinfo.maxanisotropy = 1.0;
glinfo.bgra = 0;
glinfo.texcompr = 0;
// process the extensions string and flag stuff we recognize
p = Bstrdup(glinfo.extensions);
p = (unsigned char *)Bstrdup(glinfo.extensions);
p3 = p;
while ((p2 = Bstrtoken(p3==p?p:NULL, " ", (char**)&p3, 1)) != NULL) {
if (!Bstrcmp(p2, "GL_EXT_texture_filter_anisotropic")) {
while ((p2 = (unsigned char *)Bstrtoken(p3==p?(char *)p:NULL, " ", (char**)&p3, 1)) != NULL) {
if (!Bstrcmp((char *)p2, "GL_EXT_texture_filter_anisotropic")) {
// supports anisotropy. get the maximum anisotropy level
bglGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glinfo.maxanisotropy);
} else if (!Bstrcmp(p2, "GL_EXT_texture_edge_clamp") ||
!Bstrcmp(p2, "GL_SGIS_texture_edge_clamp")) {
} else if (!Bstrcmp((char *)p2, "GL_EXT_texture_edge_clamp") ||
!Bstrcmp((char *)p2, "GL_SGIS_texture_edge_clamp")) {
// supports GL_CLAMP_TO_EDGE or GL_CLAMP_TO_EDGE_SGIS
glinfo.clamptoedge = 1;
} else if (!Bstrcmp(p2, "GL_EXT_bgra")) {
} else if (!Bstrcmp((char *)p2, "GL_EXT_bgra")) {
// support bgra textures
glinfo.bgra = 1;
} else if (!Bstrcmp(p2, "GL_ARB_texture_compression")) {
} else if (!Bstrcmp((char *)p2, "GL_ARB_texture_compression")) {
// support texture compression
glinfo.texcompr = 1;
} else if (!Bstrcmp(p2, "GL_ARB_texture_non_power_of_two")) {
} else if (!Bstrcmp((char *)p2, "GL_ARB_texture_non_power_of_two")) {
// support non-power-of-two texture sizes
glinfo.texnpot = 1;
} else if (!Bstrcmp(p2, "WGL_3DFX_gamma_control")) {
} else if (!Bstrcmp((char *)p2, "WGL_3DFX_gamma_control")) {
// 3dfx cards have issues with fog
nofog = 1;
if (!(warnonce&1)) initprintf("3dfx card detected: OpenGL fog disabled\n");