ObjFW  Check-in [4465a415f1]

Overview
Comment:Two minor cleanups - no functional change
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4465a415f1bb404878b17a24c698d014927d0e95668c7372dff8b309482c4609
User & Date: js on 2017-10-15 23:05:06
Other Links: manifest | tags
Context
2017-10-16
22:49
Update buildsys check-in: d6cf08de94 user: js tags: trunk
2017-10-15
23:05
Two minor cleanups - no functional change check-in: 4465a415f1 user: js tags: trunk
22:49
Rename __GCC_VERSION__ to OF_GCC_VERSION check-in: 60214356c2 user: js tags: trunk
Changes

Modified src/invocation/invoke-x86_64.m from [3e46ff1eb1] to [4cabeb7ba5].

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164

static void
pushLongDoublePair(struct call_context **context, long double value[2])
{
	size_t stackSize;
	struct call_context *newContext;

	stackSize = OF_ROUND_UP_POW2(2, (*context)->stackSize) + 4;

	if ((newContext = realloc(*context,
	    sizeof(**context) + stackSize * 8)) == NULL) {
		free(*context);
		@throw [OFOutOfMemoryException exceptionWithRequestedSize:
		    sizeof(**context) + stackSize * 8];
	}







|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164

static void
pushLongDoublePair(struct call_context **context, long double value[2])
{
	size_t stackSize;
	struct call_context *newContext;

	stackSize = OF_ROUND_UP_POW2(2UL, (*context)->stackSize) + 4;

	if ((newContext = realloc(*context,
	    sizeof(**context) + stackSize * 8)) == NULL) {
		free(*context);
		@throw [OFOutOfMemoryException exceptionWithRequestedSize:
		    sizeof(**context) + stackSize * 8];
	}

Modified src/macros.h from [52d18b1a04] to [15e6f8eafc].

389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
#define OF_DESTRUCTOR(prio)					\
	static void __attribute__((__destructor__(prio)))	\
	OF_PREPROCESSOR_CONCAT(destructor, __LINE__)(void)

static OF_INLINE uint16_t OF_CONST_FUNC
OF_BSWAP16_CONST(uint16_t i)
{
	return (i & UINT16_C(0xFF00)) >> 8 |
	    (i & UINT16_C(0x00FF)) << 8;
}

static OF_INLINE uint32_t OF_CONST_FUNC
OF_BSWAP32_CONST(uint32_t i)
{
	return (i & UINT32_C(0xFF000000)) >> 24 |
	    (i & UINT32_C(0x00FF0000)) >>  8 |
	    (i & UINT32_C(0x0000FF00)) <<  8 |
	    (i & UINT32_C(0x000000FF)) << 24;
}

static OF_INLINE uint64_t OF_CONST_FUNC
OF_BSWAP64_CONST(uint64_t i)
{
	return (i & UINT64_C(0xFF00000000000000)) >> 56 |
	    (i & UINT64_C(0x00FF000000000000)) >> 40 |
	    (i & UINT64_C(0x0000FF0000000000)) >> 24 |
	    (i & UINT64_C(0x000000FF00000000)) >>  8 |
	    (i & UINT64_C(0x00000000FF000000)) <<  8 |
	    (i & UINT64_C(0x0000000000FF0000)) << 24 |
	    (i & UINT64_C(0x000000000000FF00)) << 40 |
	    (i & UINT64_C(0x00000000000000FF)) << 56;
}

static OF_INLINE uint16_t OF_CONST_FUNC
OF_BSWAP16_NONCONST(uint16_t i)
{
#if defined(OF_HAVE_BUILTIN_BSWAP16)
	return __builtin_bswap16(i);







|
<





|
<
|
<





|
<
|
<
|
<
|
<







389
390
391
392
393
394
395
396

397
398
399
400
401
402

403

404
405
406
407
408
409

410

411

412

413
414
415
416
417
418
419
#define OF_DESTRUCTOR(prio)					\
	static void __attribute__((__destructor__(prio)))	\
	OF_PREPROCESSOR_CONCAT(destructor, __LINE__)(void)

static OF_INLINE uint16_t OF_CONST_FUNC
OF_BSWAP16_CONST(uint16_t i)
{
	return (i & 0xFF00) >> 8 | (i & 0x00FF) << 8;

}

static OF_INLINE uint32_t OF_CONST_FUNC
OF_BSWAP32_CONST(uint32_t i)
{
	return (i & 0xFF000000) >> 24 | (i & 0x00FF0000) >> 8 |

	    (i & 0x0000FF00) << 8 | (i & 0x000000FF) << 24;

}

static OF_INLINE uint64_t OF_CONST_FUNC
OF_BSWAP64_CONST(uint64_t i)
{
	return (i & 0xFF00000000000000) >> 56 | (i & 0x00FF000000000000) >> 40 |

	    (i & 0x0000FF0000000000) >> 24 | (i & 0x000000FF00000000) >> 8 |

	    (i & 0x00000000FF000000) << 8 | (i & 0x0000000000FF0000) << 24 |

	    (i & 0x000000000000FF00) << 40 | (i & 0x00000000000000FF) << 56;

}

static OF_INLINE uint16_t OF_CONST_FUNC
OF_BSWAP16_NONCONST(uint16_t i)
{
#if defined(OF_HAVE_BUILTIN_BSWAP16)
	return __builtin_bswap16(i);