include: always do unsigned left-shift in CTF_SET_STID

This turns into a signed left shift by 31 bits, otherwise.  This is an
offset and is always treated as unsigned in any case, so add an
appropriate cast.

include/ChangeLog
2021-03-25  Nick Alcock  <nick.alcock@oracle.com>

	PR libctf/27628
	* ctf-api.h: Fix some indentation.
	(CTF_SET_STID): Always do an unsigned shift, even if STID is
	signed.
This commit is contained in:
Nick Alcock
2021-03-25 16:32:46 +00:00
parent 485170cdb1
commit 24c877f9b1
2 changed files with 15 additions and 8 deletions

View File

@@ -1,3 +1,10 @@
2021-03-25 Nick Alcock <nick.alcock@oracle.com>
PR libctf/27628
* ctf-api.h: Fix some indentation.
(CTF_SET_STID): Always do an unsigned shift, even if STID is
signed.
2021-03-19 H.J. Lu <hongjiu.lu@intel.com> 2021-03-19 H.J. Lu <hongjiu.lu@intel.com>
* elf/common.h (EM_INTEL205): Renamed to ... * elf/common.h (EM_INTEL205): Renamed to ...

View File

@@ -368,7 +368,7 @@ union
#define CTF_NAME_STID(name) ((name) >> 31) #define CTF_NAME_STID(name) ((name) >> 31)
#define CTF_NAME_OFFSET(name) ((name) & CTF_MAX_NAME) #define CTF_NAME_OFFSET(name) ((name) & CTF_MAX_NAME)
#define CTF_SET_STID(name, stid) ((name) | (stid) << 31) #define CTF_SET_STID(name, stid) ((name) | ((unsigned int) stid) << 31)
/* V2 only. */ /* V2 only. */
#define CTF_TYPE_INFO(kind, isroot, vlen) \ #define CTF_TYPE_INFO(kind, isroot, vlen) \