public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH OBV] Use enum bfd_endian in gdbarch.sh
@ 2014-01-03  2:52 Yao Qi
  2014-01-06 20:56 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Yao Qi @ 2014-01-03  2:52 UTC (permalink / raw)
  To: gdb-patches

This patch changes the return type of gdbarch_byte_order and
gdbarch_byte_order_for_code, from 'int' to 'enum bfd_endian'.

It is obvious.  I'll push it in next week.

gdb:

2014-01-03  Yao Qi  <yao@codesourcery.com>

	* gdbarch.sh (byte_order, byte_order_for_code): Change type to
	'enum bfd_endian'.
	(struct gdbarch_info) <byte_order>: Change type to
	'enum bfd_endian'.
	<byte_order_for_code>: Likewise.
	* gdbarch.c, gdbarch.h: Regenerated.
---
 gdb/gdbarch.c  |    8 ++++----
 gdb/gdbarch.h  |    8 ++++----
 gdb/gdbarch.sh |    8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 0761008..a605c7d 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -128,8 +128,8 @@ struct gdbarch
 
   /* basic architectural information.  */
   const struct bfd_arch_info * bfd_arch_info;
-  int byte_order;
-  int byte_order_for_code;
+  enum bfd_endian byte_order;
+  enum bfd_endian byte_order_for_code;
   enum gdb_osabi osabi;
   const struct target_desc * target_desc;
 
@@ -1473,7 +1473,7 @@ gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
   return gdbarch->bfd_arch_info;
 }
 
-int
+enum bfd_endian
 gdbarch_byte_order (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -1482,7 +1482,7 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
   return gdbarch->byte_order;
 }
 
-int
+enum bfd_endian
 gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index fd96a7e..ccb7e96 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -91,10 +91,10 @@ typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
 extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
 /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized.  */
 
-extern int gdbarch_byte_order (struct gdbarch *gdbarch);
+extern enum bfd_endian gdbarch_byte_order (struct gdbarch *gdbarch);
 /* set_gdbarch_byte_order() - not applicable - pre-initialized.  */
 
-extern int gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
+extern enum bfd_endian gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
 /* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized.  */
 
 extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
@@ -1342,9 +1342,9 @@ struct gdbarch_info
   const struct bfd_arch_info *bfd_arch_info;
 
   /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO).  */
-  int byte_order;
+  enum bfd_endian byte_order;
 
-  int byte_order_for_code;
+  enum bfd_endian byte_order_for_code;
 
   /* Use default: NULL (ZERO).  */
   bfd *abfd;
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 9e1e03e..ecbede6 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -340,8 +340,8 @@ function_list ()
   cat <<EOF
 i:const struct bfd_arch_info *:bfd_arch_info:::&bfd_default_arch_struct::::gdbarch_bfd_arch_info (gdbarch)->printable_name
 #
-i:int:byte_order:::BFD_ENDIAN_BIG
-i:int:byte_order_for_code:::BFD_ENDIAN_BIG
+i:enum bfd_endian:byte_order:::BFD_ENDIAN_BIG
+i:enum bfd_endian:byte_order_for_code:::BFD_ENDIAN_BIG
 #
 i:enum gdb_osabi:osabi:::GDB_OSABI_UNKNOWN
 #
@@ -1279,9 +1279,9 @@ struct gdbarch_info
   const struct bfd_arch_info *bfd_arch_info;
 
   /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO).  */
-  int byte_order;
+  enum bfd_endian byte_order;
 
-  int byte_order_for_code;
+  enum bfd_endian byte_order_for_code;
 
   /* Use default: NULL (ZERO).  */
   bfd *abfd;
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH OBV] Use enum bfd_endian in gdbarch.sh
  2014-01-03  2:52 [PATCH OBV] Use enum bfd_endian in gdbarch.sh Yao Qi
@ 2014-01-06 20:56 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2014-01-06 20:56 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> 2014-01-03  Yao Qi  <yao@codesourcery.com>
Yao> 	* gdbarch.sh (byte_order, byte_order_for_code): Change type to
Yao> 	'enum bfd_endian'.
Yao> 	(struct gdbarch_info) <byte_order>: Change type to
Yao> 	'enum bfd_endian'.
Yao> 	<byte_order_for_code>: Likewise.
Yao> 	* gdbarch.c, gdbarch.h: Regenerated.

Thanks Yao.  It seems like a nice cleanup to me.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-06 20:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-03  2:52 [PATCH OBV] Use enum bfd_endian in gdbarch.sh Yao Qi
2014-01-06 20:56 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).