From: nhmall Date: Mon, 9 May 2022 11:31:30 +0000 (-0400) Subject: rgbstr_to_uint32() -> rgbstr_to_int32() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0aaa114a46754c1f6ce3cf5a91b989901647b607;p=nethack rgbstr_to_uint32() -> rgbstr_to_int32() Closes #756 --- diff --git a/src/utf8map.c b/src/utf8map.c index e386c366b..f6394b23c 100644 --- a/src/utf8map.c +++ b/src/utf8map.c @@ -41,7 +41,7 @@ static int unicode_val(const char *cp); static int parse_id(const char *id, struct find_struct *findwhat); static int glyph_find_core(const char *id, struct find_struct *findwhat); static char *fix_glyphname(char *str); -static uint32_t rgbstr_to_uint32(const char *rgbstr); +static int32_t rgbstr_to_int32(const char *rgbstr); boolean closest_color(uint32_t lcolor, uint32_t *closecolor, int *clridx); static void @@ -114,7 +114,7 @@ glyphrep_to_custom_map_entries(const char *op, int *glyphptr) if (c_unicode && (*c_unicode == 'U' || *c_unicode == 'u') && (c_unicode[1] == '+')) { /* unicode = unicode_val(c_unicode); */ - if ((rgb = rgbstr_to_uint32(c_rgb)) != -1L || !c_rgb) { + if ((rgb = rgbstr_to_int32(c_rgb)) != -1L || !c_rgb) { to_custom_symbol_find.unicode_val = c_unicode; /* if the color 0 is an actual color, as opposed to just "not set" we set a marker bit outside the 24-bit range to indicate a @@ -134,8 +134,8 @@ glyphrep_to_custom_map_entries(const char *op, int *glyphptr) return 0; } -static uint32_t -rgbstr_to_uint32(const char *rgbstr) +static int32_t +rgbstr_to_int32(const char *rgbstr) { int r, gn, b, milestone = 0; char *cp, *c_r,*c_g,*c_b;