Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix various signess warnings reported by gcc
  • Loading branch information
larskanis committed Dec 15, 2018
1 parent 25832f7 commit 1bc6304
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions swig-interfaces/FXImage.i
Expand Up @@ -58,7 +58,7 @@ public:
FXImage(FXApp* a,VALUE string_or_ary=Qnil,FXuint opts=0,FXint w=1,FXint h=1){
FXColor* pix=0;
if(!NIL_P(string_or_ary)){
FXuint len=FXRbNumberOfFXColors(string_or_ary);
FXint len=FXRbNumberOfFXColors(string_or_ary);
if(w*h != len){
rb_raise( rb_eArgError, "Array size does not match image size" );
}
Expand Down Expand Up @@ -97,9 +97,9 @@ public:
* This can be done by calling render().
*/
void setPixels(VALUE string_or_ary,FXuint opts=0,VALUE w=Qnil,VALUE h=Qnil){
FXuint len=FXRbNumberOfFXColors(string_or_ary);
FXint len=FXRbNumberOfFXColors(string_or_ary);
if( ( (NIL_P(w) || NIL_P(h)) && self->getWidth()*self->getHeight() != len) ||
(!(NIL_P(w) || NIL_P(h)) && NUM2UINT(w)*NUM2UINT(h) != len)){
(!(NIL_P(w) || NIL_P(h)) && NUM2INT(w)*NUM2INT(h) != len)){
rb_raise( rb_eArgError, "Array size does not match image size" );
}

Expand All @@ -116,7 +116,7 @@ public:
if (data) {
FXuint size = self->getWidth()*self->getHeight();
VALUE ary = rb_ary_new2(size);
for (int i = 0; i < size; i++)
for (FXuint i = 0; i < size; i++)
rb_ary_store(ary, i, UINT2NUM(data[i]));
return ary;
} else {
Expand Down
4 changes: 2 additions & 2 deletions swig-interfaces/FXMemoryBuffer.i
Expand Up @@ -27,7 +27,7 @@
class FXMemoryBuffer {
public:
// Create an memory buffer object
FXMemoryBuffer(FXColor *data,FXuint size);
FXMemoryBuffer(FXColor *data,FXint size);

// Returns the size (in bytes)
FXuint getSize() const;
Expand All @@ -39,7 +39,7 @@ public:
if (data) {
FXuint size = self->getSize();
VALUE ary = rb_ary_new2(size);
for (int i = 0; i < size; i++)
for (FXuint i = 0; i < size; i++)
rb_ary_store(ary, i, UINT2NUM(data[i]));
return ary;
}
Expand Down

0 comments on commit 1bc6304

Please sign in to comment.