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>
master
Loic Dachary 2014-03-06 14:48:34 +01:00
parent d8863ceff7
commit 3c4a451b50
5 changed files with 11 additions and 8 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);