From d40d348ceb23958fa1c0386a34acc8c258dcfa95 Mon Sep 17 00:00:00 2001 From: Juli Mallett Date: Thu, 20 Jun 2002 11:14:54 +0000 Subject: [PATCH] Cast sp to uintptr_t when doing a compare of it to STACKMAX which is a size_t. This messes up some indentation in mdef.h for some macros. --- usr.bin/m4/main.c | 4 ++-- usr.bin/m4/mdef.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c index f0fdeca23257..1a0011d6cf25 100644 --- a/usr.bin/m4/main.c +++ b/usr.bin/m4/main.c @@ -361,7 +361,7 @@ macro() /* no bracks */ chrsave(EOS); - if (sp == STACKMAX) + if ((uintptr_t)sp == STACKMAX) errx(1, "internal stack overflow"); eval((const char **) mstack+fp+1, 2, CALTYP); @@ -460,7 +460,7 @@ macro() else { /* end of argument list */ chrsave(EOS); - if (sp == STACKMAX) + if ((uintptr_t)sp == STACKMAX) errx(1, "internal stack overflow"); eval((const char **) mstack+fp+1, sp-fp, diff --git a/usr.bin/m4/mdef.h b/usr.bin/m4/mdef.h index 183f7539c955..9536ced54167 100644 --- a/usr.bin/m4/mdef.h +++ b/usr.bin/m4/mdef.h @@ -171,7 +171,7 @@ struct input_file { */ #define pushf(x) \ do { \ - if (++sp == STACKMAX) \ + if ((uintptr_t)++sp == STACKMAX) \ enlarge_stack();\ mstack[sp].sfra = (x); \ sstack[sp] = 0; \ @@ -179,7 +179,7 @@ struct input_file { #define pushs(x) \ do { \ - if (++sp == STACKMAX) \ + if ((uintptr_t)++sp == STACKMAX) \ enlarge_stack();\ mstack[sp].sstr = (x); \ sstack[sp] = 1; \ @@ -187,7 +187,7 @@ struct input_file { #define pushs1(x) \ do { \ - if (++sp == STACKMAX) \ + if ((uintptr_t)++sp == STACKMAX) \ enlarge_stack();\ mstack[sp].sstr = (x); \ sstack[sp] = 0; \