This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Replace _XXX with XXX_P
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Tue, 15 Dec 2009 08:58:10 -0800
- Subject: PATCH: Replace _XXX with XXX_P
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
_XXX is reserved. We can't use it in user codes. In fact, mingw headers
use _XXX. It also uses eof. I checked this in as an obvious fix.
Thanks.
H.J.
---
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 443844d..475bb46 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * opncls.c (bfd_opnr_iovec): Replace _XXX with XXX_P in
+ parameters.
+
+ * tekhex.c (pass_over): Replace eof with is_eof.
+
2009-12-14 Doug Kwan <dougkwan@google.com>
* opncls.c (bfd_opnr_iovec): Rename parameters to avoid shawdowed
diff --git a/bfd/opncls.c b/bfd/opncls.c
index 520cab6..8b3d2e1 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -523,12 +523,12 @@ static const struct bfd_iovec opncls_iovec = {
bfd *
bfd_openr_iovec (const char *filename, const char *target,
- void *(*_open) (struct bfd *, void *),
+ void *(*open_p) (struct bfd *, void *),
void *open_closure,
- file_ptr (*_pread) (struct bfd *, void *, void *, file_ptr,
- file_ptr),
- int (*_close) (struct bfd *, void *),
- int (*_stat) (struct bfd *, void *, struct stat *))
+ file_ptr (*pread_p) (struct bfd *, void *, void *,
+ file_ptr, file_ptr),
+ int (*close_p) (struct bfd *, void *),
+ int (*stat_p) (struct bfd *, void *, struct stat *))
{
bfd *nbfd;
const bfd_target *target_vec;
@@ -549,8 +549,8 @@ bfd_openr_iovec (const char *filename, const char *target,
nbfd->filename = filename;
nbfd->direction = read_direction;
- /* `open (...)' would get expanded by an the open(2) syscall macro. */
- stream = (*_open) (nbfd, open_closure);
+ /* `open_p (...)' would get expanded by an the open(2) syscall macro. */
+ stream = (*open_p) (nbfd, open_closure);
if (stream == NULL)
{
_bfd_delete_bfd (nbfd);
@@ -559,9 +559,9 @@ bfd_openr_iovec (const char *filename, const char *target,
vec = (struct opncls *) bfd_zalloc (nbfd, sizeof (struct opncls));
vec->stream = stream;
- vec->pread = _pread;
- vec->close = _close;
- vec->stat = _stat;
+ vec->pread = pread_p;
+ vec->close = close_p;
+ vec->stat = stat_p;
nbfd->iovec = &opncls_iovec;
nbfd->iostream = vec;
diff --git a/bfd/tekhex.c b/bfd/tekhex.c
index bc3c9ca..2204ebb 100644
--- a/bfd/tekhex.c
+++ b/bfd/tekhex.c
@@ -461,22 +461,22 @@ static bfd_boolean
pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *))
{
unsigned int chars_on_line;
- bfd_boolean eof = FALSE;
+ bfd_boolean is_eof = FALSE;
/* To the front of the file. */
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return FALSE;
- while (! eof)
+ while (! is_eof)
{
char src[MAXCHUNK];
char type;
/* Find first '%'. */
- eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1);
- while (*src != '%' && !eof)
- eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1);
+ is_eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1);
+ while (*src != '%' && !is_eof)
+ is_eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1);
- if (eof)
+ if (is_eof)
break;
/* Fetch the type and the length and the checksum. */