Fossil SCM

"char const" -> "const char" and various other coding style improvements. No functional change.

jan.nijtmans 2014-08-07 10:02 trunk
Commit 4e18dba698479a222076a070d6f443ed10051ae9
+17 -17
--- src/add.c
+++ src/add.c
@@ -44,11 +44,11 @@
4444
".fslckout",
4545
".fslckout-journal",
4646
".fslckout-wal",
4747
".fslckout-shm",
4848
49
- /* The use of ".fos" as the name of the checkout database is
49
+ /* The use of ".fos" as the name of the checkout database is
5050
** deprecated. Use ".fslckout" instead. At some point, the following
5151
** entries should be removed. 2012-02-04 */
5252
".fos",
5353
".fos-journal",
5454
".fos-wal",
@@ -123,11 +123,11 @@
123123
*/
124124
void test_reserved_names(void){
125125
int i;
126126
const char *z;
127127
int omitRepo = find_option("omitrepo",0,0)!=0;
128
-
128
+
129129
/* We should be done with options.. */
130130
verify_all_options();
131131
132132
db_must_be_within_tree();
133133
for(i=0; (z = fossil_reserved_name(i, omitRepo))!=0; i++){
@@ -181,11 +181,11 @@
181181
int i; /* Loop counter */
182182
const char *zReserved; /* Name of a reserved file */
183183
Blob repoName; /* Treename of the repository */
184184
Stmt loop; /* SQL to loop over all files to add */
185185
int (*xCmp)(const char*,const char*);
186
-
186
+
187187
if( !file_tree_name(g.zRepositoryName, &repoName, 0) ){
188188
blob_zero(&repoName);
189189
zRepo = "";
190190
}else{
191191
zRepo = blob_str(&repoName);
@@ -237,17 +237,17 @@
237237
** depends on the global setting, or the operating system default, if not set.
238238
**
239239
** Options:
240240
**
241241
** --case-sensitive <BOOL> override case-sensitive setting
242
-** --dotfiles include files beginning with a dot (".")
242
+** --dotfiles include files beginning with a dot (".")
243243
** -f|--force Add files without prompting
244
-** --ignore <CSG> ignore files matching patterns from the
244
+** --ignore <CSG> ignore files matching patterns from the
245245
** comma separated list of glob patterns.
246246
** --clean <CSG> also ignore files matching patterns from
247247
** the comma separated list of glob patterns.
248
-**
248
+**
249249
** See also: addremove, rm
250250
*/
251251
void add_cmd(void){
252252
int i; /* Loop counter */
253253
int vid; /* Currently checked out version */
@@ -279,11 +279,11 @@
279279
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
280280
filename_collation());
281281
pClean = glob_create(zCleanFlag);
282282
pIgnore = glob_create(zIgnoreFlag);
283283
nRoot = strlen(g.zLocalRoot);
284
-
284
+
285285
/* Load the names of all files that are to be added into sfile temp table */
286286
for(i=2; i<g.argc; i++){
287287
char *zName;
288288
int isDir;
289289
Blob fullName;
@@ -354,11 +354,11 @@
354354
void delete_cmd(void){
355355
int i;
356356
Stmt loop;
357357
358358
capture_case_sensitive_option();
359
-
359
+
360360
/* We should be done with options.. */
361361
verify_all_options();
362362
363363
db_must_be_within_tree();
364364
db_begin_transaction();
@@ -379,11 +379,11 @@
379379
zTreeName, filename_collation(), zTreeName,
380380
filename_collation(), zTreeName, filename_collation()
381381
);
382382
blob_reset(&treeName);
383383
}
384
-
384
+
385385
db_prepare(&loop, "SELECT x FROM sfile");
386386
while( db_step(&loop)==SQLITE_ROW ){
387387
fossil_print("DELETED %s\n", db_column_text(&loop, 0));
388388
}
389389
db_finalize(&loop);
@@ -494,12 +494,12 @@
494494
** on the "settings" command for further information.
495495
**
496496
** The -n|--dry-run option shows what would happen without actually doing anything.
497497
**
498498
** This command can be used to track third party software.
499
-**
500
-** Options:
499
+**
500
+** Options:
501501
** --case-sensitive <BOOL> override case-sensitive setting
502502
** --dotfiles include files beginning with a dot (".")
503503
** --ignore <CSG> ignore files matching patterns from the
504504
** comma separated list of glob patterns.
505505
** --clean <CSG> also ignore files matching patterns from
@@ -523,11 +523,11 @@
523523
524524
if( !dryRunFlag ){
525525
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
526526
}
527527
capture_case_sensitive_option();
528
-
528
+
529529
/* We should be done with options.. */
530530
verify_all_options();
531531
532532
db_must_be_within_tree();
533533
if( zCleanFlag==0 ){
@@ -537,11 +537,11 @@
537537
zIgnoreFlag = db_get("ignore-glob", 0);
538538
}
539539
vid = db_lget_int("checkout",0);
540540
db_begin_transaction();
541541
542
- /* step 1:
542
+ /* step 1:
543543
** Populate the temp table "sfile" with the names of all unmanaged
544544
** files currently in the check-out, except for files that match the
545545
** --ignore or ignore-glob patterns and dot-files. Then add all of
546546
** the files in the sfile temp table to the set of managed files.
547547
*/
@@ -563,12 +563,12 @@
563563
" WHERE NOT deleted"
564564
" ORDER BY 1",
565565
g.zLocalRoot
566566
);
567567
while( db_step(&q)==SQLITE_ROW ){
568
- const char * zFile;
569
- const char * zPath;
568
+ const char *zFile;
569
+ const char *zPath;
570570
571571
zFile = db_column_text(&q, 0);
572572
zPath = db_column_text(&q, 1);
573573
if( !file_wd_isfile_or_link(zPath) ){
574574
if( !dryRunFlag ){
@@ -595,11 +595,11 @@
595595
int x = db_int(-1, "SELECT deleted FROM vfile WHERE pathname=%Q %s",
596596
zNew, filename_collation());
597597
if( x>=0 ){
598598
if( x==0 ){
599599
fossil_fatal("cannot rename '%s' to '%s' since another file named '%s'"
600
- " is currently under management", zOrig, zNew, zNew);
600
+ " is currently under management", zOrig, zNew, zNew);
601601
}else{
602602
fossil_fatal("cannot rename '%s' to '%s' since the delete of '%s' has "
603603
"not yet been committed", zOrig, zNew, zNew);
604604
}
605605
}
@@ -636,11 +636,11 @@
636636
Blob dest;
637637
Stmt q;
638638
639639
capture_case_sensitive_option();
640640
db_must_be_within_tree();
641
-
641
+
642642
/* We should be done with options.. */
643643
verify_all_options();
644644
645645
vid = db_lget_int("checkout", 0);
646646
if( vid==0 ){
647647
--- src/add.c
+++ src/add.c
@@ -44,11 +44,11 @@
44 ".fslckout",
45 ".fslckout-journal",
46 ".fslckout-wal",
47 ".fslckout-shm",
48
49 /* The use of ".fos" as the name of the checkout database is
50 ** deprecated. Use ".fslckout" instead. At some point, the following
51 ** entries should be removed. 2012-02-04 */
52 ".fos",
53 ".fos-journal",
54 ".fos-wal",
@@ -123,11 +123,11 @@
123 */
124 void test_reserved_names(void){
125 int i;
126 const char *z;
127 int omitRepo = find_option("omitrepo",0,0)!=0;
128
129 /* We should be done with options.. */
130 verify_all_options();
131
132 db_must_be_within_tree();
133 for(i=0; (z = fossil_reserved_name(i, omitRepo))!=0; i++){
@@ -181,11 +181,11 @@
181 int i; /* Loop counter */
182 const char *zReserved; /* Name of a reserved file */
183 Blob repoName; /* Treename of the repository */
184 Stmt loop; /* SQL to loop over all files to add */
185 int (*xCmp)(const char*,const char*);
186
187 if( !file_tree_name(g.zRepositoryName, &repoName, 0) ){
188 blob_zero(&repoName);
189 zRepo = "";
190 }else{
191 zRepo = blob_str(&repoName);
@@ -237,17 +237,17 @@
237 ** depends on the global setting, or the operating system default, if not set.
238 **
239 ** Options:
240 **
241 ** --case-sensitive <BOOL> override case-sensitive setting
242 ** --dotfiles include files beginning with a dot (".")
243 ** -f|--force Add files without prompting
244 ** --ignore <CSG> ignore files matching patterns from the
245 ** comma separated list of glob patterns.
246 ** --clean <CSG> also ignore files matching patterns from
247 ** the comma separated list of glob patterns.
248 **
249 ** See also: addremove, rm
250 */
251 void add_cmd(void){
252 int i; /* Loop counter */
253 int vid; /* Currently checked out version */
@@ -279,11 +279,11 @@
279 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
280 filename_collation());
281 pClean = glob_create(zCleanFlag);
282 pIgnore = glob_create(zIgnoreFlag);
283 nRoot = strlen(g.zLocalRoot);
284
285 /* Load the names of all files that are to be added into sfile temp table */
286 for(i=2; i<g.argc; i++){
287 char *zName;
288 int isDir;
289 Blob fullName;
@@ -354,11 +354,11 @@
354 void delete_cmd(void){
355 int i;
356 Stmt loop;
357
358 capture_case_sensitive_option();
359
360 /* We should be done with options.. */
361 verify_all_options();
362
363 db_must_be_within_tree();
364 db_begin_transaction();
@@ -379,11 +379,11 @@
379 zTreeName, filename_collation(), zTreeName,
380 filename_collation(), zTreeName, filename_collation()
381 );
382 blob_reset(&treeName);
383 }
384
385 db_prepare(&loop, "SELECT x FROM sfile");
386 while( db_step(&loop)==SQLITE_ROW ){
387 fossil_print("DELETED %s\n", db_column_text(&loop, 0));
388 }
389 db_finalize(&loop);
@@ -494,12 +494,12 @@
494 ** on the "settings" command for further information.
495 **
496 ** The -n|--dry-run option shows what would happen without actually doing anything.
497 **
498 ** This command can be used to track third party software.
499 **
500 ** Options:
501 ** --case-sensitive <BOOL> override case-sensitive setting
502 ** --dotfiles include files beginning with a dot (".")
503 ** --ignore <CSG> ignore files matching patterns from the
504 ** comma separated list of glob patterns.
505 ** --clean <CSG> also ignore files matching patterns from
@@ -523,11 +523,11 @@
523
524 if( !dryRunFlag ){
525 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
526 }
527 capture_case_sensitive_option();
528
529 /* We should be done with options.. */
530 verify_all_options();
531
532 db_must_be_within_tree();
533 if( zCleanFlag==0 ){
@@ -537,11 +537,11 @@
537 zIgnoreFlag = db_get("ignore-glob", 0);
538 }
539 vid = db_lget_int("checkout",0);
540 db_begin_transaction();
541
542 /* step 1:
543 ** Populate the temp table "sfile" with the names of all unmanaged
544 ** files currently in the check-out, except for files that match the
545 ** --ignore or ignore-glob patterns and dot-files. Then add all of
546 ** the files in the sfile temp table to the set of managed files.
547 */
@@ -563,12 +563,12 @@
563 " WHERE NOT deleted"
564 " ORDER BY 1",
565 g.zLocalRoot
566 );
567 while( db_step(&q)==SQLITE_ROW ){
568 const char * zFile;
569 const char * zPath;
570
571 zFile = db_column_text(&q, 0);
572 zPath = db_column_text(&q, 1);
573 if( !file_wd_isfile_or_link(zPath) ){
574 if( !dryRunFlag ){
@@ -595,11 +595,11 @@
595 int x = db_int(-1, "SELECT deleted FROM vfile WHERE pathname=%Q %s",
596 zNew, filename_collation());
597 if( x>=0 ){
598 if( x==0 ){
599 fossil_fatal("cannot rename '%s' to '%s' since another file named '%s'"
600 " is currently under management", zOrig, zNew, zNew);
601 }else{
602 fossil_fatal("cannot rename '%s' to '%s' since the delete of '%s' has "
603 "not yet been committed", zOrig, zNew, zNew);
604 }
605 }
@@ -636,11 +636,11 @@
636 Blob dest;
637 Stmt q;
638
639 capture_case_sensitive_option();
640 db_must_be_within_tree();
641
642 /* We should be done with options.. */
643 verify_all_options();
644
645 vid = db_lget_int("checkout", 0);
646 if( vid==0 ){
647
--- src/add.c
+++ src/add.c
@@ -44,11 +44,11 @@
44 ".fslckout",
45 ".fslckout-journal",
46 ".fslckout-wal",
47 ".fslckout-shm",
48
49 /* The use of ".fos" as the name of the checkout database is
50 ** deprecated. Use ".fslckout" instead. At some point, the following
51 ** entries should be removed. 2012-02-04 */
52 ".fos",
53 ".fos-journal",
54 ".fos-wal",
@@ -123,11 +123,11 @@
123 */
124 void test_reserved_names(void){
125 int i;
126 const char *z;
127 int omitRepo = find_option("omitrepo",0,0)!=0;
128
129 /* We should be done with options.. */
130 verify_all_options();
131
132 db_must_be_within_tree();
133 for(i=0; (z = fossil_reserved_name(i, omitRepo))!=0; i++){
@@ -181,11 +181,11 @@
181 int i; /* Loop counter */
182 const char *zReserved; /* Name of a reserved file */
183 Blob repoName; /* Treename of the repository */
184 Stmt loop; /* SQL to loop over all files to add */
185 int (*xCmp)(const char*,const char*);
186
187 if( !file_tree_name(g.zRepositoryName, &repoName, 0) ){
188 blob_zero(&repoName);
189 zRepo = "";
190 }else{
191 zRepo = blob_str(&repoName);
@@ -237,17 +237,17 @@
237 ** depends on the global setting, or the operating system default, if not set.
238 **
239 ** Options:
240 **
241 ** --case-sensitive <BOOL> override case-sensitive setting
242 ** --dotfiles include files beginning with a dot (".")
243 ** -f|--force Add files without prompting
244 ** --ignore <CSG> ignore files matching patterns from the
245 ** comma separated list of glob patterns.
246 ** --clean <CSG> also ignore files matching patterns from
247 ** the comma separated list of glob patterns.
248 **
249 ** See also: addremove, rm
250 */
251 void add_cmd(void){
252 int i; /* Loop counter */
253 int vid; /* Currently checked out version */
@@ -279,11 +279,11 @@
279 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
280 filename_collation());
281 pClean = glob_create(zCleanFlag);
282 pIgnore = glob_create(zIgnoreFlag);
283 nRoot = strlen(g.zLocalRoot);
284
285 /* Load the names of all files that are to be added into sfile temp table */
286 for(i=2; i<g.argc; i++){
287 char *zName;
288 int isDir;
289 Blob fullName;
@@ -354,11 +354,11 @@
354 void delete_cmd(void){
355 int i;
356 Stmt loop;
357
358 capture_case_sensitive_option();
359
360 /* We should be done with options.. */
361 verify_all_options();
362
363 db_must_be_within_tree();
364 db_begin_transaction();
@@ -379,11 +379,11 @@
379 zTreeName, filename_collation(), zTreeName,
380 filename_collation(), zTreeName, filename_collation()
381 );
382 blob_reset(&treeName);
383 }
384
385 db_prepare(&loop, "SELECT x FROM sfile");
386 while( db_step(&loop)==SQLITE_ROW ){
387 fossil_print("DELETED %s\n", db_column_text(&loop, 0));
388 }
389 db_finalize(&loop);
@@ -494,12 +494,12 @@
494 ** on the "settings" command for further information.
495 **
496 ** The -n|--dry-run option shows what would happen without actually doing anything.
497 **
498 ** This command can be used to track third party software.
499 **
500 ** Options:
501 ** --case-sensitive <BOOL> override case-sensitive setting
502 ** --dotfiles include files beginning with a dot (".")
503 ** --ignore <CSG> ignore files matching patterns from the
504 ** comma separated list of glob patterns.
505 ** --clean <CSG> also ignore files matching patterns from
@@ -523,11 +523,11 @@
523
524 if( !dryRunFlag ){
525 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
526 }
527 capture_case_sensitive_option();
528
529 /* We should be done with options.. */
530 verify_all_options();
531
532 db_must_be_within_tree();
533 if( zCleanFlag==0 ){
@@ -537,11 +537,11 @@
537 zIgnoreFlag = db_get("ignore-glob", 0);
538 }
539 vid = db_lget_int("checkout",0);
540 db_begin_transaction();
541
542 /* step 1:
543 ** Populate the temp table "sfile" with the names of all unmanaged
544 ** files currently in the check-out, except for files that match the
545 ** --ignore or ignore-glob patterns and dot-files. Then add all of
546 ** the files in the sfile temp table to the set of managed files.
547 */
@@ -563,12 +563,12 @@
563 " WHERE NOT deleted"
564 " ORDER BY 1",
565 g.zLocalRoot
566 );
567 while( db_step(&q)==SQLITE_ROW ){
568 const char *zFile;
569 const char *zPath;
570
571 zFile = db_column_text(&q, 0);
572 zPath = db_column_text(&q, 1);
573 if( !file_wd_isfile_or_link(zPath) ){
574 if( !dryRunFlag ){
@@ -595,11 +595,11 @@
595 int x = db_int(-1, "SELECT deleted FROM vfile WHERE pathname=%Q %s",
596 zNew, filename_collation());
597 if( x>=0 ){
598 if( x==0 ){
599 fossil_fatal("cannot rename '%s' to '%s' since another file named '%s'"
600 " is currently under management", zOrig, zNew, zNew);
601 }else{
602 fossil_fatal("cannot rename '%s' to '%s' since the delete of '%s' has "
603 "not yet been committed", zOrig, zNew, zNew);
604 }
605 }
@@ -636,11 +636,11 @@
636 Blob dest;
637 Stmt q;
638
639 capture_case_sensitive_option();
640 db_must_be_within_tree();
641
642 /* We should be done with options.. */
643 verify_all_options();
644
645 vid = db_lget_int("checkout", 0);
646 if( vid==0 ){
647
+2 -2
--- src/checkout.c
+++ src/checkout.c
@@ -296,11 +296,11 @@
296296
** See also: open
297297
*/
298298
void close_cmd(void){
299299
int forceFlag = find_option("force","f",0)!=0;
300300
db_must_be_within_tree();
301
-
301
+
302302
/* We should be done with options.. */
303303
verify_all_options();
304304
305305
if( !forceFlag && unsaved_changes(0) ){
306306
fossil_fatal("there are unsaved changes in the current checkout");
@@ -311,13 +311,13 @@
311311
&& db_exists("SELECT 1 FROM %s.stash", db_name("localdb"))
312312
){
313313
fossil_fatal("closing the checkout will delete your stash");
314314
}
315315
if( db_is_writeable("repository") ){
316
- char * zUnset = mprintf("ckout:%q", g.zLocalRoot);
316
+ char *zUnset = mprintf("ckout:%q", g.zLocalRoot);
317317
db_unset(zUnset, 1);
318318
fossil_free(zUnset);
319319
}
320320
unlink_local_database(1);
321321
db_close(1);
322322
unlink_local_database(0);
323323
}
324324
--- src/checkout.c
+++ src/checkout.c
@@ -296,11 +296,11 @@
296 ** See also: open
297 */
298 void close_cmd(void){
299 int forceFlag = find_option("force","f",0)!=0;
300 db_must_be_within_tree();
301
302 /* We should be done with options.. */
303 verify_all_options();
304
305 if( !forceFlag && unsaved_changes(0) ){
306 fossil_fatal("there are unsaved changes in the current checkout");
@@ -311,13 +311,13 @@
311 && db_exists("SELECT 1 FROM %s.stash", db_name("localdb"))
312 ){
313 fossil_fatal("closing the checkout will delete your stash");
314 }
315 if( db_is_writeable("repository") ){
316 char * zUnset = mprintf("ckout:%q", g.zLocalRoot);
317 db_unset(zUnset, 1);
318 fossil_free(zUnset);
319 }
320 unlink_local_database(1);
321 db_close(1);
322 unlink_local_database(0);
323 }
324
--- src/checkout.c
+++ src/checkout.c
@@ -296,11 +296,11 @@
296 ** See also: open
297 */
298 void close_cmd(void){
299 int forceFlag = find_option("force","f",0)!=0;
300 db_must_be_within_tree();
301
302 /* We should be done with options.. */
303 verify_all_options();
304
305 if( !forceFlag && unsaved_changes(0) ){
306 fossil_fatal("there are unsaved changes in the current checkout");
@@ -311,13 +311,13 @@
311 && db_exists("SELECT 1 FROM %s.stash", db_name("localdb"))
312 ){
313 fossil_fatal("closing the checkout will delete your stash");
314 }
315 if( db_is_writeable("repository") ){
316 char *zUnset = mprintf("ckout:%q", g.zLocalRoot);
317 db_unset(zUnset, 1);
318 fossil_free(zUnset);
319 }
320 unlink_local_database(1);
321 db_close(1);
322 unlink_local_database(0);
323 }
324
+8 -8
--- src/db.c
+++ src/db.c
@@ -628,11 +628,11 @@
628628
** Execute a query. Return the first column of the first row
629629
** of the result set as a string. Space to hold the string is
630630
** obtained from malloc(). If the result set is empty, return
631631
** zDefault instead.
632632
*/
633
-char *db_text(char const *zDefault, const char *zSql, ...){
633
+char *db_text(const char *zDefault, const char *zSql, ...){
634634
va_list ap;
635635
Stmt s;
636636
char *z;
637637
va_start(ap, zSql);
638638
db_vprepare(&s, 0, zSql, ap);
@@ -1482,11 +1482,11 @@
14821482
14831483
zTemplate = find_option("template",0,1);
14841484
zDate = find_option("date-override",0,1);
14851485
zDefaultUser = find_option("admin-user","A",1);
14861486
find_option("empty", 0, 0); /* deprecated */
1487
-
1487
+
14881488
/* We should be done with options.. */
14891489
verify_all_options();
14901490
14911491
if( g.argc!=3 ){
14921492
usage("REPOSITORY-NAME");
@@ -1939,17 +1939,17 @@
19391939
/*
19401940
** Returns non-0 if the database (which must be open) table identified
19411941
** by zTableName has a column named zColName (case-sensitive), else
19421942
** returns 0.
19431943
*/
1944
-int db_table_has_column( char const *zTableName, char const *zColName ){
1944
+int db_table_has_column(const char *zTableName, const char *zColName){
19451945
Stmt q = empty_Stmt;
19461946
int rc = 0;
19471947
db_prepare( &q, "PRAGMA table_info(%Q)", zTableName );
19481948
while(SQLITE_ROW == db_step(&q)){
19491949
/* Columns: (cid, name, type, notnull, dflt_value, pk) */
1950
- char const * zCol = db_column_text(&q, 1);
1950
+ const char *zCol = db_column_text(&q, 1);
19511951
if( 0==fossil_strcmp(zColName, zCol) ){
19521952
rc = 1;
19531953
break;
19541954
}
19551955
}
@@ -2040,11 +2040,11 @@
20402040
url_proxy_options();
20412041
emptyFlag = find_option("empty",0,0)!=0;
20422042
keepFlag = find_option("keep",0,0)!=0;
20432043
forceMissingFlag = find_option("force-missing",0,0)!=0;
20442044
allowNested = find_option("nested",0,0)!=0;
2045
-
2045
+
20462046
/* We should be done with options.. */
20472047
verify_all_options();
20482048
20492049
if( g.argc!=3 && g.argc!=4 ){
20502050
usage("REPOSITORY-FILENAME ?VERSION?");
@@ -2144,16 +2144,16 @@
21442144
** The behaviour page doesn't use a special layout. It lists all
21452145
** set-commands and displays the 'set'-help as info.
21462146
*/
21472147
#if INTERFACE
21482148
struct stControlSettings {
2149
- char const *name; /* Name of the setting */
2150
- char const *var; /* Internal variable name used by db_set() */
2149
+ const char *name; /* Name of the setting */
2150
+ const char *var; /* Internal variable name used by db_set() */
21512151
int width; /* Width of display. 0 for boolean values. */
21522152
int versionable; /* Is this setting versionable? */
21532153
int forceTextArea; /* Force using a text area for display? */
2154
- char const *def; /* Default value */
2154
+ const char *def; /* Default value */
21552155
};
21562156
#endif /* INTERFACE */
21572157
struct stControlSettings const ctrlSettings[] = {
21582158
{ "access-log", 0, 0, 0, 0, "off" },
21592159
{ "allow-symlinks", 0, 0, 1, 0, "off" },
21602160
--- src/db.c
+++ src/db.c
@@ -628,11 +628,11 @@
628 ** Execute a query. Return the first column of the first row
629 ** of the result set as a string. Space to hold the string is
630 ** obtained from malloc(). If the result set is empty, return
631 ** zDefault instead.
632 */
633 char *db_text(char const *zDefault, const char *zSql, ...){
634 va_list ap;
635 Stmt s;
636 char *z;
637 va_start(ap, zSql);
638 db_vprepare(&s, 0, zSql, ap);
@@ -1482,11 +1482,11 @@
1482
1483 zTemplate = find_option("template",0,1);
1484 zDate = find_option("date-override",0,1);
1485 zDefaultUser = find_option("admin-user","A",1);
1486 find_option("empty", 0, 0); /* deprecated */
1487
1488 /* We should be done with options.. */
1489 verify_all_options();
1490
1491 if( g.argc!=3 ){
1492 usage("REPOSITORY-NAME");
@@ -1939,17 +1939,17 @@
1939 /*
1940 ** Returns non-0 if the database (which must be open) table identified
1941 ** by zTableName has a column named zColName (case-sensitive), else
1942 ** returns 0.
1943 */
1944 int db_table_has_column( char const *zTableName, char const *zColName ){
1945 Stmt q = empty_Stmt;
1946 int rc = 0;
1947 db_prepare( &q, "PRAGMA table_info(%Q)", zTableName );
1948 while(SQLITE_ROW == db_step(&q)){
1949 /* Columns: (cid, name, type, notnull, dflt_value, pk) */
1950 char const * zCol = db_column_text(&q, 1);
1951 if( 0==fossil_strcmp(zColName, zCol) ){
1952 rc = 1;
1953 break;
1954 }
1955 }
@@ -2040,11 +2040,11 @@
2040 url_proxy_options();
2041 emptyFlag = find_option("empty",0,0)!=0;
2042 keepFlag = find_option("keep",0,0)!=0;
2043 forceMissingFlag = find_option("force-missing",0,0)!=0;
2044 allowNested = find_option("nested",0,0)!=0;
2045
2046 /* We should be done with options.. */
2047 verify_all_options();
2048
2049 if( g.argc!=3 && g.argc!=4 ){
2050 usage("REPOSITORY-FILENAME ?VERSION?");
@@ -2144,16 +2144,16 @@
2144 ** The behaviour page doesn't use a special layout. It lists all
2145 ** set-commands and displays the 'set'-help as info.
2146 */
2147 #if INTERFACE
2148 struct stControlSettings {
2149 char const *name; /* Name of the setting */
2150 char const *var; /* Internal variable name used by db_set() */
2151 int width; /* Width of display. 0 for boolean values. */
2152 int versionable; /* Is this setting versionable? */
2153 int forceTextArea; /* Force using a text area for display? */
2154 char const *def; /* Default value */
2155 };
2156 #endif /* INTERFACE */
2157 struct stControlSettings const ctrlSettings[] = {
2158 { "access-log", 0, 0, 0, 0, "off" },
2159 { "allow-symlinks", 0, 0, 1, 0, "off" },
2160
--- src/db.c
+++ src/db.c
@@ -628,11 +628,11 @@
628 ** Execute a query. Return the first column of the first row
629 ** of the result set as a string. Space to hold the string is
630 ** obtained from malloc(). If the result set is empty, return
631 ** zDefault instead.
632 */
633 char *db_text(const char *zDefault, const char *zSql, ...){
634 va_list ap;
635 Stmt s;
636 char *z;
637 va_start(ap, zSql);
638 db_vprepare(&s, 0, zSql, ap);
@@ -1482,11 +1482,11 @@
1482
1483 zTemplate = find_option("template",0,1);
1484 zDate = find_option("date-override",0,1);
1485 zDefaultUser = find_option("admin-user","A",1);
1486 find_option("empty", 0, 0); /* deprecated */
1487
1488 /* We should be done with options.. */
1489 verify_all_options();
1490
1491 if( g.argc!=3 ){
1492 usage("REPOSITORY-NAME");
@@ -1939,17 +1939,17 @@
1939 /*
1940 ** Returns non-0 if the database (which must be open) table identified
1941 ** by zTableName has a column named zColName (case-sensitive), else
1942 ** returns 0.
1943 */
1944 int db_table_has_column(const char *zTableName, const char *zColName){
1945 Stmt q = empty_Stmt;
1946 int rc = 0;
1947 db_prepare( &q, "PRAGMA table_info(%Q)", zTableName );
1948 while(SQLITE_ROW == db_step(&q)){
1949 /* Columns: (cid, name, type, notnull, dflt_value, pk) */
1950 const char *zCol = db_column_text(&q, 1);
1951 if( 0==fossil_strcmp(zColName, zCol) ){
1952 rc = 1;
1953 break;
1954 }
1955 }
@@ -2040,11 +2040,11 @@
2040 url_proxy_options();
2041 emptyFlag = find_option("empty",0,0)!=0;
2042 keepFlag = find_option("keep",0,0)!=0;
2043 forceMissingFlag = find_option("force-missing",0,0)!=0;
2044 allowNested = find_option("nested",0,0)!=0;
2045
2046 /* We should be done with options.. */
2047 verify_all_options();
2048
2049 if( g.argc!=3 && g.argc!=4 ){
2050 usage("REPOSITORY-FILENAME ?VERSION?");
@@ -2144,16 +2144,16 @@
2144 ** The behaviour page doesn't use a special layout. It lists all
2145 ** set-commands and displays the 'set'-help as info.
2146 */
2147 #if INTERFACE
2148 struct stControlSettings {
2149 const char *name; /* Name of the setting */
2150 const char *var; /* Internal variable name used by db_set() */
2151 int width; /* Width of display. 0 for boolean values. */
2152 int versionable; /* Is this setting versionable? */
2153 int forceTextArea; /* Force using a text area for display? */
2154 const char *def; /* Default value */
2155 };
2156 #endif /* INTERFACE */
2157 struct stControlSettings const ctrlSettings[] = {
2158 { "access-log", 0, 0, 0, 0, "off" },
2159 { "allow-symlinks", 0, 0, 1, 0, "off" },
2160
+14 -14
--- src/login.c
+++ src/login.c
@@ -208,12 +208,12 @@
208208
** On serious (DB-level) error it will probably exit.
209209
**
210210
** zPassword may be either the plain-text form or the encrypted
211211
** form of the user's password.
212212
*/
213
-int login_search_uid(char const *zUsername, char const *zPasswd){
214
- char * zSha1Pw = sha1_shared_secret(zPasswd, zUsername, 0);
213
+int login_search_uid(const char *zUsername, const char *zPasswd){
214
+ char *zSha1Pw = sha1_shared_secret(zPasswd, zUsername, 0);
215215
int const uid =
216216
db_int(0,
217217
"SELECT uid FROM user"
218218
" WHERE login=%Q"
219219
" AND length(cap)>0 AND length(pw)>0"
@@ -231,12 +231,12 @@
231231
** The zHash parameter must be a random value which must be
232232
** subsequently stored in user.cookie for later validation.
233233
**
234234
** The returned memory should be free()d after use.
235235
*/
236
-char * login_gen_user_cookie_value(char const *zUsername, char const * zHash){
237
- char * zProjCode = db_get("project-code",NULL);
236
+char *login_gen_user_cookie_value(const char *zUsername, const char *zHash){
237
+ char *zProjCode = db_get("project-code",NULL);
238238
char *zCode = abbreviated_project_code(zProjCode);
239239
free(zProjCode);
240240
assert((zUsername && *zUsername) && "Invalid user data.");
241241
return mprintf("%s/%z/%s", zHash, zCode, zUsername);
242242
}
@@ -252,20 +252,20 @@
252252
** If zDest is not NULL then the generated cookie is copied to
253253
** *zDdest and ownership is transfered to the caller (who should
254254
** eventually pass it to free()).
255255
*/
256256
void login_set_user_cookie(
257
- char const * zUsername, /* User's name */
257
+ const char *zUsername, /* User's name */
258258
int uid, /* User's ID */
259
- char ** zDest /* Optional: store generated cookie value. */
259
+ char **zDest /* Optional: store generated cookie value. */
260260
){
261261
const char *zCookieName = login_cookie_name();
262262
const char *zExpire = db_get("cookie-expire","8766");
263263
int expires = atoi(zExpire)*3600;
264264
char *zHash;
265265
char *zCookie;
266
- char const *zIpAddr = PD("REMOTE_ADDR","nil"); /* IP address of user */
266
+ const char *zIpAddr = PD("REMOTE_ADDR","nil"); /* IP address of user */
267267
char *zRemoteAddr = ipPrefix(zIpAddr); /* Abbreviated IP address */
268268
269269
assert((zUsername && *zUsername) && (uid > 0) && "Invalid user data.");
270270
zHash = db_text(0,
271271
"SELECT cookie FROM user"
@@ -303,16 +303,16 @@
303303
** is used.
304304
**
305305
** If zCookieDest is not NULL then the generated cookie is assigned to
306306
** *zCookieDest and the caller must eventually free() it.
307307
*/
308
-void login_set_anon_cookie(char const * zIpAddr, char ** zCookieDest ){
309
- char const *zNow; /* Current time (julian day number) */
308
+void login_set_anon_cookie(const char *zIpAddr, char **zCookieDest ){
309
+ const char *zNow; /* Current time (julian day number) */
310310
char *zCookie; /* The login cookie */
311
- char const *zCookieName; /* Name of the login cookie */
311
+ const char *zCookieName; /* Name of the login cookie */
312312
Blob b; /* Blob used during cookie construction */
313
- char * zRemoteAddr; /* Abbreviated IP address */
313
+ char *zRemoteAddr; /* Abbreviated IP address */
314314
if(!zIpAddr){
315315
zIpAddr = PD("REMOTE_ADDR","nil");
316316
}
317317
zRemoteAddr = ipPrefix(zIpAddr);
318318
zCookieName = login_cookie_name();
@@ -344,11 +344,11 @@
344344
*/
345345
void login_clear_login_data(){
346346
if(!g.userUid){
347347
return;
348348
}else{
349
- char const * cookie = login_cookie_name();
349
+ const char *cookie = login_cookie_name();
350350
/* To logout, change the cookie value to an empty string */
351351
cgi_set_cookie(cookie, "",
352352
login_cookie_path(), -86400);
353353
db_multi_exec("UPDATE user SET cookie=NULL, ipaddr=NULL, "
354354
" cexpire=0 WHERE uid=%d"
@@ -629,11 +629,11 @@
629629
@ <p>If you do not have an account, you can
630630
@ <a href="%s(g.zTop)/register?g=%T(P("G"))">create one</a>.
631631
}
632632
if( zAnonPw ){
633633
unsigned int uSeed = captcha_seed();
634
- char const *zDecoded = captcha_decode(uSeed);
634
+ const char *zDecoded = captcha_decode(uSeed);
635635
int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
636636
char *zCaptcha = captcha_render(zDecoded);
637637
638638
@ <p><input type="hidden" name="cs" value="%u(uSeed)" />
639639
@ Visitors may enter <b>anonymous</b> as the user-ID with
@@ -1236,11 +1236,11 @@
12361236
**
12371237
*/
12381238
void register_page(void){
12391239
const char *zUsername, *zPasswd, *zConfirm, *zContact, *zCS, *zPw, *zCap;
12401240
unsigned int uSeed;
1241
- char const *zDecoded;
1241
+ const char *zDecoded;
12421242
char *zCaptcha;
12431243
if( !db_get_boolean("self-register", 0) ){
12441244
style_header("Registration not possible");
12451245
@ <p>This project does not allow user self-registration. Please contact the
12461246
@ project administrator to obtain an account.</p>
12471247
--- src/login.c
+++ src/login.c
@@ -208,12 +208,12 @@
208 ** On serious (DB-level) error it will probably exit.
209 **
210 ** zPassword may be either the plain-text form or the encrypted
211 ** form of the user's password.
212 */
213 int login_search_uid(char const *zUsername, char const *zPasswd){
214 char * zSha1Pw = sha1_shared_secret(zPasswd, zUsername, 0);
215 int const uid =
216 db_int(0,
217 "SELECT uid FROM user"
218 " WHERE login=%Q"
219 " AND length(cap)>0 AND length(pw)>0"
@@ -231,12 +231,12 @@
231 ** The zHash parameter must be a random value which must be
232 ** subsequently stored in user.cookie for later validation.
233 **
234 ** The returned memory should be free()d after use.
235 */
236 char * login_gen_user_cookie_value(char const *zUsername, char const * zHash){
237 char * zProjCode = db_get("project-code",NULL);
238 char *zCode = abbreviated_project_code(zProjCode);
239 free(zProjCode);
240 assert((zUsername && *zUsername) && "Invalid user data.");
241 return mprintf("%s/%z/%s", zHash, zCode, zUsername);
242 }
@@ -252,20 +252,20 @@
252 ** If zDest is not NULL then the generated cookie is copied to
253 ** *zDdest and ownership is transfered to the caller (who should
254 ** eventually pass it to free()).
255 */
256 void login_set_user_cookie(
257 char const * zUsername, /* User's name */
258 int uid, /* User's ID */
259 char ** zDest /* Optional: store generated cookie value. */
260 ){
261 const char *zCookieName = login_cookie_name();
262 const char *zExpire = db_get("cookie-expire","8766");
263 int expires = atoi(zExpire)*3600;
264 char *zHash;
265 char *zCookie;
266 char const *zIpAddr = PD("REMOTE_ADDR","nil"); /* IP address of user */
267 char *zRemoteAddr = ipPrefix(zIpAddr); /* Abbreviated IP address */
268
269 assert((zUsername && *zUsername) && (uid > 0) && "Invalid user data.");
270 zHash = db_text(0,
271 "SELECT cookie FROM user"
@@ -303,16 +303,16 @@
303 ** is used.
304 **
305 ** If zCookieDest is not NULL then the generated cookie is assigned to
306 ** *zCookieDest and the caller must eventually free() it.
307 */
308 void login_set_anon_cookie(char const * zIpAddr, char ** zCookieDest ){
309 char const *zNow; /* Current time (julian day number) */
310 char *zCookie; /* The login cookie */
311 char const *zCookieName; /* Name of the login cookie */
312 Blob b; /* Blob used during cookie construction */
313 char * zRemoteAddr; /* Abbreviated IP address */
314 if(!zIpAddr){
315 zIpAddr = PD("REMOTE_ADDR","nil");
316 }
317 zRemoteAddr = ipPrefix(zIpAddr);
318 zCookieName = login_cookie_name();
@@ -344,11 +344,11 @@
344 */
345 void login_clear_login_data(){
346 if(!g.userUid){
347 return;
348 }else{
349 char const * cookie = login_cookie_name();
350 /* To logout, change the cookie value to an empty string */
351 cgi_set_cookie(cookie, "",
352 login_cookie_path(), -86400);
353 db_multi_exec("UPDATE user SET cookie=NULL, ipaddr=NULL, "
354 " cexpire=0 WHERE uid=%d"
@@ -629,11 +629,11 @@
629 @ <p>If you do not have an account, you can
630 @ <a href="%s(g.zTop)/register?g=%T(P("G"))">create one</a>.
631 }
632 if( zAnonPw ){
633 unsigned int uSeed = captcha_seed();
634 char const *zDecoded = captcha_decode(uSeed);
635 int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
636 char *zCaptcha = captcha_render(zDecoded);
637
638 @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
639 @ Visitors may enter <b>anonymous</b> as the user-ID with
@@ -1236,11 +1236,11 @@
1236 **
1237 */
1238 void register_page(void){
1239 const char *zUsername, *zPasswd, *zConfirm, *zContact, *zCS, *zPw, *zCap;
1240 unsigned int uSeed;
1241 char const *zDecoded;
1242 char *zCaptcha;
1243 if( !db_get_boolean("self-register", 0) ){
1244 style_header("Registration not possible");
1245 @ <p>This project does not allow user self-registration. Please contact the
1246 @ project administrator to obtain an account.</p>
1247
--- src/login.c
+++ src/login.c
@@ -208,12 +208,12 @@
208 ** On serious (DB-level) error it will probably exit.
209 **
210 ** zPassword may be either the plain-text form or the encrypted
211 ** form of the user's password.
212 */
213 int login_search_uid(const char *zUsername, const char *zPasswd){
214 char *zSha1Pw = sha1_shared_secret(zPasswd, zUsername, 0);
215 int const uid =
216 db_int(0,
217 "SELECT uid FROM user"
218 " WHERE login=%Q"
219 " AND length(cap)>0 AND length(pw)>0"
@@ -231,12 +231,12 @@
231 ** The zHash parameter must be a random value which must be
232 ** subsequently stored in user.cookie for later validation.
233 **
234 ** The returned memory should be free()d after use.
235 */
236 char *login_gen_user_cookie_value(const char *zUsername, const char *zHash){
237 char *zProjCode = db_get("project-code",NULL);
238 char *zCode = abbreviated_project_code(zProjCode);
239 free(zProjCode);
240 assert((zUsername && *zUsername) && "Invalid user data.");
241 return mprintf("%s/%z/%s", zHash, zCode, zUsername);
242 }
@@ -252,20 +252,20 @@
252 ** If zDest is not NULL then the generated cookie is copied to
253 ** *zDdest and ownership is transfered to the caller (who should
254 ** eventually pass it to free()).
255 */
256 void login_set_user_cookie(
257 const char *zUsername, /* User's name */
258 int uid, /* User's ID */
259 char **zDest /* Optional: store generated cookie value. */
260 ){
261 const char *zCookieName = login_cookie_name();
262 const char *zExpire = db_get("cookie-expire","8766");
263 int expires = atoi(zExpire)*3600;
264 char *zHash;
265 char *zCookie;
266 const char *zIpAddr = PD("REMOTE_ADDR","nil"); /* IP address of user */
267 char *zRemoteAddr = ipPrefix(zIpAddr); /* Abbreviated IP address */
268
269 assert((zUsername && *zUsername) && (uid > 0) && "Invalid user data.");
270 zHash = db_text(0,
271 "SELECT cookie FROM user"
@@ -303,16 +303,16 @@
303 ** is used.
304 **
305 ** If zCookieDest is not NULL then the generated cookie is assigned to
306 ** *zCookieDest and the caller must eventually free() it.
307 */
308 void login_set_anon_cookie(const char *zIpAddr, char **zCookieDest ){
309 const char *zNow; /* Current time (julian day number) */
310 char *zCookie; /* The login cookie */
311 const char *zCookieName; /* Name of the login cookie */
312 Blob b; /* Blob used during cookie construction */
313 char *zRemoteAddr; /* Abbreviated IP address */
314 if(!zIpAddr){
315 zIpAddr = PD("REMOTE_ADDR","nil");
316 }
317 zRemoteAddr = ipPrefix(zIpAddr);
318 zCookieName = login_cookie_name();
@@ -344,11 +344,11 @@
344 */
345 void login_clear_login_data(){
346 if(!g.userUid){
347 return;
348 }else{
349 const char *cookie = login_cookie_name();
350 /* To logout, change the cookie value to an empty string */
351 cgi_set_cookie(cookie, "",
352 login_cookie_path(), -86400);
353 db_multi_exec("UPDATE user SET cookie=NULL, ipaddr=NULL, "
354 " cexpire=0 WHERE uid=%d"
@@ -629,11 +629,11 @@
629 @ <p>If you do not have an account, you can
630 @ <a href="%s(g.zTop)/register?g=%T(P("G"))">create one</a>.
631 }
632 if( zAnonPw ){
633 unsigned int uSeed = captcha_seed();
634 const char *zDecoded = captcha_decode(uSeed);
635 int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
636 char *zCaptcha = captcha_render(zDecoded);
637
638 @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
639 @ Visitors may enter <b>anonymous</b> as the user-ID with
@@ -1236,11 +1236,11 @@
1236 **
1237 */
1238 void register_page(void){
1239 const char *zUsername, *zPasswd, *zConfirm, *zContact, *zCS, *zPw, *zCap;
1240 unsigned int uSeed;
1241 const char *zDecoded;
1242 char *zCaptcha;
1243 if( !db_get_boolean("self-register", 0) ){
1244 style_header("Registration not possible");
1245 @ <p>This project does not allow user self-registration. Please contact the
1246 @ project administrator to obtain an account.</p>
1247
+20 -20
--- src/main.c
+++ src/main.c
@@ -229,45 +229,45 @@
229229
*/
230230
int resultCode; /* used for passing back specific codes
231231
** from /json callbacks. */
232232
int errorDetailParanoia; /* 0=full error codes, 1=%10, 2=%100, 3=%1000 */
233233
cson_output_opt outOpt; /* formatting options for JSON mode. */
234
- cson_value * authToken; /* authentication token */
235
- char const * jsonp; /* Name of JSONP function wrapper. */
234
+ cson_value *authToken; /* authentication token */
235
+ const char *jsonp; /* Name of JSONP function wrapper. */
236236
unsigned char dispatchDepth /* Tells JSON command dispatching
237237
which argument we are currently
238238
working on. For this purpose, arg#0
239239
is the "json" path/CLI arg.
240240
*/;
241241
struct { /* "garbage collector" */
242
- cson_value * v;
243
- cson_array * a;
242
+ cson_value *v;
243
+ cson_array *a;
244244
} gc;
245245
struct { /* JSON POST data. */
246
- cson_value * v;
247
- cson_array * a;
246
+ cson_value *v;
247
+ cson_array *a;
248248
int offset; /* Tells us which PATH_INFO/CLI args
249249
part holds the "json" command, so
250250
that we can account for sub-repos
251251
and path prefixes. This is handled
252252
differently for CLI and CGI modes.
253253
*/
254
- char const * commandStr /*"command" request param.*/;
254
+ const char *commandStr /*"command" request param.*/;
255255
} cmd;
256256
struct { /* JSON POST data. */
257
- cson_value * v;
258
- cson_object * o;
257
+ cson_value *v;
258
+ cson_object *o;
259259
} post;
260260
struct { /* GET/COOKIE params in JSON mode. */
261
- cson_value * v;
262
- cson_object * o;
261
+ cson_value *v;
262
+ cson_object *o;
263263
} param;
264264
struct {
265
- cson_value * v;
266
- cson_object * o;
265
+ cson_value *v;
266
+ cson_object *o;
267267
} reqPayload; /* request payload object (if any) */
268
- cson_array * warnings; /* response warnings */
268
+ cson_array *warnings; /* response warnings */
269269
int timerId; /* fetched from fossil_timer_start() */
270270
} json;
271271
#endif /* FOSSIL_ENABLE_JSON */
272272
};
273273
@@ -391,11 +391,11 @@
391391
unsigned int nLine; /* Number of lines in the file*/
392392
unsigned int i, j, k; /* Loop counters */
393393
int n; /* Number of bytes in one line */
394394
char *z; /* General use string pointer */
395395
char **newArgv; /* New expanded g.argv under construction */
396
- char const * zFileName; /* input file name */
396
+ const char *zFileName; /* input file name */
397397
FILE *inFile; /* input FILE */
398398
#if defined(_WIN32)
399399
wchar_t buf[MAX_PATH];
400400
#endif
401401
@@ -1004,12 +1004,12 @@
10041004
** %fossil help --w|-www Show list of WWW pages
10051005
*/
10061006
void help_cmd(void){
10071007
int rc, idx, isPage = 0;
10081008
const char *z;
1009
- char const * zCmdOrPage;
1010
- char const * zCmdOrPagePlural;
1009
+ const char *zCmdOrPage;
1010
+ const char *zCmdOrPagePlural;
10111011
if( g.argc<3 ){
10121012
z = g.argv[0];
10131013
fossil_print(
10141014
"Usage: %s help COMMAND\n"
10151015
"Common COMMANDs: (use \"%s help -a|--all\" for a complete list)\n",
@@ -1074,18 +1074,18 @@
10741074
/*
10751075
** WEBPAGE: help
10761076
** URL: /help/CMD
10771077
*/
10781078
void help_page(void){
1079
- const char * zCmd = P("cmd");
1079
+ const char *zCmd = P("cmd");
10801080
10811081
if( zCmd==0 ) zCmd = P("name");
10821082
style_header("Command-line Help");
10831083
if( zCmd ){
10841084
int rc, idx;
10851085
char *z, *s, *d;
1086
- char const * zCmdOrPage = ('/'==*zCmd) ? "page" : "command";
1086
+ const char *zCmdOrPage = ('/'==*zCmd) ? "page" : "command";
10871087
style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop);
10881088
@ <h1>The "%s(zCmd)" %s(zCmdOrPage):</h1>
10891089
rc = name_search(zCmd, aCommand, count(aCommand), 0, &idx);
10901090
if( rc==1 ){
10911091
@ unknown command: %s(zCmd)
@@ -2122,11 +2122,11 @@
21222122
zAltBase = find_option("baseurl", 0, 1);
21232123
if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
21242124
if( zAltBase ){
21252125
set_base_url(zAltBase);
21262126
}
2127
- if ( find_option("localhost", 0, 0)!=0 ){
2127
+ if( find_option("localhost", 0, 0)!=0 ){
21282128
flags |= HTTP_SERVER_LOCALHOST;
21292129
}
21302130
21312131
/* We should be done with options.. */
21322132
verify_all_options();
21332133
--- src/main.c
+++ src/main.c
@@ -229,45 +229,45 @@
229 */
230 int resultCode; /* used for passing back specific codes
231 ** from /json callbacks. */
232 int errorDetailParanoia; /* 0=full error codes, 1=%10, 2=%100, 3=%1000 */
233 cson_output_opt outOpt; /* formatting options for JSON mode. */
234 cson_value * authToken; /* authentication token */
235 char const * jsonp; /* Name of JSONP function wrapper. */
236 unsigned char dispatchDepth /* Tells JSON command dispatching
237 which argument we are currently
238 working on. For this purpose, arg#0
239 is the "json" path/CLI arg.
240 */;
241 struct { /* "garbage collector" */
242 cson_value * v;
243 cson_array * a;
244 } gc;
245 struct { /* JSON POST data. */
246 cson_value * v;
247 cson_array * a;
248 int offset; /* Tells us which PATH_INFO/CLI args
249 part holds the "json" command, so
250 that we can account for sub-repos
251 and path prefixes. This is handled
252 differently for CLI and CGI modes.
253 */
254 char const * commandStr /*"command" request param.*/;
255 } cmd;
256 struct { /* JSON POST data. */
257 cson_value * v;
258 cson_object * o;
259 } post;
260 struct { /* GET/COOKIE params in JSON mode. */
261 cson_value * v;
262 cson_object * o;
263 } param;
264 struct {
265 cson_value * v;
266 cson_object * o;
267 } reqPayload; /* request payload object (if any) */
268 cson_array * warnings; /* response warnings */
269 int timerId; /* fetched from fossil_timer_start() */
270 } json;
271 #endif /* FOSSIL_ENABLE_JSON */
272 };
273
@@ -391,11 +391,11 @@
391 unsigned int nLine; /* Number of lines in the file*/
392 unsigned int i, j, k; /* Loop counters */
393 int n; /* Number of bytes in one line */
394 char *z; /* General use string pointer */
395 char **newArgv; /* New expanded g.argv under construction */
396 char const * zFileName; /* input file name */
397 FILE *inFile; /* input FILE */
398 #if defined(_WIN32)
399 wchar_t buf[MAX_PATH];
400 #endif
401
@@ -1004,12 +1004,12 @@
1004 ** %fossil help --w|-www Show list of WWW pages
1005 */
1006 void help_cmd(void){
1007 int rc, idx, isPage = 0;
1008 const char *z;
1009 char const * zCmdOrPage;
1010 char const * zCmdOrPagePlural;
1011 if( g.argc<3 ){
1012 z = g.argv[0];
1013 fossil_print(
1014 "Usage: %s help COMMAND\n"
1015 "Common COMMANDs: (use \"%s help -a|--all\" for a complete list)\n",
@@ -1074,18 +1074,18 @@
1074 /*
1075 ** WEBPAGE: help
1076 ** URL: /help/CMD
1077 */
1078 void help_page(void){
1079 const char * zCmd = P("cmd");
1080
1081 if( zCmd==0 ) zCmd = P("name");
1082 style_header("Command-line Help");
1083 if( zCmd ){
1084 int rc, idx;
1085 char *z, *s, *d;
1086 char const * zCmdOrPage = ('/'==*zCmd) ? "page" : "command";
1087 style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop);
1088 @ <h1>The "%s(zCmd)" %s(zCmdOrPage):</h1>
1089 rc = name_search(zCmd, aCommand, count(aCommand), 0, &idx);
1090 if( rc==1 ){
1091 @ unknown command: %s(zCmd)
@@ -2122,11 +2122,11 @@
2122 zAltBase = find_option("baseurl", 0, 1);
2123 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
2124 if( zAltBase ){
2125 set_base_url(zAltBase);
2126 }
2127 if ( find_option("localhost", 0, 0)!=0 ){
2128 flags |= HTTP_SERVER_LOCALHOST;
2129 }
2130
2131 /* We should be done with options.. */
2132 verify_all_options();
2133
--- src/main.c
+++ src/main.c
@@ -229,45 +229,45 @@
229 */
230 int resultCode; /* used for passing back specific codes
231 ** from /json callbacks. */
232 int errorDetailParanoia; /* 0=full error codes, 1=%10, 2=%100, 3=%1000 */
233 cson_output_opt outOpt; /* formatting options for JSON mode. */
234 cson_value *authToken; /* authentication token */
235 const char *jsonp; /* Name of JSONP function wrapper. */
236 unsigned char dispatchDepth /* Tells JSON command dispatching
237 which argument we are currently
238 working on. For this purpose, arg#0
239 is the "json" path/CLI arg.
240 */;
241 struct { /* "garbage collector" */
242 cson_value *v;
243 cson_array *a;
244 } gc;
245 struct { /* JSON POST data. */
246 cson_value *v;
247 cson_array *a;
248 int offset; /* Tells us which PATH_INFO/CLI args
249 part holds the "json" command, so
250 that we can account for sub-repos
251 and path prefixes. This is handled
252 differently for CLI and CGI modes.
253 */
254 const char *commandStr /*"command" request param.*/;
255 } cmd;
256 struct { /* JSON POST data. */
257 cson_value *v;
258 cson_object *o;
259 } post;
260 struct { /* GET/COOKIE params in JSON mode. */
261 cson_value *v;
262 cson_object *o;
263 } param;
264 struct {
265 cson_value *v;
266 cson_object *o;
267 } reqPayload; /* request payload object (if any) */
268 cson_array *warnings; /* response warnings */
269 int timerId; /* fetched from fossil_timer_start() */
270 } json;
271 #endif /* FOSSIL_ENABLE_JSON */
272 };
273
@@ -391,11 +391,11 @@
391 unsigned int nLine; /* Number of lines in the file*/
392 unsigned int i, j, k; /* Loop counters */
393 int n; /* Number of bytes in one line */
394 char *z; /* General use string pointer */
395 char **newArgv; /* New expanded g.argv under construction */
396 const char *zFileName; /* input file name */
397 FILE *inFile; /* input FILE */
398 #if defined(_WIN32)
399 wchar_t buf[MAX_PATH];
400 #endif
401
@@ -1004,12 +1004,12 @@
1004 ** %fossil help --w|-www Show list of WWW pages
1005 */
1006 void help_cmd(void){
1007 int rc, idx, isPage = 0;
1008 const char *z;
1009 const char *zCmdOrPage;
1010 const char *zCmdOrPagePlural;
1011 if( g.argc<3 ){
1012 z = g.argv[0];
1013 fossil_print(
1014 "Usage: %s help COMMAND\n"
1015 "Common COMMANDs: (use \"%s help -a|--all\" for a complete list)\n",
@@ -1074,18 +1074,18 @@
1074 /*
1075 ** WEBPAGE: help
1076 ** URL: /help/CMD
1077 */
1078 void help_page(void){
1079 const char *zCmd = P("cmd");
1080
1081 if( zCmd==0 ) zCmd = P("name");
1082 style_header("Command-line Help");
1083 if( zCmd ){
1084 int rc, idx;
1085 char *z, *s, *d;
1086 const char *zCmdOrPage = ('/'==*zCmd) ? "page" : "command";
1087 style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop);
1088 @ <h1>The "%s(zCmd)" %s(zCmdOrPage):</h1>
1089 rc = name_search(zCmd, aCommand, count(aCommand), 0, &idx);
1090 if( rc==1 ){
1091 @ unknown command: %s(zCmd)
@@ -2122,11 +2122,11 @@
2122 zAltBase = find_option("baseurl", 0, 1);
2123 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
2124 if( zAltBase ){
2125 set_base_url(zAltBase);
2126 }
2127 if( find_option("localhost", 0, 0)!=0 ){
2128 flags |= HTTP_SERVER_LOCALHOST;
2129 }
2130
2131 /* We should be done with options.. */
2132 verify_all_options();
2133
+2 -2
--- src/merge3.c
+++ src/merge3.c
@@ -136,11 +136,11 @@
136136
}
137137
138138
/*
139139
** Text of boundary markers for merge conflicts.
140140
*/
141
-static char const * const mergeMarker[] = {
141
+static const char *const mergeMarker[] = {
142142
/*123456789 123456789 123456789 123456789 123456789 123456789 123456789*/
143143
"<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<<<<<\n",
144144
"======= COMMON ANCESTOR content follows ============================\n",
145145
"======= MERGED IN content follows ==================================\n",
146146
">>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
@@ -368,11 +368,11 @@
368368
** fossil commit
369369
**
370370
*/
371371
void delta_3waymerge_cmd(void){
372372
Blob pivot, v1, v2, merged;
373
-
373
+
374374
/* We should be done with options.. */
375375
verify_all_options();
376376
377377
if( g.argc!=6 ){
378378
usage("PIVOT V1 V2 MERGED");
379379
--- src/merge3.c
+++ src/merge3.c
@@ -136,11 +136,11 @@
136 }
137
138 /*
139 ** Text of boundary markers for merge conflicts.
140 */
141 static char const * const mergeMarker[] = {
142 /*123456789 123456789 123456789 123456789 123456789 123456789 123456789*/
143 "<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<<<<<\n",
144 "======= COMMON ANCESTOR content follows ============================\n",
145 "======= MERGED IN content follows ==================================\n",
146 ">>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
@@ -368,11 +368,11 @@
368 ** fossil commit
369 **
370 */
371 void delta_3waymerge_cmd(void){
372 Blob pivot, v1, v2, merged;
373
374 /* We should be done with options.. */
375 verify_all_options();
376
377 if( g.argc!=6 ){
378 usage("PIVOT V1 V2 MERGED");
379
--- src/merge3.c
+++ src/merge3.c
@@ -136,11 +136,11 @@
136 }
137
138 /*
139 ** Text of boundary markers for merge conflicts.
140 */
141 static const char *const mergeMarker[] = {
142 /*123456789 123456789 123456789 123456789 123456789 123456789 123456789*/
143 "<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<<<<<\n",
144 "======= COMMON ANCESTOR content follows ============================\n",
145 "======= MERGED IN content follows ==================================\n",
146 ">>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
@@ -368,11 +368,11 @@
368 ** fossil commit
369 **
370 */
371 void delta_3waymerge_cmd(void){
372 Blob pivot, v1, v2, merged;
373
374 /* We should be done with options.. */
375 verify_all_options();
376
377 if( g.argc!=6 ){
378 usage("PIVOT V1 V2 MERGED");
379
+2 -2
--- src/report.c
+++ src/report.c
@@ -1112,11 +1112,11 @@
11121112
** show all reports, which can be used for ticket show.
11131113
** Output is written to stdout as tab delimited table
11141114
*/
11151115
void rpt_list_reports(void){
11161116
Stmt q;
1117
- char const aRptOutFrmt[] = "%s\t%s\n";
1117
+ const char aRptOutFrmt[] = "%s\t%s\n";
11181118
11191119
fossil_print("Available reports:\n");
11201120
fossil_print(aRptOutFrmt,"report number","report title");
11211121
fossil_print(aRptOutFrmt,zFullTicketRptRn,zFullTicketRptTitle);
11221122
db_prepare(&q,"SELECT rn,title FROM reportfmt ORDER BY rn");
@@ -1217,11 +1217,11 @@
12171217
char *zErr1 = 0;
12181218
char *zErr2 = 0;
12191219
int count = 0;
12201220
int rn;
12211221
1222
- if (!zRep || !strcmp(zRep,zFullTicketRptRn) || !strcmp(zRep,zFullTicketRptTitle) ){
1222
+ if( !zRep || !strcmp(zRep,zFullTicketRptRn) || !strcmp(zRep,zFullTicketRptTitle) ){
12231223
zSql = "SELECT * FROM ticket";
12241224
}else{
12251225
rn = atoi(zRep);
12261226
if( rn ){
12271227
db_prepare(&q,
12281228
--- src/report.c
+++ src/report.c
@@ -1112,11 +1112,11 @@
1112 ** show all reports, which can be used for ticket show.
1113 ** Output is written to stdout as tab delimited table
1114 */
1115 void rpt_list_reports(void){
1116 Stmt q;
1117 char const aRptOutFrmt[] = "%s\t%s\n";
1118
1119 fossil_print("Available reports:\n");
1120 fossil_print(aRptOutFrmt,"report number","report title");
1121 fossil_print(aRptOutFrmt,zFullTicketRptRn,zFullTicketRptTitle);
1122 db_prepare(&q,"SELECT rn,title FROM reportfmt ORDER BY rn");
@@ -1217,11 +1217,11 @@
1217 char *zErr1 = 0;
1218 char *zErr2 = 0;
1219 int count = 0;
1220 int rn;
1221
1222 if (!zRep || !strcmp(zRep,zFullTicketRptRn) || !strcmp(zRep,zFullTicketRptTitle) ){
1223 zSql = "SELECT * FROM ticket";
1224 }else{
1225 rn = atoi(zRep);
1226 if( rn ){
1227 db_prepare(&q,
1228
--- src/report.c
+++ src/report.c
@@ -1112,11 +1112,11 @@
1112 ** show all reports, which can be used for ticket show.
1113 ** Output is written to stdout as tab delimited table
1114 */
1115 void rpt_list_reports(void){
1116 Stmt q;
1117 const char aRptOutFrmt[] = "%s\t%s\n";
1118
1119 fossil_print("Available reports:\n");
1120 fossil_print(aRptOutFrmt,"report number","report title");
1121 fossil_print(aRptOutFrmt,zFullTicketRptRn,zFullTicketRptTitle);
1122 db_prepare(&q,"SELECT rn,title FROM reportfmt ORDER BY rn");
@@ -1217,11 +1217,11 @@
1217 char *zErr1 = 0;
1218 char *zErr2 = 0;
1219 int count = 0;
1220 int rn;
1221
1222 if( !zRep || !strcmp(zRep,zFullTicketRptRn) || !strcmp(zRep,zFullTicketRptTitle) ){
1223 zSql = "SELECT * FROM ticket";
1224 }else{
1225 rn = atoi(zRep);
1226 if( rn ){
1227 db_prepare(&q,
1228
+8 -8
--- src/tag.c
+++ src/tag.c
@@ -50,11 +50,11 @@
5050
5151
/* Query for children of :pid to which to propagate the tag.
5252
** Three returns: (1) rid of the child. (2) timestamp of child.
5353
** (3) True to propagate or false to block.
5454
*/
55
- db_prepare(&s,
55
+ db_prepare(&s,
5656
"SELECT cid, plink.mtime,"
5757
" coalesce(srcid=0 AND tagxref.mtime<:mtime, %d) AS doit"
5858
" FROM plink LEFT JOIN tagxref ON cid=rid AND tagid=%d"
5959
" WHERE pid=:pid AND isprim",
6060
tagType==2, tagid
@@ -179,11 +179,11 @@
179179
db_finalize(&s);
180180
if( rc==SQLITE_ROW ){
181181
/* Another entry that is more recent already exists. Do nothing */
182182
return tagid;
183183
}
184
- db_prepare(&s,
184
+ db_prepare(&s,
185185
"REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid)"
186186
" VALUES(%d,%d,%d,%d,%Q,:mtime,%d)",
187187
tagid, tagtype, srcId, rid, zValue, rid
188188
);
189189
db_bind_double(&s, ":mtime", mtime);
@@ -256,11 +256,11 @@
256256
zTag = g.argv[2];
257257
switch( zTag[0] ){
258258
case '+': tagtype = 1; break;
259259
case '*': tagtype = 2; break;
260260
case '-': tagtype = 0; break;
261
- default:
261
+ default:
262262
fossil_fatal("tag should begin with '+', '*', or '-'");
263263
return;
264264
}
265265
rid = name_to_rid(g.argv[3]);
266266
if( rid==0 ){
@@ -378,22 +378,22 @@
378378
**
379379
** fossil update tag:decaf
380380
**
381381
** will assume that "decaf" is a tag/branch name.
382382
**
383
-** only allow --date-override and --user-override in
383
+** only allow --date-override and --user-override in
384384
** %fossil tag add --date-override 'YYYY-MMM-DD HH:MM:SS' \\
385
-** --user-override user
385
+** --user-override user
386386
** in order to import history from other scm systems
387387
*/
388388
void tag_cmd(void){
389389
int n;
390390
int fRaw = find_option("raw","",0)!=0;
391391
int fPropagate = find_option("propagate","",0)!=0;
392392
const char *zPrefix = fRaw ? "" : "sym-";
393
- char const * zFindLimit = find_option("limit","n",1);
394
- int const nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000;
393
+ const char *zFindLimit = find_option("limit","n",1);
394
+ const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000;
395395
396396
db_find_and_open_repository(0, 0);
397397
if( g.argc<3 ){
398398
goto tag_cmd_usage;
399399
}
@@ -478,11 +478,11 @@
478478
}else
479479
480480
if( strncmp(g.argv[2],"list",n)==0 ){
481481
Stmt q;
482482
if( g.argc==3 ){
483
- db_prepare(&q,
483
+ db_prepare(&q,
484484
"SELECT tagname FROM tag"
485485
" WHERE EXISTS(SELECT 1 FROM tagxref"
486486
" WHERE tagid=tag.tagid"
487487
" AND tagtype>0)"
488488
" ORDER BY tagname"
489489
--- src/tag.c
+++ src/tag.c
@@ -50,11 +50,11 @@
50
51 /* Query for children of :pid to which to propagate the tag.
52 ** Three returns: (1) rid of the child. (2) timestamp of child.
53 ** (3) True to propagate or false to block.
54 */
55 db_prepare(&s,
56 "SELECT cid, plink.mtime,"
57 " coalesce(srcid=0 AND tagxref.mtime<:mtime, %d) AS doit"
58 " FROM plink LEFT JOIN tagxref ON cid=rid AND tagid=%d"
59 " WHERE pid=:pid AND isprim",
60 tagType==2, tagid
@@ -179,11 +179,11 @@
179 db_finalize(&s);
180 if( rc==SQLITE_ROW ){
181 /* Another entry that is more recent already exists. Do nothing */
182 return tagid;
183 }
184 db_prepare(&s,
185 "REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid)"
186 " VALUES(%d,%d,%d,%d,%Q,:mtime,%d)",
187 tagid, tagtype, srcId, rid, zValue, rid
188 );
189 db_bind_double(&s, ":mtime", mtime);
@@ -256,11 +256,11 @@
256 zTag = g.argv[2];
257 switch( zTag[0] ){
258 case '+': tagtype = 1; break;
259 case '*': tagtype = 2; break;
260 case '-': tagtype = 0; break;
261 default:
262 fossil_fatal("tag should begin with '+', '*', or '-'");
263 return;
264 }
265 rid = name_to_rid(g.argv[3]);
266 if( rid==0 ){
@@ -378,22 +378,22 @@
378 **
379 ** fossil update tag:decaf
380 **
381 ** will assume that "decaf" is a tag/branch name.
382 **
383 ** only allow --date-override and --user-override in
384 ** %fossil tag add --date-override 'YYYY-MMM-DD HH:MM:SS' \\
385 ** --user-override user
386 ** in order to import history from other scm systems
387 */
388 void tag_cmd(void){
389 int n;
390 int fRaw = find_option("raw","",0)!=0;
391 int fPropagate = find_option("propagate","",0)!=0;
392 const char *zPrefix = fRaw ? "" : "sym-";
393 char const * zFindLimit = find_option("limit","n",1);
394 int const nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000;
395
396 db_find_and_open_repository(0, 0);
397 if( g.argc<3 ){
398 goto tag_cmd_usage;
399 }
@@ -478,11 +478,11 @@
478 }else
479
480 if( strncmp(g.argv[2],"list",n)==0 ){
481 Stmt q;
482 if( g.argc==3 ){
483 db_prepare(&q,
484 "SELECT tagname FROM tag"
485 " WHERE EXISTS(SELECT 1 FROM tagxref"
486 " WHERE tagid=tag.tagid"
487 " AND tagtype>0)"
488 " ORDER BY tagname"
489
--- src/tag.c
+++ src/tag.c
@@ -50,11 +50,11 @@
50
51 /* Query for children of :pid to which to propagate the tag.
52 ** Three returns: (1) rid of the child. (2) timestamp of child.
53 ** (3) True to propagate or false to block.
54 */
55 db_prepare(&s,
56 "SELECT cid, plink.mtime,"
57 " coalesce(srcid=0 AND tagxref.mtime<:mtime, %d) AS doit"
58 " FROM plink LEFT JOIN tagxref ON cid=rid AND tagid=%d"
59 " WHERE pid=:pid AND isprim",
60 tagType==2, tagid
@@ -179,11 +179,11 @@
179 db_finalize(&s);
180 if( rc==SQLITE_ROW ){
181 /* Another entry that is more recent already exists. Do nothing */
182 return tagid;
183 }
184 db_prepare(&s,
185 "REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid)"
186 " VALUES(%d,%d,%d,%d,%Q,:mtime,%d)",
187 tagid, tagtype, srcId, rid, zValue, rid
188 );
189 db_bind_double(&s, ":mtime", mtime);
@@ -256,11 +256,11 @@
256 zTag = g.argv[2];
257 switch( zTag[0] ){
258 case '+': tagtype = 1; break;
259 case '*': tagtype = 2; break;
260 case '-': tagtype = 0; break;
261 default:
262 fossil_fatal("tag should begin with '+', '*', or '-'");
263 return;
264 }
265 rid = name_to_rid(g.argv[3]);
266 if( rid==0 ){
@@ -378,22 +378,22 @@
378 **
379 ** fossil update tag:decaf
380 **
381 ** will assume that "decaf" is a tag/branch name.
382 **
383 ** only allow --date-override and --user-override in
384 ** %fossil tag add --date-override 'YYYY-MMM-DD HH:MM:SS' \\
385 ** --user-override user
386 ** in order to import history from other scm systems
387 */
388 void tag_cmd(void){
389 int n;
390 int fRaw = find_option("raw","",0)!=0;
391 int fPropagate = find_option("propagate","",0)!=0;
392 const char *zPrefix = fRaw ? "" : "sym-";
393 const char *zFindLimit = find_option("limit","n",1);
394 const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000;
395
396 db_find_and_open_repository(0, 0);
397 if( g.argc<3 ){
398 goto tag_cmd_usage;
399 }
@@ -478,11 +478,11 @@
478 }else
479
480 if( strncmp(g.argv[2],"list",n)==0 ){
481 Stmt q;
482 if( g.argc==3 ){
483 db_prepare(&q,
484 "SELECT tagname FROM tag"
485 " WHERE EXISTS(SELECT 1 FROM tagxref"
486 " WHERE tagid=tag.tagid"
487 " AND tagtype>0)"
488 " ORDER BY tagname"
489
+22 -22
--- src/timeline.c
+++ src/timeline.c
@@ -1969,11 +1969,11 @@
19691969
19701970
/*
19711971
** Set by stats_report_init_view() to one of the y=XXXX values
19721972
** accepted by /timeline?y=XXXX.
19731973
*/
1974
-static const char * statsReportTimelineYFlag = NULL;
1974
+static const char *statsReportTimelineYFlag = NULL;
19751975
19761976
/*
19771977
** Creates a TEMP VIEW named v_reports which is a wrapper around the
19781978
** EVENT table filtered on event.type. It looks for the request
19791979
** parameter 'type' (reminder: we "should" use 'y' for consistency
@@ -1990,12 +1990,12 @@
19901990
** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of
19911991
** filter it applies, or '*' if no filter is applied (i.e. if "all" is
19921992
** used).
19931993
*/
19941994
static int stats_report_init_view(){
1995
- const char * zType = PD("type","*"); /* analog to /timeline?y=... */
1996
- const char * zRealType = NULL; /* normalized form of zType */
1995
+ const char *zType = PD("type","*"); /* analog to /timeline?y=... */
1996
+ const char *zRealType = NULL; /* normalized form of zType */
19971997
int rc = 0; /* result code */
19981998
assert( !statsReportType && "Must not be called more than once." );
19991999
switch( (zType && *zType) ? *zType : 0 ){
20002000
case 'c':
20012001
case 'C':
@@ -2044,11 +2044,11 @@
20442044
** Returns a string suitable (for a given value of suitable) for
20452045
** use in a label with the header of the /reports pages, dependent
20462046
** on the 'type' flag. See stats_report_init_view().
20472047
** The returned bytes are static.
20482048
*/
2049
-static const char * stats_report_label_for_type(){
2049
+static const char *stats_report_label_for_type(){
20502050
assert( statsReportType && "Must call stats_report_init_view() first." );
20512051
switch( statsReportType ){
20522052
case 'c':
20532053
return "checkins";
20542054
case 'e':
@@ -2071,13 +2071,13 @@
20712071
** time this is called. e.g. if called from the 'byuser' view then
20722072
** zCurrentViewName must be "byuser". Any URL parameters which need to
20732073
** be added to the generated URLs should be passed in zParam. The
20742074
** caller is expected to have already encoded any zParam in the %T or
20752075
** %t encoding. */
2076
-static void stats_report_event_types_menu(const char * zCurrentViewName,
2077
- const char * zParam){
2078
- char * zTop;
2076
+static void stats_report_event_types_menu(const char *zCurrentViewName,
2077
+ const char *zParam){
2078
+ char *zTop;
20792079
if(zParam && !*zParam){
20802080
zParam = NULL;
20812081
}
20822082
zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName,
20832083
zParam ? "&" : "", zParam);
@@ -2121,11 +2121,11 @@
21212121
/*
21222122
** Helper for stats_report_by_month_year(), which generates a list of
21232123
** week numbers. zTimeframe should be either a timeframe in the form YYYY
21242124
** or YYYY-MM.
21252125
*/
2126
-static void stats_report_output_week_links(const char * zTimeframe){
2126
+static void stats_report_output_week_links(const char *zTimeframe){
21272127
Stmt stWeek = empty_Stmt;
21282128
char yearPart[5] = {0,0,0,0,0};
21292129
memcpy(yearPart, zTimeframe, 4);
21302130
db_prepare(&stWeek,
21312131
"SELECT DISTINCT strftime('%%W',mtime) AS wk, "
@@ -2135,11 +2135,11 @@
21352135
"WHERE ym=%Q AND mtime < current_timestamp "
21362136
"GROUP BY wk ORDER BY wk",
21372137
strlen(zTimeframe),
21382138
zTimeframe);
21392139
while( SQLITE_ROW == db_step(&stWeek) ){
2140
- const char * zWeek = db_column_text(&stWeek,0);
2140
+ const char *zWeek = db_column_text(&stWeek,0);
21412141
const int nCount = db_column_int(&stWeek,1);
21422142
cgi_printf("<a href='%s/timeline?"
21432143
"yw=%t-%t&n=%d&y=%s'>%s</a>",
21442144
g.zTop, yearPart, zWeek,
21452145
nCount, statsReportTimelineYFlag, zWeek);
@@ -2154,18 +2154,18 @@
21542154
** then the report is restricted to events created by the named user
21552155
** account.
21562156
*/
21572157
static void stats_report_by_month_year(char includeMonth,
21582158
char includeWeeks,
2159
- const char * zUserName){
2159
+ const char *zUserName){
21602160
Stmt query = empty_Stmt;
21612161
int nRowNumber = 0; /* current TR number */
21622162
int nEventTotal = 0; /* Total event count */
21632163
int rowClass = 0; /* counter for alternating
21642164
row colors */
21652165
Blob sql = empty_blob; /* SQL */
2166
- const char * zTimeLabel = includeMonth ? "Year/Month" : "Year";
2166
+ const char *zTimeLabel = includeMonth ? "Year/Month" : "Year";
21672167
char zPrevYear[5] = {0}; /* For keeping track of when
21682168
we change years while looping */
21692169
int nEventsPerYear = 0; /* Total event count for the
21702170
current year */
21712171
char showYearTotal = 0; /* Flag telling us when to show
@@ -2216,11 +2216,11 @@
22162216
}
22172217
++iterations;
22182218
}
22192219
db_reset(&query);
22202220
while( SQLITE_ROW == db_step(&query) ){
2221
- const char * zTimeframe = db_column_text(&query, 0);
2221
+ const char *zTimeframe = db_column_text(&query, 0);
22222222
const int nCount = db_column_int(&query, 1);
22232223
int nSize = nCount
22242224
? (int)(100 * nCount / nMaxEvents)
22252225
: 1;
22262226
showYearTotal = 0;
@@ -2301,11 +2301,11 @@
23012301
@ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
23022302
@</tr>
23032303
}
23042304
@ </tbody></table>
23052305
if(nEventTotal){
2306
- const char * zAvgLabel = includeMonth ? "month" : "year";
2306
+ const char *zAvgLabel = includeMonth ? "month" : "year";
23072307
int nAvg = iterations ? (nEventTotal/iterations) : 0;
23082308
@ <br><div>Total events: %d(nEventTotal)
23092309
@ <br>Average per active %s(zAvgLabel): %d(nAvg)
23102310
@ </div>
23112311
}
@@ -2351,11 +2351,11 @@
23512351
nMaxEvents = nCount;
23522352
}
23532353
}
23542354
db_reset(&query);
23552355
while( SQLITE_ROW == db_step(&query) ){
2356
- const char * zUser = db_column_text(&query, 0);
2356
+ const char *zUser = db_column_text(&query, 0);
23572357
const int nCount = db_column_int(&query, 1);
23582358
int nSize = nCount
23592359
? (int)(100 * nCount / nMaxEvents)
23602360
: 0;
23612361
if(!nCount) continue /* arguable! Possible? */;
@@ -2391,11 +2391,11 @@
23912391
int rowClass = 0; /* counter for alternating
23922392
row colors */
23932393
Blob sql = empty_blob; /* SQL */
23942394
int nMaxEvents = 1; /* max number of events for
23952395
all rows. */
2396
- static const char * const daysOfWeek[] = {
2396
+ static const char *const daysOfWeek[] = {
23972397
"Monday", "Tuesday", "Wednesday", "Thursday",
23982398
"Friday", "Saturday", "Sunday"
23992399
};
24002400
24012401
stats_report_init_view();
@@ -2424,11 +2424,11 @@
24242424
nMaxEvents = nCount;
24252425
}
24262426
}
24272427
db_reset(&query);
24282428
while( SQLITE_ROW == db_step(&query) ){
2429
- int const dayNum =db_column_int(&query, 0);
2429
+ const int dayNum =db_column_int(&query, 0);
24302430
const int nCount = db_column_int(&query, 1);
24312431
int nSize = nCount
24322432
? (int)(100 * nCount / nMaxEvents)
24332433
: 0;
24342434
if(!nCount) continue /* arguable! Possible? */;
@@ -2454,16 +2454,16 @@
24542454
/*
24552455
** Helper for stats_report_by_month_year(), which generates a list of
24562456
** week numbers. zTimeframe should be either a timeframe in the form YYYY
24572457
** or YYYY-MM.
24582458
*/
2459
-static void stats_report_year_weeks(const char * zUserName){
2460
- const char * zYear = P("y");
2459
+static void stats_report_year_weeks(const char *zUserName){
2460
+ const char *zYear = P("y");
24612461
int nYear = zYear ? strlen(zYear) : 0;
24622462
int i = 0;
24632463
Stmt qYears = empty_Stmt;
2464
- char * zDefaultYear = NULL;
2464
+ char *zDefaultYear = NULL;
24652465
Blob sql = empty_blob;
24662466
int nMaxEvents = 1; /* max number of events for
24672467
all rows. */
24682468
int iterations = 0; /* # of active time periods. */
24692469
stats_report_init_view();
@@ -2484,11 +2484,11 @@
24842484
blob_append(&sql,"GROUP BY y ORDER BY y", -1);
24852485
db_prepare(&qYears, blob_str(&sql));
24862486
blob_reset(&sql);
24872487
cgi_printf("Select year: ");
24882488
while( SQLITE_ROW == db_step(&qYears) ){
2489
- const char * zT = db_column_text(&qYears, 0);
2489
+ const char *zT = db_column_text(&qYears, 0);
24902490
if( i++ ){
24912491
cgi_printf(" ");
24922492
}
24932493
cgi_printf("<a href='?view=byweek&y=%s&type=%c", zT,
24942494
(char)statsReportType);
@@ -2544,11 +2544,11 @@
25442544
}
25452545
++iterations;
25462546
}
25472547
db_reset(&stWeek);
25482548
while( SQLITE_ROW == db_step(&stWeek) ){
2549
- const char * zWeek = db_column_text(&stWeek,0);
2549
+ const char *zWeek = db_column_text(&stWeek,0);
25502550
const int nCount = db_column_int(&stWeek,1);
25512551
int nSize = nCount
25522552
? (int)(100 * nCount / nMaxEvents)
25532553
: 0;
25542554
if(!nSize) nSize = 1;
@@ -2604,11 +2604,11 @@
26042604
** y=YYYY The year to report (default is the server's
26052605
** current year).
26062606
*/
26072607
void stats_report_page(){
26082608
HQuery url; /* URL for various branch links */
2609
- const char * zView = P("view"); /* Which view/report to show. */
2609
+ const char *zView = P("view"); /* Which view/report to show. */
26102610
const char *zUserName = P("user");
26112611
26122612
login_check_credentials();
26132613
if( !g.perm.Read ){ login_needed(); return; }
26142614
if(!zUserName) zUserName = P("u");
26152615
--- src/timeline.c
+++ src/timeline.c
@@ -1969,11 +1969,11 @@
1969
1970 /*
1971 ** Set by stats_report_init_view() to one of the y=XXXX values
1972 ** accepted by /timeline?y=XXXX.
1973 */
1974 static const char * statsReportTimelineYFlag = NULL;
1975
1976 /*
1977 ** Creates a TEMP VIEW named v_reports which is a wrapper around the
1978 ** EVENT table filtered on event.type. It looks for the request
1979 ** parameter 'type' (reminder: we "should" use 'y' for consistency
@@ -1990,12 +1990,12 @@
1990 ** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of
1991 ** filter it applies, or '*' if no filter is applied (i.e. if "all" is
1992 ** used).
1993 */
1994 static int stats_report_init_view(){
1995 const char * zType = PD("type","*"); /* analog to /timeline?y=... */
1996 const char * zRealType = NULL; /* normalized form of zType */
1997 int rc = 0; /* result code */
1998 assert( !statsReportType && "Must not be called more than once." );
1999 switch( (zType && *zType) ? *zType : 0 ){
2000 case 'c':
2001 case 'C':
@@ -2044,11 +2044,11 @@
2044 ** Returns a string suitable (for a given value of suitable) for
2045 ** use in a label with the header of the /reports pages, dependent
2046 ** on the 'type' flag. See stats_report_init_view().
2047 ** The returned bytes are static.
2048 */
2049 static const char * stats_report_label_for_type(){
2050 assert( statsReportType && "Must call stats_report_init_view() first." );
2051 switch( statsReportType ){
2052 case 'c':
2053 return "checkins";
2054 case 'e':
@@ -2071,13 +2071,13 @@
2071 ** time this is called. e.g. if called from the 'byuser' view then
2072 ** zCurrentViewName must be "byuser". Any URL parameters which need to
2073 ** be added to the generated URLs should be passed in zParam. The
2074 ** caller is expected to have already encoded any zParam in the %T or
2075 ** %t encoding. */
2076 static void stats_report_event_types_menu(const char * zCurrentViewName,
2077 const char * zParam){
2078 char * zTop;
2079 if(zParam && !*zParam){
2080 zParam = NULL;
2081 }
2082 zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName,
2083 zParam ? "&" : "", zParam);
@@ -2121,11 +2121,11 @@
2121 /*
2122 ** Helper for stats_report_by_month_year(), which generates a list of
2123 ** week numbers. zTimeframe should be either a timeframe in the form YYYY
2124 ** or YYYY-MM.
2125 */
2126 static void stats_report_output_week_links(const char * zTimeframe){
2127 Stmt stWeek = empty_Stmt;
2128 char yearPart[5] = {0,0,0,0,0};
2129 memcpy(yearPart, zTimeframe, 4);
2130 db_prepare(&stWeek,
2131 "SELECT DISTINCT strftime('%%W',mtime) AS wk, "
@@ -2135,11 +2135,11 @@
2135 "WHERE ym=%Q AND mtime < current_timestamp "
2136 "GROUP BY wk ORDER BY wk",
2137 strlen(zTimeframe),
2138 zTimeframe);
2139 while( SQLITE_ROW == db_step(&stWeek) ){
2140 const char * zWeek = db_column_text(&stWeek,0);
2141 const int nCount = db_column_int(&stWeek,1);
2142 cgi_printf("<a href='%s/timeline?"
2143 "yw=%t-%t&n=%d&y=%s'>%s</a>",
2144 g.zTop, yearPart, zWeek,
2145 nCount, statsReportTimelineYFlag, zWeek);
@@ -2154,18 +2154,18 @@
2154 ** then the report is restricted to events created by the named user
2155 ** account.
2156 */
2157 static void stats_report_by_month_year(char includeMonth,
2158 char includeWeeks,
2159 const char * zUserName){
2160 Stmt query = empty_Stmt;
2161 int nRowNumber = 0; /* current TR number */
2162 int nEventTotal = 0; /* Total event count */
2163 int rowClass = 0; /* counter for alternating
2164 row colors */
2165 Blob sql = empty_blob; /* SQL */
2166 const char * zTimeLabel = includeMonth ? "Year/Month" : "Year";
2167 char zPrevYear[5] = {0}; /* For keeping track of when
2168 we change years while looping */
2169 int nEventsPerYear = 0; /* Total event count for the
2170 current year */
2171 char showYearTotal = 0; /* Flag telling us when to show
@@ -2216,11 +2216,11 @@
2216 }
2217 ++iterations;
2218 }
2219 db_reset(&query);
2220 while( SQLITE_ROW == db_step(&query) ){
2221 const char * zTimeframe = db_column_text(&query, 0);
2222 const int nCount = db_column_int(&query, 1);
2223 int nSize = nCount
2224 ? (int)(100 * nCount / nMaxEvents)
2225 : 1;
2226 showYearTotal = 0;
@@ -2301,11 +2301,11 @@
2301 @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
2302 @</tr>
2303 }
2304 @ </tbody></table>
2305 if(nEventTotal){
2306 const char * zAvgLabel = includeMonth ? "month" : "year";
2307 int nAvg = iterations ? (nEventTotal/iterations) : 0;
2308 @ <br><div>Total events: %d(nEventTotal)
2309 @ <br>Average per active %s(zAvgLabel): %d(nAvg)
2310 @ </div>
2311 }
@@ -2351,11 +2351,11 @@
2351 nMaxEvents = nCount;
2352 }
2353 }
2354 db_reset(&query);
2355 while( SQLITE_ROW == db_step(&query) ){
2356 const char * zUser = db_column_text(&query, 0);
2357 const int nCount = db_column_int(&query, 1);
2358 int nSize = nCount
2359 ? (int)(100 * nCount / nMaxEvents)
2360 : 0;
2361 if(!nCount) continue /* arguable! Possible? */;
@@ -2391,11 +2391,11 @@
2391 int rowClass = 0; /* counter for alternating
2392 row colors */
2393 Blob sql = empty_blob; /* SQL */
2394 int nMaxEvents = 1; /* max number of events for
2395 all rows. */
2396 static const char * const daysOfWeek[] = {
2397 "Monday", "Tuesday", "Wednesday", "Thursday",
2398 "Friday", "Saturday", "Sunday"
2399 };
2400
2401 stats_report_init_view();
@@ -2424,11 +2424,11 @@
2424 nMaxEvents = nCount;
2425 }
2426 }
2427 db_reset(&query);
2428 while( SQLITE_ROW == db_step(&query) ){
2429 int const dayNum =db_column_int(&query, 0);
2430 const int nCount = db_column_int(&query, 1);
2431 int nSize = nCount
2432 ? (int)(100 * nCount / nMaxEvents)
2433 : 0;
2434 if(!nCount) continue /* arguable! Possible? */;
@@ -2454,16 +2454,16 @@
2454 /*
2455 ** Helper for stats_report_by_month_year(), which generates a list of
2456 ** week numbers. zTimeframe should be either a timeframe in the form YYYY
2457 ** or YYYY-MM.
2458 */
2459 static void stats_report_year_weeks(const char * zUserName){
2460 const char * zYear = P("y");
2461 int nYear = zYear ? strlen(zYear) : 0;
2462 int i = 0;
2463 Stmt qYears = empty_Stmt;
2464 char * zDefaultYear = NULL;
2465 Blob sql = empty_blob;
2466 int nMaxEvents = 1; /* max number of events for
2467 all rows. */
2468 int iterations = 0; /* # of active time periods. */
2469 stats_report_init_view();
@@ -2484,11 +2484,11 @@
2484 blob_append(&sql,"GROUP BY y ORDER BY y", -1);
2485 db_prepare(&qYears, blob_str(&sql));
2486 blob_reset(&sql);
2487 cgi_printf("Select year: ");
2488 while( SQLITE_ROW == db_step(&qYears) ){
2489 const char * zT = db_column_text(&qYears, 0);
2490 if( i++ ){
2491 cgi_printf(" ");
2492 }
2493 cgi_printf("<a href='?view=byweek&y=%s&type=%c", zT,
2494 (char)statsReportType);
@@ -2544,11 +2544,11 @@
2544 }
2545 ++iterations;
2546 }
2547 db_reset(&stWeek);
2548 while( SQLITE_ROW == db_step(&stWeek) ){
2549 const char * zWeek = db_column_text(&stWeek,0);
2550 const int nCount = db_column_int(&stWeek,1);
2551 int nSize = nCount
2552 ? (int)(100 * nCount / nMaxEvents)
2553 : 0;
2554 if(!nSize) nSize = 1;
@@ -2604,11 +2604,11 @@
2604 ** y=YYYY The year to report (default is the server's
2605 ** current year).
2606 */
2607 void stats_report_page(){
2608 HQuery url; /* URL for various branch links */
2609 const char * zView = P("view"); /* Which view/report to show. */
2610 const char *zUserName = P("user");
2611
2612 login_check_credentials();
2613 if( !g.perm.Read ){ login_needed(); return; }
2614 if(!zUserName) zUserName = P("u");
2615
--- src/timeline.c
+++ src/timeline.c
@@ -1969,11 +1969,11 @@
1969
1970 /*
1971 ** Set by stats_report_init_view() to one of the y=XXXX values
1972 ** accepted by /timeline?y=XXXX.
1973 */
1974 static const char *statsReportTimelineYFlag = NULL;
1975
1976 /*
1977 ** Creates a TEMP VIEW named v_reports which is a wrapper around the
1978 ** EVENT table filtered on event.type. It looks for the request
1979 ** parameter 'type' (reminder: we "should" use 'y' for consistency
@@ -1990,12 +1990,12 @@
1990 ** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of
1991 ** filter it applies, or '*' if no filter is applied (i.e. if "all" is
1992 ** used).
1993 */
1994 static int stats_report_init_view(){
1995 const char *zType = PD("type","*"); /* analog to /timeline?y=... */
1996 const char *zRealType = NULL; /* normalized form of zType */
1997 int rc = 0; /* result code */
1998 assert( !statsReportType && "Must not be called more than once." );
1999 switch( (zType && *zType) ? *zType : 0 ){
2000 case 'c':
2001 case 'C':
@@ -2044,11 +2044,11 @@
2044 ** Returns a string suitable (for a given value of suitable) for
2045 ** use in a label with the header of the /reports pages, dependent
2046 ** on the 'type' flag. See stats_report_init_view().
2047 ** The returned bytes are static.
2048 */
2049 static const char *stats_report_label_for_type(){
2050 assert( statsReportType && "Must call stats_report_init_view() first." );
2051 switch( statsReportType ){
2052 case 'c':
2053 return "checkins";
2054 case 'e':
@@ -2071,13 +2071,13 @@
2071 ** time this is called. e.g. if called from the 'byuser' view then
2072 ** zCurrentViewName must be "byuser". Any URL parameters which need to
2073 ** be added to the generated URLs should be passed in zParam. The
2074 ** caller is expected to have already encoded any zParam in the %T or
2075 ** %t encoding. */
2076 static void stats_report_event_types_menu(const char *zCurrentViewName,
2077 const char *zParam){
2078 char *zTop;
2079 if(zParam && !*zParam){
2080 zParam = NULL;
2081 }
2082 zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName,
2083 zParam ? "&" : "", zParam);
@@ -2121,11 +2121,11 @@
2121 /*
2122 ** Helper for stats_report_by_month_year(), which generates a list of
2123 ** week numbers. zTimeframe should be either a timeframe in the form YYYY
2124 ** or YYYY-MM.
2125 */
2126 static void stats_report_output_week_links(const char *zTimeframe){
2127 Stmt stWeek = empty_Stmt;
2128 char yearPart[5] = {0,0,0,0,0};
2129 memcpy(yearPart, zTimeframe, 4);
2130 db_prepare(&stWeek,
2131 "SELECT DISTINCT strftime('%%W',mtime) AS wk, "
@@ -2135,11 +2135,11 @@
2135 "WHERE ym=%Q AND mtime < current_timestamp "
2136 "GROUP BY wk ORDER BY wk",
2137 strlen(zTimeframe),
2138 zTimeframe);
2139 while( SQLITE_ROW == db_step(&stWeek) ){
2140 const char *zWeek = db_column_text(&stWeek,0);
2141 const int nCount = db_column_int(&stWeek,1);
2142 cgi_printf("<a href='%s/timeline?"
2143 "yw=%t-%t&n=%d&y=%s'>%s</a>",
2144 g.zTop, yearPart, zWeek,
2145 nCount, statsReportTimelineYFlag, zWeek);
@@ -2154,18 +2154,18 @@
2154 ** then the report is restricted to events created by the named user
2155 ** account.
2156 */
2157 static void stats_report_by_month_year(char includeMonth,
2158 char includeWeeks,
2159 const char *zUserName){
2160 Stmt query = empty_Stmt;
2161 int nRowNumber = 0; /* current TR number */
2162 int nEventTotal = 0; /* Total event count */
2163 int rowClass = 0; /* counter for alternating
2164 row colors */
2165 Blob sql = empty_blob; /* SQL */
2166 const char *zTimeLabel = includeMonth ? "Year/Month" : "Year";
2167 char zPrevYear[5] = {0}; /* For keeping track of when
2168 we change years while looping */
2169 int nEventsPerYear = 0; /* Total event count for the
2170 current year */
2171 char showYearTotal = 0; /* Flag telling us when to show
@@ -2216,11 +2216,11 @@
2216 }
2217 ++iterations;
2218 }
2219 db_reset(&query);
2220 while( SQLITE_ROW == db_step(&query) ){
2221 const char *zTimeframe = db_column_text(&query, 0);
2222 const int nCount = db_column_int(&query, 1);
2223 int nSize = nCount
2224 ? (int)(100 * nCount / nMaxEvents)
2225 : 1;
2226 showYearTotal = 0;
@@ -2301,11 +2301,11 @@
2301 @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
2302 @</tr>
2303 }
2304 @ </tbody></table>
2305 if(nEventTotal){
2306 const char *zAvgLabel = includeMonth ? "month" : "year";
2307 int nAvg = iterations ? (nEventTotal/iterations) : 0;
2308 @ <br><div>Total events: %d(nEventTotal)
2309 @ <br>Average per active %s(zAvgLabel): %d(nAvg)
2310 @ </div>
2311 }
@@ -2351,11 +2351,11 @@
2351 nMaxEvents = nCount;
2352 }
2353 }
2354 db_reset(&query);
2355 while( SQLITE_ROW == db_step(&query) ){
2356 const char *zUser = db_column_text(&query, 0);
2357 const int nCount = db_column_int(&query, 1);
2358 int nSize = nCount
2359 ? (int)(100 * nCount / nMaxEvents)
2360 : 0;
2361 if(!nCount) continue /* arguable! Possible? */;
@@ -2391,11 +2391,11 @@
2391 int rowClass = 0; /* counter for alternating
2392 row colors */
2393 Blob sql = empty_blob; /* SQL */
2394 int nMaxEvents = 1; /* max number of events for
2395 all rows. */
2396 static const char *const daysOfWeek[] = {
2397 "Monday", "Tuesday", "Wednesday", "Thursday",
2398 "Friday", "Saturday", "Sunday"
2399 };
2400
2401 stats_report_init_view();
@@ -2424,11 +2424,11 @@
2424 nMaxEvents = nCount;
2425 }
2426 }
2427 db_reset(&query);
2428 while( SQLITE_ROW == db_step(&query) ){
2429 const int dayNum =db_column_int(&query, 0);
2430 const int nCount = db_column_int(&query, 1);
2431 int nSize = nCount
2432 ? (int)(100 * nCount / nMaxEvents)
2433 : 0;
2434 if(!nCount) continue /* arguable! Possible? */;
@@ -2454,16 +2454,16 @@
2454 /*
2455 ** Helper for stats_report_by_month_year(), which generates a list of
2456 ** week numbers. zTimeframe should be either a timeframe in the form YYYY
2457 ** or YYYY-MM.
2458 */
2459 static void stats_report_year_weeks(const char *zUserName){
2460 const char *zYear = P("y");
2461 int nYear = zYear ? strlen(zYear) : 0;
2462 int i = 0;
2463 Stmt qYears = empty_Stmt;
2464 char *zDefaultYear = NULL;
2465 Blob sql = empty_blob;
2466 int nMaxEvents = 1; /* max number of events for
2467 all rows. */
2468 int iterations = 0; /* # of active time periods. */
2469 stats_report_init_view();
@@ -2484,11 +2484,11 @@
2484 blob_append(&sql,"GROUP BY y ORDER BY y", -1);
2485 db_prepare(&qYears, blob_str(&sql));
2486 blob_reset(&sql);
2487 cgi_printf("Select year: ");
2488 while( SQLITE_ROW == db_step(&qYears) ){
2489 const char *zT = db_column_text(&qYears, 0);
2490 if( i++ ){
2491 cgi_printf(" ");
2492 }
2493 cgi_printf("<a href='?view=byweek&y=%s&type=%c", zT,
2494 (char)statsReportType);
@@ -2544,11 +2544,11 @@
2544 }
2545 ++iterations;
2546 }
2547 db_reset(&stWeek);
2548 while( SQLITE_ROW == db_step(&stWeek) ){
2549 const char *zWeek = db_column_text(&stWeek,0);
2550 const int nCount = db_column_int(&stWeek,1);
2551 int nSize = nCount
2552 ? (int)(100 * nCount / nMaxEvents)
2553 : 0;
2554 if(!nSize) nSize = 1;
@@ -2604,11 +2604,11 @@
2604 ** y=YYYY The year to report (default is the server's
2605 ** current year).
2606 */
2607 void stats_report_page(){
2608 HQuery url; /* URL for various branch links */
2609 const char *zView = P("view"); /* Which view/report to show. */
2610 const char *zUserName = P("user");
2611
2612 login_check_credentials();
2613 if( !g.perm.Read ){ login_needed(); return; }
2614 if(!zUserName) zUserName = P("u");
2615
+1 -1
--- src/unicode.c
+++ src/unicode.c
@@ -208,11 +208,11 @@
208208
iHi = iTest-1;
209209
}
210210
}
211211
assert( key>=aDia[iRes] );
212212
return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]);
213
-};
213
+}
214214
215215
216216
/*
217217
** Return true if the argument interpreted as a unicode codepoint
218218
** is a diacritical modifier character.
219219
--- src/unicode.c
+++ src/unicode.c
@@ -208,11 +208,11 @@
208 iHi = iTest-1;
209 }
210 }
211 assert( key>=aDia[iRes] );
212 return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]);
213 };
214
215
216 /*
217 ** Return true if the argument interpreted as a unicode codepoint
218 ** is a diacritical modifier character.
219
--- src/unicode.c
+++ src/unicode.c
@@ -208,11 +208,11 @@
208 iHi = iTest-1;
209 }
210 }
211 assert( key>=aDia[iRes] );
212 return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]);
213 }
214
215
216 /*
217 ** Return true if the argument interpreted as a unicode codepoint
218 ** is a diacritical modifier character.
219
+2 -2
--- src/util.c
+++ src/util.c
@@ -295,11 +295,11 @@
295295
*/
296296
int fossil_timer_is_active( int timerId ){
297297
if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
298298
return 0;
299299
}else{
300
- int const rc = fossilTimerList[timerId-1].id;
300
+ const int rc = fossilTimerList[timerId-1].id;
301301
assert(!rc || (rc == timerId));
302302
return fossilTimerList[timerId-1].id;
303303
}
304304
}
305305
@@ -317,10 +317,10 @@
317317
318318
/*
319319
** Returns TRUE if zSym is exactly UUID_SIZE bytes long and contains
320320
** only lower-case ASCII hexadecimal values.
321321
*/
322
-int fossil_is_uuid(char const * zSym){
322
+int fossil_is_uuid(const char *zSym){
323323
return zSym
324324
&& (UUID_SIZE==strlen(zSym))
325325
&& validate16(zSym, UUID_SIZE);
326326
}
327327
--- src/util.c
+++ src/util.c
@@ -295,11 +295,11 @@
295 */
296 int fossil_timer_is_active( int timerId ){
297 if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
298 return 0;
299 }else{
300 int const rc = fossilTimerList[timerId-1].id;
301 assert(!rc || (rc == timerId));
302 return fossilTimerList[timerId-1].id;
303 }
304 }
305
@@ -317,10 +317,10 @@
317
318 /*
319 ** Returns TRUE if zSym is exactly UUID_SIZE bytes long and contains
320 ** only lower-case ASCII hexadecimal values.
321 */
322 int fossil_is_uuid(char const * zSym){
323 return zSym
324 && (UUID_SIZE==strlen(zSym))
325 && validate16(zSym, UUID_SIZE);
326 }
327
--- src/util.c
+++ src/util.c
@@ -295,11 +295,11 @@
295 */
296 int fossil_timer_is_active( int timerId ){
297 if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
298 return 0;
299 }else{
300 const int rc = fossilTimerList[timerId-1].id;
301 assert(!rc || (rc == timerId));
302 return fossilTimerList[timerId-1].id;
303 }
304 }
305
@@ -317,10 +317,10 @@
317
318 /*
319 ** Returns TRUE if zSym is exactly UUID_SIZE bytes long and contains
320 ** only lower-case ASCII hexadecimal values.
321 */
322 int fossil_is_uuid(const char *zSym){
323 return zSym
324 && (UUID_SIZE==strlen(zSym))
325 && validate16(zSym, UUID_SIZE);
326 }
327
+8 -8
--- src/wiki.c
+++ src/wiki.c
@@ -860,11 +860,11 @@
860860
** URL: /wfind?title=TITLE
861861
** List all wiki pages whose titles contain the search text
862862
*/
863863
void wfind_page(void){
864864
Stmt q;
865
- const char * zTitle;
865
+ const char *zTitle;
866866
login_check_credentials();
867867
if( !g.perm.RdWiki ){ login_needed(); return; }
868868
zTitle = PD("title","*");
869869
style_header("Wiki Pages Found");
870870
@ <ul>
@@ -960,18 +960,18 @@
960960
**
961961
** zMimeType specifies the N-card for the wiki page. If it is 0,
962962
** empty, or "text/x-fossil-wiki" (the default format) then it is
963963
** ignored.
964964
*/
965
-int wiki_cmd_commit(char const * zPageName, int isNew, Blob *pContent,
966
- char const * zMimeType){
965
+int wiki_cmd_commit(const char *zPageName, int isNew, Blob *pContent,
966
+ const char *zMimeType){
967967
Blob wiki; /* Wiki page content */
968968
Blob cksum; /* wiki checksum */
969969
int rid; /* artifact ID of parent page */
970970
char *zDate; /* timestamp */
971971
char *zUuid; /* uuid for rid */
972
-
972
+
973973
rid = db_int(0,
974974
"SELECT x.rid FROM tag t, tagxref x"
975975
" WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
976976
" ORDER BY x.mtime DESC LIMIT 1",
977977
zPageName
@@ -1058,12 +1058,12 @@
10581058
if( n==0 ){
10591059
goto wiki_cmd_usage;
10601060
}
10611061
10621062
if( strncmp(g.argv[2],"export",n)==0 ){
1063
- char const *zPageName; /* Name of the wiki page to export */
1064
- char const *zFile; /* Name of the output file (0=stdout) */
1063
+ const char *zPageName; /* Name of the wiki page to export */
1064
+ const char *zFile; /* Name of the output file (0=stdout) */
10651065
int rid; /* Artifact ID of the wiki page */
10661066
int i; /* Loop counter */
10671067
char *zBody = 0; /* Wiki page content */
10681068
Blob body; /* Wiki page content */
10691069
Manifest *pWiki = 0; /* Parsed wiki page content */
@@ -1091,15 +1091,15 @@
10911091
blob_reset(&body);
10921092
manifest_destroy(pWiki);
10931093
return;
10941094
}else if( strncmp(g.argv[2],"commit",n)==0
10951095
|| strncmp(g.argv[2],"create",n)==0 ){
1096
- char const *zPageName; /* page name */
1096
+ const char *zPageName; /* page name */
10971097
Blob content; /* Input content */
10981098
int rid;
10991099
Manifest *pWiki = 0; /* Parsed wiki page content */
1100
- char const * zMimeType = find_option("mimetype", "M", 1);
1100
+ const char *zMimeType = find_option("mimetype", "M", 1);
11011101
if( g.argc!=4 && g.argc!=5 ){
11021102
usage("commit|create PAGENAME ?FILE? [-mimetype TEXT-FORMAT]");
11031103
}
11041104
zPageName = g.argv[3];
11051105
if( g.argc==4 ){
11061106
--- src/wiki.c
+++ src/wiki.c
@@ -860,11 +860,11 @@
860 ** URL: /wfind?title=TITLE
861 ** List all wiki pages whose titles contain the search text
862 */
863 void wfind_page(void){
864 Stmt q;
865 const char * zTitle;
866 login_check_credentials();
867 if( !g.perm.RdWiki ){ login_needed(); return; }
868 zTitle = PD("title","*");
869 style_header("Wiki Pages Found");
870 @ <ul>
@@ -960,18 +960,18 @@
960 **
961 ** zMimeType specifies the N-card for the wiki page. If it is 0,
962 ** empty, or "text/x-fossil-wiki" (the default format) then it is
963 ** ignored.
964 */
965 int wiki_cmd_commit(char const * zPageName, int isNew, Blob *pContent,
966 char const * zMimeType){
967 Blob wiki; /* Wiki page content */
968 Blob cksum; /* wiki checksum */
969 int rid; /* artifact ID of parent page */
970 char *zDate; /* timestamp */
971 char *zUuid; /* uuid for rid */
972
973 rid = db_int(0,
974 "SELECT x.rid FROM tag t, tagxref x"
975 " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
976 " ORDER BY x.mtime DESC LIMIT 1",
977 zPageName
@@ -1058,12 +1058,12 @@
1058 if( n==0 ){
1059 goto wiki_cmd_usage;
1060 }
1061
1062 if( strncmp(g.argv[2],"export",n)==0 ){
1063 char const *zPageName; /* Name of the wiki page to export */
1064 char const *zFile; /* Name of the output file (0=stdout) */
1065 int rid; /* Artifact ID of the wiki page */
1066 int i; /* Loop counter */
1067 char *zBody = 0; /* Wiki page content */
1068 Blob body; /* Wiki page content */
1069 Manifest *pWiki = 0; /* Parsed wiki page content */
@@ -1091,15 +1091,15 @@
1091 blob_reset(&body);
1092 manifest_destroy(pWiki);
1093 return;
1094 }else if( strncmp(g.argv[2],"commit",n)==0
1095 || strncmp(g.argv[2],"create",n)==0 ){
1096 char const *zPageName; /* page name */
1097 Blob content; /* Input content */
1098 int rid;
1099 Manifest *pWiki = 0; /* Parsed wiki page content */
1100 char const * zMimeType = find_option("mimetype", "M", 1);
1101 if( g.argc!=4 && g.argc!=5 ){
1102 usage("commit|create PAGENAME ?FILE? [-mimetype TEXT-FORMAT]");
1103 }
1104 zPageName = g.argv[3];
1105 if( g.argc==4 ){
1106
--- src/wiki.c
+++ src/wiki.c
@@ -860,11 +860,11 @@
860 ** URL: /wfind?title=TITLE
861 ** List all wiki pages whose titles contain the search text
862 */
863 void wfind_page(void){
864 Stmt q;
865 const char *zTitle;
866 login_check_credentials();
867 if( !g.perm.RdWiki ){ login_needed(); return; }
868 zTitle = PD("title","*");
869 style_header("Wiki Pages Found");
870 @ <ul>
@@ -960,18 +960,18 @@
960 **
961 ** zMimeType specifies the N-card for the wiki page. If it is 0,
962 ** empty, or "text/x-fossil-wiki" (the default format) then it is
963 ** ignored.
964 */
965 int wiki_cmd_commit(const char *zPageName, int isNew, Blob *pContent,
966 const char *zMimeType){
967 Blob wiki; /* Wiki page content */
968 Blob cksum; /* wiki checksum */
969 int rid; /* artifact ID of parent page */
970 char *zDate; /* timestamp */
971 char *zUuid; /* uuid for rid */
972
973 rid = db_int(0,
974 "SELECT x.rid FROM tag t, tagxref x"
975 " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
976 " ORDER BY x.mtime DESC LIMIT 1",
977 zPageName
@@ -1058,12 +1058,12 @@
1058 if( n==0 ){
1059 goto wiki_cmd_usage;
1060 }
1061
1062 if( strncmp(g.argv[2],"export",n)==0 ){
1063 const char *zPageName; /* Name of the wiki page to export */
1064 const char *zFile; /* Name of the output file (0=stdout) */
1065 int rid; /* Artifact ID of the wiki page */
1066 int i; /* Loop counter */
1067 char *zBody = 0; /* Wiki page content */
1068 Blob body; /* Wiki page content */
1069 Manifest *pWiki = 0; /* Parsed wiki page content */
@@ -1091,15 +1091,15 @@
1091 blob_reset(&body);
1092 manifest_destroy(pWiki);
1093 return;
1094 }else if( strncmp(g.argv[2],"commit",n)==0
1095 || strncmp(g.argv[2],"create",n)==0 ){
1096 const char *zPageName; /* page name */
1097 Blob content; /* Input content */
1098 int rid;
1099 Manifest *pWiki = 0; /* Parsed wiki page content */
1100 const char *zMimeType = find_option("mimetype", "M", 1);
1101 if( g.argc!=4 && g.argc!=5 ){
1102 usage("commit|create PAGENAME ?FILE? [-mimetype TEXT-FORMAT]");
1103 }
1104 zPageName = g.argv[3];
1105 if( g.argc==4 ){
1106

Keyboard Shortcuts

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