diff options
author | Thomas White <taw@physics.org> | 2018-02-18 19:48:22 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-02-19 20:19:04 +0100 |
commit | 889bff2106db15c5bb7100e7fdd6f14ad6ae2bd5 (patch) | |
tree | 1edfd15832470fb43376376dca1933c5d06827a0 /src/debugger.c | |
parent | 66d7abfe17971edc86ac3b06b272d9234f0b4cfe (diff) |
Remove text run SCBlock offset
The \newpara change (commit 7f2d0abd) removed the only situation when the
start of a run might not coincide with the start of an SCBlock, or vice-versa
(although not all SCBlocks correspond to text runs, obviously).
Therefore, the offset is always zero and can be removed, simplifying the code.
Diffstat (limited to 'src/debugger.c')
-rw-r--r-- | src/debugger.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/debugger.c b/src/debugger.c index 39a5cb4..c5aaa1f 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -45,7 +45,6 @@ struct run_debug int np; size_t len; void *scblock; /* Don't you dare try to dereference this */ - size_t offs; size_t para_offs; }; @@ -117,14 +116,14 @@ static void debug_text_para(Paragraph *para, cairo_t *cr, double *ypos, plot_text(cr, ypos, fontdesc, tmp); for ( i=0; i<nrun; i++ ) { - size_t scblock_offs, para_offs, len; + size_t para_offs, len; SCBlock *scblock; - if ( para_debug_run_info(para, i, &len, &scblock, &scblock_offs, ¶_offs) ) { + if ( para_debug_run_info(para, i, &len, &scblock, ¶_offs) ) { plot_text(cr, ypos, fontdesc, "Error"); } else { - snprintf(tmp, 255, " Run %i: len %li, SCBlock %p offs %li, para offs %li", - i, len, scblock, scblock_offs, para_offs); + snprintf(tmp, 255, " Run %i: len %li, SCBlock %p, para offs %li", + i, len, scblock, para_offs); plot_text(cr, ypos, fontdesc, tmp); if ( len != rd[*dpos].len ) { snprintf(tmp, 255, " (len was %li)", rd[*dpos].len); @@ -136,11 +135,6 @@ static void debug_text_para(Paragraph *para, cairo_t *cr, double *ypos, plot_text(cr, ypos, fontdesc, tmp); (*changesig) += i*(*dpos)*para_offs*(*ypos); } - if ( scblock_offs != rd[*dpos].offs ) { - snprintf(tmp, 255, " (offs was %li)", rd[*dpos].offs); - plot_text(cr, ypos, fontdesc, tmp); - (*changesig) += i*(*dpos)*scblock_offs*(*ypos); - } (*dpos)++; } @@ -172,11 +166,11 @@ static void record_runs(struct debugwindow *dbgw) for ( j=0; j<nrun; j++ ) { - size_t scblock_offs, para_offs, len; + size_t para_offs, len; SCBlock *scblock; if ( para_debug_run_info(para, j, &len, &scblock, - &scblock_offs, ¶_offs) ) + ¶_offs) ) { continue; } @@ -184,7 +178,6 @@ static void record_runs(struct debugwindow *dbgw) dbgw->runs[n].np = i; dbgw->runs[n].len = len; dbgw->runs[n].scblock = scblock; - dbgw->runs[n].offs = scblock_offs; dbgw->runs[n].para_offs = para_offs; n++; |