Fossil SCM
Proposed fix for compiler warning: passing argument 4 of ‘sqlite3_result_text’ from incompatible pointer type
Commit
c2faa14d85ba236babb10a752f440b6b24db68ee
Parent
412030b14500d71…
2 files changed
+17
-15
+2
-2
+17
-15
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -720,15 +720,15 @@ | ||
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | static struct{ |
| 723 | 723 | int rev; /* SVN revision number */ |
| 724 | 724 | int parentRev; /* SVN revision number of parent check-in */ |
| 725 | - const char *zParentBranch; /* Name of branch of parent check-in */ | |
| 726 | - const char *zBranch; /* Name of a branch for a commit */ | |
| 727 | - const char *zDate; /* Date/time stamp */ | |
| 728 | - const char *zUser; /* User name */ | |
| 729 | - const char *zComment; /* Comment of a commit */ | |
| 725 | + char *zParentBranch; /* Name of branch of parent check-in */ | |
| 726 | + char *zBranch; /* Name of a branch for a commit */ | |
| 727 | + char *zDate; /* Date/time stamp */ | |
| 728 | + char *zUser; /* User name */ | |
| 729 | + char *zComment; /* Comment of a commit */ | |
| 730 | 730 | int flatFlag; /* True if whole repo is a single file tree */ |
| 731 | 731 | const char *zTrunk; /* Name of trunk folder in repo root */ |
| 732 | 732 | int lenTrunk; /* String length of zTrunk */ |
| 733 | 733 | const char *zBranches; /* Name of branches folder in repo root */ |
| 734 | 734 | int lenBranches; /* String length of zBranches */ |
| @@ -735,11 +735,11 @@ | ||
| 735 | 735 | const char *zTags; /* Name of tags folder in repo root */ |
| 736 | 736 | int lenTags; /* String length of zTags */ |
| 737 | 737 | Blob filter; /* Path to repo root */ |
| 738 | 738 | } gsvn; |
| 739 | 739 | typedef struct { |
| 740 | - const char *zKey; | |
| 740 | + char *zKey; | |
| 741 | 741 | const char *zVal; |
| 742 | 742 | } KeyVal; |
| 743 | 743 | typedef struct { |
| 744 | 744 | KeyVal *aHeaders; |
| 745 | 745 | int nHeaders; |
| @@ -914,11 +914,11 @@ | ||
| 914 | 914 | static Stmt qFiles; |
| 915 | 915 | static Stmt qTags; |
| 916 | 916 | int nBaseFilter; |
| 917 | 917 | int nFilter; |
| 918 | 918 | int rid; |
| 919 | - const char *zParentBranch = 0; | |
| 919 | + char *zParentBranch = 0; | |
| 920 | 920 | Blob mcksum; |
| 921 | 921 | |
| 922 | 922 | blob_zero(&manifest); |
| 923 | 923 | nBaseFilter = blob_size(&gsvn.filter); |
| 924 | 924 | if( !gsvn.flatFlag ){ |
| @@ -984,11 +984,11 @@ | ||
| 984 | 984 | db_bind_text(&qFiles, ":filter", blob_str(&gsvn.filter)); |
| 985 | 985 | while( db_step(&qFiles)==SQLITE_ROW ){ |
| 986 | 986 | const char *zFile = db_column_text(&qFiles, 0); |
| 987 | 987 | int rid = db_column_int(&qFiles, 1); |
| 988 | 988 | const char *zPerm = db_column_text(&qFiles, 2); |
| 989 | - const char *zUuid; | |
| 989 | + char *zUuid; | |
| 990 | 990 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 991 | 991 | blob_appendf(&manifest, "F %F %s %s\n", zFile+nFilter, zUuid, zPerm); |
| 992 | 992 | fossil_free(zUuid); |
| 993 | 993 | } |
| 994 | 994 | db_reset(&qFiles); |
| @@ -1186,10 +1186,11 @@ | ||
| 1186 | 1186 | ); |
| 1187 | 1187 | gsvn.rev = -1; |
| 1188 | 1188 | while( svn_read_rec(pIn, &rec) ){ |
| 1189 | 1189 | if( (zTemp = svn_find_header(rec, "Revision-number")) ){ /* revision node */ |
| 1190 | 1190 | /* finish previous revision */ |
| 1191 | + const char *zDate = NULL; | |
| 1191 | 1192 | if( bHasFiles ){ |
| 1192 | 1193 | svn_create_manifest(); |
| 1193 | 1194 | } |
| 1194 | 1195 | fossil_free(gsvn.zUser); |
| 1195 | 1196 | fossil_free(gsvn.zComment); |
| @@ -1198,13 +1199,13 @@ | ||
| 1198 | 1199 | fossil_free(gsvn.zParentBranch); |
| 1199 | 1200 | /* start new revision */ |
| 1200 | 1201 | gsvn.rev = atoi(zTemp); |
| 1201 | 1202 | gsvn.zUser = mprintf("%s", svn_find_prop(rec, "svn:author")); |
| 1202 | 1203 | gsvn.zComment = mprintf("%s", svn_find_prop(rec, "svn:log")); |
| 1203 | - gsvn.zDate = svn_find_prop(rec, "svn:date"); | |
| 1204 | - if( gsvn.zDate ){ | |
| 1205 | - gsvn.zDate = date_in_standard_format(gsvn.zDate); | |
| 1204 | + zDate = svn_find_prop(rec, "svn:date"); | |
| 1205 | + if( zDate ){ | |
| 1206 | + gsvn.zDate = date_in_standard_format(zDate); | |
| 1206 | 1207 | } |
| 1207 | 1208 | gsvn.parentRev = -1; |
| 1208 | 1209 | gsvn.zParentBranch = 0; |
| 1209 | 1210 | gsvn.zBranch = 0; |
| 1210 | 1211 | bHasFiles = 0; |
| @@ -1231,20 +1232,21 @@ | ||
| 1231 | 1232 | }else{ |
| 1232 | 1233 | fossil_fatal("Missing copyfrom-rev"); |
| 1233 | 1234 | } |
| 1234 | 1235 | } |
| 1235 | 1236 | if( !gsvn.flatFlag ){ |
| 1236 | - if( (zTemp=svn_extract_branch(zPath))!=0 ){ | |
| 1237 | + char *zBranch; | |
| 1238 | + if( (zBranch=svn_extract_branch(zPath))!=0 ){ | |
| 1237 | 1239 | if( gsvn.zBranch!=0 ){ |
| 1238 | - if( strcmp(zTemp, gsvn.zBranch)!=0 | |
| 1240 | + if( strcmp(zBranch, gsvn.zBranch)!=0 | |
| 1239 | 1241 | && strncmp(zAction, "delete", 6)!=0) |
| 1240 | 1242 | { |
| 1241 | 1243 | fossil_fatal("Commit to multiple branches"); |
| 1242 | 1244 | } |
| 1243 | - fossil_free(zTemp); | |
| 1245 | + fossil_free(zBranch); | |
| 1244 | 1246 | }else{ |
| 1245 | - gsvn.zBranch = zTemp; | |
| 1247 | + gsvn.zBranch = zBranch; | |
| 1246 | 1248 | } |
| 1247 | 1249 | } |
| 1248 | 1250 | } |
| 1249 | 1251 | if( strncmp(zAction, "delete", 6)==0 |
| 1250 | 1252 | || strncmp(zAction, "replace", 7)==0 ) |
| 1251 | 1253 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -720,15 +720,15 @@ | |
| 720 | } |
| 721 | |
| 722 | static struct{ |
| 723 | int rev; /* SVN revision number */ |
| 724 | int parentRev; /* SVN revision number of parent check-in */ |
| 725 | const char *zParentBranch; /* Name of branch of parent check-in */ |
| 726 | const char *zBranch; /* Name of a branch for a commit */ |
| 727 | const char *zDate; /* Date/time stamp */ |
| 728 | const char *zUser; /* User name */ |
| 729 | const char *zComment; /* Comment of a commit */ |
| 730 | int flatFlag; /* True if whole repo is a single file tree */ |
| 731 | const char *zTrunk; /* Name of trunk folder in repo root */ |
| 732 | int lenTrunk; /* String length of zTrunk */ |
| 733 | const char *zBranches; /* Name of branches folder in repo root */ |
| 734 | int lenBranches; /* String length of zBranches */ |
| @@ -735,11 +735,11 @@ | |
| 735 | const char *zTags; /* Name of tags folder in repo root */ |
| 736 | int lenTags; /* String length of zTags */ |
| 737 | Blob filter; /* Path to repo root */ |
| 738 | } gsvn; |
| 739 | typedef struct { |
| 740 | const char *zKey; |
| 741 | const char *zVal; |
| 742 | } KeyVal; |
| 743 | typedef struct { |
| 744 | KeyVal *aHeaders; |
| 745 | int nHeaders; |
| @@ -914,11 +914,11 @@ | |
| 914 | static Stmt qFiles; |
| 915 | static Stmt qTags; |
| 916 | int nBaseFilter; |
| 917 | int nFilter; |
| 918 | int rid; |
| 919 | const char *zParentBranch = 0; |
| 920 | Blob mcksum; |
| 921 | |
| 922 | blob_zero(&manifest); |
| 923 | nBaseFilter = blob_size(&gsvn.filter); |
| 924 | if( !gsvn.flatFlag ){ |
| @@ -984,11 +984,11 @@ | |
| 984 | db_bind_text(&qFiles, ":filter", blob_str(&gsvn.filter)); |
| 985 | while( db_step(&qFiles)==SQLITE_ROW ){ |
| 986 | const char *zFile = db_column_text(&qFiles, 0); |
| 987 | int rid = db_column_int(&qFiles, 1); |
| 988 | const char *zPerm = db_column_text(&qFiles, 2); |
| 989 | const char *zUuid; |
| 990 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 991 | blob_appendf(&manifest, "F %F %s %s\n", zFile+nFilter, zUuid, zPerm); |
| 992 | fossil_free(zUuid); |
| 993 | } |
| 994 | db_reset(&qFiles); |
| @@ -1186,10 +1186,11 @@ | |
| 1186 | ); |
| 1187 | gsvn.rev = -1; |
| 1188 | while( svn_read_rec(pIn, &rec) ){ |
| 1189 | if( (zTemp = svn_find_header(rec, "Revision-number")) ){ /* revision node */ |
| 1190 | /* finish previous revision */ |
| 1191 | if( bHasFiles ){ |
| 1192 | svn_create_manifest(); |
| 1193 | } |
| 1194 | fossil_free(gsvn.zUser); |
| 1195 | fossil_free(gsvn.zComment); |
| @@ -1198,13 +1199,13 @@ | |
| 1198 | fossil_free(gsvn.zParentBranch); |
| 1199 | /* start new revision */ |
| 1200 | gsvn.rev = atoi(zTemp); |
| 1201 | gsvn.zUser = mprintf("%s", svn_find_prop(rec, "svn:author")); |
| 1202 | gsvn.zComment = mprintf("%s", svn_find_prop(rec, "svn:log")); |
| 1203 | gsvn.zDate = svn_find_prop(rec, "svn:date"); |
| 1204 | if( gsvn.zDate ){ |
| 1205 | gsvn.zDate = date_in_standard_format(gsvn.zDate); |
| 1206 | } |
| 1207 | gsvn.parentRev = -1; |
| 1208 | gsvn.zParentBranch = 0; |
| 1209 | gsvn.zBranch = 0; |
| 1210 | bHasFiles = 0; |
| @@ -1231,20 +1232,21 @@ | |
| 1231 | }else{ |
| 1232 | fossil_fatal("Missing copyfrom-rev"); |
| 1233 | } |
| 1234 | } |
| 1235 | if( !gsvn.flatFlag ){ |
| 1236 | if( (zTemp=svn_extract_branch(zPath))!=0 ){ |
| 1237 | if( gsvn.zBranch!=0 ){ |
| 1238 | if( strcmp(zTemp, gsvn.zBranch)!=0 |
| 1239 | && strncmp(zAction, "delete", 6)!=0) |
| 1240 | { |
| 1241 | fossil_fatal("Commit to multiple branches"); |
| 1242 | } |
| 1243 | fossil_free(zTemp); |
| 1244 | }else{ |
| 1245 | gsvn.zBranch = zTemp; |
| 1246 | } |
| 1247 | } |
| 1248 | } |
| 1249 | if( strncmp(zAction, "delete", 6)==0 |
| 1250 | || strncmp(zAction, "replace", 7)==0 ) |
| 1251 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -720,15 +720,15 @@ | |
| 720 | } |
| 721 | |
| 722 | static struct{ |
| 723 | int rev; /* SVN revision number */ |
| 724 | int parentRev; /* SVN revision number of parent check-in */ |
| 725 | char *zParentBranch; /* Name of branch of parent check-in */ |
| 726 | char *zBranch; /* Name of a branch for a commit */ |
| 727 | char *zDate; /* Date/time stamp */ |
| 728 | char *zUser; /* User name */ |
| 729 | char *zComment; /* Comment of a commit */ |
| 730 | int flatFlag; /* True if whole repo is a single file tree */ |
| 731 | const char *zTrunk; /* Name of trunk folder in repo root */ |
| 732 | int lenTrunk; /* String length of zTrunk */ |
| 733 | const char *zBranches; /* Name of branches folder in repo root */ |
| 734 | int lenBranches; /* String length of zBranches */ |
| @@ -735,11 +735,11 @@ | |
| 735 | const char *zTags; /* Name of tags folder in repo root */ |
| 736 | int lenTags; /* String length of zTags */ |
| 737 | Blob filter; /* Path to repo root */ |
| 738 | } gsvn; |
| 739 | typedef struct { |
| 740 | char *zKey; |
| 741 | const char *zVal; |
| 742 | } KeyVal; |
| 743 | typedef struct { |
| 744 | KeyVal *aHeaders; |
| 745 | int nHeaders; |
| @@ -914,11 +914,11 @@ | |
| 914 | static Stmt qFiles; |
| 915 | static Stmt qTags; |
| 916 | int nBaseFilter; |
| 917 | int nFilter; |
| 918 | int rid; |
| 919 | char *zParentBranch = 0; |
| 920 | Blob mcksum; |
| 921 | |
| 922 | blob_zero(&manifest); |
| 923 | nBaseFilter = blob_size(&gsvn.filter); |
| 924 | if( !gsvn.flatFlag ){ |
| @@ -984,11 +984,11 @@ | |
| 984 | db_bind_text(&qFiles, ":filter", blob_str(&gsvn.filter)); |
| 985 | while( db_step(&qFiles)==SQLITE_ROW ){ |
| 986 | const char *zFile = db_column_text(&qFiles, 0); |
| 987 | int rid = db_column_int(&qFiles, 1); |
| 988 | const char *zPerm = db_column_text(&qFiles, 2); |
| 989 | char *zUuid; |
| 990 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 991 | blob_appendf(&manifest, "F %F %s %s\n", zFile+nFilter, zUuid, zPerm); |
| 992 | fossil_free(zUuid); |
| 993 | } |
| 994 | db_reset(&qFiles); |
| @@ -1186,10 +1186,11 @@ | |
| 1186 | ); |
| 1187 | gsvn.rev = -1; |
| 1188 | while( svn_read_rec(pIn, &rec) ){ |
| 1189 | if( (zTemp = svn_find_header(rec, "Revision-number")) ){ /* revision node */ |
| 1190 | /* finish previous revision */ |
| 1191 | const char *zDate = NULL; |
| 1192 | if( bHasFiles ){ |
| 1193 | svn_create_manifest(); |
| 1194 | } |
| 1195 | fossil_free(gsvn.zUser); |
| 1196 | fossil_free(gsvn.zComment); |
| @@ -1198,13 +1199,13 @@ | |
| 1199 | fossil_free(gsvn.zParentBranch); |
| 1200 | /* start new revision */ |
| 1201 | gsvn.rev = atoi(zTemp); |
| 1202 | gsvn.zUser = mprintf("%s", svn_find_prop(rec, "svn:author")); |
| 1203 | gsvn.zComment = mprintf("%s", svn_find_prop(rec, "svn:log")); |
| 1204 | zDate = svn_find_prop(rec, "svn:date"); |
| 1205 | if( zDate ){ |
| 1206 | gsvn.zDate = date_in_standard_format(zDate); |
| 1207 | } |
| 1208 | gsvn.parentRev = -1; |
| 1209 | gsvn.zParentBranch = 0; |
| 1210 | gsvn.zBranch = 0; |
| 1211 | bHasFiles = 0; |
| @@ -1231,20 +1232,21 @@ | |
| 1232 | }else{ |
| 1233 | fossil_fatal("Missing copyfrom-rev"); |
| 1234 | } |
| 1235 | } |
| 1236 | if( !gsvn.flatFlag ){ |
| 1237 | char *zBranch; |
| 1238 | if( (zBranch=svn_extract_branch(zPath))!=0 ){ |
| 1239 | if( gsvn.zBranch!=0 ){ |
| 1240 | if( strcmp(zBranch, gsvn.zBranch)!=0 |
| 1241 | && strncmp(zAction, "delete", 6)!=0) |
| 1242 | { |
| 1243 | fossil_fatal("Commit to multiple branches"); |
| 1244 | } |
| 1245 | fossil_free(zBranch); |
| 1246 | }else{ |
| 1247 | gsvn.zBranch = zBranch; |
| 1248 | } |
| 1249 | } |
| 1250 | } |
| 1251 | if( strncmp(zAction, "delete", 6)==0 |
| 1252 | || strncmp(zAction, "replace", 7)==0 ) |
| 1253 |
+2
-2
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -48,12 +48,12 @@ | ||
| 48 | 48 | void *fossil_malloc(size_t n){ |
| 49 | 49 | void *p = malloc(n==0 ? 1 : n); |
| 50 | 50 | if( p==0 ) fossil_panic("out of memory"); |
| 51 | 51 | return p; |
| 52 | 52 | } |
| 53 | -void fossil_free(const void *p){ | |
| 54 | - free((void*)p); | |
| 53 | +void fossil_free(void *p){ | |
| 54 | + free(p); | |
| 55 | 55 | } |
| 56 | 56 | void *fossil_realloc(void *p, size_t n){ |
| 57 | 57 | p = realloc(p, n); |
| 58 | 58 | if( p==0 ) fossil_panic("out of memory"); |
| 59 | 59 | return p; |
| 60 | 60 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -48,12 +48,12 @@ | |
| 48 | void *fossil_malloc(size_t n){ |
| 49 | void *p = malloc(n==0 ? 1 : n); |
| 50 | if( p==0 ) fossil_panic("out of memory"); |
| 51 | return p; |
| 52 | } |
| 53 | void fossil_free(const void *p){ |
| 54 | free((void*)p); |
| 55 | } |
| 56 | void *fossil_realloc(void *p, size_t n){ |
| 57 | p = realloc(p, n); |
| 58 | if( p==0 ) fossil_panic("out of memory"); |
| 59 | return p; |
| 60 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -48,12 +48,12 @@ | |
| 48 | void *fossil_malloc(size_t n){ |
| 49 | void *p = malloc(n==0 ? 1 : n); |
| 50 | if( p==0 ) fossil_panic("out of memory"); |
| 51 | return p; |
| 52 | } |
| 53 | void fossil_free(void *p){ |
| 54 | free(p); |
| 55 | } |
| 56 | void *fossil_realloc(void *p, size_t n){ |
| 57 | p = realloc(p, n); |
| 58 | if( p==0 ) fossil_panic("out of memory"); |
| 59 | return p; |
| 60 |