ObjFW  Diff

Differences From Artifact [793bb737f0]:

To Artifact [9c903dee26]:


206
207
208
209
210
211
212


213





214
215
216
217
218
219


220





221
222
223
224
225
226
227
228
# define of_bswap32(i) of_bswap32_const(i)
# define of_bswap64(i) of_bswap64_const(i)
#endif

static OF_INLINE float OF_CONST_FUNC
of_bswap_float(float f)
{


	uint32_t tmp = of_bswap32(*(uint32_t*)&f);





	return *(float*)&tmp;
}

static OF_INLINE double OF_CONST_FUNC
of_bswap_double(double d)
{


	uint64_t tmp = of_bswap64(*(uint64_t*)&d);





	return *(double*)&tmp;
}

static OF_INLINE void
of_bswap32_vec(uint32_t *buffer, size_t length)
{
	while (length--) {
		*buffer = of_bswap32(*buffer);







>
>
|
>
>
>
>
>
|





>
>
|
>
>
>
>
>
|







206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# define of_bswap32(i) of_bswap32_const(i)
# define of_bswap64(i) of_bswap64_const(i)
#endif

static OF_INLINE float OF_CONST_FUNC
of_bswap_float(float f)
{
	union {
		float f;
		uint32_t i;
	} u;

	u.f = f;
	u.i = of_bswap32(u.i);

	return u.f;
}

static OF_INLINE double OF_CONST_FUNC
of_bswap_double(double d)
{
	union {
		double d;
		uint64_t i;
	} u;

	u.d = d;
	u.i = of_bswap64(u.i);

	return u.d;
}

static OF_INLINE void
of_bswap32_vec(uint32_t *buffer, size_t length)
{
	while (length--) {
		*buffer = of_bswap32(*buffer);