Fossil SCM
Fix compiler warnings in makeheaders.c.
Commit
04b976b15163e5e55c13e2d427297e80a5275909
Parent
baa6df0650e6c41…
1 file changed
+8
-8
+8
-8
| --- src/makeheaders.c | ||
| +++ src/makeheaders.c | ||
| @@ -2144,11 +2144,11 @@ | ||
| 2144 | 2144 | zArg = &zCmd[2]; |
| 2145 | 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | 2146 | zArg++; |
| 2147 | 2147 | } |
| 2148 | 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2149 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2150 | 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | ||
| 2163 | 2163 | zArg = &zCmd[5]; |
| 2164 | 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | 2165 | zArg++; |
| 2166 | 2166 | } |
| 2167 | 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2168 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2169 | 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | 2171 | /* |
| 2172 | 2172 | ** Push an #ifndef. |
| 2173 | 2173 | */ |
| @@ -2174,11 +2174,11 @@ | ||
| 2174 | 2174 | zArg = &zCmd[6]; |
| 2175 | 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | 2176 | zArg++; |
| 2177 | 2177 | } |
| 2178 | 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2179 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2180 | 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | 2182 | /* |
| 2183 | 2183 | ** Invert the #if on the top of the stack |
| 2184 | 2184 | */ |
| @@ -2800,11 +2800,11 @@ | ||
| 2800 | 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | 2802 | fprintf(stderr, |
| 2803 | 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | - pFile->zHdr, strlen(pFile->zHdr), ""); | |
| 2805 | + pFile->zHdr, (int)strlen(pFile->zHdr), ""); | |
| 2806 | 2806 | nErr++; |
| 2807 | 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | ||
| 2955 | 2955 | if( nLabel==0 ) continue; |
| 2956 | 2956 | zLabel[nLabel] = 0; |
| 2957 | 2957 | InsertExtraDecl(pDecl); |
| 2958 | 2958 | zDecl = pDecl->zDecl; |
| 2959 | 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | - printf("%s %s %s %d %d %d %d %d %d\n", | |
| 2960 | + printf("%s %s %s %p %d %d %d %d %d\n", | |
| 2961 | 2961 | pDecl->zName, |
| 2962 | 2962 | zLabel, |
| 2963 | 2963 | pDecl->zFile, |
| 2964 | - pDecl->pComment ? (int)pDecl->pComment/sizeof(Token) : 0, | |
| 2964 | + pDecl->pComment, | |
| 2965 | 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | - pDecl->zIf ? strlen(pDecl->zIf)+1 : 0, | |
| 2967 | - zDecl ? strlen(zDecl) : 0, | |
| 2966 | + pDecl->zIf ? (int)strlen(pDecl->zIf)+1 : 0, | |
| 2967 | + zDecl ? (int)strlen(zDecl) : 0, | |
| 2968 | 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | 2970 | ); |
| 2971 | 2971 | if( pDecl->pComment ){ |
| 2972 | 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 | 2973 |
| --- src/makeheaders.c | |
| +++ src/makeheaders.c | |
| @@ -2144,11 +2144,11 @@ | |
| 2144 | zArg = &zCmd[2]; |
| 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | zArg++; |
| 2147 | } |
| 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | |
| 2163 | zArg = &zCmd[5]; |
| 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | zArg++; |
| 2166 | } |
| 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | /* |
| 2172 | ** Push an #ifndef. |
| 2173 | */ |
| @@ -2174,11 +2174,11 @@ | |
| 2174 | zArg = &zCmd[6]; |
| 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | zArg++; |
| 2177 | } |
| 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | /* |
| 2183 | ** Invert the #if on the top of the stack |
| 2184 | */ |
| @@ -2800,11 +2800,11 @@ | |
| 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | fprintf(stderr, |
| 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | pFile->zHdr, strlen(pFile->zHdr), ""); |
| 2806 | nErr++; |
| 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | |
| 2955 | if( nLabel==0 ) continue; |
| 2956 | zLabel[nLabel] = 0; |
| 2957 | InsertExtraDecl(pDecl); |
| 2958 | zDecl = pDecl->zDecl; |
| 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | printf("%s %s %s %d %d %d %d %d %d\n", |
| 2961 | pDecl->zName, |
| 2962 | zLabel, |
| 2963 | pDecl->zFile, |
| 2964 | pDecl->pComment ? (int)pDecl->pComment/sizeof(Token) : 0, |
| 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | pDecl->zIf ? strlen(pDecl->zIf)+1 : 0, |
| 2967 | zDecl ? strlen(zDecl) : 0, |
| 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | ); |
| 2971 | if( pDecl->pComment ){ |
| 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 |
| --- src/makeheaders.c | |
| +++ src/makeheaders.c | |
| @@ -2144,11 +2144,11 @@ | |
| 2144 | zArg = &zCmd[2]; |
| 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | zArg++; |
| 2147 | } |
| 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | |
| 2163 | zArg = &zCmd[5]; |
| 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | zArg++; |
| 2166 | } |
| 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | /* |
| 2172 | ** Push an #ifndef. |
| 2173 | */ |
| @@ -2174,11 +2174,11 @@ | |
| 2174 | zArg = &zCmd[6]; |
| 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | zArg++; |
| 2177 | } |
| 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | /* |
| 2183 | ** Invert the #if on the top of the stack |
| 2184 | */ |
| @@ -2800,11 +2800,11 @@ | |
| 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | fprintf(stderr, |
| 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | pFile->zHdr, (int)strlen(pFile->zHdr), ""); |
| 2806 | nErr++; |
| 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | |
| 2955 | if( nLabel==0 ) continue; |
| 2956 | zLabel[nLabel] = 0; |
| 2957 | InsertExtraDecl(pDecl); |
| 2958 | zDecl = pDecl->zDecl; |
| 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | printf("%s %s %s %p %d %d %d %d %d\n", |
| 2961 | pDecl->zName, |
| 2962 | zLabel, |
| 2963 | pDecl->zFile, |
| 2964 | pDecl->pComment, |
| 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | pDecl->zIf ? (int)strlen(pDecl->zIf)+1 : 0, |
| 2967 | zDecl ? (int)strlen(zDecl) : 0, |
| 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | ); |
| 2971 | if( pDecl->pComment ){ |
| 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 |