X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_color.c;h=0a68e309fcfb039eba45da6bc630a050f698cfc7;hp=f0d2006b71ab9ce2a79849fc029a92a10ad4ac46;hb=c3e8eb8e7407c4173394c2f52c635ed86327edc6;hpb=0c12f3c8ff417105269bda50a3a2fe06c0bfdebf diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c index f0d2006b..0a68e309 100644 --- a/ncurses/base/lib_color.c +++ b/ncurses/base/lib_color.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -45,7 +45,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_color.c,v 1.103 2011/07/23 22:00:34 tom Exp $") +MODULE_ID("$Id: lib_color.c,v 1.105 2012/06/09 20:34:11 tom Exp $") #ifdef USE_TERM_DRIVER #define CanChange InfoOf(SP_PARM).canchange @@ -390,10 +390,10 @@ start_color(void) /* This function was originally written by Daniel Weaver */ static void -rgb2hls(short r, short g, short b, short *h, short *l, short *s) +rgb2hls(int r, int g, int b, short *h, short *l, short *s) /* convert RGB to HLS system */ { - short min, max, t; + int min, max, t; if ((min = g < r ? g : r) > b) min = b; @@ -423,7 +423,7 @@ rgb2hls(short r, short g, short b, short *h, short *l, short *s) else t = (short) (360 + ((r - g) * 60) / (max - min)); - *h = t % 360; + *h = (short) (t % 360); } /* @@ -748,8 +748,8 @@ NCURSES_SP_NAME(pair_content) (NCURSES_SP_DCLx if (!ValidPair(pair)) { result = ERR; } else { - NCURSES_COLOR_T fg = FORE_OF(SP_PARM->_color_pairs[pair]); - NCURSES_COLOR_T bg = BACK_OF(SP_PARM->_color_pairs[pair]); + NCURSES_COLOR_T fg = (NCURSES_COLOR_T) FORE_OF(SP_PARM->_color_pairs[pair]); + NCURSES_COLOR_T bg = (NCURSES_COLOR_T) BACK_OF(SP_PARM->_color_pairs[pair]); #if NCURSES_EXT_FUNCS if (fg == COLOR_DEFAULT) @@ -782,9 +782,9 @@ pair_content(short pair, short *f, short *b) NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx - short old_pair, - short pair, - bool reverse, + int old_pair, + int pair, + int reverse, NCURSES_SP_OUTC outc) { #ifdef USE_TERM_DRIVER @@ -810,7 +810,7 @@ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx if (old_pair >= 0 && SP_PARM != 0 - && pair_content(old_pair, &old_fg, &old_bg) != ERR) { + && pair_content((short) old_pair, &old_fg, &old_bg) != ERR) { if ((isDefaultColor(fg) && !isDefaultColor(old_fg)) || (isDefaultColor(bg) && !isDefaultColor(old_bg))) { #if NCURSES_EXT_FUNCS @@ -864,7 +864,7 @@ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx #if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_do_color(short old_pair, short pair, bool reverse, NCURSES_OUTC outc) +_nc_do_color(int old_pair, int pair, int reverse, NCURSES_OUTC outc) { SetSafeOutcWrapper(outc); NCURSES_SP_NAME(_nc_do_color) (CURRENT_SCREEN,