Fix warnings

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10121 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2007-11-14 21:42:31 +00:00
commit 8eae1cfb5a
2 changed files with 6 additions and 4 deletions

View file

@ -48,7 +48,7 @@ getA()
return a; return a;
} }
static struct A fixed = {20, 3.010101, 42}; static struct A fixed = {20, 3, 42.0};
struct A * struct A *
getARef() getARef()

View file

@ -17,12 +17,14 @@ Obj *
getObject(int i, double d) getObject(int i, double d)
{ {
const char *test_string = "a test string";
Obj *obj; Obj *obj;
obj = (Obj *) calloc(1, sizeof(Obj)); obj = (Obj *) calloc(1, sizeof(Obj));
obj->i = i; obj->i = i;
obj->d = d; obj->d = d;
obj->str = strdup("a test string"); obj->str = (char *)malloc(strlen(test_string));
strcpy(obj->str, test_string);
return(obj); return(obj);
} }
@ -48,7 +50,7 @@ extern float *MyFloatRef;
#define PI 3.14159265358979 #define PI 3.14159265358979
unsigned long MyULong = 20; unsigned long MyULong = 20;
static float MyFloat = 1.05; static float MyFloat = 1.05f;
float *MyFloatRef = &MyFloat; float *MyFloatRef = &MyFloat;
const double PiSquared = PI * PI; const double PiSquared = PI * PI;
@ -73,7 +75,7 @@ getDouble()
float float
getFloat() getFloat()
{ {
return PI/2; return (float)PI/2;
} }
long getLong() long getLong()