comparison lib/vasnprintf.c @ 4886:e4317f1f2e2c

Use size_t instead of ssize_t.
author Bruno Haible <bruno@clisp.org>
date Tue, 25 Nov 2003 11:18:46 +0000
parents 9b96adbed643
children a2cb70e482fc
comparison
equal deleted inserted replaced
4885:3ecffbe2fb59 4886:e4317f1f2e2c
220 /* Execute a single directive. */ 220 /* Execute a single directive. */
221 if (dp->conversion == '%') 221 if (dp->conversion == '%')
222 { 222 {
223 size_t augmented_length; 223 size_t augmented_length;
224 224
225 if (!(dp->arg_index < 0)) 225 if (!(dp->arg_index == ARG_NONE))
226 abort (); 226 abort ();
227 augmented_length = xsum (length, 1); 227 augmented_length = xsum (length, 1);
228 ENSURE_ALLOCATION (augmented_length); 228 ENSURE_ALLOCATION (augmented_length);
229 result[length] = '%'; 229 result[length] = '%';
230 length = augmented_length; 230 length = augmented_length;
231 } 231 }
232 else 232 else
233 { 233 {
234 if (!(dp->arg_index >= 0)) 234 if (!(dp->arg_index != ARG_NONE))
235 abort (); 235 abort ();
236 236
237 if (dp->conversion == 'n') 237 if (dp->conversion == 'n')
238 { 238 {
239 switch (a.arg[dp->arg_index].type) 239 switch (a.arg[dp->arg_index].type)
277 size_t precision; 277 size_t precision;
278 278
279 width = 0; 279 width = 0;
280 if (dp->width_start != dp->width_end) 280 if (dp->width_start != dp->width_end)
281 { 281 {
282 if (dp->width_arg_index >= 0) 282 if (dp->width_arg_index != ARG_NONE)
283 { 283 {
284 int arg; 284 int arg;
285 285
286 if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) 286 if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
287 abort (); 287 abort ();
299 } 299 }
300 300
301 precision = 6; 301 precision = 6;
302 if (dp->precision_start != dp->precision_end) 302 if (dp->precision_start != dp->precision_end)
303 { 303 {
304 if (dp->precision_arg_index >= 0) 304 if (dp->precision_arg_index != ARG_NONE)
305 { 305 {
306 int arg; 306 int arg;
307 307
308 if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) 308 if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
309 abort (); 309 abort ();
561 p[1] = '\0'; 561 p[1] = '\0';
562 #endif 562 #endif
563 563
564 /* Construct the arguments for calling snprintf or sprintf. */ 564 /* Construct the arguments for calling snprintf or sprintf. */
565 prefix_count = 0; 565 prefix_count = 0;
566 if (dp->width_arg_index >= 0) 566 if (dp->width_arg_index != ARG_NONE)
567 { 567 {
568 if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) 568 if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
569 abort (); 569 abort ();
570 prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; 570 prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
571 } 571 }
572 if (dp->precision_arg_index >= 0) 572 if (dp->precision_arg_index != ARG_NONE)
573 { 573 {
574 if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) 574 if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
575 abort (); 575 abort ();
576 prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; 576 prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
577 } 577 }