ObjFW  Check-in [3092cda94b]

Overview
Comment:Handle q length modifier in of_asprintf on iOS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 0.5
Files: files | file ages | folders
SHA3-256: 3092cda94b1051409fc52ab7a45cfa3a8d74729cb0e1e5e4fbc5b34dce3af49c
User & Date: js on 2011-06-26 00:45:51
Other Links: branch diff | manifest | tags
Context
2011-06-30
20:50
of_asprintf: Work around Win32 breaking C99 standard length modifiers. check-in: 4075c85e25 user: js tags: 0.5
2011-06-26
00:59
Check for buggy -Wcast-align. check-in: 9653fe1e73 user: js tags: 0.5
00:45
Handle q length modifier in of_asprintf on iOS. check-in: 3092cda94b user: js tags: 0.5
Changes

Modified src/of_asprintf.m from [379e3421b7] to [e3742f904d].

22
23
24
25
26
27
28


29
30
31
32
33
34
35
#include <stdarg.h>
#include <stdbool.h>
#include <wchar.h>

#import "OFString.h"
#import "OFAutoreleasePool.h"
#import "asprintf.h"



#define MAX_SUBFMT_LEN 64

struct context {
	const char *fmt;
	size_t fmt_len;
	char subfmt[MAX_SUBFMT_LEN + 1];







>
>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdarg.h>
#include <stdbool.h>
#include <wchar.h>

#import "OFString.h"
#import "OFAutoreleasePool.h"
#import "asprintf.h"

#import "macros.h"

#define MAX_SUBFMT_LEN 64

struct context {
	const char *fmt;
	size_t fmt_len;
	char subfmt[MAX_SUBFMT_LEN + 1];
228
229
230
231
232
233
234









235
236
237
238
239
240
241
				return false;

			ctx->i += 2;
			ctx->len_mod = LENGTH_MODIFIER_LL;
		} else
			ctx->i--;










		break;
#endif
	default:
		ctx->i--;

		break;
	}







>
>
>
>
>
>
>
>
>







230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
				return false;

			ctx->i += 2;
			ctx->len_mod = LENGTH_MODIFIER_LL;
		} else
			ctx->i--;

		break;
#endif
#ifdef OF_IOS
	case 'q': /* iOS uses this for PRI?64 */
		if (!appendSubformat(ctx, ctx->format + ctx->i, 1))
			return false;

		ctx->lengthModifier = LENGTH_MODIFIER_LL;

		break;
#endif
	default:
		ctx->i--;

		break;
	}