]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed compile errors and warnings using Dev-C++ in "Compile as C++" mode
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 15 Sep 2009 10:08:02 +0000 (10:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 15 Sep 2009 10:08:02 +0000 (10:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9198 d7cf8633-e32d-0410-b094-e92efae38249

cap_ogg.c
cl_main.c
cl_particles.c
image_png.c
lhnet.c
menu.c
model_shared.c
sys_sdl.c

index 9382bb566ac11d3cef3378a39e337bf625745e61..626efe4a7d626cc0b36e1307799990da3642f8fb 100644 (file)
--- 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);
                        }
                }
index 108701a79fba11b664e333f051253397feae706d..799010d240a4808598f096f437607edc7c5c3ae8 100644 (file)
--- 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];
index 47020d78601c10a59ede1bc8c6a2975de51863cd..ac186bbe981be69a2ad6d8774e9a0cf060874787 100644 (file)
@@ -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
index c7acf47947ab91be2c15e47c5efd7c990b5f68f3..ca090b2c57ff53113369cab8deba020deb0ae7bf 100644 (file)
@@ -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 1e90318fe603a53bc8b1aa0eb0abc03df2a73eae..492074b43413e0235cfc9abce1c925d8910a8c61 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -6,7 +6,7 @@
 #define _WIN32_WINNT 0x0501
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#include <wspiapi.h>
+//#include <wspiapi.h>
 #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 d74c17d2ad4e558f55a67afd933702be390adc64..96fc75e1ffd3a2a2c817590a29956fb6e06b9f69 100644 (file)
--- 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)
index b65104b96ffa53adfbe1c1c0361c6a484ebc523d..3705359b2bbf34ece305aebd3cc6ff41a2f000f0 100644 (file)
@@ -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);
index 6ca7812961ff51c393417f4caad952dd55d35580..4a908537cce4c72f4c56ac3efae71c0481a0c43e 100644 (file)
--- 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);
                        }