From: havoc Date: Tue, 15 Sep 2009 10:08:02 +0000 (+0000) Subject: fixed compile errors and warnings using Dev-C++ in "Compile as C++" mode X-Git-Tag: xonotic-v0.1.0preview~1434 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=030497a0992d36242aeaf2691f1e2d208ec00cb9 fixed compile errors and warnings using Dev-C++ in "Compile as C++" mode git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9198 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cap_ogg.c b/cap_ogg.c index 9382bb56..626efe4a 100644 --- a/cap_ogg.c +++ b/cap_ogg.c @@ -1009,13 +1009,13 @@ void SCR_CaptureVideo_Ogg_BeginVideo(void) if(ti.quality < 0) { ti.target_bitrate = -1; - ti.keyframe_data_target_bitrate = -1; + ti.keyframe_data_target_bitrate = (unsigned int)-1; ti.quality = 63; } else { ti.target_bitrate = -1; - ti.keyframe_data_target_bitrate = -1; + ti.keyframe_data_target_bitrate = (unsigned int)-1; ti.quality = bound(0, ti.quality, 63); } } diff --git a/cl_main.c b/cl_main.c index 108701a7..799010d2 100644 --- a/cl_main.c +++ b/cl_main.c @@ -1231,7 +1231,7 @@ void CL_UpdateViewModel(void) ent->state_previous = ent->state_current; ent->state_current = defaultstate; ent->state_current.time = cl.time; - ent->state_current.number = -1; + ent->state_current.number = (unsigned int)-1; ent->state_current.active = true; ent->state_current.modelindex = cl.stats[STAT_WEAPON]; ent->state_current.frame = cl.stats[STAT_WEAPONFRAME]; diff --git a/cl_particles.c b/cl_particles.c index 47020d78..ac186bbe 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -301,8 +301,8 @@ void CL_Particles_ParseEffectInfo(const char *textstart, const char *textend) info->lightshadow = true; info->lighttime = 9999; info->stretchfactor = 1; - info->staincolor[0] = -1; - info->staincolor[1] = -1; + info->staincolor[0] = (unsigned int)-1; + info->staincolor[1] = (unsigned int)-1; info->staintex[0] = -1; info->staintex[1] = -1; } @@ -376,7 +376,7 @@ void CL_Particles_ParseEffectInfo(const char *textstart, const char *textend) else if (!strcmp(argv[0], "stretchfactor")) {readfloat(info->stretchfactor);} else if (!strcmp(argv[0], "staincolor")) {readints(info->staincolor, 2);} else if (!strcmp(argv[0], "staintex")) {readints(info->staintex, 2);} - else if (!strcmp(argv[0], "stainless")) {info->staintex[0] = -2; info->staincolor[0] = -1; info->staincolor[1] = -1;} + else if (!strcmp(argv[0], "stainless")) {info->staintex[0] = -2; info->staincolor[0] = (unsigned int)-1; info->staincolor[1] = (unsigned int)-1;} else Con_Printf("effectinfo.txt:%i: skipping unknown command %s\n", linenumber, argv[0]); #undef checkparms diff --git a/image_png.c b/image_png.c index c7acf479..ca090b2c 100644 --- a/image_png.c +++ b/image_png.c @@ -249,7 +249,7 @@ unsigned char *PNG_LoadImage_BGRA (const unsigned char *raw, int filesize) // NOTE: this relies on jmp_buf being the first thing in the png structure // created by libpng! (this is correct for libpng 1.2.x) #ifdef __cplusplus -#ifdef MACOSX +#if defined(MACOSX) || defined(WIN32) if (setjmp((int *)png)) #else if (setjmp((__jmp_buf_tag *)png)) diff --git a/lhnet.c b/lhnet.c index 1e90318f..492074b4 100644 --- a/lhnet.c +++ b/lhnet.c @@ -6,7 +6,7 @@ #define _WIN32_WINNT 0x0501 #include #include -#include +//#include #endif #ifndef STANDALONETEST @@ -878,7 +878,7 @@ int LHNET_Read(lhnetsocket_t *lhnetsocket, void *content, int maxcontentlength, SOCKLEN_T inetaddresslength; address->addresstype = LHNETADDRESSTYPE_NONE; inetaddresslength = sizeof(address->addr.in); - value = recvfrom(lhnetsocket->inetsocket, content, maxcontentlength, 0, &address->addr.sock, &inetaddresslength); + value = recvfrom(lhnetsocket->inetsocket, (char *)content, maxcontentlength, 0, &address->addr.sock, &inetaddresslength); if (value > 0) { address->addresstype = LHNETADDRESSTYPE_INET4; @@ -904,7 +904,7 @@ int LHNET_Read(lhnetsocket_t *lhnetsocket, void *content, int maxcontentlength, SOCKLEN_T inetaddresslength; address->addresstype = LHNETADDRESSTYPE_NONE; inetaddresslength = sizeof(address->addr.in6); - value = recvfrom(lhnetsocket->inetsocket, content, maxcontentlength, 0, &address->addr.sock, &inetaddresslength); + value = recvfrom(lhnetsocket->inetsocket, (char *)content, maxcontentlength, 0, &address->addr.sock, &inetaddresslength); if (value > 0) { address->addresstype = LHNETADDRESSTYPE_INET6; @@ -957,7 +957,7 @@ int LHNET_Write(lhnetsocket_t *lhnetsocket, const void *content, int contentleng } else if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET4) { - value = sendto(lhnetsocket->inetsocket, content, contentlength, 0, (struct sockaddr *)&address->addr.in, sizeof(struct sockaddr_in)); + value = sendto(lhnetsocket->inetsocket, (char *)content, contentlength, 0, (struct sockaddr *)&address->addr.in, sizeof(struct sockaddr_in)); if (value == -1) { if (SOCKETERRNO == EWOULDBLOCK) @@ -967,7 +967,7 @@ int LHNET_Write(lhnetsocket_t *lhnetsocket, const void *content, int contentleng } else if (lhnetsocket->address.addresstype == LHNETADDRESSTYPE_INET6) { - value = sendto(lhnetsocket->inetsocket, content, contentlength, 0, (struct sockaddr *)&address->addr.in6, sizeof(struct sockaddr_in6)); + value = sendto(lhnetsocket->inetsocket, (char *)content, contentlength, 0, (struct sockaddr *)&address->addr.in6, sizeof(struct sockaddr_in6)); if (value == -1) { if (SOCKETERRNO == EWOULDBLOCK) diff --git a/menu.c b/menu.c index d74c17d2..96fc75e1 100644 --- a/menu.c +++ b/menu.c @@ -5377,7 +5377,7 @@ void MR_Init(void) } if(video_resolutions[i].conwidth > video_resolutions[i].width || video_resolutions[i].conheight > video_resolutions[i].height) { - double f1, f2; + int f1, f2; f1 = video_resolutions[i].conwidth > video_resolutions[i].width; f2 = video_resolutions[i].conheight > video_resolutions[i].height; if(f1 > f2) diff --git a/model_shared.c b/model_shared.c index b65104b9..3705359b 100644 --- a/model_shared.c +++ b/model_shared.c @@ -318,7 +318,7 @@ dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk) Con_Printf("loading model %s\n", mod->name); mod->used = true; - mod->crc = -1; + mod->crc = (unsigned int)-1; mod->loaded = false; VectorClear(mod->normalmins); diff --git a/sys_sdl.c b/sys_sdl.c index 6ca78129..4a908537 100644 --- a/sys_sdl.c +++ b/sys_sdl.c @@ -177,11 +177,11 @@ char *Sys_GetClipboardData (void) if ((hClipboardData = GetClipboardData (CF_TEXT)) != 0) { - if ((cliptext = GlobalLock (hClipboardData)) != 0) + if ((cliptext = (char *)GlobalLock (hClipboardData)) != 0) { size_t allocsize; allocsize = GlobalSize (hClipboardData) + 1; - data = Z_Malloc (allocsize); + data = (char *)Z_Malloc (allocsize); strlcpy (data, cliptext, allocsize); GlobalUnlock (hClipboardData); }