Fossil SCM

Remove unused variables in the annotation engine.

drh 2013-05-25 01:57 trunk
Commit 305e3951cc08685443915d5887a973bf31df75e5
1 file changed +2 -13
+2 -13
--- src/diff.c
+++ src/diff.c
@@ -2191,21 +2191,17 @@
21912191
struct Annotator {
21922192
DContext c; /* The diff-engine context */
21932193
struct AnnLine { /* Lines of the original files... */
21942194
const char *z; /* The text of the line */
21952195
short int n; /* Number of bytes (omitting trailing space and \n) */
2196
- short int iLevel; /* Level at which tag was set */
2197
- int iVers; /* aVers[] entry responsible for this line */
2196
+ short int iVers; /* Level at which tag was set */
21982197
} *aOrig;
21992198
int nOrig; /* Number of elements in aOrig[] */
2200
- int nNoSrc; /* Number of entries where aOrig[].zSrc==NULL */
2201
- int iLevel; /* Current level */
22022199
int nVers; /* Number of versions analyzed */
22032200
struct AnnVers {
22042201
const char *zFUuid; /* File being analyzed */
22052202
const char *zMUuid; /* Check-in containing the file */
2206
- const char *zUser; /* User who did the check-in */
22072203
const char *zDate; /* Date of the check-in */
22082204
const char *zBgColor; /* Suggested background color */
22092205
unsigned cnt; /* Number of lines contributed by this check-in */
22102206
} *aVers; /* For each check-in analyzed */
22112207
char **azVers; /* Names of versions analyzed */
@@ -2257,11 +2253,10 @@
22572253
diff_all(&p->c);
22582254
22592255
/* Where new lines are inserted on this difference, record the
22602256
** iVers as the source of the new line.
22612257
*/
2262
- p->iLevel++;
22632258
for(i=lnTo=0; i<p->c.nEdit; i+=3){
22642259
int nCopy = p->c.aEdit[i];
22652260
int nIns = p->c.aEdit[i+2];
22662261
lnTo += nCopy;
22672262
for(j=0; j<nIns; j++, lnTo++){
@@ -2302,11 +2297,10 @@
23022297
int annFlags /* Flags to alter the annotation */
23032298
){
23042299
Blob toAnnotate; /* Text of the final (mid) version of the file */
23052300
Blob step; /* Text of previous revision */
23062301
int rid; /* Artifact ID of the file being annotated */
2307
- char *zLabel; /* Label to apply to a line */
23082302
Stmt q; /* Query returning all ancestor versions */
23092303
Stmt ins; /* Inserts into the temporary VSEEN table */
23102304
int cnt = 0; /* Number of versions examined */
23112305
23122306
/* Initialize the annotation */
@@ -2328,11 +2322,10 @@
23282322
db_prepare(&ins, "INSERT OR IGNORE INTO vseen(rid) VALUES(:rid)");
23292323
db_prepare(&q,
23302324
"SELECT (SELECT uuid FROM blob WHERE rid=mlink.fid),"
23312325
" (SELECT uuid FROM blob WHERE rid=mlink.mid),"
23322326
" date(event.mtime),"
2333
- " coalesce(event.euser,event.user),"
23342327
" mlink.pid"
23352328
" FROM mlink, event"
23362329
" WHERE mlink.fid=:rid"
23372330
" AND event.objid=mlink.mid"
23382331
" AND mlink.pid NOT IN vseen"
@@ -2342,16 +2335,15 @@
23422335
);
23432336
23442337
db_bind_int(&q, ":rid", rid);
23452338
if( iLimit==0 ) iLimit = 1000000000;
23462339
while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){
2347
- int prevId = db_column_int(&q, 4);
2340
+ int prevId = db_column_int(&q, 3);
23482341
p->aVers = fossil_realloc(p->aVers, (p->nVers+1)*sizeof(p->aVers[0]));
23492342
p->aVers[p->nVers].zFUuid = fossil_strdup(db_column_text(&q, 0));
23502343
p->aVers[p->nVers].zMUuid = fossil_strdup(db_column_text(&q, 1));
23512344
p->aVers[p->nVers].zDate = fossil_strdup(db_column_text(&q, 2));
2352
- p->aVers[p->nVers].zUser = fossil_strdup(db_column_text(&q, 3));
23532345
if( p->nVers ){
23542346
content_get(rid, &step);
23552347
annotation_step(p, &step, p->nVers-1);
23562348
blob_reset(&step);
23572349
}
@@ -2471,11 +2463,10 @@
24712463
clr2 = 0xb5e0ff; /* Older changes: blue (cold) */
24722464
}
24732465
for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
24742466
clr = gradient_color(clr1, clr2, ann.nVers-1, i);
24752467
ann.aVers[i].zBgColor = mprintf("#%06x", clr);
2476
- ann.aVers[i].zUser = mprintf("%h", ann.aVers[i].zUser);
24772468
}
24782469
24792470
if( showLog ){
24802471
@ <h2>Versions analyzed:</h2>
24812472
@ <ol>
@@ -2514,11 +2505,10 @@
25142505
}else{
25152506
zLn[0] = 0;
25162507
}
25172508
@ <pre>
25182509
for(i=0; i<ann.nOrig; i++){
2519
- struct AnnVers *p;
25202510
int iVers = ann.aOrig[i].iVers;
25212511
char *z = (char*)ann.aOrig[i].z;
25222512
int n = ann.aOrig[i].n;
25232513
char zPrefix[300];
25242514
z[n] = 0;
@@ -2612,11 +2602,10 @@
26122602
i+1, p->zDate, p->zMUuid, p->zFUuid);
26132603
}
26142604
fossil_print("---------------------------------------------------\n");
26152605
}
26162606
for(i=0; i<ann.nOrig; i++){
2617
- struct AnnVers *p;
26182607
int iVers = ann.aOrig[i].iVers;
26192608
char *z = (char*)ann.aOrig[i].z;
26202609
int n = ann.aOrig[i].n;
26212610
char zPrefix[200];
26222611
z[n] = 0;
26232612
--- src/diff.c
+++ src/diff.c
@@ -2191,21 +2191,17 @@
2191 struct Annotator {
2192 DContext c; /* The diff-engine context */
2193 struct AnnLine { /* Lines of the original files... */
2194 const char *z; /* The text of the line */
2195 short int n; /* Number of bytes (omitting trailing space and \n) */
2196 short int iLevel; /* Level at which tag was set */
2197 int iVers; /* aVers[] entry responsible for this line */
2198 } *aOrig;
2199 int nOrig; /* Number of elements in aOrig[] */
2200 int nNoSrc; /* Number of entries where aOrig[].zSrc==NULL */
2201 int iLevel; /* Current level */
2202 int nVers; /* Number of versions analyzed */
2203 struct AnnVers {
2204 const char *zFUuid; /* File being analyzed */
2205 const char *zMUuid; /* Check-in containing the file */
2206 const char *zUser; /* User who did the check-in */
2207 const char *zDate; /* Date of the check-in */
2208 const char *zBgColor; /* Suggested background color */
2209 unsigned cnt; /* Number of lines contributed by this check-in */
2210 } *aVers; /* For each check-in analyzed */
2211 char **azVers; /* Names of versions analyzed */
@@ -2257,11 +2253,10 @@
2257 diff_all(&p->c);
2258
2259 /* Where new lines are inserted on this difference, record the
2260 ** iVers as the source of the new line.
2261 */
2262 p->iLevel++;
2263 for(i=lnTo=0; i<p->c.nEdit; i+=3){
2264 int nCopy = p->c.aEdit[i];
2265 int nIns = p->c.aEdit[i+2];
2266 lnTo += nCopy;
2267 for(j=0; j<nIns; j++, lnTo++){
@@ -2302,11 +2297,10 @@
2302 int annFlags /* Flags to alter the annotation */
2303 ){
2304 Blob toAnnotate; /* Text of the final (mid) version of the file */
2305 Blob step; /* Text of previous revision */
2306 int rid; /* Artifact ID of the file being annotated */
2307 char *zLabel; /* Label to apply to a line */
2308 Stmt q; /* Query returning all ancestor versions */
2309 Stmt ins; /* Inserts into the temporary VSEEN table */
2310 int cnt = 0; /* Number of versions examined */
2311
2312 /* Initialize the annotation */
@@ -2328,11 +2322,10 @@
2328 db_prepare(&ins, "INSERT OR IGNORE INTO vseen(rid) VALUES(:rid)");
2329 db_prepare(&q,
2330 "SELECT (SELECT uuid FROM blob WHERE rid=mlink.fid),"
2331 " (SELECT uuid FROM blob WHERE rid=mlink.mid),"
2332 " date(event.mtime),"
2333 " coalesce(event.euser,event.user),"
2334 " mlink.pid"
2335 " FROM mlink, event"
2336 " WHERE mlink.fid=:rid"
2337 " AND event.objid=mlink.mid"
2338 " AND mlink.pid NOT IN vseen"
@@ -2342,16 +2335,15 @@
2342 );
2343
2344 db_bind_int(&q, ":rid", rid);
2345 if( iLimit==0 ) iLimit = 1000000000;
2346 while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){
2347 int prevId = db_column_int(&q, 4);
2348 p->aVers = fossil_realloc(p->aVers, (p->nVers+1)*sizeof(p->aVers[0]));
2349 p->aVers[p->nVers].zFUuid = fossil_strdup(db_column_text(&q, 0));
2350 p->aVers[p->nVers].zMUuid = fossil_strdup(db_column_text(&q, 1));
2351 p->aVers[p->nVers].zDate = fossil_strdup(db_column_text(&q, 2));
2352 p->aVers[p->nVers].zUser = fossil_strdup(db_column_text(&q, 3));
2353 if( p->nVers ){
2354 content_get(rid, &step);
2355 annotation_step(p, &step, p->nVers-1);
2356 blob_reset(&step);
2357 }
@@ -2471,11 +2463,10 @@
2471 clr2 = 0xb5e0ff; /* Older changes: blue (cold) */
2472 }
2473 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2474 clr = gradient_color(clr1, clr2, ann.nVers-1, i);
2475 ann.aVers[i].zBgColor = mprintf("#%06x", clr);
2476 ann.aVers[i].zUser = mprintf("%h", ann.aVers[i].zUser);
2477 }
2478
2479 if( showLog ){
2480 @ <h2>Versions analyzed:</h2>
2481 @ <ol>
@@ -2514,11 +2505,10 @@
2514 }else{
2515 zLn[0] = 0;
2516 }
2517 @ <pre>
2518 for(i=0; i<ann.nOrig; i++){
2519 struct AnnVers *p;
2520 int iVers = ann.aOrig[i].iVers;
2521 char *z = (char*)ann.aOrig[i].z;
2522 int n = ann.aOrig[i].n;
2523 char zPrefix[300];
2524 z[n] = 0;
@@ -2612,11 +2602,10 @@
2612 i+1, p->zDate, p->zMUuid, p->zFUuid);
2613 }
2614 fossil_print("---------------------------------------------------\n");
2615 }
2616 for(i=0; i<ann.nOrig; i++){
2617 struct AnnVers *p;
2618 int iVers = ann.aOrig[i].iVers;
2619 char *z = (char*)ann.aOrig[i].z;
2620 int n = ann.aOrig[i].n;
2621 char zPrefix[200];
2622 z[n] = 0;
2623
--- src/diff.c
+++ src/diff.c
@@ -2191,21 +2191,17 @@
2191 struct Annotator {
2192 DContext c; /* The diff-engine context */
2193 struct AnnLine { /* Lines of the original files... */
2194 const char *z; /* The text of the line */
2195 short int n; /* Number of bytes (omitting trailing space and \n) */
2196 short int iVers; /* Level at which tag was set */
 
2197 } *aOrig;
2198 int nOrig; /* Number of elements in aOrig[] */
 
 
2199 int nVers; /* Number of versions analyzed */
2200 struct AnnVers {
2201 const char *zFUuid; /* File being analyzed */
2202 const char *zMUuid; /* Check-in containing the file */
 
2203 const char *zDate; /* Date of the check-in */
2204 const char *zBgColor; /* Suggested background color */
2205 unsigned cnt; /* Number of lines contributed by this check-in */
2206 } *aVers; /* For each check-in analyzed */
2207 char **azVers; /* Names of versions analyzed */
@@ -2257,11 +2253,10 @@
2253 diff_all(&p->c);
2254
2255 /* Where new lines are inserted on this difference, record the
2256 ** iVers as the source of the new line.
2257 */
 
2258 for(i=lnTo=0; i<p->c.nEdit; i+=3){
2259 int nCopy = p->c.aEdit[i];
2260 int nIns = p->c.aEdit[i+2];
2261 lnTo += nCopy;
2262 for(j=0; j<nIns; j++, lnTo++){
@@ -2302,11 +2297,10 @@
2297 int annFlags /* Flags to alter the annotation */
2298 ){
2299 Blob toAnnotate; /* Text of the final (mid) version of the file */
2300 Blob step; /* Text of previous revision */
2301 int rid; /* Artifact ID of the file being annotated */
 
2302 Stmt q; /* Query returning all ancestor versions */
2303 Stmt ins; /* Inserts into the temporary VSEEN table */
2304 int cnt = 0; /* Number of versions examined */
2305
2306 /* Initialize the annotation */
@@ -2328,11 +2322,10 @@
2322 db_prepare(&ins, "INSERT OR IGNORE INTO vseen(rid) VALUES(:rid)");
2323 db_prepare(&q,
2324 "SELECT (SELECT uuid FROM blob WHERE rid=mlink.fid),"
2325 " (SELECT uuid FROM blob WHERE rid=mlink.mid),"
2326 " date(event.mtime),"
 
2327 " mlink.pid"
2328 " FROM mlink, event"
2329 " WHERE mlink.fid=:rid"
2330 " AND event.objid=mlink.mid"
2331 " AND mlink.pid NOT IN vseen"
@@ -2342,16 +2335,15 @@
2335 );
2336
2337 db_bind_int(&q, ":rid", rid);
2338 if( iLimit==0 ) iLimit = 1000000000;
2339 while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){
2340 int prevId = db_column_int(&q, 3);
2341 p->aVers = fossil_realloc(p->aVers, (p->nVers+1)*sizeof(p->aVers[0]));
2342 p->aVers[p->nVers].zFUuid = fossil_strdup(db_column_text(&q, 0));
2343 p->aVers[p->nVers].zMUuid = fossil_strdup(db_column_text(&q, 1));
2344 p->aVers[p->nVers].zDate = fossil_strdup(db_column_text(&q, 2));
 
2345 if( p->nVers ){
2346 content_get(rid, &step);
2347 annotation_step(p, &step, p->nVers-1);
2348 blob_reset(&step);
2349 }
@@ -2471,11 +2463,10 @@
2463 clr2 = 0xb5e0ff; /* Older changes: blue (cold) */
2464 }
2465 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2466 clr = gradient_color(clr1, clr2, ann.nVers-1, i);
2467 ann.aVers[i].zBgColor = mprintf("#%06x", clr);
 
2468 }
2469
2470 if( showLog ){
2471 @ <h2>Versions analyzed:</h2>
2472 @ <ol>
@@ -2514,11 +2505,10 @@
2505 }else{
2506 zLn[0] = 0;
2507 }
2508 @ <pre>
2509 for(i=0; i<ann.nOrig; i++){
 
2510 int iVers = ann.aOrig[i].iVers;
2511 char *z = (char*)ann.aOrig[i].z;
2512 int n = ann.aOrig[i].n;
2513 char zPrefix[300];
2514 z[n] = 0;
@@ -2612,11 +2602,10 @@
2602 i+1, p->zDate, p->zMUuid, p->zFUuid);
2603 }
2604 fossil_print("---------------------------------------------------\n");
2605 }
2606 for(i=0; i<ann.nOrig; i++){
 
2607 int iVers = ann.aOrig[i].iVers;
2608 char *z = (char*)ann.aOrig[i].z;
2609 int n = ann.aOrig[i].n;
2610 char zPrefix[200];
2611 z[n] = 0;
2612

Keyboard Shortcuts

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