@@ -75,20 +75,19 @@ LOCAL void pbLabel( SI pgfmt, SI row, SI col, SI wid, const char *label);
7575
7676// =========================================================================
7777void CDEC pgbuildr (
78- /* declared new way for passing FLOATs 2-90. DOES *NOT* WORK: MSC 5.1 passes floats in variable arg list double. */
7978
8079 // Add text to a pgpak page per tables; optionally allocs, outputs (via cpnat.c), frees.
8180
8281 char **ppp, /* NULL to use internal page ptr (2-90), or ptr to page ptr (may be updated on return).
8382 CAUTION: if ptr ptr given but page is alloc here (row nz), ptr must contain NULL or valid, freeable DM ptr. */
8483 RC *prc, /* If *prc is not RCOK, pgbuildr() does *NOTHING*;
8584 otherwise outcome of this operation is returned in *prc (non-RCOK if console interrupt, printer error, etc). */
86- SI rows, /* Size of page to alloc, or row 0 if *ppp already alloc'd. */
87- SI cols, /* .. */
88- SI rOff, /* Row offset for *ALL* rows specified in all actions in this call: shifts display down w/o changing
85+ int rows, /* Size of page to alloc, or row 0 if *ppp already alloc'd. */
86+ int cols, /* .. */
87+ int rOff, /* Row offset for *ALL* rows specified in all actions in this call: shifts display down w/o changing
8988 many table entries. Typical use: make blank space above title (idx'd methods).
9089 [ CAUTION: avoid both nz rOff and > 1 PGCUR in table rows. fixing this bug 2-90.] */
91- char *title, /* NULL or Title to appear PGLJ at position (1+rOff,1).
90+ const char *title, /* NULL or Title to appear PGLJ at position (1+rOff,1).
9291 " continued" is appended if table head repeated on continuation print page.
9392 Allow for row used by title in PBHEAD.val2 with PBTABLE, PBFILLREC. */
9493
@@ -119,12 +118,6 @@ void CDEC pgbuildr(
119118
120119// *prc remains RCOK if allocation, addition, and output completed ok; else nz. Errors have been reported (using WRN).
121120{
122- va_list argp; // Working pointer for variable args
123- USI meth;
124- SI keepgoing;
125- RC rc;
126- char *rp = nullptr ;
127- char *tp;
128121 /* Size table -- !! MUST match PBxxxx method type defns in cpgbuild.c. Used to increment pointer through method driver tables.
129122 Currently not used by methods involving PBM_IDX (such as PB_TABCOL and PB_FILLREC), but they are in table anyway */
130123 static char sizetab[] = {
@@ -141,7 +134,10 @@ void CDEC pgbuildr(
141134 if (*prc != RCOK)
142135 return ;
143136
137+ char *rp = nullptr ;
138+
144139 /* Initialize */
140+ va_list argp; // Working pointer for variable args
145141 va_start ( argp, title);
146142
147143 /* some arguments to file-globals for use by internal subfunctions */
@@ -166,10 +162,10 @@ void CDEC pgbuildr(
166162
167163 /* Loop over arguments */
168164
169- keepgoing = TRUE ; /* Loop termination flag, tested at end of loop */
165+ bool keepgoing = true ; /* Loop termination flag, tested at end of loop */
170166 do
171167 {
172- rc = RCOK; /* no error yet this arg */
168+ RC rc = RCOK; /* no error yet this arg */
173169 pbHd = va_arg ( argp, PBHEAD *); /* Ptr to PBHEAD, or spec fcn. file-global used by callees. */
174170 if (pbHd==NULL )
175171 continue ; /* skip NULL args */
@@ -202,8 +198,8 @@ void CDEC pgbuildr(
202198 /* Other arguments: output per method */
203199
204200 {
205- meth = (pbHd->methopt ) & PBMTHMASK; /* Formatting method */
206- tp = (char *)pbHd->methtab ; /* method table pointer, actual type depends on meth. */
201+ int meth = (pbHd->methopt ) & PBMTHMASK; /* Formatting method */
202+ char * tp = (char *)pbHd->methtab ; /* method table pointer, actual type depends on meth. */
207203 if (meth & PBM_RP) /* method bit says rp arg follows */
208204 rp = va_arg (argp, char *); /* Pick up record pointer */
209205 /* pbIdxMth() and its callees also picks up additional arguments */
@@ -222,16 +218,16 @@ void CDEC pgbuildr(
222218
223219 while ( ((PB_TEXT *)tp)->pgfmt != PBMETHEND )
224220 {
225- SI wid = 0 ;
226- SI units, cvfmt;
227- SI off;
228- USI dt;
221+ int wid = 0 ;
222+ int units, cvfmt;
223+ int off;
224+ int dt;
229225 char *p;
230226
231227 /* prefetch .pgfmt,.row,.col for cases where struct matches PBTEXT (all cases except those without .col, 2-90) */
232- SI pgfmt = ((PB_TEXT *)tp)->pgfmt | PGGROW; /* pgpak format. PGGROW: say enlarge page if necess */
233- SI row = ROWOFF ( ((PB_TEXT *)tp)->row ); /* ROWOFF: adds pbROff if not PGCUR-relative */
234- SI col = ((PB_TEXT *)tp)->col ;
228+ int pgfmt = ((PB_TEXT *)tp)->pgfmt | PGGROW; /* pgpak format. PGGROW: say enlarge page if necess */
229+ int row = ROWOFF ( ((PB_TEXT *)tp)->row ); /* ROWOFF: adds pbROff if not PGCUR-relative */
230+ int col = ((PB_TEXT *)tp)->col ;
235231
236232 /* more common init */
237233 const char * label = nullptr ; // default no label: for shared case code
@@ -297,17 +293,17 @@ void CDEC pgbuildr(
297293 cvfmt = ((PB_DATA *)tp)->cvfmt ; /* get cvpak fmt */
298294offJoin: /* PBDATOFF/L join here */
299295 if (dt==(USI)PBARGSI) /* on special value get dt */
300- dt = va_arg ( argp, USI ); /* ...from pgbuildr arg list*/
296+ dt = va_arg ( argp, int ); /* ...from pgbuildr arg list*/
301297 if (p==NULL ) /* for NULL data ptr */
302298 dt = DTUNDEF; /* show '?' (historical) */
303299 /* NB if both in arg list, dt precedes data */
304300
305301 if (units==PBARGSI) /* spec value says */
306- units = va_arg ( argp, SI ); /* get from arg list*/
302+ units = va_arg ( argp, int ); /* get from arg list*/
307303 if (wid==PBARGSI) /* spec value says */
308- wid = va_arg ( argp, SI ); /* get from arg list*/
304+ wid = va_arg ( argp, int ); /* get from arg list*/
309305 if (cvfmt==PBARGSI) /* spec value says */
310- cvfmt = va_arg ( argp, SI ); /* get from arg list*/
306+ cvfmt = va_arg ( argp, int ); /* get from arg list*/
311307 if (p==PBOMITP) /* ptr value omits output & label */
312308 {
313309 /* s is "" from above (write anyway for PGCUR) */
0 commit comments