mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
A couple of additional compat.h formatting changes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4716 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
2badda6ec4
commit
e516fb0c8a
1 changed files with 35 additions and 20 deletions
|
@ -351,8 +351,15 @@ extern "C" {
|
|||
# endif
|
||||
#elif defined B_ENDIAN_C_INLINE
|
||||
static inline uint16_t B_SWAP16(uint16_t s) { return (s >> 8) | (s << 8); }
|
||||
static inline uint32_t B_SWAP32(uint32_t l) { return ((l>>8)&0xff00)|((l&0xff00)<<8)|(l<<24)|(l>>24); }
|
||||
static inline uint64_t B_SWAP64(uint64_t l) { return (l>>56)|((l>>40)&0xff00)|((l>>24)&0xff0000)|((l>>8)&0xff000000)|((l&255)<<56)|((l&0xff00)<<40)|((l&0xff0000)<<24)|((l&0xff000000)<<8); }
|
||||
static inline uint32_t B_SWAP32(uint32_t l)
|
||||
{
|
||||
return ((l >> 8) & 0xff00) | ((l & 0xff00) << 8) | (l << 24) | (l >> 24);
|
||||
}
|
||||
static inline uint64_t B_SWAP64(uint64_t l)
|
||||
{
|
||||
return (l >> 56) | ((l >> 40) & 0xff00) | ((l >> 24) & 0xff0000) | ((l >> 8) & 0xff000000) |
|
||||
((l & 255) << 56) | ((l & 0xff00) << 40) | ((l & 0xff0000) << 24) | ((l & 0xff000000) << 8);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void B_BUF16(uint8_t *buf, uint16_t x)
|
||||
|
@ -380,8 +387,15 @@ static inline void B_BUF64(uint8_t *buf, uint64_t x)
|
|||
}
|
||||
|
||||
static inline uint16_t B_UNBUF16(const uint8_t *buf) { return (buf[1] << 8) | (buf[0]); }
|
||||
static inline uint32_t B_UNBUF32(const uint8_t *buf) { return (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | (buf[0]); }
|
||||
static inline uint64_t B_UNBUF64(const uint8_t *buf) { return ((uint64_t)buf[7] << 56) | ((uint64_t)buf[6] << 48) | ((uint64_t)buf[5] << 40) | ((uint64_t)buf[4] << 32) | (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | (buf[0]); }
|
||||
static inline uint32_t B_UNBUF32(const uint8_t *buf)
|
||||
{
|
||||
return (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | (buf[0]);
|
||||
}
|
||||
static inline uint64_t B_UNBUF64(const uint8_t *buf)
|
||||
{
|
||||
return ((uint64_t)buf[7] << 56) | ((uint64_t)buf[6] << 48) | ((uint64_t)buf[5] << 40) |
|
||||
((uint64_t)buf[4] << 32) | (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | (buf[0]);
|
||||
}
|
||||
|
||||
#if defined (BITNESS64)
|
||||
#include <emmintrin.h>
|
||||
|
@ -533,7 +547,8 @@ CLAMP_DECL float fclamp2(float in, float min, float max)
|
|||
#define BMAX_PATH 256
|
||||
|
||||
|
||||
struct Bdirent {
|
||||
struct Bdirent
|
||||
{
|
||||
uint16_t namlen;
|
||||
char *name;
|
||||
uint32_t mode;
|
||||
|
|
Loading…
Reference in a new issue