Home | History | Annotate | Download | only in libiberty

Lines Matching refs:buf

183 simple_object_fetch_big_16 (const unsigned char *buf)
185 return ((unsigned short) buf[0] << 8) | (unsigned short) buf[1];
191 simple_object_fetch_little_16 (const unsigned char *buf)
193 return ((unsigned short) buf[1] << 8) | (unsigned short) buf[0];
199 simple_object_fetch_big_32 (const unsigned char *buf)
201 return (((unsigned int) buf[0] << 24)
202 | ((unsigned int) buf[1] << 16)
203 | ((unsigned int) buf[2] << 8)
204 | (unsigned int) buf[3]);
210 simple_object_fetch_little_32 (const unsigned char *buf)
212 return (((unsigned int) buf[3] << 24)
213 | ((unsigned int) buf[2] << 16)
214 | ((unsigned int) buf[1] << 8)
215 | (unsigned int) buf[0]);
221 simple_object_fetch_big_32_ulong (const unsigned char *buf)
223 return (ulong_type) simple_object_fetch_big_32 (buf);
229 simple_object_fetch_little_32_ulong (const unsigned char *buf)
231 return (ulong_type) simple_object_fetch_little_32 (buf);
239 simple_object_fetch_big_64 (const unsigned char *buf)
241 return (((ulong_type) buf[0] << 56)
242 | ((ulong_type) buf[1] << 48)
243 | ((ulong_type) buf[2] << 40)
244 | ((ulong_type) buf[3] << 32)
245 | ((ulong_type) buf[4] << 24)
246 | ((ulong_type) buf[5] << 16)
247 | ((ulong_type) buf[6] << 8)
248 | (ulong_type) buf[7]);
254 simple_object_fetch_little_64 (const unsigned char *buf)
256 return (((ulong_type) buf[7] << 56)
257 | ((ulong_type) buf[6] << 48)
258 | ((ulong_type) buf[5] << 40)
259 | ((ulong_type) buf[4] << 32)
260 | ((ulong_type) buf[3] << 24)
261 | ((ulong_type) buf[2] << 16)
262 | ((ulong_type) buf[1] << 8)
263 | (ulong_type) buf[0]);
271 simple_object_set_big_16 (unsigned char *buf, unsigned short val)
273 buf[0] = (val >> 8) & 0xff;
274 buf[1] = val & 0xff;
280 simple_object_set_little_16 (unsigned char *buf, unsigned short val)
282 buf[1] = (val >> 8) & 0xff;
283 buf[0] = val & 0xff;
289 simple_object_set_big_32 (unsigned char *buf, unsigned int val)
291 buf[0] = (val >> 24) & 0xff;
292 buf[1] = (val >> 16) & 0xff;
293 buf[2] = (val >> 8) & 0xff;
294 buf[3] = val & 0xff;
300 simple_object_set_little_32 (unsigned char *buf, unsigned int val)
302 buf[3] = (val >> 24) & 0xff;
303 buf[2] = (val >> 16) & 0xff;
304 buf[1] = (val >> 8) & 0xff;
305 buf[0] = val & 0xff;
311 simple_object_set_big_32_ulong (unsigned char *buf, ulong_type val)
313 simple_object_set_big_32 (buf, val);
319 simple_object_set_little_32_ulong (unsigned char *buf, ulong_type val)
321 simple_object_set_little_32 (buf, val);
329 simple_object_set_big_64 (unsigned char *buf, ulong_type val)
331 buf[0] = (val >> 56) & 0xff;
332 buf[1] = (val >> 48) & 0xff;
333 buf[2] = (val >> 40) & 0xff;
334 buf[3] = (val >> 32) & 0xff;
335 buf[4] = (val >> 24) & 0xff;
336 buf[5] = (val >> 16) & 0xff;
337 buf[6] = (val >> 8) & 0xff;
338 buf[7] = val & 0xff;
344 simple_object_set_little_64 (unsigned char *buf, ulong_type val)
346 buf[7] = (val >> 56) & 0xff;
347 buf[6] = (val >> 48) & 0xff;
348 buf[5] = (val >> 40) & 0xff;
349 buf[4] = (val >> 32) & 0xff;
350 buf[3] = (val >> 24) & 0xff;
351 buf[2] = (val >> 16) & 0xff;
352 buf[1] = (val >> 8) & 0xff;
353 buf[0] = val & 0xff;