Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Commit

Permalink
Use NUM2UINT in place of rb_num2uint. Fixes #4.
Browse files Browse the repository at this point in the history
@FenixFyreX reported that rb_num2uint is only present for environments
where sizeof(int) < sizeof(long) -- should've used NUM2UINT which is
properly defined for the given environment.
  • Loading branch information
nilium committed Apr 29, 2014
1 parent 3ec3f12 commit 8ddbd7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ext/glfw3/glfw3.c
Expand Up @@ -531,9 +531,9 @@ static VALUE rb_monitor_set_gamma_ramp(VALUE self, VALUE ramp_hash)
ramp.blue = &ramp_buffer[ramp_len * 2];

for (; ramp_index < ramp_len; ++ramp_index) {
ramp.red[ramp_index] = (unsigned short)rb_num2uint(rb_ary_entry(rb_red, ramp_index));
ramp.green[ramp_index] = (unsigned short)rb_num2uint(rb_ary_entry(rb_green, ramp_index));
ramp.blue[ramp_index] = (unsigned short)rb_num2uint(rb_ary_entry(rb_blue, ramp_index));
ramp.red[ramp_index] = (unsigned short)NUM2UINT(rb_ary_entry(rb_red, ramp_index));
ramp.green[ramp_index] = (unsigned short)NUM2UINT(rb_ary_entry(rb_green, ramp_index));
ramp.blue[ramp_index] = (unsigned short)NUM2UINT(rb_ary_entry(rb_blue, ramp_index));
}

ramp.size = ramp_len;
Expand Down

0 comments on commit 8ddbd7a

Please sign in to comment.