=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/term.c,v retrieving revision 1.52 retrieving revision 1.53 diff -c -r1.52 -r1.53 *** src/usr.bin/mandoc/term.c 2010/10/01 21:38:26 1.52 --- src/usr.bin/mandoc/term.c 2010/10/02 15:11:54 1.53 *************** *** 1,4 **** ! /* $Id: term.c,v 1.52 2010/10/01 21:38:26 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze --- 1,4 ---- ! /* $Id: term.c,v 1.53 2010/10/02 15:11:54 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze *************** *** 142,165 **** * an indentation, but can be, for tagged lists or columns, a * small set of values. */ - assert(p->offset < p->rmargin); - - maxvis = (int)(p->rmargin - p->offset) - p->overstep < 0 ? - /* LINTED */ - 0 : p->rmargin - p->offset - p->overstep; - mmax = (int)(p->maxrmargin - p->offset) - p->overstep < 0 ? - /* LINTED */ - 0 : p->maxrmargin - p->offset - p->overstep; - bp = TERMP_NOBREAK & p->flags ? mmax : maxvis; /* * Indent the first line of a paragraph. */ ! vbl = p->flags & TERMP_NOLPAD ? 0 : p->offset; ! vis = vend = i = 0; while (i < (int)p->col) { /* --- 142,162 ---- * an indentation, but can be, for tagged lists or columns, a * small set of values. */ + assert (p->rmargin > p->offset); + dv = p->rmargin - p->offset; + maxvis = (int)dv > p->overstep ? dv - (size_t)p->overstep : 0; + dv = p->maxrmargin - p->offset; + mmax = (int)dv > p->overstep ? dv - (size_t)p->overstep : 0; bp = TERMP_NOBREAK & p->flags ? mmax : maxvis; /* * Indent the first line of a paragraph. */ ! vbl = p->flags & TERMP_NOLPAD ? (size_t)0 : p->offset; ! vis = vend = 0; ! i = 0; while (i < (int)p->col) { /* *************** *** 180,186 **** * space is printed according to regular spacing rules). */ - /* LINTED */ for (j = i, jhy = 0; j < (int)p->col; j++) { if ((j && ' ' == p->buf[j]) || '\t' == p->buf[j]) break; --- 177,182 ---- *************** *** 219,226 **** /* Remove the p->overstep width. */ ! bp += (int)/* LINTED */ ! p->overstep; p->overstep = 0; } --- 215,221 ---- /* Remove the p->overstep width. */ ! bp += (size_t)p->overstep; p->overstep = 0; } *************** *** 234,240 **** j = i; while (' ' == p->buf[i]) i++; ! dv = (i - j) * (*p->width)(p, ' '); vbl += dv; vend += dv; break; --- 229,235 ---- j = i; while (' ' == p->buf[i]) i++; ! dv = (size_t)(i - j) * (*p->width)(p, ' '); vbl += dv; vend += dv; break; *************** *** 283,290 **** if (TERMP_HANG & p->flags) { /* We need one blank after the tag. */ ! p->overstep = /* LINTED */ ! vis - maxvis + (*p->width)(p, ' '); /* * Behave exactly the same way as groff: --- 278,284 ---- if (TERMP_HANG & p->flags) { /* We need one blank after the tag. */ ! p->overstep = (int)(vis - maxvis + (*p->width)(p, ' ')); /* * Behave exactly the same way as groff: *************** *** 298,305 **** */ if (p->overstep >= -1) { assert((int)maxvis + p->overstep >= 0); ! /* LINTED */ ! maxvis += p->overstep; } else p->overstep = 0; --- 292,298 ---- */ if (p->overstep >= -1) { assert((int)maxvis + p->overstep >= 0); ! maxvis += (size_t)p->overstep; } else p->overstep = 0; *************** *** 307,315 **** return; /* Right-pad. */ ! if (maxvis > vis + /* LINTED */ ! ((TERMP_TWOSPACE & p->flags) ? ! (*p->width)(p, ' ') : 0)) { p->viscol += maxvis - vis; (*p->advance)(p, maxvis - vis); vis += (maxvis - vis); --- 300,307 ---- return; /* Right-pad. */ ! if (maxvis > vis + ! ((TERMP_TWOSPACE & p->flags) ? (*p->width)(p, ' ') : 0)) { p->viscol += maxvis - vis; (*p->advance)(p, maxvis - vis); vis += (maxvis - vis);