Lines Matching refs:buf
219 char buf[10]; in ihex_bad_byte() local
222 sprintf (buf, "\\%03o", (unsigned int) c); in ihex_bad_byte()
225 buf[0] = c; in ihex_bad_byte()
226 buf[1] = '\0'; in ihex_bad_byte()
230 abfd, lineno, buf); in ihex_bad_byte()
246 bfd_byte *buf = NULL; in ihex_scan() local
311 buf = (bfd_byte *) bfd_realloc (buf, (bfd_size_type) chars); in ihex_scan()
312 if (buf == NULL) in ihex_scan()
317 if (bfd_bread (buf, (bfd_size_type) chars, abfd) != chars) in ihex_scan()
322 if (! ISHEX (buf[i])) in ihex_scan()
324 ihex_bad_byte (abfd, lineno, buf[i], error); in ihex_scan()
332 chksum += HEX2 (buf + 2 * i); in ihex_scan()
333 if (((- chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i)) in ihex_scan()
338 (- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i)); in ihex_scan()
382 if (buf != NULL) in ihex_scan()
383 free (buf); in ihex_scan()
397 segbase = HEX4 (buf) << 4; in ihex_scan()
414 abfd->start_address += (HEX4 (buf) << 4) + HEX4 (buf + 4); in ihex_scan()
431 extbase = HEX4 (buf) << 16; in ihex_scan()
449 abfd->start_address += HEX4 (buf) << 16; in ihex_scan()
451 abfd->start_address = (HEX4 (buf) << 16) + HEX4 (buf + 4); in ihex_scan()
470 if (buf != NULL) in ihex_scan()
471 free (buf); in ihex_scan()
476 if (buf != NULL) in ihex_scan()
477 free (buf); in ihex_scan()
544 bfd_byte *buf = NULL; in ihex_read_section() local
585 buf = (bfd_byte *) bfd_realloc (buf, (bfd_size_type) len * 2); in ihex_read_section()
586 if (buf == NULL) in ihex_read_section()
591 if (bfd_bread (buf, (bfd_size_type) len * 2, abfd) != len * 2) in ihex_read_section()
595 *p++ = HEX2 (buf + 2 * i); in ihex_read_section()
599 if (buf != NULL) in ihex_read_section()
600 free (buf); in ihex_read_section()
605 if (bfd_bread (buf, (bfd_size_type) 2, abfd) != 2) in ihex_read_section()
617 if (buf != NULL) in ihex_read_section()
618 free (buf); in ihex_read_section()
623 if (buf != NULL) in ihex_read_section()
624 free (buf); in ihex_read_section()
721 char buf[9 + CHUNK * 2 + 4]; in ihex_write_record() local
727 #define TOHEX(buf, v) \ in ihex_write_record() argument
728 ((buf)[0] = digs[((v) >> 4) & 0xf], (buf)[1] = digs[(v) & 0xf]) in ihex_write_record()
730 buf[0] = ':'; in ihex_write_record()
731 TOHEX (buf + 1, count); in ihex_write_record()
732 TOHEX (buf + 3, (addr >> 8) & 0xff); in ihex_write_record()
733 TOHEX (buf + 5, addr & 0xff); in ihex_write_record()
734 TOHEX (buf + 7, type); in ihex_write_record()
738 for (i = 0, p = buf + 9; i < count; i++, p += 2, data++) in ihex_write_record()
749 if (bfd_bwrite (buf, (bfd_size_type) total, abfd) != total) in ihex_write_record()
821 char buf[20]; in ihex_write_object_contents() local
823 sprintf_vma (buf, where); in ihex_write_object_contents()
826 bfd_get_filename (abfd), buf); in ihex_write_object_contents()