Skip to content

Commit fdf92d1

Browse files
shugoclaude
andcommitted
Fix type conversion macros in Window#attr_set and Window#attr_get
- attr_set: NUM2ULONG -> NUM2UINT to match attr_t (unsigned int) - attr_get: ULONG2NUM -> UINT2NUM for attr_t; INT2FIX -> INT2NUM for pair number to safely handle extended pair values on all platforms Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7d4188e commit fdf92d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/curses/curses.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,7 +2970,7 @@ window_attr_set(VALUE obj, VALUE attrs, VALUE pair)
29702970
struct windata *winp;
29712971

29722972
GetWINDOW(obj, winp);
2973-
return (wattr_set(winp->window, NUM2ULONG(attrs), NUM2INT(pair), NULL) == OK) ? Qtrue : Qfalse;
2973+
return (wattr_set(winp->window, NUM2UINT(attrs), NUM2INT(pair), NULL) == OK) ? Qtrue : Qfalse;
29742974
}
29752975
#else
29762976
#define window_attr_set rb_f_notimplement
@@ -3003,7 +3003,7 @@ window_attr_get(VALUE obj)
30033003
GetWINDOW(obj, winp);
30043004
if (wattr_get(winp->window, &attrs, &pair, NULL) == ERR)
30053005
return Qnil;
3006-
return rb_ary_new3(2, ULONG2NUM(attrs), INT2FIX(pair));
3006+
return rb_ary_new3(2, UINT2NUM(attrs), INT2NUM(pair));
30073007
}
30083008
#else
30093009
#define window_attr_get rb_f_notimplement

0 commit comments

Comments
 (0)