summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-09-08 12:17:26 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-09-12 12:41:04 +0200
commitcddcd3839fa6cf69a46fe30a09a5b07fb66a70d4 (patch)
treeec2c4f700e0fb57a771e39419f5de81103631e2d /os_dep.c
parenteb650a2a7697e7320ffadda1be064866a816349d (diff)
Resolve "comparison of signed and unsigned values" compiler warnings.
(Apply commit 96f7891) * cord/cordprnt.c (CORD_vsprintf): Cast "prec" and "width" local variables to size_t. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Change type of "i" local variable to int. * pthread_support.c (start_mark_threads): Likewise. * os_dep.c (GC_repeat_read): Change type of "num_read" to size_t. * os_dep.c (GC_get_maps): Change type of "result" local variable from int to ssize_t; cast "result" to size_t in comparison. * pthread_support.c (GC_remove_all_threads_but_me): Cast "result" to int. * pthread_support.c (GC_wait_for_gc_completion): Change type of "old_gc_no" local variable to word. * pthread_support.c (GC_lock): Change type of "i" local variable to unsigned. * tests/staticrootstest.c (main): Cast sizeof() value to int in comparisons.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/os_dep.c b/os_dep.c
index 0290e2e..1c0b73e 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -149,7 +149,7 @@
/* we encounter EOF. */
STATIC ssize_t GC_repeat_read(int fd, char *buf, size_t count)
{
- ssize_t num_read = 0;
+ size_t num_read = 0;
ssize_t result;
ASSERT_CANCEL_DISABLED();
@@ -199,7 +199,7 @@ STATIC ssize_t GC_repeat_read(int fd, char *buf, size_t count)
GC_INNER char * GC_get_maps(void)
{
int f;
- int result;
+ ssize_t result;
static char init_buf[1];
static char *maps_buf = init_buf;
static size_t maps_buf_sz = 1;
@@ -260,7 +260,7 @@ GC_INNER char * GC_get_maps(void)
if (result <= 0)
break;
maps_size += result;
- } while (result == maps_buf_sz-1);
+ } while ((size_t)result == maps_buf_sz-1);
close(f);
if (result <= 0)
return 0;