]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
* fixed warnings
authormattn <mattn>
Thu, 26 Jun 2008 11:40:59 +0000 (11:40 +0000)
committermattn <mattn>
Thu, 26 Jun 2008 11:40:59 +0000 (11:40 +0000)
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@278 8a3a26a2-13c4-0310-b231-cf6edde360e5

12 files changed:
plugins/entity/light.cpp
plugins/imagem8/m32.cpp
plugins/imagem8/m8.cpp
plugins/imagewal/wal.cpp
plugins/map/parse.cpp
plugins/map/write.cpp
plugins/shaders/plugin.cpp
plugins/surface/surfacedialog.cpp
plugins/surface_heretic2/surfacedialog.cpp
plugins/surface_quake2/surfacedialog.cpp
plugins/surface_ufoai/surfacedialog.cpp
radiant/texwindow.cpp

index 477fc72d44d61c5fcd4e1c48126304b53b194495..9e08c18105a9fd4179ac5fa6a8e9df5553058d62 100644 (file)
@@ -243,7 +243,7 @@ static void DrawLightSphere(entity_t * e, int nGLState, int pref)
   const char *target = ValueForKey(e, "target");
   bool bIsSpotLight = !!target[0];
   //!\todo Write an API for modules to register preference settings, and make this preference module-specific.
