diff options
-rw-r--r-- | src/grt/ghwlib.c | 2 | ||||
-rw-r--r-- | src/grt/ghwlib.h | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/grt/ghwlib.c b/src/grt/ghwlib.c index 6115ff628..340e12d08 100644 --- a/src/grt/ghwlib.c +++ b/src/grt/ghwlib.c @@ -200,7 +200,7 @@ ghw_read_sleb128 (struct ghw_handler *h, int32_t *res) if ((v & 0x80) == 0) { if ((v & 0x40) && off < 32) - r |= -1 << off; + r |= ~0U << off; break; } } diff --git a/src/grt/ghwlib.h b/src/grt/ghwlib.h index 3c0fecc10..4937da928 100644 --- a/src/grt/ghwlib.h +++ b/src/grt/ghwlib.h @@ -24,6 +24,11 @@ #include <stdio.h> #include <stdlib.h> +/* To be libraries friendly. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + /* The ghwlib uses the standard c99 int32_t and int64_t. They are declared in stdint.h. Header inttypes.h includes stdint.h and provides macro for printf and co specifiers. Use it if known to be available. */ @@ -432,6 +437,8 @@ enum ghw_res { ghw_res_other = 3 }; +enum ghw_res ghw_read_sm_hdr (struct ghw_handler *h, int *list); + int ghw_read_sm (struct ghw_handler *h, enum ghw_sm_type *sm); int ghw_read_dump (struct ghw_handler *h); |