Fossil SCM
Remove unused variables in the annotation engine.
Commit
305e3951cc08685443915d5887a973bf31df75e5
Parent
89bf6f13f9c407c…
1 file changed
+2
-13
+2
-13
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2191,21 +2191,17 @@ | ||
| 2191 | 2191 | struct Annotator { |
| 2192 | 2192 | DContext c; /* The diff-engine context */ |
| 2193 | 2193 | struct AnnLine { /* Lines of the original files... */ |
| 2194 | 2194 | const char *z; /* The text of the line */ |
| 2195 | 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 */ | |
| 2196 | + short int iVers; /* Level at which tag was set */ | |
| 2198 | 2197 | } *aOrig; |
| 2199 | 2198 | int nOrig; /* Number of elements in aOrig[] */ |
| 2200 | - int nNoSrc; /* Number of entries where aOrig[].zSrc==NULL */ | |
| 2201 | - int iLevel; /* Current level */ | |
| 2202 | 2199 | int nVers; /* Number of versions analyzed */ |
| 2203 | 2200 | struct AnnVers { |
| 2204 | 2201 | const char *zFUuid; /* File being analyzed */ |
| 2205 | 2202 | const char *zMUuid; /* Check-in containing the file */ |
| 2206 | - const char *zUser; /* User who did the check-in */ | |
| 2207 | 2203 | const char *zDate; /* Date of the check-in */ |
| 2208 | 2204 | const char *zBgColor; /* Suggested background color */ |
| 2209 | 2205 | unsigned cnt; /* Number of lines contributed by this check-in */ |
| 2210 | 2206 | } *aVers; /* For each check-in analyzed */ |
| 2211 | 2207 | char **azVers; /* Names of versions analyzed */ |
| @@ -2257,11 +2253,10 @@ | ||
| 2257 | 2253 | diff_all(&p->c); |
| 2258 | 2254 | |
| 2259 | 2255 | /* Where new lines are inserted on this difference, record the |
| 2260 | 2256 | ** iVers as the source of the new line. |
| 2261 | 2257 | */ |
| 2262 | - p->iLevel++; | |
| 2263 | 2258 | for(i=lnTo=0; i<p->c.nEdit; i+=3){ |
| 2264 | 2259 | int nCopy = p->c.aEdit[i]; |
| 2265 | 2260 | int nIns = p->c.aEdit[i+2]; |
| 2266 | 2261 | lnTo += nCopy; |
| 2267 | 2262 | for(j=0; j<nIns; j++, lnTo++){ |
| @@ -2302,11 +2297,10 @@ | ||
| 2302 | 2297 | int annFlags /* Flags to alter the annotation */ |
| 2303 | 2298 | ){ |
| 2304 | 2299 | Blob toAnnotate; /* Text of the final (mid) version of the file */ |
| 2305 | 2300 | Blob step; /* Text of previous revision */ |
| 2306 | 2301 | int rid; /* Artifact ID of the file being annotated */ |
| 2307 | - char *zLabel; /* Label to apply to a line */ | |
| 2308 | 2302 | Stmt q; /* Query returning all ancestor versions */ |
| 2309 | 2303 | Stmt ins; /* Inserts into the temporary VSEEN table */ |
| 2310 | 2304 | int cnt = 0; /* Number of versions examined */ |
| 2311 | 2305 | |
| 2312 | 2306 | /* Initialize the annotation */ |
| @@ -2328,11 +2322,10 @@ | ||
| 2328 | 2322 | db_prepare(&ins, "INSERT OR IGNORE INTO vseen(rid) VALUES(:rid)"); |
| 2329 | 2323 | db_prepare(&q, |
| 2330 | 2324 | "SELECT (SELECT uuid FROM blob WHERE rid=mlink.fid)," |
| 2331 | 2325 | " (SELECT uuid FROM blob WHERE rid=mlink.mid)," |
| 2332 | 2326 | " date(event.mtime)," |
| 2333 | - " coalesce(event.euser,event.user)," | |
| 2334 | 2327 | " mlink.pid" |
| 2335 | 2328 | " FROM mlink, event" |
| 2336 | 2329 | " WHERE mlink.fid=:rid" |
| 2337 | 2330 | " AND event.objid=mlink.mid" |
| 2338 | 2331 | " AND mlink.pid NOT IN vseen" |
| @@ -2342,16 +2335,15 @@ | ||
| 2342 | 2335 | ); |
| 2343 | 2336 | |
| 2344 | 2337 | db_bind_int(&q, ":rid", rid); |
| 2345 | 2338 | if( iLimit==0 ) iLimit = 1000000000; |
| 2346 | 2339 | 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); | |
| 2348 | 2341 | p->aVers = fossil_realloc(p->aVers, (p->nVers+1)*sizeof(p->aVers[0])); |
| 2349 | 2342 | p->aVers[p->nVers].zFUuid = fossil_strdup(db_column_text(&q, 0)); |
| 2350 | 2343 | p->aVers[p->nVers].zMUuid = fossil_strdup(db_column_text(&q, 1)); |
| 2351 | 2344 | 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 | 2345 | if( p->nVers ){ |
| 2354 | 2346 | content_get(rid, &step); |
| 2355 | 2347 | annotation_step(p, &step, p->nVers-1); |
| 2356 | 2348 | blob_reset(&step); |
| 2357 | 2349 | } |
| @@ -2471,11 +2463,10 @@ | ||
| 2471 | 2463 | clr2 = 0xb5e0ff; /* Older changes: blue (cold) */ |
| 2472 | 2464 | } |
| 2473 | 2465 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2474 | 2466 | clr = gradient_color(clr1, clr2, ann.nVers-1, i); |
| 2475 | 2467 | ann.aVers[i].zBgColor = mprintf("#%06x", clr); |
| 2476 | - ann.aVers[i].zUser = mprintf("%h", ann.aVers[i].zUser); | |
| 2477 | 2468 | } |
| 2478 | 2469 | |
| 2479 | 2470 | if( showLog ){ |
| 2480 | 2471 | @ <h2>Versions analyzed:</h2> |
| 2481 | 2472 | @ <ol> |
| @@ -2514,11 +2505,10 @@ | ||
| 2514 | 2505 | }else{ |
| 2515 | 2506 | zLn[0] = 0; |
| 2516 | 2507 | } |
| 2517 | 2508 | @ <pre> |
| 2518 | 2509 | for(i=0; i<ann.nOrig; i++){ |
| 2519 | - struct AnnVers *p; | |
| 2520 | 2510 | int iVers = ann.aOrig[i].iVers; |
| 2521 | 2511 | char *z = (char*)ann.aOrig[i].z; |
| 2522 | 2512 | int n = ann.aOrig[i].n; |
| 2523 | 2513 | char zPrefix[300]; |
| 2524 | 2514 | z[n] = 0; |
| @@ -2612,11 +2602,10 @@ | ||
| 2612 | 2602 | i+1, p->zDate, p->zMUuid, p->zFUuid); |
| 2613 | 2603 | } |
| 2614 | 2604 | fossil_print("---------------------------------------------------\n"); |
| 2615 | 2605 | } |
| 2616 | 2606 | for(i=0; i<ann.nOrig; i++){ |
| 2617 | - struct AnnVers *p; | |
| 2618 | 2607 | int iVers = ann.aOrig[i].iVers; |
| 2619 | 2608 | char *z = (char*)ann.aOrig[i].z; |
| 2620 | 2609 | int n = ann.aOrig[i].n; |
| 2621 | 2610 | char zPrefix[200]; |
| 2622 | 2611 | z[n] = 0; |
| 2623 | 2612 |
| --- 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 |