@@ -99,128 +99,128 @@ pub unsafe fn move_val_init<T>(dst: &mut T, src: T) {
99
99
intrinsics:: move_val_init ( dst, src)
100
100
}
101
101
102
- /// Convert an i16 to little endian from the target's endianness.
102
+ /// Convert an u16 to little endian from the target's endianness.
103
103
///
104
104
/// 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 }
106
106
107
- /// Convert an i16 to little endian from the target's endianness.
107
+ /// Convert an u16 to little endian from the target's endianness.
108
108
///
109
109
/// 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) } }
111
111
112
- /// Convert an i32 to little endian from the target's endianness.
112
+ /// Convert an u32 to little endian from the target's endianness.
113
113
///
114
114
/// 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 }
116
116
117
- /// Convert an i32 to little endian from the target's endianness.
117
+ /// Convert an u32 to little endian from the target's endianness.
118
118
///
119
119
/// 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) } }
121
121
122
- /// Convert an i64 to little endian from the target's endianness.
122
+ /// Convert an u64 to little endian from the target's endianness.
123
123
///
124
124
/// 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 }
126
126
127
- /// Convert an i64 to little endian from the target's endianness.
127
+ /// Convert an u64 to little endian from the target's endianness.
128
128
///
129
129
/// 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) } }
131
131
132
132
133
- /// Convert an i16 to big endian from the target's endianness.
133
+ /// Convert an u16 to big endian from the target's endianness.
134
134
///
135
135
/// 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) } }
137
137
138
- /// Convert an i16 to big endian from the target's endianness.
138
+ /// Convert an u16 to big endian from the target's endianness.
139
139
///
140
140
/// 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 }
142
142
143
- /// Convert an i32 to big endian from the target's endianness.
143
+ /// Convert an u32 to big endian from the target's endianness.
144
144
///
145
145
/// 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) } }
147
147
148
- /// Convert an i32 to big endian from the target's endianness.
148
+ /// Convert an u32 to big endian from the target's endianness.
149
149
///
150
150
/// 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 }
152
152
153
- /// Convert an i64 to big endian from the target's endianness.
153
+ /// Convert an u64 to big endian from the target's endianness.
154
154
///
155
155
/// 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) } }
157
157
158
- /// Convert an i64 to big endian from the target's endianness.
158
+ /// Convert an u64 to big endian from the target's endianness.
159
159
///
160
160
/// 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 }
162
162
163
163
164
- /// Convert an i16 from little endian to the target's endianness.
164
+ /// Convert an u16 from little endian to the target's endianness.
165
165
///
166
166
/// 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 }
168
168
169
- /// Convert an i16 from little endian to the target's endianness.
169
+ /// Convert an u16 from little endian to the target's endianness.
170
170
///
171
171
/// 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) } }
173
173
174
- /// Convert an i32 from little endian to the target's endianness.
174
+ /// Convert an u32 from little endian to the target's endianness.
175
175
///
176
176
/// 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 }
178
178
179
- /// Convert an i32 from little endian to the target's endianness.
179
+ /// Convert an u32 from little endian to the target's endianness.
180
180
///
181
181
/// 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) } }
183
183
184
- /// Convert an i64 from little endian to the target's endianness.
184
+ /// Convert an u64 from little endian to the target's endianness.
185
185
///
186
186
/// 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 }
188
188
189
- /// Convert an i64 from little endian to the target's endianness.
189
+ /// Convert an u64 from little endian to the target's endianness.
190
190
///
191
191
/// 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) } }
193
193
194
194
195
- /// Convert an i16 from big endian to the target's endianness.
195
+ /// Convert an u16 from big endian to the target's endianness.
196
196
///
197
197
/// 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) } }
199
199
200
- /// Convert an i16 from big endian to the target's endianness.
200
+ /// Convert an u16 from big endian to the target's endianness.
201
201
///
202
202
/// 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 }
204
204
205
- /// Convert an i32 from big endian to the target's endianness.
205
+ /// Convert an u32 from big endian to the target's endianness.
206
206
///
207
207
/// 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) } }
209
209
210
- /// Convert an i32 from big endian to the target's endianness.
210
+ /// Convert an u32 from big endian to the target's endianness.
211
211
///
212
212
/// 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 }
214
214
215
- /// Convert an i64 from big endian to the target's endianness.
215
+ /// Convert an u64 from big endian to the target's endianness.
216
216
///
217
217
/// 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) } }
219
219
220
- /// Convert an i64 from big endian to the target's endianness.
220
+ /// Convert an u64 from big endian to the target's endianness.
221
221
///
222
222
/// 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 }
224
224
225
225
226
226
/**
0 commit comments