Fossil SCM

Fix a harmless compiler warning in regexp.c.

drh 2013-03-01 23:33 trunk
Commit 520703dd552b6a6a32e6d15d3e29793c53f2bd84
1 file changed +3 -2
+3 -2
--- src/regexp.c
+++ src/regexp.c
@@ -111,11 +111,11 @@
111111
ReInput sIn; /* Regular expression text */
112112
const char *zErr; /* Error message to return */
113113
char *aOp; /* Operators for the virtual machine */
114114
int *aArg; /* Arguments to each operator */
115115
unsigned (*xNextChar)(ReInput*); /* Next character function */
116
- char zInit[12]; /* Initial text to match */
116
+ unsigned char zInit[12]; /* Initial text to match */
117117
int nInit; /* Number of characters in zInit */
118118
unsigned nState; /* Number of entries in aOp[] and aArg[] */
119119
unsigned nAlloc; /* Slots allocated for aOp[] and aArg[] */
120120
};
121121
#endif
@@ -197,11 +197,12 @@
197197
198198
/* Look for the initial prefix match, if there is one. */
199199
if( pRe->nInit ){
200200
unsigned char x = pRe->zInit[0];
201201
while( in.i+pRe->nInit<=in.mx
202
- && (zIn[in.i]!=x || strncmp(zIn+in.i, pRe->zInit, pRe->nInit)!=0)
202
+ && (zIn[in.i]!=x ||
203
+ strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0)
203204
){
204205
in.i++;
205206
}
206207
if( in.i+pRe->nInit>in.mx ) return 0;
207208
}
208209
--- src/regexp.c
+++ src/regexp.c
@@ -111,11 +111,11 @@
111 ReInput sIn; /* Regular expression text */
112 const char *zErr; /* Error message to return */
113 char *aOp; /* Operators for the virtual machine */
114 int *aArg; /* Arguments to each operator */
115 unsigned (*xNextChar)(ReInput*); /* Next character function */
116 char zInit[12]; /* Initial text to match */
117 int nInit; /* Number of characters in zInit */
118 unsigned nState; /* Number of entries in aOp[] and aArg[] */
119 unsigned nAlloc; /* Slots allocated for aOp[] and aArg[] */
120 };
121 #endif
@@ -197,11 +197,12 @@
197
198 /* Look for the initial prefix match, if there is one. */
199 if( pRe->nInit ){
200 unsigned char x = pRe->zInit[0];
201 while( in.i+pRe->nInit<=in.mx
202 && (zIn[in.i]!=x || strncmp(zIn+in.i, pRe->zInit, pRe->nInit)!=0)
 
203 ){
204 in.i++;
205 }
206 if( in.i+pRe->nInit>in.mx ) return 0;
207 }
208
--- src/regexp.c
+++ src/regexp.c
@@ -111,11 +111,11 @@
111 ReInput sIn; /* Regular expression text */
112 const char *zErr; /* Error message to return */
113 char *aOp; /* Operators for the virtual machine */
114 int *aArg; /* Arguments to each operator */
115 unsigned (*xNextChar)(ReInput*); /* Next character function */
116 unsigned char zInit[12]; /* Initial text to match */
117 int nInit; /* Number of characters in zInit */
118 unsigned nState; /* Number of entries in aOp[] and aArg[] */
119 unsigned nAlloc; /* Slots allocated for aOp[] and aArg[] */
120 };
121 #endif
@@ -197,11 +197,12 @@
197
198 /* Look for the initial prefix match, if there is one. */
199 if( pRe->nInit ){
200 unsigned char x = pRe->zInit[0];
201 while( in.i+pRe->nInit<=in.mx
202 && (zIn[in.i]!=x ||
203 strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0)
204 ){
205 in.i++;
206 }
207 if( in.i+pRe->nInit>in.mx ) return 0;
208 }
209

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button