Lines Matching defs:C
1 //===- endian.h - Endianness support ----------------------------*- C++ -*-===//
101 inline unsigned char getSwappedBytes(unsigned char C) { return C; }
102 inline signed char getSwappedBytes(signed char C) { return C; }
103 inline char getSwappedBytes(char C) { return C; }
105 inline unsigned short getSwappedBytes(unsigned short C) {
106 return ByteSwap_16(C);
108 inline signed short getSwappedBytes(signed short C) { return ByteSwap_16(C); }
110 inline unsigned int getSwappedBytes(unsigned int C) { return ByteSwap_32(C); }
111 inline signed int getSwappedBytes(signed int C) { return ByteSwap_32(C); }
113 inline unsigned long getSwappedBytes(unsigned long C) {
115 return sizeof(long) == sizeof(int) ? ByteSwap_32((uint32_t)C)
116 : ByteSwap_64((uint64_t)C);
118 inline signed long getSwappedBytes(signed long C) {
120 return sizeof(long) == sizeof(int) ? ByteSwap_32((uint32_t)C)
121 : ByteSwap_64((uint64_t)C);
124 inline unsigned long long getSwappedBytes(unsigned long long C) {
125 return ByteSwap_64(C);
127 inline signed long long getSwappedBytes(signed long long C) {
128 return ByteSwap_64(C);
132 inline std::enable_if_t<std::is_enum<T>::value, T> getSwappedBytes(T C) {
134 getSwappedBytes(static_cast<std::underlying_type_t<T>>(C)));