-  int nPasses = pref == 1 ? 3 : 2;
// int nPasses = pref == 1 ? 3 : 2;
 
   g_QglTable.m_pfn_qglPushAttrib(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
   g_QglTable.m_pfn_qglDepthMask(GL_FALSE);
@@ -287,7 +287,7 @@ unsigned short indices[24] = { 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 2,
 
 void DrawLight(entity_t* e, int nGLState, int pref, int nViewType)
 {
-  int i;
+//  int i;
   // top, bottom, tleft, tright, bright, bleft
   vec3_t points[6];
   vec3_t vMid, vMin, vMax;
@@ -479,7 +479,7 @@ void DrawLight(entity_t* e, int nGLState, int pref, int nViewType)
       g_QglTable.m_pfn_qglLineStipple(8, 0xAAAA);
       g_QglTable.m_pfn_qglEnable(GL_LINE_STIPPLE);
 
-      float* envelope = (pref == 1) ? e->fLightEnvelope1 : e->fLightEnvelope2; 
+      float* envelope = (pref == 1) ? e->fLightEnvelope1 : e->fLightEnvelope2;
       for (int iPass = 0; iPass < nPasses; iPass++)
       {
         float fRadius = envelope[iPass];
index 5bbe616ed57f4dc1a6db13cb32f25b4e34f5c3f2..3ae2b770c9cf0fc9243ef6b53c53181c1eb06a52 100644 (file)
@@ -26,17 +26,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 void LoadM32(const char *name, unsigned char **pic, int *width, int *height)
 {
-    FILE       *f;
+//    FILE     *f;
     m32_header_t       *m32_header;
     //rgb_t    *palette;
     int                i, num_pixels, size;
-    char       text_buf[255];
+//    char     text_buf[255];
     unsigned int       length;
     unsigned char      *palette_ent, *buf_temp;
     unsigned char       *buffer, *m32_file_buffer;
 
     // open file
-    if ( length = vfsLoadFile ((char *) name, (void **) &m32_file_buffer, 0) == (unsigned int) -1)
+    if ( (length = vfsLoadFile ((char *) name, (void **) &m32_file_buffer, 0)) == (unsigned int) -1)
     {
        Sys_Printf("Unable to open file %s\n",name);
        return;
index 4b6dea55ff39182f45a12db402c03ad74c3a0855..7e11d1e00f37363bdae0d0e718cc874c0121f669 100644 (file)
@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 void LoadM8(const char *name, unsigned char **pic, int *width, int *height)
 {
-    FILE       *f;
+//    FILE     *f;
     m8_header_t        *m8_header;
     rgb_t      *palette;
     int                i, num_pixels, size;
@@ -44,7 +44,7 @@ void LoadM8(const char *name, unsigned char **pic, int *width, int *height)
     strcat(text_buf, ".pcx.m8");
 
     // open file
-       if ( length = vfsLoadFile ((char *) text_buf, (void **) &m8_file_buffer, 0) == (unsigned int) -1)
+       if ( (length = vfsLoadFile ((char *) text_buf, (void **) &m8_file_buffer, 0)) == (unsigned int) -1)
     {
        strcpy(text_buf, name);
        for(i=(strlen(text_buf)-1); i>0; i--)
@@ -62,7 +62,7 @@ void LoadM8(const char *name, unsigned char **pic, int *width, int *height)
                return;
        }
     }
-    
+
     m8_header = (m8_header_t *)m8_file_buffer;
 
     // make sure we have a valid M8 file
index 6bb8ca23cd6a99ca664dc58359befd49ec2459d7..79e7c3aa77fff52bc0048acdd34f5f7ef44a5a0d 100644 (file)
@@ -30,17 +30,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 void LoadWAL(const char *name, unsigned char **pic, int *width, int *height)
 {
-    FILE       *f;
+//    FILE     *f;
     miptex_t   *wal_header;
-    rgb_t      *palette;
+//    rgb_t    *palette;
     int                i, num_pixels, size;
-    char       text_buf[255];
+//    char     text_buf[255];
     unsigned int       length;
     unsigned char      *palette_ent, *buf_temp;
     unsigned char       *buffer, *wal_file_buffer;
 
     // open file
-    if ( length = vfsLoadFile ((char *) name, (void **) &wal_file_buffer, 0) == (unsigned int) -1)
+    if ( (length = vfsLoadFile ((char *) name, (void **) &wal_file_buffer, 0)) == (unsigned int) -1)
     {
        Sys_Printf("Unable to open file %s\n",name);
       return;
index a40a8f343a5e49d7a1f292ef5b8dafd903398052..871fff89907753edafd82153541d17e18854183c 100644 (file)
@@ -569,7 +569,7 @@ bool Primitive_Parse(brush_t *pBrush)
 void Entity_Parse(entity_t *pEntity)
 {
   brush_t *pBrush;
-  CPtrArray *brushes = NULL;
+//  CPtrArray *brushes = NULL;
   char temptoken[1024];
 
   char *token = Token();
index fb0700e29747ccc2166a175a0073e5611fc5bbda..621b5cd4f567067f5fddb415e3316b0bc981024e 100644 (file)
@@ -52,7 +52,7 @@ void Patch_Write(patchMesh_t *pPatch, IDataStream *out)
   if(!strncmp(str, "textures/", 9)) str+=9;
   out->printf("patchDef2\n{\n%s\n( %i %i 0 0 0 )\n",
     str, pPatch->width, pPatch->height);
-  
+
   // write matrix
   out->printf("(\n");
   for(i=0; i<pPatch->width; i++)
@@ -117,7 +117,7 @@ void Face_Write (face_t *face, IDataStream *out, bool bAlternateTexdef = false)
   if (g_MapVersion == MAPVERSION_HL)
   {
     char *pos;
-       while ( pos = (char*)strchr( str, '/' ) ) {
+       while ( (pos = (char*)strchr( str, '/' )) != NULL ) {
                str = pos+1; // to speed optimize, change the "while" to an "if"
        }
   }
index 2a238355e94d974f8dc377606564108c385de95c..430ab4ddafa58f6b8456d3c91c085eab6e72b896 100644 (file)
@@ -2,30 +2,30 @@
 Copyright (c) 2001, Loki software, inc.
 All rights reserved.
 
-Redistribution and use in source and binary forms, with or without modification, 
+Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
 
-Redistributions of source code must retain the above copyright notice, this list 
+Redistributions of source code must retain the above copyright notice, this list
 of conditions and the following disclaimer.
 
 Redistributions in binary form must reproduce the above copyright notice, this
 list of conditions and the following disclaimer in the documentation and/or
 other materials provided with the distribution.
 
-Neither the name of Loki software nor the names of its contributors may be used 
-to endorse or promote products derived from this software without specific prior 
-written permission. 
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
-DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 
-DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+Neither the name of Loki software nor the names of its contributors may be used
+to endorse or promote products derived from this software without specific prior
+written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 //
@@ -46,7 +46,7 @@ _QERFileSystemTable g_VFSTable;
 _QERScripLibTable g_ScripLibTable;
 _QERBrushTable g_BrushTable;
 
-static bool g_bInterfaceInitDone = false;
+// static bool g_bInterfaceInitDone = false;
 
 // =============================================================================
 // SYNAPSE
@@ -54,8 +54,8 @@ static bool g_bInterfaceInitDone = false;
 CSynapseServer* g_pSynapseServer = NULL;
 CSynapseClientShaders g_SynapseClient;
 
-static const XMLConfigEntry_t entries[] = 
-  { 
+static const XMLConfigEntry_t entries[] =
+  {
     { SHADERS_MAJOR, SYN_PROVIDE, sizeof(_QERShadersTable), NULL },
     { VFS_MAJOR, SYN_REQUIRE, sizeof(g_VFSTable), &g_VFSTable },
     { NULL, SYN_UNKNOWN, 0, NULL } };
@@ -75,11 +75,11 @@ extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const
   g_pSynapseServer = pServer;
   g_pSynapseServer->IncRef();
   Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf());
-  
+
   if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) {
     return NULL;
   }
-  
+
   g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable);
   g_SynapseClient.AddAPI(DATA_MAJOR, NULL, sizeof(_QERAppDataTable), SYN_REQUIRE, &g_DataTable);
   g_SynapseClient.AddAPI(QGL_MAJOR, NULL, sizeof(_QERQglTable), SYN_REQUIRE, &g_QglTable);
index 8c2fd90e59c6b944d3db6a2d96b7e02fcbea2db4..dd0483ce04116cf7fc37705427b6a125f083e561 100644 (file)
@@ -219,7 +219,7 @@ void IsFaceConflicting()
 {
   texdef_t* tmp_texdef;
   texdef_to_face_t* temp_texdef_face_list;
-  char buf[12];
+//  char buf[12];
   char texture_name[128];
 
   if (texdef_face_list_empty())
@@ -257,7 +257,7 @@ void IsFaceConflicting()
   {
     temp_texdef_face_list = get_texdef_face_list()->next;
 
-    for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
+    for (; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
     {
       tmp_texdef = &temp_texdef_face_list->texdef;
       if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] )
@@ -315,7 +315,7 @@ static void PopulateTextureComboList()
   texdef_to_face_t* temp_texdef_face_list;
   char blank[1];
   GList *items = NULL;
-  GList *tmp_item;
+//  GList *tmp_item;
   int num_of_list_items = 0;
 
   blank[0] = 0;
@@ -381,7 +381,7 @@ static void GetTexdefInfo_from_Radiant()
 
   if (!texdef_face_list_empty())
   {
-    texdef_to_face_t* p = get_texdef_face_list();
+//    texdef_to_face_t* p = get_texdef_face_list();
     GetSelFacesTexdef( get_texdef_face_list() );
   }
 
@@ -1862,7 +1862,7 @@ static void on_fit_button_clicked (GtkButton *button, gpointer user_data)
 static void on_axial_button_clicked (GtkButton *button, gpointer user_data)
 {
   texdef_t* tmp_texdef;
-  texdef_t* tmp_orig_texdef;
+//  texdef_t* tmp_orig_texdef;
   texdef_to_face_t* temp_texdef_face_list;
 
   if (!texdef_face_list_empty() && g_bListenChanged)
index c67fa7c02d265cdd9aa66e7f15fd572a6a24aaee..7c016fcbec4e8e63222edd15446c219f6f70b4d9 100644 (file)
@@ -262,7 +262,7 @@ void IsFaceConflicting()
   {
     temp_texdef_face_list = get_texdef_face_list()->next;
 
-    for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
+    for (; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
     {
       tmp_texdef = &temp_texdef_face_list->texdef;
       if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] )
index 7f92210aa9d6d0f0d79743a10f85da421e6584b5..37aad9cce837e7072e73cd89ae994b7dca46cd62 100644 (file)
@@ -224,7 +224,7 @@ void IsFaceConflicting()
 {
   texdef_t* tmp_texdef;
   texdef_to_face_t* temp_texdef_face_list;
-  char buf[12];
+//  char buf[12];
   char texture_name[128];
 
   if (texdef_face_list_empty())
@@ -262,7 +262,7 @@ void IsFaceConflicting()
   {
     temp_texdef_face_list = get_texdef_face_list()->next;
 
-    for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
+    for (; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
     {
       tmp_texdef = &temp_texdef_face_list->texdef;
       if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] )
@@ -320,7 +320,7 @@ static void PopulateTextureComboList()
   texdef_to_face_t* temp_texdef_face_list;
   char blank[1];
   GList *items = NULL;
-  GList *tmp_item;
+//  GList *tmp_item;
   int num_of_list_items = 0;
 
   blank[0] = 0;
@@ -386,7 +386,7 @@ static void GetTexdefInfo_from_Radiant()
 
   if (!texdef_face_list_empty())
   {
-    texdef_to_face_t* p = get_texdef_face_list();
+//    texdef_to_face_t* p = get_texdef_face_list();
     GetSelFacesTexdef( get_texdef_face_list() );
   }
 
@@ -1875,7 +1875,7 @@ static void on_fit_button_clicked (GtkButton *button, gpointer user_data)
 static void on_axial_button_clicked (GtkButton *button, gpointer user_data)
 {
   texdef_t* tmp_texdef;
-  texdef_t* tmp_orig_texdef;
+//  texdef_t* tmp_orig_texdef;
   texdef_to_face_t* temp_texdef_face_list;
 
   if (!texdef_face_list_empty() && g_bListenChanged)
index 7ff1357a2b185d4349e7f8022859d38f4a9befe2..dabe39b6afcefd5eaea89e3e50c5a70f687e82d3 100644 (file)
@@ -262,7 +262,7 @@ void IsFaceConflicting()
   {
     temp_texdef_face_list = get_texdef_face_list()->next;
 
-    for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
+    for (; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
     {
       tmp_texdef = &temp_texdef_face_list->texdef;
       if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] )
index 7d85894918c18c8fbd0c25a13ad44ba5d9781065..d246a20331df53344d2f687c28cda3a4ebfe8adc 100644 (file)
@@ -264,6 +264,8 @@ void Texture_SetMode(int iMenu)
     iMode = -1;
     texturing = false;
     break;
+  default:
+    return;
   }
 
   g_qeglobals.d_savedinfo.iTexMenu = iMenu;