From: spog Date: Sun, 11 Jun 2006 11:20:33 +0000 (+0000) Subject: fixed warnings X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7075489efc1277a464cec8fd98a61eeffa1a3c83;p=xonotic%2Fnetradiant.git fixed warnings git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@79 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- diff --git a/contrib/bobtoolz/DBrush.cpp b/contrib/bobtoolz/DBrush.cpp index 6c03fb82..96c884d2 100644 --- a/contrib/bobtoolz/DBrush.cpp +++ b/contrib/bobtoolz/DBrush.cpp @@ -126,7 +126,7 @@ int DBrush::BuildPoints() // Sys_Printf("%i points on brush\n", pointList.size()); #endif - return pointList.size(); + return static_cast(pointList.size()); } void DBrush_addFace(DBrush& brush, const _QERFaceData& faceData) diff --git a/contrib/bobtoolz/DEntity.cpp b/contrib/bobtoolz/DEntity.cpp index 6dafc93b..f03b489e 100644 --- a/contrib/bobtoolz/DEntity.cpp +++ b/contrib/bobtoolz/DEntity.cpp @@ -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(entity.brushList.size())); loadBrush->LoadFromBrush(brush, true); } typedef ReferenceCaller1 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(brushList.size()); } DBrush* DEntity::FindBrushByPointer( scene::Node& brush ) { diff --git a/contrib/bobtoolz/DPatch.cpp b/contrib/bobtoolz/DPatch.cpp index 4698c610..30bb5c60 100644 --- a/contrib/bobtoolz/DPatch.cpp +++ b/contrib/bobtoolz/DPatch.cpp @@ -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(matrix.x()); + height = static_cast(matrix.y()); for(int x = 0; x < height; x++) { diff --git a/contrib/bobtoolz/DTrainDrawer.cpp b/contrib/bobtoolz/DTrainDrawer.cpp index c0831bf5..92b2333a 100644 --- a/contrib/bobtoolz/DTrainDrawer.cpp +++ b/contrib/bobtoolz/DTrainDrawer.cpp @@ -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(count), out._pnt, tension); pSP->m_vertexList.push_front(out); } diff --git a/contrib/bobtoolz/bobToolz-GTK.cpp b/contrib/bobtoolz/bobToolz-GTK.cpp index 26578e93..be4f7804 100644 --- a/contrib/bobtoolz/bobToolz-GTK.cpp +++ b/contrib/bobtoolz/bobToolz-GTK.cpp @@ -204,7 +204,7 @@ public: } } - int mIndex; + std::size_t mIndex; }; CBobtoolzToolbarButton g_bobtoolzToolbarButtons[NUM_TOOLBARBUTTONS]; diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index cdfc54f6..15d9db67 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "str.h" #include #include +#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) diff --git a/contrib/bobtoolz/misc.cpp b/contrib/bobtoolz/misc.cpp index 027e123d..82560533 100644 --- a/contrib/bobtoolz/misc.cpp +++ b/contrib/bobtoolz/misc.cpp @@ -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 ; iwidth; 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]; } diff --git a/contrib/prtview/AboutDialog.cpp b/contrib/prtview/AboutDialog.cpp index 6918e149..bd85103a 100644 --- a/contrib/prtview/AboutDialog.cpp +++ b/contrib/prtview/AboutDialog.cpp @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "AboutDialog.h" #include #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) diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 89dd6fe9..d0e95894 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -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(); diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index 9dc80b2b..a7c06bfd 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -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))); }