aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-08-05 19:02:17 +0200
committerTristan Gingold <tgingold@free.fr>2020-08-05 19:02:17 +0200
commit8b101ef0fdb36145cbd7afbfe46fdd5a09237170 (patch)
treeaaf402d63fd7df9a3ad728f2fbd60e75702f9fde /src
parent3d3b0672bb0d99d6e0a50883bbd0f86110bc5726 (diff)
downloadghdl-8b101ef0fdb36145cbd7afbfe46fdd5a09237170.tar.gz
ghdl-8b101ef0fdb36145cbd7afbfe46fdd5a09237170.tar.bz2
ghdl-8b101ef0fdb36145cbd7afbfe46fdd5a09237170.zip
grt: import changes from gtkwave to ghwlib
Diffstat (limited to 'src')
-rw-r--r--src/grt/ghwlib.c2
-rw-r--r--src/grt/ghwlib.h7
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);