64 bit portability warnings fix

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

View file

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

View file

@ -55,7 +55,7 @@ public:
const std::string &invoke(int idx) {
return quuxen_[idx]->director_method();
}
int size() {
size_t size() {
return quuxen_.size();
}
private:
@ -86,7 +86,7 @@ public:
void push(Quux *elem);
Quux *get(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,
Pointer ALIGN8
{
long tmp;
tmp = (long) $1;
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 7) {
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,
Pointer ALIGN4
{
long tmp;
tmp = (long) $1;
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 3) {
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,
Pointer ALIGN2
{
long tmp;
tmp = (long) $1;
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 1) {
SWIG_exception(SWIG_ValueError,"Pointer must be 2-byte aligned.");
}

View file

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