fixed warnings

git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@79 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
spog 2006-06-11 11:20:33 +00:00
parent 8feb702d62
commit 0f319946a6
11 changed files with 21 additions and 23 deletions

View 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)

View 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 ) {

View 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++)
{

View 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);
}

View file

@ -204,7 +204,7 @@ public:
}
}
int mIndex;
std::size_t mIndex;
};
CBobtoolzToolbarButton g_bobtoolzToolbarButtons[NUM_TOOLBARBUTTONS];

View 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)

View 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')
{

View 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];
}

View 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)

View 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();

View 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)));
}