commit fa8f1e7fdae47c124d217edb3ef5a572fe8bde54 from: Sven M. Hallberg date: Sat Jul 01 15:59:24 2023 UTC make nchars a size_t Why did this have an explicitly sized type before? commit - 963e1d10638a4572ff325b27e4a463fdbd2f6227 commit + fa8f1e7fdae47c124d217edb3ef5a572fe8bde54 blob - 86e7584321c6804465db47414debf9c5e43fd5ce blob + 8c4789e3ee82116b33fb707ce2326d534449ab33 --- pdf.c +++ pdf.c @@ -195,7 +195,7 @@ struct textmat { double cell[6]; }; struct textstr { uint8_t *text; - uint32_t nchars; + size_t nchars; const HParsedToken *tobj; }; @@ -1341,11 +1341,11 @@ pp_textentry(FILE *stream, const HParsedToken *tok, in case TW_Tj: case TW_Tq: case TW_Tqq: - fprintf(stream, "len=%u, ", txte->tstr.nchars); + fprintf(stream, "len=%zu, ", txte->tstr.nchars); fwrite((const void *)txte->tstr.text, (int) txte->tstr.nchars, 1, stream); break; case TW_TJ: - fprintf(stream, "len=%u, ", txte->tarray.flattened.nchars); + fprintf(stream, "len=%zu, ", txte->tarray.flattened.nchars); fwrite((const void *)txte->tarray.flattened.text, (int) txte->tarray.flattened.nchars, 1, stream); break; @@ -2217,7 +2217,7 @@ text_extract(struct Env *aux, const char *outfn, const pp_fontinfo(stream2, &txte->node->ts, ft); else fputs("\nMissing Font Info!!\n", stream2); - fwrite(tstr->text, 1, (size_t)tstr->nchars, stream2); + fwrite(tstr->text, 1, tstr->nchars, stream2); } if (outfn) fwrite(tstr->text, 1, (size_t)tstr->nchars, stream);