Differences From Artifact [fa426a4240]:
- File
src/of_asprintf.m
— part of check-in
[619cced011]
at
2013-11-22 18:23:37
on branch trunk
— of_asprintf.m: Fix coding style.
This file still used the very old coding style. (user: js, size: 12393) [annotate] [blame] [check-ins using]
To Artifact [0f6776e0aa]:
- File src/of_asprintf.m — part of check-in [e803913a9d] at 2013-11-22 19:27:05 on branch trunk — of_asprintf: Add %C format specifier. (user: js, size: 12764) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #include <stdbool.h> #include <wchar.h> #include <sys/types.h> #import "OFString.h" #import "asprintf.h" #import "autorelease.h" #import "macros.h" #define MAX_SUBFORMAT_LEN 64 struct context { | > > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #include <stdbool.h> #include <wchar.h> #include <sys/types.h> #import "OFString.h" #import "OFInvalidEncodingException.h" #import "asprintf.h" #import "autorelease.h" #import "macros.h" #define MAX_SUBFORMAT_LEN 64 struct context { |
︙ | ︙ | |||
308 309 310 311 312 313 314 315 316 317 318 319 320 321 | } else tmpLen = asprintf(&tmp, ctx->subformat, "(nil)"); } @catch (id e) { free(ctx->buffer); @throw e; } break; case 'd': case 'i': switch (ctx->lengthModifier) { case LENGTH_MODIFIER_NONE: case LENGTH_MODIFIER_HH: | > > > > > > > > > > > > > > > > | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | } else tmpLen = asprintf(&tmp, ctx->subformat, "(nil)"); } @catch (id e) { free(ctx->buffer); @throw e; } break; case 'C': ctx->subformat[ctx->subformatLen - 1] = 's'; { char buffer[5]; size_t len = of_string_utf8_encode( va_arg(ctx->arguments, of_unichar_t), buffer); if (len == 0) @throw [OFInvalidEncodingException exception]; buffer[len] = 0; tmpLen = asprintf(&tmp, ctx->subformat, buffer); } break; case 'd': case 'i': switch (ctx->lengthModifier) { case LENGTH_MODIFIER_NONE: case LENGTH_MODIFIER_HH: |
︙ | ︙ |