]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
fixed warnings
authorspog <spog@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Sun, 11 Jun 2006 11:20:33 +0000 (11:20 +0000)
committerspog <spog@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Sun, 11 Jun 2006 11:20:33 +0000 (11:20 +0000)
git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@79 8a3a26a2-13c4-0310-b231-cf6edde360e5

contrib/bobtoolz/DBrush.cpp
contrib/bobtoolz/DEntity.cpp
contrib/bobtoolz/DPatch.cpp
contrib/bobtoolz/DTrainDrawer.cpp
contrib/bobtoolz/bobToolz-GTK.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/bobtoolz/misc.cpp
contrib/bobtoolz/shapes.cpp
contrib/prtview/AboutDialog.cpp
contrib/prtview/ConfigDialog.cpp
contrib/prtview/LoadPortalFileDialog.cpp

index 6c03fb8227da05ef4a0c6b82b2b74c1ef1b7bb23..96c884d22e69528ecab72a4861f7e488d7b7cbbd 100644 (file)
@@ -126,7 +126,7 @@ int DBrush::BuildPoints()
 //     Sys_Printf("%i points on brush\n", pointList.size());
 #endif
 
-       return pointList.size();
+       return static_cast<int>(pointList.size());
 }
 
 void DBrush_addFace(DBrush& brush, const _QERFaceData& faceData)
index 6dafc93bf001902ec35fd2244b157d701c3cb5ea..f03b489e786e14c4794bc7f3e185878c57efcfdd 100644 (file)
@@ -252,7 +252,7 @@ inline const Functor& Scene_forEachSelectedBrush(const Functor& functor)
 
 void DEntity_loadBrush(DEntity& entity, scene::Instance& brush)
 {
-  DBrush* loadBrush = entity.NewBrush(entity.brushList.size());
+  DBrush* loadBrush = entity.NewBrush(static_cast<int>(entity.brushList.size()));
        loadBrush->LoadFromBrush(brush, true);
 }
 typedef ReferenceCaller1<DEntity, scene::Instance&, DEntity_loadBrush> DEntityLoadBrushCaller;
@@ -702,7 +702,7 @@ void DEntity::SpawnVector(const char* key, const char* defaultstring, vec_t* out
 }
 
 int DEntity::GetBrushCount( void ) {
-       return brushList.size();
+       return static_cast<int>(brushList.size());
 }
 
 DBrush* DEntity::FindBrushByPointer( scene::Node& brush ) {
index 4698c610361260efd289c4ccf704f568ac6ca379..30bb5c60029e90342021d20bd32faf4c97bf7b2e 100644 (file)
@@ -145,8 +145,8 @@ void DPatch::LoadFromPatch(scene::Instance& patch)
 
   PatchControlMatrix matrix = GlobalPatchCreator().Patch_getControlPoints(patch.path().top());
 
-  width = matrix.x();
-       height = matrix.y();
+  width = static_cast<int>(matrix.x());
+       height = static_cast<int>(matrix.y());
 
   for(int x = 0; x < height; x++)
   {
index c0831bf58d0a5022cd782a29aca346a0dc914f0c..92b2333a1a10011a9a205bbc5d632e53dda6fa46 100644 (file)
@@ -273,7 +273,7 @@ void DTrainDrawer::BuildPaths() {
                        continue;
                }
 
-               int count = pSP->m_pointList.size() + 2;
+    std::size_t count = pSP->m_pointList.size() + 2;
                vec3_t* v = new vec3_t[count];
 
                VectorCopy(pSP->point.vOrigin, v[0]);
@@ -286,7 +286,7 @@ void DTrainDrawer::BuildPaths() {
                VectorCopy(pSP->pTarget->vOrigin, v[i]);
 
                for (float tension = 0.0f; tension <= 1.f; tension += 0.01f) {
-                       CalculateSpline_r(v, count, out._pnt, tension);
+                       CalculateSpline_r(v, static_cast<int>(count), out._pnt, tension);
                        pSP->m_vertexList.push_front(out);
                }
 
index 26578e93802b08b4a0d1308fcf253ce378c5f898..be4f7804c67f41e929d5a7b6c54c06d305589983 100644 (file)
@@ -204,7 +204,7 @@ public:
     }
   }
 
-  int mIndex;
+  std::size_t mIndex;
 };
 
 CBobtoolzToolbarButton g_bobtoolzToolbarButtons[NUM_TOOLBARBUTTONS];
index cdfc54f6bf3d94f5f476116ca0702842e200f5f5..15d9db672723959f35c38937bcb2677d6992dcb5 100644 (file)
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #include "str.h"
 #include <list>
 #include <gtk/gtk.h>
