Fossil SCM

Proposed fix for compiler warning: passing argument 4 of ‘sqlite3_result_text’ from incompatible pointer type

jan.nijtmans 2014-11-07 11:52 svn-import
Commit c2faa14d85ba236babb10a752f440b6b24db68ee
2 files changed +17 -15 +2 -2
+17 -15
--- src/import.c
+++ src/import.c
@@ -720,15 +720,15 @@
720720
}
721721
722722
static struct{
723723
int rev; /* SVN revision number */
724724
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 */
730730
int flatFlag; /* True if whole repo is a single file tree */
731731
const char *zTrunk; /* Name of trunk folder in repo root */
732732
int lenTrunk; /* String length of zTrunk */
733733
const char *zBranches; /* Name of branches folder in repo root */
734734
int lenBranches; /* String length of zBranches */
@@ -735,11 +735,11 @@
735735
const char *zTags; /* Name of tags folder in repo root */
736736
int lenTags; /* String length of zTags */
737737
Blob filter; /* Path to repo root */
738738
} gsvn;
739739
typedef struct {
740
- const char *zKey;
740
+ char *zKey;
741741
const char *zVal;
742742
} KeyVal;
743743
typedef struct {
744744
KeyVal *aHeaders;
745745
int nHeaders;
@@ -914,11 +914,11 @@
914914
static Stmt qFiles;
915915
static Stmt qTags;
916916
int nBaseFilter;
917917
int nFilter;
918918
int rid;
919
- const char *zParentBranch = 0;
919
+ char *zParentBranch = 0;
920920
Blob mcksum;
921921
922922
blob_zero(&manifest);
923923
nBaseFilter = blob_size(&gsvn.filter);
924924
if( !gsvn.flatFlag ){
@@ -984,11 +984,11 @@
984984
db_bind_text(&qFiles, ":filter", blob_str(&gsvn.filter));
985985
while( db_step(&qFiles)==SQLITE_ROW ){
986986
const char *zFile = db_column_text(&qFiles, 0);
987987
int rid = db_column_int(&qFiles, 1);
988988
const char *zPerm = db_column_text(&qFiles, 2);
989
- const char *zUuid;
989
+ char *zUuid;
990990
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
991991
blob_appendf(&manifest, "F %F %s %s\n", zFile+nFilter, zUuid, zPerm);
992992
fossil_free(zUuid);
993993
}
994994
db_reset(&qFiles);
@@ -1186,10 +1186,11 @@
11861186
);
11871187
gsvn.rev = -1;
11881188
while( svn_read_rec(pIn, &rec) ){
11891189
if( (zTemp = svn_find_header(rec, "Revision-number")) ){ /* revision node */
11901190
/* finish previous revision */
1191
+ const char *zDate = NULL;
11911192
if( bHasFiles ){
11921193
svn_create_manifest();
11931194
}
11941195
fossil_free(gsvn.zUser);
11951196
fossil_free(gsvn.zComment);
@@ -1198,13 +1199,13 @@
11981199
fossil_free(gsvn.zParentBranch);
11991200
/* start new revision */
12001201
gsvn.rev = atoi(zTemp);
12011202
gsvn.zUser = mprintf("%s", svn_find_prop(rec, "svn:author"));
12021203
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);
12061207
}
12071208
gsvn.parentRev = -1;
12081209
gsvn.zParentBranch = 0;
12091210
gsvn.zBranch = 0;
12101211
bHasFiles = 0;
@@ -1231,20 +1232,21 @@
12311232
}else{
12321233
fossil_fatal("Missing copyfrom-rev");
12331234
}
12341235
}
12351236
if( !gsvn.flatFlag ){
1236
- if( (zTemp=svn_extract_branch(zPath))!=0 ){
1237
+ char *zBranch;
1238
+ if( (zBranch=svn_extract_branch(zPath))!=0 ){
12371239
if( gsvn.zBranch!=0 ){
1238
- if( strcmp(zTemp, gsvn.zBranch)!=0
1240
+ if( strcmp(zBranch, gsvn.zBranch)!=0
12391241
&& strncmp(zAction, "delete", 6)!=0)
12401242
{
12411243
fossil_fatal("Commit to multiple branches");
12421244
}
1243
- fossil_free(zTemp);
1245
+ fossil_free(zBranch);
12441246
}else{
1245
- gsvn.zBranch = zTemp;
1247
+ gsvn.zBranch = zBranch;
12461248
}
12471249
}
12481250
}
12491251
if( strncmp(zAction, "delete", 6)==0
12501252
|| strncmp(zAction, "replace", 7)==0 )
12511253
--- 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 @@
4848
void *fossil_malloc(size_t n){
4949
void *p = malloc(n==0 ? 1 : n);
5050
if( p==0 ) fossil_panic("out of memory");
5151
return p;
5252
}
53
-void fossil_free(const void *p){
54
- free((void*)p);
53
+void fossil_free(void *p){
54
+ free(p);
5555
}
5656
void *fossil_realloc(void *p, size_t n){
5757
p = realloc(p, n);
5858
if( p==0 ) fossil_panic("out of memory");
5959
return p;
6060
--- 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

Keyboard Shortcuts

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