Mercurial > hg > th-libs
comparison th_string.c @ 284:5a467b40800a
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 22 Feb 2016 13:43:28 +0200 |
parents | 2b76cc316205 |
children | e1414cf8fef8 |
comparison
equal
deleted
inserted
replaced
283:2b76cc316205 | 284:5a467b40800a |
---|---|
132 if ((ret = vputch(ctx, padChar)) == EOF) | 132 if ((ret = vputch(ctx, padChar)) == EOF) |
133 return ret; | 133 return ret; |
134 } | 134 } |
135 return 0; | 135 return 0; |
136 } | 136 } |
137 | |
137 | 138 |
138 static int th_printf_vput_int(th_printf_ctx *ctx, th_printf_vputch vputch, | 139 static int th_printf_vput_int(th_printf_ctx *ctx, th_printf_vputch vputch, |
139 int pval, const int radix, const char padMode, const char padChar, | 140 int pval, const int radix, const char padMode, const char padChar, |
140 const int width, const BOOL unsig, const BOOL upcase, const BOOL sign) | 141 const int width, const BOOL unsig, const BOOL upcase, const BOOL sign) |
141 { | 142 { |
252 BOOL sign = FALSE; | 253 BOOL sign = FALSE; |
253 int width = 0, prec = -1; | 254 int width = 0, prec = -1; |
254 | 255 |
255 fmt++; | 256 fmt++; |
256 | 257 |
257 // Check sign | 258 // Check for field sign |
258 if (*fmt == '+') | 259 if (*fmt == '+') |
259 { | 260 { |
260 sign = TRUE; | 261 sign = TRUE; |
261 fmt++; | 262 fmt++; |
262 } | 263 } |
275 | 276 |
276 if (*fmt == 0) | 277 if (*fmt == 0) |
277 return -102; | 278 return -102; |
278 } | 279 } |
279 | 280 |
280 // Get width | 281 // Get field width |
281 while (th_isdigit(*fmt)) | 282 while (th_isdigit(*fmt)) |
282 width = width * 10 + (*fmt++ - '0'); | 283 width = width * 10 + (*fmt++ - '0'); |
283 | 284 |
284 // Check for precision | 285 // Check for precision |
285 if (*fmt == '.') | 286 if (*fmt == '.') |