Fossil SCM

Fix some commenting and variable naming convensions in the diff code. No logical changes.

drh 2015-09-11 13:14 trunk
Commit 4140eb35757eea1f20e9c0f457198ecd5c897230
1 file changed +15 -14
+15 -14
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,16 +287,16 @@
287287
** When using an external diff program, zBinGlob contains the GLOB patterns
288288
** for file names to treat as binary. If fIncludeBinary is zero, these files
289289
** will be skipped in addition to files that may contain binary content.
290290
*/
291291
static void diff_one_against_disk(
292
- const char *zFrom, /* Name of file */
292
+ const char *zFrom, /* Version tag for the "before" file */
293293
const char *zDiffCmd, /* Use this "diff" command */
294294
const char *zBinGlob, /* Treat file names matching this as binary */
295295
int fIncludeBinary, /* Include binary files for external diff */
296296
u64 diffFlags, /* Diff control flags */
297
- const char *zFileTreeName
297
+ const char *zFileTreeName /* Name of the file to be diffed */
298298
){
299299
Blob fname;
300300
Blob content;
301301
int isLink;
302302
int isBin;
@@ -440,17 +440,17 @@
440440
** When using an external diff program, zBinGlob contains the GLOB patterns
441441
** for file names to treat as binary. If fIncludeBinary is zero, these files
442442
** will be skipped in addition to files that may contain binary content.
443443
*/
444444
static void diff_one_two_versions(
445
- const char *zFrom,
446
- const char *zTo,
447
- const char *zDiffCmd,
448
- const char *zBinGlob,
449
- int fIncludeBinary,
450
- u64 diffFlags,
451
- const char *zFileTreeName
445
+ const char *zFrom, /* Version tag for the "before" file */
446
+ const char *zTo, /* Version tag for the "after" file */
447
+ const char *zDiffCmd, /* Use this "diff" command */
448
+ const char *zBinGlob, /* GLOB pattern for files that are binary */
449
+ int fIncludeBinary, /* True to show binary files */
450
+ u64 diffFlags, /* Diff flags */
451
+ const char *zFileTreeName /* Name of the file to be diffed */
452452
){
453453
char *zName;
454454
Blob fname;
455455
Blob v1, v2;
456456
int isLink1, isLink2;
@@ -770,11 +770,10 @@
770770
const char *zBranch; /* Branch to diff */
771771
const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
772772
const char *zBinGlob = 0; /* Treat file names matching this as binary */
773773
int fIncludeBinary = 0; /* Include binary files for external diff */
774774
u64 diffFlags = 0; /* Flags to control the DIFF */
775
- int f;
776775
777776
if( find_option("tk",0,0)!=0 ){
778777
diff_tk("diff", 2);
779778
return;
780779
}
@@ -803,13 +802,14 @@
803802
}
804803
zBinGlob = diff_get_binary_glob();
805804
fIncludeBinary = diff_include_binary_files();
806805
verify_all_options();
807806
if( g.argc>=3 ){
808
- for(f=2; f<g.argc; ++f){
807
+ int i;
808
+ for(i=2; i<g.argc; i++){
809809
diff_one_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary,
810
- diffFlags, g.argv[f]);
810
+ diffFlags, g.argv[i]);
811811
}
812812
}else{
813813
diff_all_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary,
814814
diffFlags);
815815
}
@@ -822,13 +822,14 @@
822822
}
823823
zBinGlob = diff_get_binary_glob();
824824
fIncludeBinary = diff_include_binary_files();
825825
verify_all_options();
826826
if( g.argc>=3 ){
827
- for(f=2; f<g.argc; ++f){
827
+ int i;
828
+ for(i=2; i<g.argc; i++){
828829
diff_one_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary,
829
- diffFlags, g.argv[f]);
830
+ diffFlags, g.argv[i]);
830831
}
831832
}else{
832833
diff_all_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary,
833834
diffFlags);
834835
}
835836
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,16 +287,16 @@
287 ** When using an external diff program, zBinGlob contains the GLOB patterns
288 ** for file names to treat as binary. If fIncludeBinary is zero, these files
289 ** will be skipped in addition to files that may contain binary content.
290 */
291 static void diff_one_against_disk(
292 const char *zFrom, /* Name of file */
293 const char *zDiffCmd, /* Use this "diff" command */
294 const char *zBinGlob, /* Treat file names matching this as binary */
295 int fIncludeBinary, /* Include binary files for external diff */
296 u64 diffFlags, /* Diff control flags */
297 const char *zFileTreeName
298 ){
299 Blob fname;
300 Blob content;
301 int isLink;
302 int isBin;
@@ -440,17 +440,17 @@
440 ** When using an external diff program, zBinGlob contains the GLOB patterns
441 ** for file names to treat as binary. If fIncludeBinary is zero, these files
442 ** will be skipped in addition to files that may contain binary content.
443 */
444 static void diff_one_two_versions(
445 const char *zFrom,
446 const char *zTo,
447 const char *zDiffCmd,
448 const char *zBinGlob,
449 int fIncludeBinary,
450 u64 diffFlags,
451 const char *zFileTreeName
452 ){
453 char *zName;
454 Blob fname;
455 Blob v1, v2;
456 int isLink1, isLink2;
@@ -770,11 +770,10 @@
770 const char *zBranch; /* Branch to diff */
771 const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
772 const char *zBinGlob = 0; /* Treat file names matching this as binary */
773 int fIncludeBinary = 0; /* Include binary files for external diff */
774 u64 diffFlags = 0; /* Flags to control the DIFF */
775 int f;
776
777 if( find_option("tk",0,0)!=0 ){
778 diff_tk("diff", 2);
779 return;
780 }
@@ -803,13 +802,14 @@
803 }
804 zBinGlob = diff_get_binary_glob();
805 fIncludeBinary = diff_include_binary_files();
806 verify_all_options();
807 if( g.argc>=3 ){
808 for(f=2; f<g.argc; ++f){
 
809 diff_one_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary,
810 diffFlags, g.argv[f]);
811 }
812 }else{
813 diff_all_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary,
814 diffFlags);
815 }
@@ -822,13 +822,14 @@
822 }
823 zBinGlob = diff_get_binary_glob();
824 fIncludeBinary = diff_include_binary_files();
825 verify_all_options();
826 if( g.argc>=3 ){
827 for(f=2; f<g.argc; ++f){
 
828 diff_one_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary,
829 diffFlags, g.argv[f]);
830 }
831 }else{
832 diff_all_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary,
833 diffFlags);
834 }
835
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,16 +287,16 @@
287 ** When using an external diff program, zBinGlob contains the GLOB patterns
288 ** for file names to treat as binary. If fIncludeBinary is zero, these files
289 ** will be skipped in addition to files that may contain binary content.
290 */
291 static void diff_one_against_disk(
292 const char *zFrom, /* Version tag for the "before" file */
293 const char *zDiffCmd, /* Use this "diff" command */
294 const char *zBinGlob, /* Treat file names matching this as binary */
295 int fIncludeBinary, /* Include binary files for external diff */
296 u64 diffFlags, /* Diff control flags */
297 const char *zFileTreeName /* Name of the file to be diffed */
298 ){
299 Blob fname;
300 Blob content;
301 int isLink;
302 int isBin;
@@ -440,17 +440,17 @@
440 ** When using an external diff program, zBinGlob contains the GLOB patterns
441 ** for file names to treat as binary. If fIncludeBinary is zero, these files
442 ** will be skipped in addition to files that may contain binary content.
443 */
444 static void diff_one_two_versions(
445 const char *zFrom, /* Version tag for the "before" file */
446 const char *zTo, /* Version tag for the "after" file */
447 const char *zDiffCmd, /* Use this "diff" command */
448 const char *zBinGlob, /* GLOB pattern for files that are binary */
449 int fIncludeBinary, /* True to show binary files */
450 u64 diffFlags, /* Diff flags */
451 const char *zFileTreeName /* Name of the file to be diffed */
452 ){
453 char *zName;
454 Blob fname;
455 Blob v1, v2;
456 int isLink1, isLink2;
@@ -770,11 +770,10 @@
770 const char *zBranch; /* Branch to diff */
771 const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
772 const char *zBinGlob = 0; /* Treat file names matching this as binary */
773 int fIncludeBinary = 0; /* Include binary files for external diff */
774 u64 diffFlags = 0; /* Flags to control the DIFF */
 
775
776 if( find_option("tk",0,0)!=0 ){
777 diff_tk("diff", 2);
778 return;
779 }
@@ -803,13 +802,14 @@
802 }
803 zBinGlob = diff_get_binary_glob();
804 fIncludeBinary = diff_include_binary_files();
805 verify_all_options();
806 if( g.argc>=3 ){
807 int i;
808 for(i=2; i<g.argc; i++){
809 diff_one_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary,
810 diffFlags, g.argv[i]);
811 }
812 }else{
813 diff_all_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary,
814 diffFlags);
815 }
@@ -822,13 +822,14 @@
822 }
823 zBinGlob = diff_get_binary_glob();
824 fIncludeBinary = diff_include_binary_files();
825 verify_all_options();
826 if( g.argc>=3 ){
827 int i;
828 for(i=2; i<g.argc; i++){
829 diff_one_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary,
830 diffFlags, g.argv[i]);
831 }
832 }else{
833 diff_all_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary,
834 diffFlags);
835 }
836

Keyboard Shortcuts

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