Fossil SCM
Fix a harmless compiler warning in regexp.c.
Commit
520703dd552b6a6a32e6d15d3e29793c53f2bd84
Parent
9122ad308a9392e…
1 file changed
+3
-2
+3
-2
| --- src/regexp.c | ||
| +++ src/regexp.c | ||
| @@ -111,11 +111,11 @@ | ||
| 111 | 111 | ReInput sIn; /* Regular expression text */ |
| 112 | 112 | const char *zErr; /* Error message to return */ |
| 113 | 113 | char *aOp; /* Operators for the virtual machine */ |
| 114 | 114 | int *aArg; /* Arguments to each operator */ |
| 115 | 115 | unsigned (*xNextChar)(ReInput*); /* Next character function */ |
| 116 | - char zInit[12]; /* Initial text to match */ | |
| 116 | + unsigned char zInit[12]; /* Initial text to match */ | |
| 117 | 117 | int nInit; /* Number of characters in zInit */ |
| 118 | 118 | unsigned nState; /* Number of entries in aOp[] and aArg[] */ |
| 119 | 119 | unsigned nAlloc; /* Slots allocated for aOp[] and aArg[] */ |
| 120 | 120 | }; |
| 121 | 121 | #endif |
| @@ -197,11 +197,12 @@ | ||
| 197 | 197 | |
| 198 | 198 | /* Look for the initial prefix match, if there is one. */ |
| 199 | 199 | if( pRe->nInit ){ |
| 200 | 200 | unsigned char x = pRe->zInit[0]; |
| 201 | 201 | 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) | |
| 203 | 204 | ){ |
| 204 | 205 | in.i++; |
| 205 | 206 | } |
| 206 | 207 | if( in.i+pRe->nInit>in.mx ) return 0; |
| 207 | 208 | } |
| 208 | 209 |
| --- 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 |