Skip to content

Commit

Permalink
FIX: resolved some of possibly uninitialized variables warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Aug 24, 2021
1 parent 17e9d0f commit 9f0b072
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/core/t-gob.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,8 @@ const REBCNT Gob_Flag_Words[] = {
REBVAL *arg;
REBGOB *gob = 0;
REBGOB *ngob;
REBCNT index;
REBCNT tail;
REBCNT index = 0;
REBCNT tail = 0;
REBCNT len;

arg = D_ARG(2);
Expand Down
4 changes: 2 additions & 2 deletions src/core/t-image.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ INLINE REBCNT ARGB_To_BGR(REBCNT i)
REBVAL *len = D_ARG(4);
REBVAL *count = D_ARG(7);
REBINT part = 1; // /part len
REBINT partx, party;
REBINT partx = 0, party = 0;
REBINT dup = 1; // /dup count
REBINT dupx, dupy;
REBOOL only = 0; // /only
Expand Down Expand Up @@ -997,7 +997,7 @@ INLINE REBCNT ARGB_To_BGR(REBCNT i)
REBSER *series = VAL_SERIES(value);
REBINT index = (REBINT)VAL_INDEX(value);
REBINT tail;
REBINT diff, len, w, h;
REBINT diff, len = 0, w, h;
REBVAL *val;

// Clip index if past tail:
Expand Down
2 changes: 1 addition & 1 deletion src/core/t-integer.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
REBVAL *val = D_ARG(1);
REBVAL *val2 = D_ARG(2);
REBI64 num;
REBI64 arg;
REBI64 arg = 0;
REBINT n;

REBU64 p; // for overflow detection
Expand Down
2 changes: 1 addition & 1 deletion src/core/t-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
{
REBVAL *val = D_ARG(1);
REBVAL *arg = D_ARG(2);
REBINT n;
REBINT n = 0;
REBSER *series = VAL_SERIES(val);

// Check must be in this order (to avoid checking a non-series value);
Expand Down
6 changes: 3 additions & 3 deletions src/core/t-pair.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@
{
REBVAL *val;
REBVAL *arg = NULL;
REBINT n;
REBD32 x1, x2;
REBD32 y1, y2;
REBINT n = 0;
REBD32 x1, x2 = 0.0;
REBD32 y1, y2 = 0.0;

val = D_ARG(1);
x1 = VAL_PAIR_X(val);
Expand Down
8 changes: 4 additions & 4 deletions src/core/t-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ static struct {
REBSER *ser;
REB_MOLD mo = {0};
REBCNT n;
REBUNI c;
REBUNI c = 0;
REBSER *arg;

if (pvs->setval) return PE_BAD_SET;
Expand Down Expand Up @@ -559,8 +559,8 @@ static struct {
{
REBVAL *value = D_ARG(1);
REBVAL *arg = D_ARG(2);
REBINT index;
REBINT tail;
REBINT index = 0;
REBINT tail = 0;
REBINT len;
REBSER *ser;
REBCNT type;
Expand Down Expand Up @@ -676,7 +676,7 @@ static struct {
return R_RET;
}
else {
REBUNI c;
REBUNI c = 0;
arg = D_ARG(3);
if (IS_CHAR(arg))
c = VAL_CHAR(arg);
Expand Down
4 changes: 2 additions & 2 deletions src/core/t-tuple.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@
REBCNT len = 0;
REBCNT alen;
REBI64 v;
REBI64 a;
REBDEC dec;
REBI64 a = 0;
REBDEC dec = 0.0;

value = D_ARG(1);
if (IS_TUPLE(value)) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/t-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ void Set_Vector_Row(REBSER *ser, REBVAL *blk)
REBCNT l2 = VAL_LEN(v2);
REBCNT len = MIN(l1, l2);
REBCNT n;
REBU64 i1;
REBU64 i2;
REBU64 i1 = 0;
REBU64 i2 = 0;
REBYTE *d1 = VAL_SERIES(v1)->data;
REBYTE *d2 = VAL_SERIES(v2)->data;
REBCNT b1 = VECT_TYPE(VAL_SERIES(v1));
Expand Down
2 changes: 1 addition & 1 deletion src/core/t-word.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
REBVAL *arg = D_ARG(2);
REBCNT type = VAL_TYPE(val);
REBINT diff;
REBCNT sym;
REBCNT sym = 0;

switch (action) {
case A_LENGTHQ:
Expand Down
4 changes: 2 additions & 2 deletions src/core/u-bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void Unmap_Bytes(void *srcp, REBYTE **dstp, char *map) {
**
***********************************************************************/
{
REBINT i, j, x, y, c;
REBINT i, j, x = 0, y, c = 0;
REBINT colors, compression, bitcount;
REBINT w, h;
BITMAPFILEHEADER bmfh;
Expand Down Expand Up @@ -644,4 +644,4 @@ void Unmap_Bytes(void *srcp, REBYTE **dstp, char *map) {
Register_Codec("bmp", Codec_BMP_Image);
}

#endif //INCLUDE_BMP_CODEC
#endif //INCLUDE_BMP_CODEC
2 changes: 1 addition & 1 deletion src/core/u-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
***********************************************************************/
{
REBSER *series = parse->series;
REBCNT i;
REBCNT i = 0;
REBSER *ser;

// TO a specific index position.
Expand Down
12 changes: 6 additions & 6 deletions src/core/u-png.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static unsigned int calc_color(unsigned int color,unsigned short alpha) {

static void process_row_0_1(unsigned char *p,int width,int r,int hoff,int hskip) {
int c;
unsigned char m;
unsigned char m = '\0';
unsigned int v,*imgp;

imgp=img_output+r*png_ihdr.width+hoff;
Expand All @@ -241,7 +241,7 @@ static void process_row_0_1(unsigned char *p,int width,int r,int hoff,int hskip)

static void process_row_0_2(unsigned char *p,int width,int r,int hoff,int hskip) {
int c;
unsigned char m;
unsigned char m = '\0';
unsigned int v,*imgp;

imgp=img_output+r*png_ihdr.width+hoff;
Expand All @@ -263,7 +263,7 @@ static void process_row_0_2(unsigned char *p,int width,int r,int hoff,int hskip)

static void process_row_0_4(unsigned char *p,int width,int r,int hoff,int hskip) {
int c;
unsigned char m;
unsigned char m = '\0';
unsigned int v,*imgp;

imgp=img_output+r*png_ihdr.width+hoff;
Expand Down Expand Up @@ -359,7 +359,7 @@ static void process_row_2_16(unsigned char *p,int width,int r,int hoff,int hskip

static void process_row_3_1(unsigned char *p,int width,int r,int hoff,int hskip) {
int c;
unsigned char m;
unsigned char m = '\0';
unsigned int v,*imgp;

imgp=img_output+r*png_ihdr.width+hoff;
Expand All @@ -375,7 +375,7 @@ static void process_row_3_1(unsigned char *p,int width,int r,int hoff,int hskip)

static void process_row_3_2(unsigned char *p,int width,int r,int hoff,int hskip) {
int c;
unsigned char m;
unsigned char m = '\0';
unsigned int v,*imgp;

imgp=img_output+r*png_ihdr.width+hoff;
Expand All @@ -391,7 +391,7 @@ static void process_row_3_2(unsigned char *p,int width,int r,int hoff,int hskip)

static void process_row_3_4(unsigned char *p,int width,int r,int hoff,int hskip) {
int c;
unsigned char m;
unsigned char m = '\0';
unsigned int v,*imgp;

imgp=img_output+r*png_ihdr.width+hoff;
Expand Down

0 comments on commit 9f0b072

Please sign in to comment.