+#include "gtkutil/pointer.h"
 
 #include "../lists.h"
 #include "../misc.h"
@@ -90,7 +91,7 @@ static void dialog_button_callback (GtkWidget *widget, gpointer data)
        ret = (EMessageBoxReturn*)g_object_get_data (G_OBJECT (parent), "ret");
  
        *loop = 0;
-       *ret = (EMessageBoxReturn)GPOINTER_TO_INT(data);
+       *ret = (EMessageBoxReturn)gpointer_to_int(data);
 }
  
 static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)
index 027e123d1eaa12afeb80093625bd205b7e95b941..82560533307af1266696b7434b98d15a186580d7 100644 (file)
@@ -131,12 +131,10 @@ void SetInitialStairPos(int dir, vec3_t min, vec3_t max, float width)
 char* TranslateString (char *buf)
 {
        static  char    buf2[32768];
-       int             i, l;
-       char    *out;
 
-       l = strlen(buf);
-       out = buf2;
-       for (i=0 ; i<l ; i++)
+  std::size_t l = strlen(buf);
+       char* out = buf2;
+       for (int i=0 ; i<l ; i++)
        {
                if (buf[i] == '\n')
                {
index 7385b6f038cac651ad075c37fc4abf90c29468f3..4713ff5f65aa93a21d0a5ce5a2fab221732c5b84 100644 (file)
@@ -113,19 +113,17 @@ void AddFaceWithTextureScaled(scene::Node& brush, vec3_t va, vec3_t vb, vec3_t v
 
                if(bHorScale)
                {
-                       int texWidth = pqtTexInfo->width;
                        float width = maxX - minX;
 
-                       scale[0] = width/texWidth;
+                       scale[0] = width/pqtTexInfo->width;
                        shift[0] = -(float)((int)maxX%(int)width)/scale[0];
                }
 
                if(bVertScale)
                {
-                       int texHeight = pqtTexInfo->height;
                        float height = maxY - minY;
 
-                       scale[1] = height/texHeight;
+                       scale[1] = height/pqtTexInfo->height;
                        shift[1] = (float)((int)minY%(int)height)/scale[1];
                }
 
index 6918e14935297ebf1c7ec9808bcd0ce0de70cfef..bd85103a9240bcb70231d3cef17692af52a04096 100644 (file)
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #include "AboutDialog.h"
 #include <gtk/gtk.h>
 #include "version.h"
+#include "gtkutil/pointer.h"
 
 #include "prtview.h"
 #include "ConfigDialog.h"
@@ -34,7 +35,7 @@ static void dialog_button_callback (GtkWidget *widget, gpointer data)
   ret = (int*)g_object_get_data (G_OBJECT (parent), "ret");
 
   *loop = 0;
-  *ret = (int)data;
+  *ret = gpointer_to_int(data);
 }
 
 static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)
index 89dd6fe94ef069a13ba933ad2010494874c25c34..d0e9589485bf794de3471bc4104f406050f4172e 100644 (file)
@@ -36,7 +36,7 @@ static void dialog_button_callback (GtkWidget *widget, gpointer data)
   ret = (int*)g_object_get_data (G_OBJECT (parent), "ret");
 
   *loop = 0;
-  *ret = (int)data;
+  *ret = gpointer_to_int(data);
 }
 
 static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)
@@ -236,7 +236,7 @@ static void OnFog (GtkWidget *widget, gpointer data)
 
 static void OnSelchangeZbuffer (GtkWidget *widget, gpointer data)
 {
-  portals.zbuffer = GPOINTER_TO_INT (data);
+  portals.zbuffer = gpointer_to_int(data);
 
   Portals_shadersChanged();
   SceneChangeNotify();
index 9dc80b2be871a9cd6832ace1c91b56327e68801f..a7c06bfd4657060c3e1c455ffe0a4b40382ae403 100644 (file)
@@ -41,7 +41,7 @@ static void dialog_button_callback (GtkWidget *widget, gpointer data)
   ret = (int*)g_object_get_data (G_OBJECT (parent), "ret");
 
   *loop = 0;
-  *ret = (int)data;
+  *ret = gpointer_to_int(data);
 }
 
 static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)
@@ -66,7 +66,7 @@ static void file_sel_callback (GtkWidget *widget, gpointer data)
   filename = (char**)g_object_get_data (G_OBJECT (parent), "filename");
  
   *loop = 0;
-  if ((int)data == IDOK)
+  if (gpointer_to_int(data) == IDOK)
     *filename = g_strdup (gtk_file_selection_get_filename (GTK_FILE_SELECTION (parent)));
 }