From e872716d8afcbda4d8bd7eb5c7e49b36e6f3d1a9 Mon Sep 17 00:00:00 2001 From: Juli Mallett Date: Fri, 21 Jun 2002 10:56:44 +0000 Subject: [PATCH] Clean up hex() and octal() to return and work with unsigned integers since they scan values of unsigned types, and since they do not need otherwise, have them take const char * arguments. --- usr.sbin/config/lang.l | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l index f7f6ee058ac1..bef36f1f98ef 100644 --- a/usr.sbin/config/lang.l +++ b/usr.sbin/config/lang.l @@ -84,8 +84,8 @@ struct kt { static int endinclude(void); int include(const char *, int); int kw_lookup(char *); -int octal(char *); -int hex(char *); +unsigned int octal(const char *); +unsigned int hex(const char *); int yyerror(const char *); %} @@ -198,19 +198,19 @@ kw_lookup(char *word) * Number conversion routines */ -int -octal(char *str) +unsigned int +octal(const char *str) { - int num; + unsigned int num; (void) sscanf(str, "%o", &num); return num; } -int -hex(char *str) +unsigned int +hex(const char *str) { - int num; + unsigned int num; (void) sscanf(str+2, "%x", &num); return num;