Fossil SCM

Fix variable declaration order to block-top; keeps the C89 conformance.

ashepilko 2020-07-17 22:05 trunk
Commit 0cb6e03443f96985fa834d9345468669f1c6de42263d059bc6a39e55732c61c3
2 files changed +1 -1 +5 -3
+1 -1
--- src/graph.c
+++ src/graph.c
@@ -737,15 +737,15 @@
737737
** iReuseRail = -1; */
738738
isCherrypick = 1;
739739
}
740740
pDesc = hashFind(p, parentRid);
741741
if( pDesc==0 ){
742
+ int iMrail = -1;
742743
/* Merge from a node that is off-screen */
743744
if( iReuseIdx>=p->nRow+1 ){
744745
continue; /* Suppress multiple off-screen merges */
745746
}
746
- int iMrail = -1;
747747
for(j=0; j<GR_MAX_RAIL; j++){
748748
if( mergeRiserFrom[j]==parentRid ){
749749
iMrail = j;
750750
break;
751751
}
752752
--- src/graph.c
+++ src/graph.c
@@ -737,15 +737,15 @@
737 ** iReuseRail = -1; */
738 isCherrypick = 1;
739 }
740 pDesc = hashFind(p, parentRid);
741 if( pDesc==0 ){
 
742 /* Merge from a node that is off-screen */
743 if( iReuseIdx>=p->nRow+1 ){
744 continue; /* Suppress multiple off-screen merges */
745 }
746 int iMrail = -1;
747 for(j=0; j<GR_MAX_RAIL; j++){
748 if( mergeRiserFrom[j]==parentRid ){
749 iMrail = j;
750 break;
751 }
752
--- src/graph.c
+++ src/graph.c
@@ -737,15 +737,15 @@
737 ** iReuseRail = -1; */
738 isCherrypick = 1;
739 }
740 pDesc = hashFind(p, parentRid);
741 if( pDesc==0 ){
742 int iMrail = -1;
743 /* Merge from a node that is off-screen */
744 if( iReuseIdx>=p->nRow+1 ){
745 continue; /* Suppress multiple off-screen merges */
746 }
 
747 for(j=0; j<GR_MAX_RAIL; j++){
748 if( mergeRiserFrom[j]==parentRid ){
749 iMrail = j;
750 break;
751 }
752
+5 -3
--- src/hook.c
+++ src/hook.c
@@ -272,14 +272,15 @@
272272
nSeq = zSeq ? atoi(zSeq) : 10;
273273
if( g.argc<4 ) usage("delete ID ...");
274274
db_begin_write();
275275
for(i=3; i<g.argc; i++){
276276
Blob sql;
277
+ int id;
277278
if( sqlite3_strglob("*[^0-9]*", g.argv[i])==0 ){
278279
fossil_fatal("not a valid ID: \"%s\"", g.argv[i]);
279280
}
280
- int id = atoi(g.argv[i]);
281
+ id = atoi(g.argv[i]);
281282
blob_init(&sql, 0, 0);
282283
blob_append_sql(&sql, "UPDATE config SET mtime=now(), value="
283284
"json_replace(CASE WHEN json_valid(value) THEN value ELSE '[]' END");
284285
if( zCmd ){
285286
blob_append_sql(&sql, ",'$[%d].cmd',%Q", id, zCmd);
@@ -324,12 +325,12 @@
324325
}
325326
db_commit_transaction();
326327
}else
327328
if( strncmp(zCmd, "list", nCmd)==0 ){
328329
Stmt q;
329
- verify_all_options();
330330
int n = 0;
331
+ verify_all_options();
331332
db_prepare(&q,
332333
"SELECT jx.key,"
333334
" json_extract(jx.value,'$.seq'),"
334335
" json_extract(jx.value,'$.cmd'),"
335336
" json_extract(jx.value,'$.type')"
@@ -356,17 +357,18 @@
356357
}
357358
db_finalize(&q);
358359
}else
359360
if( strncmp(zCmd, "test", nCmd)==0 ){
360361
Stmt q;
362
+ int id;
361363
int bDryRun = find_option("dry-run", "n", 0)!=0;
362364
const char *zOrigRcvid = find_option("base-rcvid",0,1);
363365
const char *zNewRcvid = find_option("new-rcvid",0,1);
364366
const char *zAuxFilename = find_option("aux-file",0,1);
365367
verify_all_options();
366368
if( g.argc<4 ) usage("test ID");
367
- int id = atoi(g.argv[3]);
369
+ id = atoi(g.argv[3]);
368370
if( zOrigRcvid==0 ){
369371
zOrigRcvid = db_text(0, "SELECT max(rcvid)-1 FROM rcvfrom");
370372
}
371373
db_prepare(&q,
372374
"SELECT json_extract(value,'$[%d].cmd'), "
373375
--- src/hook.c
+++ src/hook.c
@@ -272,14 +272,15 @@
272 nSeq = zSeq ? atoi(zSeq) : 10;
273 if( g.argc<4 ) usage("delete ID ...");
274 db_begin_write();
275 for(i=3; i<g.argc; i++){
276 Blob sql;
 
277 if( sqlite3_strglob("*[^0-9]*", g.argv[i])==0 ){
278 fossil_fatal("not a valid ID: \"%s\"", g.argv[i]);
279 }
280 int id = atoi(g.argv[i]);
281 blob_init(&sql, 0, 0);
282 blob_append_sql(&sql, "UPDATE config SET mtime=now(), value="
283 "json_replace(CASE WHEN json_valid(value) THEN value ELSE '[]' END");
284 if( zCmd ){
285 blob_append_sql(&sql, ",'$[%d].cmd',%Q", id, zCmd);
@@ -324,12 +325,12 @@
324 }
325 db_commit_transaction();
326 }else
327 if( strncmp(zCmd, "list", nCmd)==0 ){
328 Stmt q;
329 verify_all_options();
330 int n = 0;
 
331 db_prepare(&q,
332 "SELECT jx.key,"
333 " json_extract(jx.value,'$.seq'),"
334 " json_extract(jx.value,'$.cmd'),"
335 " json_extract(jx.value,'$.type')"
@@ -356,17 +357,18 @@
356 }
357 db_finalize(&q);
358 }else
359 if( strncmp(zCmd, "test", nCmd)==0 ){
360 Stmt q;
 
361 int bDryRun = find_option("dry-run", "n", 0)!=0;
362 const char *zOrigRcvid = find_option("base-rcvid",0,1);
363 const char *zNewRcvid = find_option("new-rcvid",0,1);
364 const char *zAuxFilename = find_option("aux-file",0,1);
365 verify_all_options();
366 if( g.argc<4 ) usage("test ID");
367 int id = atoi(g.argv[3]);
368 if( zOrigRcvid==0 ){
369 zOrigRcvid = db_text(0, "SELECT max(rcvid)-1 FROM rcvfrom");
370 }
371 db_prepare(&q,
372 "SELECT json_extract(value,'$[%d].cmd'), "
373
--- src/hook.c
+++ src/hook.c
@@ -272,14 +272,15 @@
272 nSeq = zSeq ? atoi(zSeq) : 10;
273 if( g.argc<4 ) usage("delete ID ...");
274 db_begin_write();
275 for(i=3; i<g.argc; i++){
276 Blob sql;
277 int id;
278 if( sqlite3_strglob("*[^0-9]*", g.argv[i])==0 ){
279 fossil_fatal("not a valid ID: \"%s\"", g.argv[i]);
280 }
281 id = atoi(g.argv[i]);
282 blob_init(&sql, 0, 0);
283 blob_append_sql(&sql, "UPDATE config SET mtime=now(), value="
284 "json_replace(CASE WHEN json_valid(value) THEN value ELSE '[]' END");
285 if( zCmd ){
286 blob_append_sql(&sql, ",'$[%d].cmd',%Q", id, zCmd);
@@ -324,12 +325,12 @@
325 }
326 db_commit_transaction();
327 }else
328 if( strncmp(zCmd, "list", nCmd)==0 ){
329 Stmt q;
 
330 int n = 0;
331 verify_all_options();
332 db_prepare(&q,
333 "SELECT jx.key,"
334 " json_extract(jx.value,'$.seq'),"
335 " json_extract(jx.value,'$.cmd'),"
336 " json_extract(jx.value,'$.type')"
@@ -356,17 +357,18 @@
357 }
358 db_finalize(&q);
359 }else
360 if( strncmp(zCmd, "test", nCmd)==0 ){
361 Stmt q;
362 int id;
363 int bDryRun = find_option("dry-run", "n", 0)!=0;
364 const char *zOrigRcvid = find_option("base-rcvid",0,1);
365 const char *zNewRcvid = find_option("new-rcvid",0,1);
366 const char *zAuxFilename = find_option("aux-file",0,1);
367 verify_all_options();
368 if( g.argc<4 ) usage("test ID");
369 id = atoi(g.argv[3]);
370 if( zOrigRcvid==0 ){
371 zOrigRcvid = db_text(0, "SELECT max(rcvid)-1 FROM rcvfrom");
372 }
373 db_prepare(&q,
374 "SELECT json_extract(value,'$[%d].cmd'), "
375

Keyboard Shortcuts

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