From 47cecb0287f6cdf58f678a1eeaee07dc38ae419f Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 7 Jan 2004 21:27:23 +0000 Subject: [PATCH] Warning fixes git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5604 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Examples/chicken/multimap/example.c | 2 +- SWIG/Examples/csharp/variables/example.c | 4 ++-- SWIG/Examples/guile/multimap/example.c | 2 +- SWIG/Examples/java/multimap/example.c | 2 +- SWIG/Examples/java/native/example.i | 2 ++ SWIG/Examples/java/reference/example.cxx | 2 +- SWIG/Examples/java/variables/example.c | 4 ++-- SWIG/Examples/mzscheme/multimap/example.c | 2 +- SWIG/Examples/perl5/multimap/example.c | 2 +- SWIG/Examples/perl5/reference/example.cxx | 2 +- SWIG/Examples/perl5/variables/example.c | 4 ++-- SWIG/Examples/php4/reference/example.cxx | 2 +- SWIG/Examples/php4/variables/example.c | 4 ++-- SWIG/Examples/python/multimap/example.c | 2 +- SWIG/Examples/python/reference/example.cxx | 2 +- SWIG/Examples/python/variables/example.c | 4 ++-- SWIG/Examples/ruby/multimap/example.c | 2 +- SWIG/Examples/ruby/reference/example.cxx | 2 +- SWIG/Examples/ruby/variables/example.c | 4 ++-- SWIG/Examples/tcl/multimap/example.c | 2 +- SWIG/Examples/tcl/reference/example.cxx | 2 +- SWIG/Examples/tcl/variables/example.c | 4 ++-- 22 files changed, 30 insertions(+), 28 deletions(-) diff --git a/SWIG/Examples/chicken/multimap/example.c b/SWIG/Examples/chicken/multimap/example.c index d135481af..b8360fa8a 100644 --- a/SWIG/Examples/chicken/multimap/example.c +++ b/SWIG/Examples/chicken/multimap/example.c @@ -39,7 +39,7 @@ int count(char *bytes, int len, char c) { void capitalize(char *str, int len) { int i; for (i = 0; i < len; i++) { - str[i] = toupper(str[i]); + str[i] = (char)toupper(str[i]); } } diff --git a/SWIG/Examples/csharp/variables/example.c b/SWIG/Examples/csharp/variables/example.c index 37e9feb33..ac2b011bd 100644 --- a/SWIG/Examples/csharp/variables/example.c +++ b/SWIG/Examples/csharp/variables/example.c @@ -47,9 +47,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)"); - printf("iptrvar = %x\n", iptrvar); + printf("iptrvar = %p\n", iptrvar); printf("name = %s\n", name); - printf("ptptr = %x (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/SWIG/Examples/guile/multimap/example.c b/SWIG/Examples/guile/multimap/example.c index d135481af..b8360fa8a 100644 --- a/SWIG/Examples/guile/multimap/example.c +++ b/SWIG/Examples/guile/multimap/example.c @@ -39,7 +39,7 @@ int count(char *bytes, int len, char c) { void capitalize(char *str, int len) { int i; for (i = 0; i < len; i++) { - str[i] = toupper(str[i]); + str[i] = (char)toupper(str[i]); } } diff --git a/SWIG/Examples/java/multimap/example.c b/SWIG/Examples/java/multimap/example.c index d8cbdc74d..3f44e2daa 100644 --- a/SWIG/Examples/java/multimap/example.c +++ b/SWIG/Examples/java/multimap/example.c @@ -38,7 +38,7 @@ int count(char *bytes, int len, char c) { void capitalize(char *str, int len) { int i; for (i = 0; i < len; i++) { - str[i] = toupper(str[i]); + str[i] = (char)toupper(str[i]); } } diff --git a/SWIG/Examples/java/native/example.i b/SWIG/Examples/java/native/example.i index 76ae9eea8..65710f2bc 100644 --- a/SWIG/Examples/java/native/example.i +++ b/SWIG/Examples/java/native/example.i @@ -33,6 +33,8 @@ JNIEXPORT jstring JNICALL Java_exampleJNI_point_1toString2(JNIEnv *jenv, jclass char buf[80]; jstring result; + (void)jcls; + p = *(Point **)&jpoint; sprintf(buf, "[%d,%d]", p->x, p->y); diff --git a/SWIG/Examples/java/reference/example.cxx b/SWIG/Examples/java/reference/example.cxx index 384e40bb7..8bc264b02 100644 --- a/SWIG/Examples/java/reference/example.cxx +++ b/SWIG/Examples/java/reference/example.cxx @@ -14,7 +14,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %x (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); return temp; } diff --git a/SWIG/Examples/java/variables/example.c b/SWIG/Examples/java/variables/example.c index 37e9feb33..ac2b011bd 100644 --- a/SWIG/Examples/java/variables/example.c +++ b/SWIG/Examples/java/variables/example.c @@ -47,9 +47,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)"); - printf("iptrvar = %x\n", iptrvar); + printf("iptrvar = %p\n", iptrvar); printf("name = %s\n", name); - printf("ptptr = %x (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/SWIG/Examples/mzscheme/multimap/example.c b/SWIG/Examples/mzscheme/multimap/example.c index d135481af..b8360fa8a 100644 --- a/SWIG/Examples/mzscheme/multimap/example.c +++ b/SWIG/Examples/mzscheme/multimap/example.c @@ -39,7 +39,7 @@ int count(char *bytes, int len, char c) { void capitalize(char *str, int len) { int i; for (i = 0; i < len; i++) { - str[i] = toupper(str[i]); + str[i] = (char)toupper(str[i]); } } diff --git a/SWIG/Examples/perl5/multimap/example.c b/SWIG/Examples/perl5/multimap/example.c index d135481af..b8360fa8a 100644 --- a/SWIG/Examples/perl5/multimap/example.c +++ b/SWIG/Examples/perl5/multimap/example.c @@ -39,7 +39,7 @@ int count(char *bytes, int len, char c) { void capitalize(char *str, int len) { int i; for (i = 0; i < len; i++) { - str[i] = toupper(str[i]); + str[i] = (char)toupper(str[i]); } } diff --git a/SWIG/Examples/perl5/reference/example.cxx b/SWIG/Examples/perl5/reference/example.cxx index 384e40bb7..8bc264b02 100644 --- a/SWIG/Examples/perl5/reference/example.cxx +++ b/SWIG/Examples/perl5/reference/example.cxx @@ -14,7 +14,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %x (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); return temp; } diff --git a/SWIG/Examples/perl5/variables/example.c b/SWIG/Examples/perl5/variables/example.c index 37e9feb33..ac2b011bd 100644 --- a/SWIG/Examples/perl5/variables/example.c +++ b/SWIG/Examples/perl5/variables/example.c @@ -47,9 +47,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)"); - printf("iptrvar = %x\n", iptrvar); + printf("iptrvar = %p\n", iptrvar); printf("name = %s\n", name); - printf("ptptr = %x (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/SWIG/Examples/php4/reference/example.cxx b/SWIG/Examples/php4/reference/example.cxx index a37660666..6c8dc8edb 100644 --- a/SWIG/Examples/php4/reference/example.cxx +++ b/SWIG/Examples/php4/reference/example.cxx @@ -14,7 +14,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %x (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); return temp; } diff --git a/SWIG/Examples/php4/variables/example.c b/SWIG/Examples/php4/variables/example.c index 856895951..552ee49aa 100644 --- a/SWIG/Examples/php4/variables/example.c +++ b/SWIG/Examples/php4/variables/example.c @@ -47,9 +47,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)"); - printf("iptrvar = %x\n", iptrvar); + printf("iptrvar = %p\n", iptrvar); printf("name = %s\n", name); - printf("ptptr = %x (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/SWIG/Examples/python/multimap/example.c b/SWIG/Examples/python/multimap/example.c index d135481af..b8360fa8a 100644 --- a/SWIG/Examples/python/multimap/example.c +++ b/SWIG/Examples/python/multimap/example.c @@ -39,7 +39,7 @@ int count(char *bytes, int len, char c) { void capitalize(char *str, int len) { int i; for (i = 0; i < len; i++) { - str[i] = toupper(str[i]); + str[i] = (char)toupper(str[i]); } } diff --git a/SWIG/Examples/python/reference/example.cxx b/SWIG/Examples/python/reference/example.cxx index 384e40bb7..8bc264b02 100644 --- a/SWIG/Examples/python/reference/example.cxx +++ b/SWIG/Examples/python/reference/example.cxx @@ -14,7 +14,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %x (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); return temp; } diff --git a/SWIG/Examples/python/variables/example.c b/SWIG/Examples/python/variables/example.c index 37e9feb33..ac2b011bd 100644 --- a/SWIG/Examples/python/variables/example.c +++ b/SWIG/Examples/python/variables/example.c @@ -47,9 +47,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)"); - printf("iptrvar = %x\n", iptrvar); + printf("iptrvar = %p\n", iptrvar); printf("name = %s\n", name); - printf("ptptr = %x (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/SWIG/Examples/ruby/multimap/example.c b/SWIG/Examples/ruby/multimap/example.c index d135481af..b8360fa8a 100644 --- a/SWIG/Examples/ruby/multimap/example.c +++ b/SWIG/Examples/ruby/multimap/example.c @@ -39,7 +39,7 @@ int count(char *bytes, int len, char c) { void capitalize(char *str, int len) { int i; for (i = 0; i < len; i++) { - str[i] = toupper(str[i]); + str[i] = (char)toupper(str[i]); } } diff --git a/SWIG/Examples/ruby/reference/example.cxx b/SWIG/Examples/ruby/reference/example.cxx index 384e40bb7..8bc264b02 100644 --- a/SWIG/Examples/ruby/reference/example.cxx +++ b/SWIG/Examples/ruby/reference/example.cxx @@ -14,7 +14,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %x (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); return temp; } diff --git a/SWIG/Examples/ruby/variables/example.c b/SWIG/Examples/ruby/variables/example.c index 37e9feb33..ac2b011bd 100644 --- a/SWIG/Examples/ruby/variables/example.c +++ b/SWIG/Examples/ruby/variables/example.c @@ -47,9 +47,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)"); - printf("iptrvar = %x\n", iptrvar); + printf("iptrvar = %p\n", iptrvar); printf("name = %s\n", name); - printf("ptptr = %x (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/SWIG/Examples/tcl/multimap/example.c b/SWIG/Examples/tcl/multimap/example.c index d135481af..b8360fa8a 100644 --- a/SWIG/Examples/tcl/multimap/example.c +++ b/SWIG/Examples/tcl/multimap/example.c @@ -39,7 +39,7 @@ int count(char *bytes, int len, char c) { void capitalize(char *str, int len) { int i; for (i = 0; i < len; i++) { - str[i] = toupper(str[i]); + str[i] = (char)toupper(str[i]); } } diff --git a/SWIG/Examples/tcl/reference/example.cxx b/SWIG/Examples/tcl/reference/example.cxx index 384e40bb7..8bc264b02 100644 --- a/SWIG/Examples/tcl/reference/example.cxx +++ b/SWIG/Examples/tcl/reference/example.cxx @@ -14,7 +14,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %x (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); return temp; } diff --git a/SWIG/Examples/tcl/variables/example.c b/SWIG/Examples/tcl/variables/example.c index 37e9feb33..ac2b011bd 100644 --- a/SWIG/Examples/tcl/variables/example.c +++ b/SWIG/Examples/tcl/variables/example.c @@ -47,9 +47,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)"); - printf("iptrvar = %x\n", iptrvar); + printf("iptrvar = %p\n", iptrvar); printf("name = %s\n", name); - printf("ptptr = %x (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); }