Fossil SCM

Removed some dead code in /json/timeline/wiki.

stephan 2012-03-10 03:59 trunk
Commit fe5cf37e665214c0a85088d1b6c213f708f31ff0
1 file changed +1 -10
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -494,11 +494,10 @@
494494
*/
495495
cson_value * json_timeline_wiki(){
496496
/* This code is 95% the same as json_timeline_ci(), by the way. */
497497
cson_value * payV = NULL;
498498
cson_object * pay = NULL;
499
- cson_value * tmp = NULL;
500499
cson_array * list = NULL;
501500
int check = 0;
502501
Stmt q = empty_Stmt;
503502
Blob sql = empty_blob;
504503
if( !g.perm.RdWiki && !g.perm.Read ){
@@ -511,16 +510,10 @@
511510
if(check){
512511
json_set_err(check, "Query initialization failed.");
513512
goto error;
514513
}
515514
516
-#define SET(K) if(0!=(check=cson_object_set(pay,K,tmp))){ \
517
- json_set_err((cson_rc.AllocError==check) \
518
- ? FSL_JSON_E_ALLOC : FSL_JSON_E_UNKNOWN, \
519
- "Object property insertion failed."); \
520
- goto error;\
521
- } (void)0
522515
#if 0
523516
/* only for testing! */
524517
tmp = cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)));
525518
SET("timelineSql");
526519
#endif
@@ -543,14 +536,12 @@
543536
#endif
544537
" FROM json_timeline"
545538
" ORDER BY rowid",
546539
-1);
547540
list = cson_new_array();
548
- tmp = cson_array_value(list);
549
- SET("timeline");
550541
json_stmt_to_array_of_obj(&q, list);
551
-#undef SET
542
+ cson_object_set(pay, "timeline", cson_array_value(list));
552543
goto ok;
553544
error:
554545
assert( 0 != g.json.resultCode );
555546
cson_value_free(payV);
556547
payV = NULL;
557548
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -494,11 +494,10 @@
494 */
495 cson_value * json_timeline_wiki(){
496 /* This code is 95% the same as json_timeline_ci(), by the way. */
497 cson_value * payV = NULL;
498 cson_object * pay = NULL;
499 cson_value * tmp = NULL;
500 cson_array * list = NULL;
501 int check = 0;
502 Stmt q = empty_Stmt;
503 Blob sql = empty_blob;
504 if( !g.perm.RdWiki && !g.perm.Read ){
@@ -511,16 +510,10 @@
511 if(check){
512 json_set_err(check, "Query initialization failed.");
513 goto error;
514 }
515
516 #define SET(K) if(0!=(check=cson_object_set(pay,K,tmp))){ \
517 json_set_err((cson_rc.AllocError==check) \
518 ? FSL_JSON_E_ALLOC : FSL_JSON_E_UNKNOWN, \
519 "Object property insertion failed."); \
520 goto error;\
521 } (void)0
522 #if 0
523 /* only for testing! */
524 tmp = cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)));
525 SET("timelineSql");
526 #endif
@@ -543,14 +536,12 @@
543 #endif
544 " FROM json_timeline"
545 " ORDER BY rowid",
546 -1);
547 list = cson_new_array();
548 tmp = cson_array_value(list);
549 SET("timeline");
550 json_stmt_to_array_of_obj(&q, list);
551 #undef SET
552 goto ok;
553 error:
554 assert( 0 != g.json.resultCode );
555 cson_value_free(payV);
556 payV = NULL;
557
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -494,11 +494,10 @@
494 */
495 cson_value * json_timeline_wiki(){
496 /* This code is 95% the same as json_timeline_ci(), by the way. */
497 cson_value * payV = NULL;
498 cson_object * pay = NULL;
 
499 cson_array * list = NULL;
500 int check = 0;
501 Stmt q = empty_Stmt;
502 Blob sql = empty_blob;
503 if( !g.perm.RdWiki && !g.perm.Read ){
@@ -511,16 +510,10 @@
510 if(check){
511 json_set_err(check, "Query initialization failed.");
512 goto error;
513 }
514
 
 
 
 
 
 
515 #if 0
516 /* only for testing! */
517 tmp = cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)));
518 SET("timelineSql");
519 #endif
@@ -543,14 +536,12 @@
536 #endif
537 " FROM json_timeline"
538 " ORDER BY rowid",
539 -1);
540 list = cson_new_array();
 
 
541 json_stmt_to_array_of_obj(&q, list);
542 cson_object_set(pay, "timeline", cson_array_value(list));
543 goto ok;
544 error:
545 assert( 0 != g.json.resultCode );
546 cson_value_free(payV);
547 payV = NULL;
548

Keyboard Shortcuts

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