Bladeren bron

Add const attribute to byte-swapping functions

tags/v0.9.3
Michael Brown 16 jaren geleden
bovenliggende
commit
687afdcdd9
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3
    3
      src/arch/i386/include/bits/byteswap.h

+ 3
- 3
src/arch/i386/include/bits/byteswap.h Bestand weergeven

@@ -1,7 +1,7 @@
1 1
 #ifndef ETHERBOOT_BITS_BYTESWAP_H
2 2
 #define ETHERBOOT_BITS_BYTESWAP_H
3 3
 
4
-static inline __attribute__ ((always_inline)) uint16_t
4
+static inline __attribute__ ((always_inline, const)) uint16_t
5 5
 __i386_bswap_16(uint16_t x)
6 6
 {
7 7
 	__asm__("xchgb %b0,%h0\n\t"
@@ -10,7 +10,7 @@ __i386_bswap_16(uint16_t x)
10 10
 	return x;
11 11
 }
12 12
 
13
-static inline __attribute__ ((always_inline)) uint32_t
13
+static inline __attribute__ ((always_inline, const)) uint32_t
14 14
 __i386_bswap_32(uint32_t x)
15 15
 {
16 16
 	__asm__("xchgb %b0,%h0\n\t"
@@ -21,7 +21,7 @@ __i386_bswap_32(uint32_t x)
21 21
 	return x;
22 22
 }
23 23
 
24
-static inline __attribute__ ((always_inline)) uint64_t
24
+static inline __attribute__ ((always_inline, const)) uint64_t
25 25
 __i386_bswap_64(uint64_t x)
26 26
 {
27 27
 	union {

Laden…
Annuleren
Opslaan