ObjFW  Check-in [58f7af5290]

Overview
Comment:Handle q length modifier in of_asprintf on iOS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 58f7af5290d18babab2d37d2b2db3087e1d96fb86bcd040f0fec1b90e38eabd8
User & Date: js on 2011-06-26 00:45:51
Other Links: manifest | tags
Context
2011-06-26
00:59
Check for buggy -Wcast-align. check-in: 05b17b8de4 user: js tags: trunk
00:45
Handle q length modifier in of_asprintf on iOS. check-in: 58f7af5290 user: js tags: trunk
00:40
Copy serialization.xml to iOS host. check-in: c36c369395 user: js tags: trunk
Changes

Modified src/of_asprintf.m from [0950c4780b] to [5101db410e].

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_SUBFORMAT_LEN 64

struct context {
	const char *format;
	size_t formatLen;
	char subformat[MAX_SUBFORMAT_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_SUBFORMAT_LEN 64

struct context {
	const char *format;
	size_t formatLen;
	char subformat[MAX_SUBFORMAT_LEN + 1];
232
233
234
235
236
237
238









239
240
241
242
243
244
245
				return false;

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










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

		break;
	}







>
>
>
>
>
>
>
>
>







234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
				return false;

			ctx->i += 2;
			ctx->lengthModifier = 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;
	}