* cord/cordprnt.c (CORD_vsprintf): Explicitly cast "prec" to unsigned
(to avoid assignment of a signed value to a variable of a bigger
unsigned integer type).
* cord/cordxtra.c (CORD_nul_func, CORD_chars): Cast between pointer
and char via GC_word (instead of long); explicitly cast char to
unsigned char (to avoid a signed value cast to a bigger unsigned one).
* cord/tests/de.c (replace_line): Explicitly cast COLS to unsigned
(when compared to "len" local variable).
if (prec != NONE && len > (size_t)prec) {
if (prec < 0) return(-1);
arg = CORD_substr(arg, 0, prec);
- len = prec;
+ len = (unsigned)prec;
}
if (width != NONE && len < (size_t)width) {
char * blanks = GC_MALLOC_ATOMIC(width-len+1);
char CORD_nul_func(size_t i CORD_ATTR_UNUSED, void * client_data)
{
- return((char)(unsigned long)client_data);
+ return (char)(GC_word)client_data;
}
-
CORD CORD_chars(char c, size_t i)
{
- return(CORD_from_fn(CORD_nul_func, (void *)(unsigned long)c, i));
+ return CORD_from_fn(CORD_nul_func, (void *)(GC_word)(unsigned char)c, i);
}
CORD CORD_from_file_eager(FILE * f)
}
# if !defined(MACINTOSH)
/* A gross workaround for an apparent curses bug: */
- if (i == LINES-1 && len == COLS) {
+ if (i == LINES-1 && len == (unsigned)COLS) {
s = CORD_substr(s, 0, len - 1);
}
# endif