From 7a027d3bd08849589328b2a085d33dea2874465a Mon Sep 17 00:00:00 2001 From: pfg Date: Sun, 7 May 2017 01:31:42 +0000 Subject: MFC r317346: regex: unsign and constify some variables. Taking some hints from the regex variant in nvi(1) and higher-level compiler warnings, update some types in our regex(3) implementation. Joint work with: Kyle Evans --- lib/libc/regex/regex2.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/libc/regex/regex2.h') diff --git a/lib/libc/regex/regex2.h b/lib/libc/regex/regex2.h index 7aa717e..813bbd3 100644 --- a/lib/libc/regex/regex2.h +++ b/lib/libc/regex/regex2.h @@ -73,7 +73,7 @@ * immediately *preceding* "execution" of that operator. */ typedef unsigned long sop; /* strip operator */ -typedef long sopno; +typedef unsigned long sopno; #define OPRMASK 0xf8000000L #define OPDMASK 0x07ffffffL #define OPSHIFT ((unsigned)27) @@ -113,11 +113,11 @@ typedef struct { typedef struct { unsigned char bmp[NC / 8]; wctype_t *types; - int ntypes; + unsigned int ntypes; wint_t *wides; - int nwides; + unsigned int nwides; crange *ranges; - int nranges; + unsigned int nranges; int invert; int icase; } cset; @@ -125,7 +125,7 @@ typedef struct { static int CHIN1(cset *cs, wint_t ch) { - int i; + unsigned int i; assert(ch >= 0); if (ch < NC) @@ -165,7 +165,7 @@ struct re_guts { int magic; # define MAGIC2 ((('R'^0200)<<8)|'E') sop *strip; /* malloced area for strip */ - int ncsets; /* number of csets in use */ + unsigned int ncsets; /* number of csets in use */ cset *sets; /* -> cset [ncsets] */ int cflags; /* copy of regcomp() cflags argument */ sopno nstates; /* = number of sops */ -- cgit v1.1