regcomp.c:311:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’
regcomp.c:311:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long int’
regcomp.c:311:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long int’
regcomp.c:333:12: warning: comparison between signed and unsigned integer expressions
regcomp.c:542:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’
test2.c:16:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘char *’
test2.c:16:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘char *’
test2.c:16:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘char *’
test2.c:19:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘char *’
test2.c:19:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘char *’
test2.c:19:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘char *’
test2.c:7:10: warning: unused parameter ‘ac’
test2.c:7:21: warning: unused parameter ‘av’
test.c:28:10: warning: unused parameter ‘ac’
utf.c:159:8: warning: comparison between signed and unsigned integer expressions
static int nbra;
static char* exprp; /* pointer to next character in source expression */
static int lexdone;
-static int nclass;
+static unsigned int nclass;
static Reclass*classp;
static Reinst* freep;
static int errors;
l = pp->firstinst;
do{
- printf("%d:\t0%o\t%d\t%d", l-pp->firstinst, l->type,
- l->u2.left-pp->firstinst, l->u1.right-pp->firstinst);
+ printf("%d:\t0%o\t%d\t%d", (int)(l-pp->firstinst), l->type,
+ (int)(l->u2.left-pp->firstinst), (int)(l->u1.right-pp->firstinst));
if(l->type == RUNE)
printf("\t%C\n", l->u1.r);
else if(l->type == CCLASS || l->type == NCCLASS){
#endif
pp = optimize(pp);
#ifdef DEBUG
- printf("start: %d\n", andp->first-pp->firstinst);
+ printf("start: %d\n", (int)(andp->first-pp->firstinst));
dump(pp);
#endif
out:
char dst[128];
struct x *tp;
+ if(ac != 2)
+ exit(1);
+
for(tp = t; tp->re; tp++)
tp->p = regcomp(tp->re);
#include "regexp9.h"
int
-main(int ac, char **av)
+main()
{
Resub rs[10];
Reprog *p;
p = regcomp("[^a-z]");
s = "\n";
if(regexec(p, s, rs, 10))
- printf("%s %lux %lux %lux\n", s, s, rs[0].s.sp, rs[0].e.ep);
+ printf("%s %p %p %p\n", s, s, rs[0].s.sp, rs[0].e.ep);
s = "0";
if(regexec(p, s, rs, 10))
- printf("%s %lux %lux %lux\n", s, s, rs[0].s.sp, rs[0].e.ep);
+ printf("%s %p %p %p\n", s, s, rs[0].s.sp, rs[0].e.ep);
exit(0);
}
}
char*
-utfrune(char *s, long c)
+utfrune(char *s, Rune c)
{
- long c1;
+ Rune c1;
Rune r;
int n;
int chartorune(Rune *rune, char *str);
Rune* runestrchr(Rune *s, Rune c);
-char* utfrune(char *s, long c);
+char* utfrune(char *s, Rune c);
#if defined(__cplusplus)
}