summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Dachary <loic@dachary.org>2014-03-06 14:48:34 +0100
committerLoic Dachary <loic@dachary.org>2014-03-28 17:12:40 +0100
commitb40e645fd703bc32d36f75f967d135f6200d0271 (patch)
tree0f9fc3004fa697ec9733f40ffb42290ab4741ae0
parent08d53bd3e32651b64d41991becc684371d5e695c (diff)
downloadgf-complete-b40e645fd703bc32d36f75f967d135f6200d0271.tar.gz
silence some warnings for unset variables
By setting them when they are defined and when the compiler fails to see the logic is ok. Signed-off-by: Loic Dachary <loic@dachary.org> (cherry picked from commit 3c4a451b509cfc3d51f9906326a66ac3e95de9d4)
-rw-r--r--examples/gf_example_2.c4
-rw-r--r--src/gf.c2
-rw-r--r--src/gf_w8.c6
-rw-r--r--test/gf_unit.c3
-rw-r--r--tools/gf_inline_time.c4
5 files changed, 11 insertions, 8 deletions
diff --git a/examples/gf_example_2.c b/examples/gf_example_2.c
index e98774a..576d9a5 100644
--- a/examples/gf_example_2.c
+++ b/examples/gf_example_2.c
@@ -28,8 +28,8 @@ int main(int argc, char **argv)
{
uint32_t a, b, c;
uint8_t *r1, *r2;
- uint16_t *r16;
- uint32_t *r32;
+ uint16_t *r16 = NULL;
+ uint32_t *r32 = NULL;
int w, i;
gf_t gf;
diff --git a/src/gf.c b/src/gf.c
index c14f03e..5a71ad6 100644
--- a/src/gf.c
+++ b/src/gf.c
@@ -767,7 +767,7 @@ void gf_set_region_data(gf_region_data *rd,
int xor,
int align)
{
- gf_internal_t *h;
+ gf_internal_t *h = NULL;
int wb;
uint32_t a;
unsigned long uls, uld;
diff --git a/src/gf_w8.c b/src/gf_w8.c
index b171639..44c42a5 100644
--- a/src/gf_w8.c
+++ b/src/gf_w8.c
@@ -799,9 +799,9 @@ gf_w8_logzero_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int
int gf_w8_log_init(gf_t *gf)
{
gf_internal_t *h;
- struct gf_w8_logtable_data *ltd;
- struct gf_w8_logzero_table_data *ztd;
- struct gf_w8_logzero_small_table_data *std;
+ struct gf_w8_logtable_data *ltd = NULL;
+ struct gf_w8_logzero_table_data *ztd = NULL;
+ struct gf_w8_logzero_small_table_data *std = NULL;
uint8_t *alt;
uint8_t *inv;
int i, b;
diff --git a/test/gf_unit.c b/test/gf_unit.c
index cf466fe..22d4905 100644
--- a/test/gf_unit.c
+++ b/test/gf_unit.c
@@ -80,6 +80,9 @@ int main(int argc, char **argv)
uint16_t a16, b16, c16, d16, *log16, *alog16;
char as[50], bs[50], cs[50], ds[50], ais[50], bis[50];
uint32_t mask;
+ uint8_t a8, b8, c8, *mult4 = NULL, *mult8 = NULL;
+ uint16_t a16, b16, c16, *log16 = NULL, *alog16 = NULL;
+ uint32_t mask = 0;
char *ra, *rb, *rc, *rd, *target;
int align;
diff --git a/tools/gf_inline_time.c b/tools/gf_inline_time.c
index e64f0b3..193c004 100644
--- a/tools/gf_inline_time.c
+++ b/tools/gf_inline_time.c
@@ -62,8 +62,8 @@ int main(int argc, char **argv)
int w, j, i, size, iterations;
gf_t gf;
double timer, elapsed, dnum, num;
- uint8_t *ra, *rb, *mult4, *mult8;
- uint16_t *ra16, *rb16, *log16, *alog16;
+ uint8_t *ra = NULL, *rb = NULL, *mult4, *mult8;
+ uint16_t *ra16 = NULL, *rb16 = NULL, *log16, *alog16;
time_t t0;
if (argc != 5) usage(NULL);