@@ -99,128 +99,128 @@ pub unsafe fn move_val_init<T>(dst: &mut T, src: T) {
9999 intrinsics:: move_val_init ( dst, src)
100100}
101101
102- /// Convert an i16 to little endian from the target's endianness.
102+ /// Convert an u16 to little endian from the target's endianness.
103103///
104104/// On little endian, this is a no-op. On big endian, the bytes are swapped.
105- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_le16 ( x : i16 ) -> i16 { x }
105+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_le16 ( x : u16 ) -> u16 { x }
106106
107- /// Convert an i16 to little endian from the target's endianness.
107+ /// Convert an u16 to little endian from the target's endianness.
108108///
109109/// On little endian, this is a no-op. On big endian, the bytes are swapped.
110- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_le16 ( x : i16 ) -> i16 { unsafe { bswap16 ( x) } }
110+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_le16 ( x : u16 ) -> u16 { unsafe { bswap16 ( x) } }
111111
112- /// Convert an i32 to little endian from the target's endianness.
112+ /// Convert an u32 to little endian from the target's endianness.
113113///
114114/// On little endian, this is a no-op. On big endian, the bytes are swapped.
115- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_le32 ( x : i32 ) -> i32 { x }
115+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_le32 ( x : u32 ) -> u32 { x }
116116
117- /// Convert an i32 to little endian from the target's endianness.
117+ /// Convert an u32 to little endian from the target's endianness.
118118///
119119/// On little endian, this is a no-op. On big endian, the bytes are swapped.
120- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_le32 ( x : i32 ) -> i32 { unsafe { bswap32 ( x) } }
120+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_le32 ( x : u32 ) -> u32 { unsafe { bswap32 ( x) } }
121121
122- /// Convert an i64 to little endian from the target's endianness.
122+ /// Convert an u64 to little endian from the target's endianness.
123123///
124124/// On little endian, this is a no-op. On big endian, the bytes are swapped.
125- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_le64 ( x : i64 ) -> i64 { x }
125+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_le64 ( x : u64 ) -> u64 { x }
126126
127- /// Convert an i64 to little endian from the target's endianness.
127+ /// Convert an u64 to little endian from the target's endianness.
128128///
129129/// On little endian, this is a no-op. On big endian, the bytes are swapped.
130- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_le64 ( x : i64 ) -> i64 { unsafe { bswap64 ( x) } }
130+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_le64 ( x : u64 ) -> u64 { unsafe { bswap64 ( x) } }
131131
132132
133- /// Convert an i16 to big endian from the target's endianness.
133+ /// Convert an u16 to big endian from the target's endianness.
134134///
135135/// On big endian, this is a no-op. On little endian, the bytes are swapped.
136- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_be16 ( x : i16 ) -> i16 { unsafe { bswap16 ( x) } }
136+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_be16 ( x : u16 ) -> u16 { unsafe { bswap16 ( x) } }
137137
138- /// Convert an i16 to big endian from the target's endianness.
138+ /// Convert an u16 to big endian from the target's endianness.
139139///
140140/// On big endian, this is a no-op. On little endian, the bytes are swapped.
141- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_be16 ( x : i16 ) -> i16 { x }
141+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_be16 ( x : u16 ) -> u16 { x }
142142
143- /// Convert an i32 to big endian from the target's endianness.
143+ /// Convert an u32 to big endian from the target's endianness.
144144///
145145/// On big endian, this is a no-op. On little endian, the bytes are swapped.
146- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_be32 ( x : i32 ) -> i32 { unsafe { bswap32 ( x) } }
146+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_be32 ( x : u32 ) -> u32 { unsafe { bswap32 ( x) } }
147147
148- /// Convert an i32 to big endian from the target's endianness.
148+ /// Convert an u32 to big endian from the target's endianness.
149149///
150150/// On big endian, this is a no-op. On little endian, the bytes are swapped.
151- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_be32 ( x : i32 ) -> i32 { x }
151+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_be32 ( x : u32 ) -> u32 { x }
152152
153- /// Convert an i64 to big endian from the target's endianness.
153+ /// Convert an u64 to big endian from the target's endianness.
154154///
155155/// On big endian, this is a no-op. On little endian, the bytes are swapped.
156- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_be64 ( x : i64 ) -> i64 { unsafe { bswap64 ( x) } }
156+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn to_be64 ( x : u64 ) -> u64 { unsafe { bswap64 ( x) } }
157157
158- /// Convert an i64 to big endian from the target's endianness.
158+ /// Convert an u64 to big endian from the target's endianness.
159159///
160160/// On big endian, this is a no-op. On little endian, the bytes are swapped.
161- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_be64 ( x : i64 ) -> i64 { x }
161+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn to_be64 ( x : u64 ) -> u64 { x }
162162
163163
164- /// Convert an i16 from little endian to the target's endianness.
164+ /// Convert an u16 from little endian to the target's endianness.
165165///
166166/// On little endian, this is a no-op. On big endian, the bytes are swapped.
167- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_le16 ( x : i16 ) -> i16 { x }
167+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_le16 ( x : u16 ) -> u16 { x }
168168
169- /// Convert an i16 from little endian to the target's endianness.
169+ /// Convert an u16 from little endian to the target's endianness.
170170///
171171/// On little endian, this is a no-op. On big endian, the bytes are swapped.
172- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_le16 ( x : i16 ) -> i16 { unsafe { bswap16 ( x) } }
172+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_le16 ( x : u16 ) -> u16 { unsafe { bswap16 ( x) } }
173173
174- /// Convert an i32 from little endian to the target's endianness.
174+ /// Convert an u32 from little endian to the target's endianness.
175175///
176176/// On little endian, this is a no-op. On big endian, the bytes are swapped.
177- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_le32 ( x : i32 ) -> i32 { x }
177+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_le32 ( x : u32 ) -> u32 { x }
178178
179- /// Convert an i32 from little endian to the target's endianness.
179+ /// Convert an u32 from little endian to the target's endianness.
180180///
181181/// On little endian, this is a no-op. On big endian, the bytes are swapped.
182- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_le32 ( x : i32 ) -> i32 { unsafe { bswap32 ( x) } }
182+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_le32 ( x : u32 ) -> u32 { unsafe { bswap32 ( x) } }
183183
184- /// Convert an i64 from little endian to the target's endianness.
184+ /// Convert an u64 from little endian to the target's endianness.
185185///
186186/// On little endian, this is a no-op. On big endian, the bytes are swapped.
187- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_le64 ( x : i64 ) -> i64 { x }
187+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_le64 ( x : u64 ) -> u64 { x }
188188
189- /// Convert an i64 from little endian to the target's endianness.
189+ /// Convert an u64 from little endian to the target's endianness.
190190///
191191/// On little endian, this is a no-op. On big endian, the bytes are swapped.
192- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_le64 ( x : i64 ) -> i64 { unsafe { bswap64 ( x) } }
192+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_le64 ( x : u64 ) -> u64 { unsafe { bswap64 ( x) } }
193193
194194
195- /// Convert an i16 from big endian to the target's endianness.
195+ /// Convert an u16 from big endian to the target's endianness.
196196///
197197/// On big endian, this is a no-op. On little endian, the bytes are swapped.
198- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_be16 ( x : i16 ) -> i16 { unsafe { bswap16 ( x) } }
198+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_be16 ( x : u16 ) -> u16 { unsafe { bswap16 ( x) } }
199199
200- /// Convert an i16 from big endian to the target's endianness.
200+ /// Convert an u16 from big endian to the target's endianness.
201201///
202202/// On big endian, this is a no-op. On little endian, the bytes are swapped.
203- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_be16 ( x : i16 ) -> i16 { x }
203+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_be16 ( x : u16 ) -> u16 { x }
204204
205- /// Convert an i32 from big endian to the target's endianness.
205+ /// Convert an u32 from big endian to the target's endianness.
206206///
207207/// On big endian, this is a no-op. On little endian, the bytes are swapped.
208- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_be32 ( x : i32 ) -> i32 { unsafe { bswap32 ( x) } }
208+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_be32 ( x : u32 ) -> u32 { unsafe { bswap32 ( x) } }
209209
210- /// Convert an i32 from big endian to the target's endianness.
210+ /// Convert an u32 from big endian to the target's endianness.
211211///
212212/// On big endian, this is a no-op. On little endian, the bytes are swapped.
213- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_be32 ( x : i32 ) -> i32 { x }
213+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_be32 ( x : u32 ) -> u32 { x }
214214
215- /// Convert an i64 from big endian to the target's endianness.
215+ /// Convert an u64 from big endian to the target's endianness.
216216///
217217/// On big endian, this is a no-op. On little endian, the bytes are swapped.
218- #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_be64 ( x : i64 ) -> i64 { unsafe { bswap64 ( x) } }
218+ #[ cfg( target_endian = "little" ) ] #[ inline] pub fn from_be64 ( x : u64 ) -> u64 { unsafe { bswap64 ( x) } }
219219
220- /// Convert an i64 from big endian to the target's endianness.
220+ /// Convert an u64 from big endian to the target's endianness.
221221///
222222/// On big endian, this is a no-op. On little endian, the bytes are swapped.
223- #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_be64 ( x : i64 ) -> i64 { x }
223+ #[ cfg( target_endian = "big" ) ] #[ inline] pub fn from_be64 ( x : u64 ) -> u64 { x }
224224
225225
226226/**
0 commit comments