Mercurial > hg > th-libs
changeset 411:371567cf0a38
Add some XXX TODO FIXME in here :P
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 09 Mar 2016 12:10:41 +0200 |
parents | 04cb03baf114 |
children | 4852ebc17575 |
files | th_string.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/th_string.c Wed Mar 09 12:07:10 2016 +0200 +++ b/th_string.c Wed Mar 09 12:10:41 2016 +0200 @@ -246,6 +246,11 @@ (f_neg ? '-' : ((f_flags & TH_PF_SPACE) ? ' ' : 0))); // Calculate necessary padding, etc + // + // << XXX TODO FIXME: The logic here is not very elegant, and it's incorrect + // at least for some alternate format modifier cases. + // + int nlen = (f_sign ? 1 : 0) + (f_altstr ? strlen(f_altstr) : 0); int qlen = (f_prec > f_len ? f_prec : f_len) + nlen; @@ -276,6 +281,8 @@ PP_PRINTF(": vret=%3d, f_flags=[%s], f_unsig=%d, f_sign='%c', f_len=%3d, f_width=%3d, f_prec=%3d, nwidth=%3d, nprec=%3d, qlen=%3d\n", vret, get_flags(f_flags), f_unsig, f_sign ? f_sign : '?', f_len, f_width, f_prec, nwidth, nprec, qlen); + // << XXX TODO FIXME + // Prefix padding if ((ret = th_printf_pad_pre(ctx, vputch, nwidth, f_flags)) == EOF) return ret;