Fossil SCM

Fixed a couple C99-isms reported at [https://fossil-scm.org/forum/forumpost/487f05e382 | /forumpost/487f05e382].

stephan 2021-01-14 11:15 trunk
Commit a7af387dd8aa7f5bfea84a15fa33487ceab8d94047e8eb54e1c473f6003d6402
2 files changed +4 -2 +2 -2
+4 -2
--- src/import.c
+++ src/import.c
@@ -1797,10 +1797,11 @@
17971797
gsvn.zBranches = find_option("branches", 0, 1);
17981798
gsvn.zTags = find_option("tags", 0, 1);
17991799
gsvn.revFlag = find_option("rev-tags", 0, 0)
18001800
|| (incrFlag && !find_option("no-rev-tags", 0, 0));
18011801
}else if( gitFlag ){
1802
+ const char *zGitUser;
18021803
markfile_in = find_option("import-marks", 0, 1);
18031804
markfile_out = find_option("export-marks", 0, 1);
18041805
if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){
18051806
ggit.zMasterName = "master";
18061807
}
@@ -1807,15 +1808,16 @@
18071808
ggit.authorFlag = find_option("use-author", 0, 0)!=0;
18081809
/*
18091810
** Extract --attribute 'emailaddr username' args that will populate
18101811
** new 'fx_' table to later match username for check-in attribution.
18111812
*/
1812
- const char *zGitUser = find_option("attribute", 0, 1);
1813
+ zGitUser = find_option("attribute", 0, 1);
18131814
while( zGitUser != 0 ){
1815
+ char *currGitUser;
18141816
ggit.gitUserInfo = fossil_realloc(ggit.gitUserInfo, ++ggit.nGitAttr
18151817
* sizeof(ggit.gitUserInfo[0]));
1816
- char *currGitUser = fossil_strdup(zGitUser);
1818
+ currGitUser = fossil_strdup(zGitUser);
18171819
ggit.gitUserInfo[ggit.nGitAttr-1].zEmail = next_token(&currGitUser);
18181820
ggit.gitUserInfo[ggit.nGitAttr-1].zUser = rest_of_line(&currGitUser);
18191821
zGitUser = find_option("attribute", 0, 1);
18201822
}
18211823
}
18221824
--- src/import.c
+++ src/import.c
@@ -1797,10 +1797,11 @@
1797 gsvn.zBranches = find_option("branches", 0, 1);
1798 gsvn.zTags = find_option("tags", 0, 1);
1799 gsvn.revFlag = find_option("rev-tags", 0, 0)
1800 || (incrFlag && !find_option("no-rev-tags", 0, 0));
1801 }else if( gitFlag ){
 
1802 markfile_in = find_option("import-marks", 0, 1);
1803 markfile_out = find_option("export-marks", 0, 1);
1804 if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){
1805 ggit.zMasterName = "master";
1806 }
@@ -1807,15 +1808,16 @@
1807 ggit.authorFlag = find_option("use-author", 0, 0)!=0;
1808 /*
1809 ** Extract --attribute 'emailaddr username' args that will populate
1810 ** new 'fx_' table to later match username for check-in attribution.
1811 */
1812 const char *zGitUser = find_option("attribute", 0, 1);
1813 while( zGitUser != 0 ){
 
1814 ggit.gitUserInfo = fossil_realloc(ggit.gitUserInfo, ++ggit.nGitAttr
1815 * sizeof(ggit.gitUserInfo[0]));
1816 char *currGitUser = fossil_strdup(zGitUser);
1817 ggit.gitUserInfo[ggit.nGitAttr-1].zEmail = next_token(&currGitUser);
1818 ggit.gitUserInfo[ggit.nGitAttr-1].zUser = rest_of_line(&currGitUser);
1819 zGitUser = find_option("attribute", 0, 1);
1820 }
1821 }
1822
--- src/import.c
+++ src/import.c
@@ -1797,10 +1797,11 @@
1797 gsvn.zBranches = find_option("branches", 0, 1);
1798 gsvn.zTags = find_option("tags", 0, 1);
1799 gsvn.revFlag = find_option("rev-tags", 0, 0)
1800 || (incrFlag && !find_option("no-rev-tags", 0, 0));
1801 }else if( gitFlag ){
1802 const char *zGitUser;
1803 markfile_in = find_option("import-marks", 0, 1);
1804 markfile_out = find_option("export-marks", 0, 1);
1805 if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){
1806 ggit.zMasterName = "master";
1807 }
@@ -1807,15 +1808,16 @@
1808 ggit.authorFlag = find_option("use-author", 0, 0)!=0;
1809 /*
1810 ** Extract --attribute 'emailaddr username' args that will populate
1811 ** new 'fx_' table to later match username for check-in attribution.
1812 */
1813 zGitUser = find_option("attribute", 0, 1);
1814 while( zGitUser != 0 ){
1815 char *currGitUser;
1816 ggit.gitUserInfo = fossil_realloc(ggit.gitUserInfo, ++ggit.nGitAttr
1817 * sizeof(ggit.gitUserInfo[0]));
1818 currGitUser = fossil_strdup(zGitUser);
1819 ggit.gitUserInfo[ggit.nGitAttr-1].zEmail = next_token(&currGitUser);
1820 ggit.gitUserInfo[ggit.nGitAttr-1].zUser = rest_of_line(&currGitUser);
1821 zGitUser = find_option("attribute", 0, 1);
1822 }
1823 }
1824
+2 -2
--- src/timeline.c
+++ src/timeline.c
@@ -2982,15 +2982,15 @@
29822982
}else{
29832983
zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom);
29842984
}
29852985
29862986
if( zFormat ){
2987
+ char *zEntry;
2988
+ int nEntryLine = 0;
29872989
if( nChild==0 ){
29882990
sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*LEAF* ");
29892991
}
2990
- char *zEntry;
2991
- int nEntryLine = 0;
29922992
zEntry = timeline_entry_subst(zFormat, &nEntryLine, zId, zDate, zUserShort,
29932993
zComShort, zBranch, zTags, zPrefix);
29942994
nLine += nEntryLine;
29952995
fossil_print("%s\n", zEntry);
29962996
fossil_free(zEntry);
29972997
--- src/timeline.c
+++ src/timeline.c
@@ -2982,15 +2982,15 @@
2982 }else{
2983 zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom);
2984 }
2985
2986 if( zFormat ){
 
 
2987 if( nChild==0 ){
2988 sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*LEAF* ");
2989 }
2990 char *zEntry;
2991 int nEntryLine = 0;
2992 zEntry = timeline_entry_subst(zFormat, &nEntryLine, zId, zDate, zUserShort,
2993 zComShort, zBranch, zTags, zPrefix);
2994 nLine += nEntryLine;
2995 fossil_print("%s\n", zEntry);
2996 fossil_free(zEntry);
2997
--- src/timeline.c
+++ src/timeline.c
@@ -2982,15 +2982,15 @@
2982 }else{
2983 zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom);
2984 }
2985
2986 if( zFormat ){
2987 char *zEntry;
2988 int nEntryLine = 0;
2989 if( nChild==0 ){
2990 sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*LEAF* ");
2991 }
 
 
2992 zEntry = timeline_entry_subst(zFormat, &nEntryLine, zId, zDate, zUserShort,
2993 zComShort, zBranch, zTags, zPrefix);
2994 nLine += nEntryLine;
2995 fossil_print("%s\n", zEntry);
2996 fossil_free(zEntry);
2997

Keyboard Shortcuts

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