aboutsummaryrefslogtreecommitdiff
path: root/display_args.c
diff options
context:
space:
mode:
authorZachary T Welch <zwelch@codesourcery.com>2010-12-08 18:55:09 -0800
committerJoe Damato <ice799@gmail.com>2010-12-10 00:39:21 -0800
commitba6aca21bd9e0e66dac17b1828cf6b6e7377b983 (patch)
treeb0ad829909e0ff24994d14a8b7851ac4e5738811 /display_args.c
parentdd1352379a16ae982041f6be4fa62e3bf0dab7fb (diff)
downloadltrace-ba6aca21bd9e0e66dac17b1828cf6b6e7377b983.tar.gz
Fix building with --enable-debug
Numerous warnings had snuck into the build, preventing ltrace from building with --enable-debug (which uses -Wall, -Werror, and more). This patch fixes the problems, mostly caused by -Wsign-compare. Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Diffstat (limited to 'display_args.c')
-rw-r--r--display_args.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/display_args.c b/display_args.c
index 993a808..c639c88 100644
--- a/display_args.c
+++ b/display_args.c
@@ -15,8 +15,8 @@ static int display_value(enum tof type, Process *proc,
static int display_unknown(enum tof type, Process *proc, long value);
static int display_format(enum tof type, Process *proc, int arg_num);
-static int string_maxlength = INT_MAX;
-static int array_maxlength = INT_MAX;
+static size_t string_maxlength = INT_MAX;
+static size_t array_maxlength = INT_MAX;
static long
get_length(enum tof type, Process *proc, int len_spec,
@@ -59,8 +59,8 @@ display_arrayptr(enum tof type, Process *proc,
void *addr, arg_type_info * info,
void *st, arg_type_info* st_info) {
int len = 0;
- int i;
- int array_len;
+ size_t i;
+ size_t array_len;
if (addr == NULL)
return fprintf(options.output, "NULL");
@@ -143,7 +143,7 @@ display_pointer(enum tof type, Process *proc, long value,
static int
display_enum(enum tof type, Process *proc,
arg_type_info* info, long value) {
- int ii;
+ size_t ii;
for (ii = 0; ii < info->u.enum_info.entries; ++ii) {
if (info->u.enum_info.values[ii] == value)
return fprintf(options.output, "%s", info->u.enum_info.keys[ii]);
@@ -281,7 +281,7 @@ static int
display_string(enum tof type, Process *proc, void *addr,
size_t maxlength) {
unsigned char *str1;
- int i;
+ size_t i;
int len = 0;
if (!addr) {
@@ -328,7 +328,7 @@ display_format(enum tof type, Process *proc, int arg_num) {
void *addr;
unsigned char *str1;
int i;
- int len = 0;
+ size_t len = 0;
arg_type_info info;
info.type = ARGTYPE_POINTER;