| 347 | typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1]; |
| 348 | |
| 349 | static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v) |
| 350 | { |
| 351 | while (*fmt) { |
| 352 | switch (*fmt++) { |
| 353 | case ' ': break; |
| 354 | case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int)); |
| 355 | s->func(s->context,&x,1); |
| 356 | break; } |
| 357 | case '2': { int x = va_arg(v,int); |
| 358 | unsigned char b[2]; |
| 359 | b[0] = STBIW_UCHAR(x); |
| 360 | b[1] = STBIW_UCHAR(x>>8); |
| 361 | s->func(s->context,b,2); |
| 362 | break; } |
| 363 | case '4': { stbiw_uint32 x = va_arg(v,int); |
| 364 | unsigned char b[4]; |
| 365 | b[0]=STBIW_UCHAR(x); |
| 366 | b[1]=STBIW_UCHAR(x>>8); |
| 367 | b[2]=STBIW_UCHAR(x>>16); |
| 368 | b[3]=STBIW_UCHAR(x>>24); |
| 369 | s->func(s->context,b,4); |
| 370 | break; } |
| 371 | default: |
| 372 | STBIW_ASSERT(0); |
| 373 | return; |
| 374 | } |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | static void stbiw__writef(stbi__write_context *s, const char *fmt, ...) |
| 379 | { |
no outgoing calls
no test coverage detected