diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2007-10-26 00:23:58 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2007-10-26 00:23:58 +0000 |
commit | bee6b6650fd262a4b632eeef2b899b039fd0e9c5 (patch) | |
tree | 48d156c76cbed6fe1ad8876b986b0082feccd684 /Lib/ruby | |
parent | fb6586ecdf2dff1e8333e0216b14a69835f6e0f2 (diff) | |
download | swig-bee6b6650fd262a4b632eeef2b899b039fd0e9c5.tar.gz |
signed / unsigned mismatch fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10046 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/ruby')
-rw-r--r-- | Lib/ruby/rubycontainer.swg | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/ruby/rubycontainer.swg b/Lib/ruby/rubycontainer.swg index 814086807..bc13a6d8f 100644 --- a/Lib/ruby/rubycontainer.swg +++ b/Lib/ruby/rubycontainer.swg @@ -652,7 +652,8 @@ namespace swig if ( j <= 0 ) return Qnil; std::size_t len = $self->size(); if ( i < 0 ) i = len - i; - j += i; if ( j >= len ) j = len-1; + j += i; + if ( static_cast<std::size_t>(j) >= len ) j = len-1; VALUE r = Qnil; try { @@ -804,7 +805,7 @@ namespace swig if ( j <= 0 ) return Qnil; std::size_t len = $self->size(); if ( i < 0 ) i = len - i; - j += i; if ( j >= len ) j = len-1; + j += i; if ( static_cast<std::size_t>(j) >= len ) j = len-1; VALUE r = Qnil; try { @@ -842,7 +843,7 @@ namespace swig VALUE end = rb_funcall( i, id_end, 0 ); bool noend = ( rb_funcall( i, id_noend, 0 ) == Qtrue ); - std::size_t len = $self->size(); + int len = $self->size(); int s = NUM2INT( start ); if ( s < 0 ) s = len + s; @@ -863,7 +864,7 @@ namespace swig { std::size_t len = $self->size(); if ( i < 0 ) i = len - i; - else if ( i >= len ) + else if ( static_cast<std::size_t>(i) >= len ) $self->resize( i+1, x ); else *(swig::getpos(self,i)) = x; @@ -878,7 +879,7 @@ namespace swig std::size_t len = $self->size(); if ( i < 0 ) i = len - i; j += i; - if ( j >= len ) { + if ( static_cast<std::size_t>(j) >= len ) { $self->resize( j+1, *(v.begin()) ); j = len-1; } |