Keep gcc from complaining about uninitialized variables

This commit is contained in:
Larry Doolittle 2015-08-14 13:22:17 -07:00 committed by Clifford Wolf
parent 0350074819
commit 022f570563
2 changed files with 3 additions and 3 deletions

View File

@ -2102,9 +2102,9 @@ AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m
AstNode *block = new AstNode(AST_BLOCK); AstNode *block = new AstNode(AST_BLOCK);
AstNode *meminit = nullptr; AstNode *meminit = nullptr;
int next_meminit_cursor; int next_meminit_cursor=0;
vector<State> meminit_bits; vector<State> meminit_bits;
int meminit_size; int meminit_size=0;
std::ifstream f; std::ifstream f;
f.open(mem_filename.c_str()); f.open(mem_filename.c_str());

View File

@ -79,7 +79,7 @@ void handle_memory(RTLIL::Module *module, RTLIL::Cell *memory)
Const initval = memory->parameters.at("\\INIT"); Const initval = memory->parameters.at("\\INIT");
RTLIL::Cell *last_init_cell = nullptr; RTLIL::Cell *last_init_cell = nullptr;
SigSpec last_init_data; SigSpec last_init_data;
int last_init_addr; int last_init_addr=0;
for (int i = 0; i < GetSize(initval) && i/mem->width < (1 << abits); i += mem->width) { for (int i = 0; i < GetSize(initval) && i/mem->width < (1 << abits); i += mem->width) {
Const val = initval.extract(i, mem->width, State::Sx); Const val = initval.extract(i, mem->width, State::Sx);