[1/3] libctf: fix the type of ctf_enum.cte_value

Message ID 20190603204735.203510-1-nick.alcock@oracle.com
State New
Headers show
Series
  • [1/3] libctf: fix the type of ctf_enum.cte_value
Related show

Commit Message

Nick Alcock June 3, 2019, 8:47 p.m.
This stops the file format from depending on the size of the host int.
(It does mean that we cannot encode enums with a value > 2^32 on
platforms with an int > 2^32: this will be fixed in the next format
revision.)

include/
	* ctf.h (ctf_enum.cte_value): Fix type to int32_t.
---
 include/ctf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.21.0.237.gd0cfaa883d

Patch

diff --git a/include/ctf.h b/include/ctf.h
index 2c3384fe84..e99a673109 100644
--- a/include/ctf.h
+++ b/include/ctf.h
@@ -507,7 +507,7 @@  typedef struct ctf_lmember_v2
 typedef struct ctf_enum
 {
   uint32_t cte_name;		/* Reference to name in string table.  */
-  int cte_value;		/* Value associated with this name.  */
+  int32_t cte_value;		/* Value associated with this name.  */
 } ctf_enum_t;
 
 /* The ctf_archive is a collection of ctf_file_t's stored together. The format