Overview
Comment: | Use __attribute__((const)) where useful. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
ef8b7bb44e2655b98f8590119a96a703 |
User & Date: | js on 2010-11-21 00:52:13 |
Other Links: | manifest | tags |
Context
2010-11-21
| ||
13:26 | objfw-compile: Don't care about the order in which flags are specified. check-in: 5936b9f9c3 user: js tags: trunk | |
00:52 | Use __attribute__((const)) where useful. check-in: ef8b7bb44e user: js tags: trunk | |
00:34 | OFXMLParser: Parse processing instructions. check-in: b31d5c02df user: js tags: trunk | |
Changes
Modified src/macros.h from [c5676bbe71] to [0f503553d9].
︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | + + | #include <stddef.h> #include <stdint.h> #ifdef __GNUC__ # define OF_INLINE inline __attribute__((always_inline)) # define OF_LIKELY(cond) __builtin_expect(!!(cond), 1) # define OF_UNLIKELY(cond) __builtin_expect(!!(cond), 0) # define OF_CONST_FUNC __attribute__((const)) #else # define OF_INLINE inline # define OF_LIKELY(cond) cond # define OF_UNLIKELY(cond) cond # define OF_CONST_FUNC #endif /* Required to build universal binaries on OS X */ #if __BIG_ENDIAN__ || __LITTLE_ENDIAN__ # if __BIG_ENDIAN__ && __LITTLE_ENDIAN__ # error __BIG_ENDIAN__ and __LITTLE_ENDIAN__ defined! # endif |
︙ | |||
53 54 55 56 57 58 59 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + - + - + - + | #ifndef _WIN32 # define OF_PATH_DELIM '/' #else # define OF_PATH_DELIM '\\' #endif |
︙ | |||
110 111 112 113 114 115 116 | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | - + | #else i = (i & UINT16_C(0xFF00)) >> 8 | (i & UINT16_C(0x00FF)) << 8; #endif return i; } |
︙ | |||
140 141 142 143 144 145 146 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | - + | (i & UINT32_C(0x00FF0000)) >> 8 | (i & UINT32_C(0x0000FF00)) << 8 | (i & UINT32_C(0x000000FF)) << 24; #endif return i; } |
︙ |