Skip to content

Commit

Permalink
Refactor: fix uninitialized variable warnings from Pelles C
Browse files Browse the repository at this point in the history
  • Loading branch information
positively-charged committed Jun 25, 2017
1 parent 727540f commit 4a5da41
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/cache/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ static void restore_namespace( struct restorer* restorer, bool upmost ) {
static void restore_namespace_path( struct restorer* restorer ) {
// Restore namespace path.
struct ns_path* head = NULL;
struct ns_path* tail;
struct ns_path* tail = NULL;
while ( f_peek( restorer->r ) == F_NAMESPACE ) {
RF( restorer, F_NAMESPACE );
struct ns_path* path = mem_alloc( sizeof( *path ) );
Expand Down Expand Up @@ -901,7 +901,7 @@ static void restore_spec( struct restorer* restorer,

static struct path* restore_path( struct restorer* restorer ) {
struct path* head = NULL;
struct path* tail;
struct path* tail = NULL;
if ( f_peek( restorer->r ) == F_PATH ) {
RF( restorer, F_PATH );
while ( f_peek( restorer->r ) != F_END ) {
Expand All @@ -926,7 +926,7 @@ static struct path* restore_path( struct restorer* restorer ) {

static struct ref* restore_ref( struct restorer* restorer ) {
struct ref* head = NULL;
struct ref* tail;
struct ref* tail = NULL;
while ( f_peek( restorer->r ) == F_REF ) {
RF( restorer, F_REF );
struct pos pos;
Expand Down Expand Up @@ -982,7 +982,7 @@ static struct ref* restore_specific_ref( struct restorer* restorer,

static struct dim* restore_dim( struct restorer* restorer ) {
struct dim* head = NULL;
struct dim* tail;
struct dim* tail = NULL;
while ( f_peek( restorer->r ) == F_DIM ) {
struct dim* dim = t_alloc_dim();
RF( restorer, F_DIM );
Expand Down Expand Up @@ -1133,7 +1133,7 @@ static void restore_impl( struct restorer* restorer, struct func* func ) {

static struct param* restore_param_list( struct restorer* restorer ) {
struct param* head = NULL;
struct param* tail;
struct param* tail = NULL;
while ( f_peek( restorer->r ) == F_PARAM ) {
RF( restorer, F_PARAM );
struct param* param = t_alloc_param();
Expand Down
4 changes: 2 additions & 2 deletions src/codegen/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2861,7 +2861,7 @@ static void push_ref_array_length( struct codegen* codegen,

static void copy_struct( struct codegen* codegen, struct result* result,
struct memcpy_call* call ) {
int dst_ofs;
int dst_ofs = 0;
struct result dst;
init_result( &dst, true );
visit_operand( codegen, &dst, call->destination->root );
Expand All @@ -2871,7 +2871,7 @@ static void copy_struct( struct codegen* codegen, struct result* result,
c_pcd( codegen, PCD_ADD );
c_pcd( codegen, PCD_ASSIGNSCRIPTVAR, dst_ofs );
}
int src_ofs;
int src_ofs = 0;
struct result src;
init_result( &src, true );
visit_operand( codegen, &src, call->source->root );
Expand Down
2 changes: 1 addition & 1 deletion src/parse/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ static void read_call_args( struct parse* parse, struct expr_reading* reading,

static struct format_item* read_format_item_list( struct parse* parse ) {
struct format_item* head = NULL;
struct format_item* tail;
struct format_item* tail = NULL;
while ( true ) {
struct format_item* item = read_format_item( parse );
if ( head ) {
Expand Down

0 comments on commit 4a5da41

Please sign in to comment.