if (prec == VARIABLE) prec = va_arg(args, int);
arg = va_arg(args, CORD);
len = CORD_len(arg);
- if (prec != NONE && len > (size_t)prec) {
+ if (prec != NONE && len > (unsigned)prec) {
if (prec < 0) return(-1);
- arg = CORD_substr(arg, 0, prec);
+ arg = CORD_substr(arg, 0, (unsigned)prec);
len = (unsigned)prec;
}
- if (width != NONE && len < (size_t)width) {
- char * blanks =
- (char *)GC_MALLOC_ATOMIC(width - len + 1);
+ if (width != NONE && len < (unsigned)width) {
+ char * blanks = (char *)GC_MALLOC_ATOMIC(
+ (unsigned)width - len + 1);
if (NULL == blanks) OUT_OF_MEMORY;
- memset(blanks, ' ', width-len);
- blanks[width-len] = '\0';
+ memset(blanks, ' ', (unsigned)width - len);
+ blanks[(unsigned)width - len] = '\0';
if (left_adj) {
arg = CORD_cat(arg, blanks);
} else {
if (prec != NONE && prec > max_size) max_size = prec;
max_size += CONV_RESULT_LEN;
if (max_size >= CORD_BUFSZ) {
- buf = (char *)GC_MALLOC_ATOMIC(max_size + 1);
+ buf = (char *)GC_MALLOC_ATOMIC((unsigned)max_size + 1);
if (NULL == buf) OUT_OF_MEMORY;
} else {
if (CORD_BUFSZ - (result[0].ec_bufptr-result[0].ec_buf)
&& !defined(__EMX__))
va_end(vsprintf_args);
# endif
- len = (size_t)res;
+ len = (unsigned)res;
if ((char *)(GC_word)res == buf) {
/* old style vsprintf */
len = strlen(buf);
void test_basics(void)
{
CORD x = CORD_from_char_star("ab");
- int i;
+ size_t i;
CORD y;
CORD_pos p;
while(CORD_pos_valid(p)) {
char c = CORD_pos_fetch(p);
- if(c != i) ABORT("Traversal of function node failed");
+ if ((unsigned char)c != i)
+ ABORT("Traversal of function node failed");
CORD_next(p);
i++;
}
((oh *)p) -> oh_bg_ptr = HIDE_BACK_PTR((ptr_t)0);
# endif
((oh *)p) -> oh_string = string;
- ((oh *)p) -> oh_int = (word)linenum;
+ ((oh *)p) -> oh_int = linenum;
# ifndef SHORT_DBG_HDRS
((oh *)p) -> oh_sz = sz;
((oh *)p) -> oh_sf = START_FLAG ^ (word)result;
word oh_dummy;
# endif
# endif
- const char * oh_string; /* object descriptor string */
- word oh_int; /* object descriptor integers */
+ const char * oh_string; /* object descriptor string (file name) */
+ signed_word oh_int; /* object descriptor integer (line number) */
# ifdef NEED_CALLINFO
struct callinfo oh_ci[NFRAMES];
# endif
pstats->non_gc_bytes = GC_non_gc_bytes;
pstats->gc_no = GC_gc_no; /* could be -1 */
# ifdef PARALLEL_MARK
- pstats->markers_m1 = (word)GC_markers_m1;
+ pstats->markers_m1 = (word)((signed_word)GC_markers_m1);
# else
pstats->markers_m1 = 0; /* one marker */
# endif
if (space_divisor_string != NULL) {
int space_divisor = atoi(space_divisor_string);
if (space_divisor > 0)
- GC_free_space_divisor = (word)space_divisor;
+ GC_free_space_divisor = (unsigned)space_divisor;
}
}
# ifdef USE_MUNMAP
IF_CANCEL(int cancel_state;)
DISABLE_CANCEL(cancel_state);
- while ((size_t)bytes_written < len) {
+ while ((unsigned)bytes_written < len) {
# ifdef GC_SOLARIS_THREADS
int result = syscall(SYS_write, fd, buf + bytes_written,
len - bytes_written);