summaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/debug.c b/debug.c
index a0ce09b5..eb0a59a1 100644
--- a/debug.c
+++ b/debug.c
@@ -594,7 +594,8 @@ print_lines(char *src, int start_line, int nlines)
}
for (i = start_line; i < start_line + nlines; i++) {
- int supposed_len, len;
+ int supposed_len;
+ size_t len;
char *p;
sprintf(linebuf, "%-8d", i);
@@ -624,7 +625,7 @@ print_lines(char *src, int start_line, int nlines)
supposed_len = pos[i] - pos[i - 1];
len = read(s->fd, p, supposed_len);
switch (len) {
- case -1:
+ case (size_t) -1:
d_error(_("cannot read source file `%s': %s"),
src, strerror(errno));
return -1;
@@ -1091,8 +1092,7 @@ print_array(volatile NODE *arr, char *arr_name)
{
NODE *subs;
NODE **list;
- int i;
- size_t num_elems = 0;
+ size_t i, num_elems = 0;
volatile NODE *r;
volatile int ret = 0;
volatile jmp_buf pager_quit_tag_stack;
@@ -1661,7 +1661,7 @@ find_subscript(struct list_item *item, NODE **ptr)
/* cmp_val --- compare values of watched item, returns true if different; */
static int
-cmp_val(struct list_item *w, NODE *old, NODE *new)
+cmp_val(struct list_item *w, NODE *old, NODE *new_val)
{
/*
* case old new result
@@ -1679,26 +1679,26 @@ cmp_val(struct list_item *w, NODE *old, NODE *new)
if (WATCHING_ARRAY(w)) {
long size = 0;
- if (! new) /* 9 */
+ if (! new_val) /* 9 */
return true;
- if (new->type == Node_val) /* 7 */
+ if (new_val->type == Node_val) /* 7 */
return true;
- /* new->type == Node_var_array */ /* 8 */
- size = assoc_length(new);
+ /* new_val->type == Node_var_array */ /* 8 */
+ size = assoc_length(new_val);
if (w->cur_size == size)
return false;
return true;
}
- if (! old && ! new) /* 3 */
+ if (! old && ! new_val) /* 3 */
return false;
- if ((! old && new) /* 1, 2 */
- || (old && ! new)) /* 6 */
+ if ((! old && new_val) /* 1, 2 */
+ || (old && ! new_val)) /* 6 */
return true;
- if (new->type == Node_var_array) /* 5 */
+ if (new_val->type == Node_var_array) /* 5 */
return true;
- return cmp_nodes(old, new, true); /* 4 */
+ return cmp_nodes(old, new_val, true); /* 4 */
}
/* watchpoint_triggered --- check if we should stop at this watchpoint;
@@ -4356,7 +4356,7 @@ gprintf(FILE *fp, const char *format, ...)
static size_t buflen = 0;
static int bl = 0;
char *p, *q;
- int nchar;
+ size_t nchar;
#define GPRINTF_BUFSIZ 512
if (buf == NULL) {
@@ -4388,11 +4388,11 @@ gprintf(FILE *fp, const char *format, ...)
bl = 0;
for (p = buf; (q = strchr(p, '\n')) != NULL; p = q + 1) {
- int sz = (int) (q - p);
+ size_t sz = (q - p);
while (sz > 0) {
- int cnt;
- cnt = sz > screen_width ? screen_width : sz;
+ size_t cnt;
+ cnt = sz > ((size_t) screen_width) ? screen_width : sz;
/* do not print partial line before scrolling */
if (cnt < sz && (pager_lines_printed == (screen_height - 2)))