64 bit portability warnings fix

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9580 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-11-24 22:41:17 +00:00
commit e3cb7be56d
4 changed files with 11 additions and 10 deletions

View file

@ -21,6 +21,7 @@ struct Base {
Base(int v = 0) : value(v) {} Base(int v = 0) : value(v) {}
int value; int value;
virtual int method(int v) { virtual int method(int v) {
return v;
} }
}; };
struct Derived : Base { struct Derived : Base {

View file

@ -55,7 +55,7 @@ public:
const std::string &invoke(int idx) { const std::string &invoke(int idx) {
return quuxen_[idx]->director_method(); return quuxen_[idx]->director_method();
} }
int size() { size_t size() {
return quuxen_.size(); return quuxen_.size();
} }
private: private:
@ -86,7 +86,7 @@ public:
void push(Quux *elem); void push(Quux *elem);
Quux *get(int idx); Quux *get(int idx);
const std::string &invoke(int idx); const std::string &invoke(int idx);
int size(); size_t size();
}; };

View file

@ -195,8 +195,8 @@ If you have used typedef to change type-names, you can also do this :
void * ALIGN8, void * ALIGN8,
Pointer ALIGN8 Pointer ALIGN8
{ {
long tmp; unsigned long long tmp;
tmp = (long) $1; tmp = (unsigned long long) $1;
if (tmp & 7) { if (tmp & 7) {
SWIG_exception(SWIG_ValueError,"Pointer must be 8-byte aligned."); SWIG_exception(SWIG_ValueError,"Pointer must be 8-byte aligned.");
} }
@ -206,8 +206,8 @@ If you have used typedef to change type-names, you can also do this :
void * ALIGN4, void * ALIGN4,
Pointer ALIGN4 Pointer ALIGN4
{ {
long tmp; unsigned long long tmp;
tmp = (long) $1; tmp = (unsigned long long) $1;
if (tmp & 3) { if (tmp & 3) {
SWIG_exception(SWIG_ValueError,"Pointer must be 4-byte aligned."); SWIG_exception(SWIG_ValueError,"Pointer must be 4-byte aligned.");
} }
@ -217,8 +217,8 @@ If you have used typedef to change type-names, you can also do this :
void * ALIGN2, void * ALIGN2,
Pointer ALIGN2 Pointer ALIGN2
{ {
long tmp; unsigned long long tmp;
tmp = (long) $1; tmp = (unsigned long long) $1;
if (tmp & 1) { if (tmp & 1) {
SWIG_exception(SWIG_ValueError,"Pointer must be 2-byte aligned."); SWIG_exception(SWIG_ValueError,"Pointer must be 2-byte aligned.");
} }

View file

@ -297,14 +297,14 @@
int index = -1; int index = -1;
std::vector<CTYPE >::iterator it = std::find(self->begin(), self->end(), value); std::vector<CTYPE >::iterator it = std::find(self->begin(), self->end(), value);
if (it != self->end()) if (it != self->end())
index = it - self->begin(); index = (int)(it - self->begin());
return index; return index;
} }
int LastIndexOf(const value_type& value) { int LastIndexOf(const value_type& value) {
int index = -1; int index = -1;
std::vector<CTYPE >::reverse_iterator rit = std::find(self->rbegin(), self->rend(), value); std::vector<CTYPE >::reverse_iterator rit = std::find(self->rbegin(), self->rend(), value);
if (rit != self->rend()) if (rit != self->rend())
index = self->rend() - 1 - rit; index = (int)(self->rend() - 1 - rit);
return index; return index;
} }
void Remove(const value_type& value) { void Remove(const value_type& value) {