Skip to content

Commit

Permalink
Refactor: fix inconsistent storage 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 99ecb6f commit 727540f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/codegen/chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static void do_svct( struct codegen* codegen ) {
}
}

inline bool svct_script( struct script* script ) {
inline static bool svct_script( struct script* script ) {
enum { DEFAULT_SCRIPT_SIZE = 20 };
return ( script->size > DEFAULT_SCRIPT_SIZE );
}
Expand Down Expand Up @@ -968,7 +968,7 @@ static void do_mstr( struct codegen* codegen ) {
}
}

inline bool mstr_var( struct var* var ) {
inline static bool mstr_var( struct var* var ) {
return ( var->desc == DESC_PRIMITIVEVAR && var->initial_has_str ) ||
( var->desc == DESC_REFVAR && var->ref->type == REF_FUNCTION );
}
Expand Down Expand Up @@ -999,7 +999,7 @@ static void do_astr( struct codegen* codegen ) {
}
}

inline bool astr_var( struct var* var ) {
inline static bool astr_var( struct var* var ) {
return ( var->desc == DESC_ARRAY && ( var->initial_has_str ||
( var->ref && var->ref->type == REF_FUNCTION ) ) );
}
Expand Down Expand Up @@ -1200,7 +1200,7 @@ static void write_sary_chunk( struct codegen* codegen, const char* chunk_name,
}
}

inline bool script_array( struct var* var ) {
inline static bool script_array( struct var* var ) {
return ( var->storage == STORAGE_LOCAL && ( var->dim ||
( ! var->ref && var->structure ) ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static void write_switch_casegoto( struct codegen* codegen,
set_jumps_point( codegen, stmt->jump_break, exit_point );
}

inline bool string_switch( struct switch_stmt* stmt ) {
inline static bool string_switch( struct switch_stmt* stmt ) {
return ( stmt->cond.expr ?
stmt->cond.expr->spec == SPEC_STR :
stmt->cond.var->spec == SPEC_STR );
Expand Down
6 changes: 3 additions & 3 deletions src/parse/dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static void read_enum( struct parse* parse, struct dec* dec ) {
}
}

inline bool is_enum_def( struct parse* parse ) {
inline static bool is_enum_def( struct parse* parse ) {
return parse->tk == TK_ENUM && (
p_peek( parse ) == TK_BRACE_L ||
p_peek( parse ) == TK_COLON || ( ( p_peek( parse ) == TK_ID ||
Expand Down Expand Up @@ -525,7 +525,7 @@ static void read_struct( struct parse* parse, struct dec* dec ) {
}
}

inline bool is_struct_def( struct parse* parse ) {
inline static bool is_struct_def( struct parse* parse ) {
return ( parse->tk == TK_STRUCT && ( p_peek( parse ) == TK_BRACE_L ||
( ( p_peek( parse ) == TK_ID || p_peek( parse ) == TK_TYPENAME ) &&
p_peek_2nd( parse ) == TK_BRACE_L ) ) );
Expand Down Expand Up @@ -1205,7 +1205,7 @@ static void read_name( struct parse* parse, struct dec* dec ) {
}
}

inline bool is_name( struct parse* parse, struct dec* dec ) {
inline static bool is_name( struct parse* parse, struct dec* dec ) {
return ( ( dec->type_alias && parse->tk == TK_TYPENAME ) ||
( ! dec->type_alias && parse->tk == TK_ID ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/parse/token/dirc.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static void read_macro_name( struct parse* parse,
p_read_stream( parse );
}

inline bool valid_macro_name( const char* name ) {
inline static bool valid_macro_name( const char* name ) {
// At this time, only one name is reserved and cannot be used.
return ( strcmp( name, "defined" ) != 0 );
}
Expand Down
4 changes: 2 additions & 2 deletions src/semantic/type.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ void s_take_fine_type_snapshot( struct type_info* type,
snapshot->storage = type->storage;
}

struct ref* dup_ref( struct ref* ref ) {
static struct ref* dup_ref( struct ref* ref ) {
size_t size = 0;
switch ( ref->type ) {
case REF_ARRAY: size = sizeof( struct ref_array ); break;
Expand Down Expand Up @@ -749,7 +749,7 @@ bool s_same_storageignored_type( struct type_info* a, struct type_info* b ) {
return s_same_type( &temp_a, &temp_b );
}

void set_storage( struct type_info* type, int storage ) {
static void set_storage( struct type_info* type, int storage ) {
if ( type->ref ) {
if ( ! type->ref->implicit ) {
create_implicit_ref( type );
Expand Down

0 comments on commit 727540f

Please sign in to comment.