Commit 3c4a451b509cfc3d51f9906326a66ac3e95de9d4

Authored by Loic Dachary
1 parent d8863cef
Exists in master and in 2 other branches v2, v3

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>
examples/gf_example_2.c
... ... @@ -28,8 +28,8 @@ int main(int argc, char **argv)
28 28 {
29 29 uint32_t a, b, c;
30 30 uint8_t *r1, *r2;
31   - uint16_t *r16;
32   - uint32_t *r32;
  31 + uint16_t *r16 = NULL;
  32 + uint32_t *r32 = NULL;
33 33 int w, i;
34 34 gf_t gf;
35 35  
... ...
src/gf.c
... ... @@ -767,7 +767,7 @@ void gf_set_region_data(gf_region_data *rd,
767 767 int xor,
768 768 int align)
769 769 {
770   - gf_internal_t *h;
  770 + gf_internal_t *h = NULL;
771 771 int wb;
772 772 uint32_t a;
773 773 unsigned long uls, uld;
... ...
src/gf_w8.c
... ... @@ -799,9 +799,9 @@ gf_w8_logzero_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int
799 799 int gf_w8_log_init(gf_t *gf)
800 800 {
801 801 gf_internal_t *h;
802   - struct gf_w8_logtable_data *ltd;
803   - struct gf_w8_logzero_table_data *ztd;
804   - struct gf_w8_logzero_small_table_data *std;
  802 + struct gf_w8_logtable_data *ltd = NULL;
  803 + struct gf_w8_logzero_table_data *ztd = NULL;
  804 + struct gf_w8_logzero_small_table_data *std = NULL;
805 805 uint8_t *alt;
806 806 uint8_t *inv;
807 807 int i, b;
... ...
test/gf_unit.c
... ... @@ -80,6 +80,9 @@ int main(int argc, char **argv)
80 80 uint16_t a16, b16, c16, d16, *log16, *alog16;
81 81 char as[50], bs[50], cs[50], ds[50], ais[50], bis[50];
82 82 uint32_t mask;
  83 + uint8_t a8, b8, c8, *mult4 = NULL, *mult8 = NULL;
  84 + uint16_t a16, b16, c16, *log16 = NULL, *alog16 = NULL;
  85 + uint32_t mask = 0;
83 86 char *ra, *rb, *rc, *rd, *target;
84 87 int align;
85 88  
... ...
tools/gf_inline_time.c
... ... @@ -62,8 +62,8 @@ int main(int argc, char **argv)
62 62 int w, j, i, size, iterations;
63 63 gf_t gf;
64 64 double timer, elapsed, dnum, num;
65   - uint8_t *ra, *rb, *mult4, *mult8;
66   - uint16_t *ra16, *rb16, *log16, *alog16;
  65 + uint8_t *ra = NULL, *rb = NULL, *mult4, *mult8;
  66 + uint16_t *ra16 = NULL, *rb16 = NULL, *log16, *alog16;
67 67 time_t t0;
68 68  
69 69 if (argc != 5) usage(NULL);
... ...