aboutsummaryrefslogtreecommitdiffstats
path: root/ghw
diff options
context:
space:
mode:
authorUnai Martinez-Corral <38422348+umarcor@users.noreply.github.com>2021-06-26 19:40:25 +0100
committerGitHub <noreply@github.com>2021-06-26 20:40:25 +0200
commitb4d4d9abb322ed0807d2ba0888e73820499aa338 (patch)
treeb980d379e95034ee72aac29955833e1ef0dfd912 /ghw
parent111fe055b2f0f3a0225d2553cf739572d691a14d (diff)
downloadghdl-b4d4d9abb322ed0807d2ba0888e73820499aa338.tar.gz
ghdl-b4d4d9abb322ed0807d2ba0888e73820499aa338.tar.bz2
ghdl-b4d4d9abb322ed0807d2ba0888e73820499aa338.zip
Codacy issues, Travis cleanup and update ghdl.texi (#1807)
* ghw: fix memleaks reported by codacy * ghw: printf issues and style (GNU indent) * testsuite/gna: minor printf issues * testsuite: fix issues reported by codacy * scripts/ci-run: clean travis stuff (deprecated) * scripts: fix issues reported by codacy * doc/Makefile: add .PHONY * doc: update ghdl.texi * testsuite/synth: use synth_tb
Diffstat (limited to 'ghw')
-rw-r--r--ghw/libghw.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ghw/libghw.c b/ghw/libghw.c
index eabc31cba..7b01db680 100644
--- a/ghw/libghw.c
+++ b/ghw/libghw.c
@@ -655,7 +655,7 @@ ghw_read_type (struct ghw_handler *h)
if (t == EOF)
return -1;
if (h->flag_verbose > 1)
- printf ("type[%d]= %d\n", i, t);
+ printf ("type[%u]= %d\n", i, t);
switch (t)
{
case ghdl_rtik_type_b2:
@@ -684,6 +684,7 @@ ghw_read_type (struct ghw_handler *h)
h->types[i] = (union ghw_type *) e;
break;
err_b2:
+ free (e->lits);
free (e);
return -1;
}
@@ -771,6 +772,7 @@ ghw_read_type (struct ghw_handler *h)
h->types[i] = (union ghw_type *) arr;
break;
err_array:
+ free (arr->dims);
free (arr);
return -1;
}
@@ -1002,8 +1004,8 @@ ghw_read_signal (struct ghw_handler *h, unsigned int *sigs, union ghw_type *t)
}
int
-ghw_read_value (struct ghw_handler *h, union ghw_val *val,
- union ghw_type *type)
+ghw_read_value (struct ghw_handler *h,
+ union ghw_val *val, union ghw_type *type)
{
switch (ghw_get_base_type (type)->kind)
{
@@ -1079,7 +1081,7 @@ ghw_read_hie (struct ghw_handler *h)
h->nbr_sigs = ghw_get_i32 (h, &hdr[12]);
if (h->flag_verbose)
- printf ("%u scopes, %u signals, %u signal elements\n", nbr_scopes,
+ printf ("%d scopes, %d signals, %u signal elements\n", nbr_scopes,
nbr_sigs, h->nbr_sigs);
blk = (struct ghw_hie *) malloc (sizeof (struct ghw_hie));