summaryrefslogtreecommitdiff
path: root/usr.bin/m4
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2006-01-20 23:10:20 +0000
committerMarc Espie <espie@cvs.openbsd.org>2006-01-20 23:10:20 +0000
commitbb73845798cff57670d538da76e8d33d95a83c96 (patch)
tree9e05f9d8f0f4336731a34377fb78a85d6a5d7312 /usr.bin/m4
parentf0d48f87e2fca677ee8cf862dadddda3c3dd47ee (diff)
use stdint.h where appropriate. okay millert@
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/eval.c6
-rw-r--r--usr.bin/m4/expr.c4
-rw-r--r--usr.bin/m4/extern.h4
-rw-r--r--usr.bin/m4/look.c4
-rw-r--r--usr.bin/m4/main.c4
-rw-r--r--usr.bin/m4/parser.y3
-rw-r--r--usr.bin/m4/tokenizer.l6
-rw-r--r--usr.bin/m4/trace.c10
8 files changed, 21 insertions, 20 deletions
diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c
index caf82d45256..34255aa9a3f 100644
--- a/usr.bin/m4/eval.c
+++ b/usr.bin/m4/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.58 2005/09/06 15:33:21 espie Exp $ */
+/* $OpenBSD: eval.c,v 1.59 2006/01/20 23:10:19 espie Exp $ */
/* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */
/*
@@ -97,7 +97,7 @@ unsigned long expansion_id;
void
eval(const char *argv[], int argc, int td, int is_traced)
{
- ssize_t mark = -1;
+ size_t mark = SIZE_MAX;
expansion_id++;
if (td & RECDEF)
@@ -109,7 +109,7 @@ eval(const char *argv[], int argc, int td, int is_traced)
expand_macro(argv, argc);
else
expand_builtin(argv, argc, td);
- if (mark != -1)
+ if (mark != SIZE_MAX)
finish_trace(mark);
}
diff --git a/usr.bin/m4/expr.c b/usr.bin/m4/expr.c
index 5805eb08f60..b04c0da3b37 100644
--- a/usr.bin/m4/expr.c
+++ b/usr.bin/m4/expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expr.c,v 1.16 2004/05/12 21:17:03 espie Exp $ */
+/* $OpenBSD: expr.c,v 1.17 2006/01/20 23:10:19 espie Exp $ */
/*
* Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
*
@@ -14,7 +14,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
+#include <stdint.h>
#include <stdio.h>
#include <stddef.h>
#include "mdef.h"
diff --git a/usr.bin/m4/extern.h b/usr.bin/m4/extern.h
index f1de0d75715..32e553d10ff 100644
--- a/usr.bin/m4/extern.h
+++ b/usr.bin/m4/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.42 2005/09/06 15:33:21 espie Exp $ */
+/* $OpenBSD: extern.h,v 1.43 2006/01/20 23:10:19 espie Exp $ */
/* $NetBSD: extern.h,v 1.3 1996/01/13 23:25:24 pk Exp $ */
/*-
@@ -138,7 +138,7 @@ extern char *endest;
extern unsigned int trace_flags;
#define TRACE_ALL 512
extern void trace_file(const char *);
-extern ssize_t trace(const char **, int, struct input_file *);
+extern size_t trace(const char **, int, struct input_file *);
extern void finish_trace(size_t);
extern void set_trace_flags(const char *);
extern FILE *traceout;
diff --git a/usr.bin/m4/look.c b/usr.bin/m4/look.c
index 4eeb99e0e2a..a9bfe1e5433 100644
--- a/usr.bin/m4/look.c
+++ b/usr.bin/m4/look.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: look.c,v 1.17 2005/08/06 16:22:26 espie Exp $ */
+/* $OpenBSD: look.c,v 1.18 2006/01/20 23:10:19 espie Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -38,9 +38,9 @@
* by: oz
*/
-#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <ohash.h>
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index d53dd8a0da8..a5ed6cd98ef 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.68 2005/09/06 15:33:21 espie Exp $ */
+/* $OpenBSD: main.c,v 1.69 2006/01/20 23:10:19 espie Exp $ */
/* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */
/*-
@@ -39,7 +39,6 @@
* by: oz
*/
-#include <sys/types.h>
#include <assert.h>
#include <signal.h>
#include <errno.h>
@@ -48,6 +47,7 @@
#include <ctype.h>
#include <string.h>
#include <stddef.h>
+#include <stdint.h>
#include <stdlib.h>
#include <ohash.h>
#include <err.h>
diff --git a/usr.bin/m4/parser.y b/usr.bin/m4/parser.y
index a0742cb5eee..7ab40204da8 100644
--- a/usr.bin/m4/parser.y
+++ b/usr.bin/m4/parser.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: parser.y,v 1.2 2004/06/22 19:21:34 otto Exp $ */
+/* $OpenBSD: parser.y,v 1.3 2006/01/20 23:10:19 espie Exp $ */
/*
* Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
*
@@ -15,6 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdint.h>
#define YYSTYPE int32_t
extern int32_t end_result;
extern int yylex(void);
diff --git a/usr.bin/m4/tokenizer.l b/usr.bin/m4/tokenizer.l
index 7188a8cfc35..895ea5ca887 100644
--- a/usr.bin/m4/tokenizer.l
+++ b/usr.bin/m4/tokenizer.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: tokenizer.l,v 1.2 2004/05/12 21:28:35 espie Exp $ */
+/* $OpenBSD: tokenizer.l,v 1.3 2006/01/20 23:10:19 espie Exp $ */
/*
* Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
*
@@ -18,7 +18,7 @@
#include "parser.h"
#include <stdlib.h>
#include <errno.h>
-#include <sys/types.h>
+#include <stdint.h>
#include <limits.h>
extern int32_t yylval;
@@ -54,7 +54,7 @@ number()
errno = 0;
l = strtol(yytext, NULL, 0);
if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) ||
- l > 0x7fffffff || l < (-0x7fffffff - 1)) {
+ l > INT32_MAX || l < INT32_MIN) {
fprintf(stderr, "m4: numeric overflow in expr: %s\n", yytext);
}
return l;
diff --git a/usr.bin/m4/trace.c b/usr.bin/m4/trace.c
index b96e7c7af4b..e2416cb2b1e 100644
--- a/usr.bin/m4/trace.c
+++ b/usr.bin/m4/trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trace.c,v 1.12 2005/01/21 19:11:02 espie Exp $ */
+/* $OpenBSD: trace.c,v 1.13 2006/01/20 23:10:19 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
*
@@ -24,11 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
-#include <err.h>
#include <stdlib.h>
+#include <err.h>
#include "mdef.h"
#include "stdd.h"
#include "extern.h"
@@ -142,7 +142,7 @@ print_header(struct input_file *inp)
fprintf(traceout, "id %lu: ", expansion_id);
}
-ssize_t
+size_t
trace(const char *argv[], int argc, struct input_file *inp)
{
if (!traceout)
@@ -179,7 +179,7 @@ trace(const char *argv[], int argc, struct input_file *inp)
return buffer_mark();
else {
fprintf(traceout, "\n");
- return -1;
+ return SIZE_MAX;
}
}