DSPAssembler: In-class initialize members where applicable
Avoids repeating ourself in the initializer list and makes the class have a predictable initial state.
This commit is contained in:
parent
091efcc41d
commit
1389bf35bd
|
@ -51,9 +51,7 @@ static const char* err_string[] = {"",
|
|||
"Number out of range",
|
||||
"Program counter out of range"};
|
||||
|
||||
DSPAssembler::DSPAssembler(const AssemblerSettings& settings)
|
||||
: m_cur_addr(0), m_cur_pass(0), m_current_param(0), settings_(settings)
|
||||
|
||||
DSPAssembler::DSPAssembler(const AssemblerSettings& settings) : settings_(settings)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -107,23 +107,23 @@ private:
|
|||
std::string include_dir;
|
||||
std::string cur_line;
|
||||
|
||||
u32 m_cur_addr;
|
||||
int m_totalSize;
|
||||
u8 m_cur_pass;
|
||||
u32 m_cur_addr = 0;
|
||||
int m_totalSize = 0;
|
||||
u8 m_cur_pass = 0;
|
||||
|
||||
LabelMap labels;
|
||||
|
||||
u32 code_line;
|
||||
bool failed;
|
||||
u32 code_line = 0;
|
||||
bool failed = false;
|
||||
std::string last_error_str;
|
||||
AssemblerError last_error;
|
||||
AssemblerError last_error = AssemblerError::OK;
|
||||
|
||||
typedef std::map<std::string, std::string> AliasMap;
|
||||
AliasMap aliases;
|
||||
|
||||
segment_t cur_segment;
|
||||
u32 segment_addr[SEGMENT_MAX];
|
||||
int m_current_param;
|
||||
segment_t cur_segment = SEGMENT_CODE;
|
||||
u32 segment_addr[SEGMENT_MAX] = {};
|
||||
int m_current_param = 0;
|
||||
const AssemblerSettings settings_;
|
||||
};
|
||||
} // namespace DSP
|
||||
|
|
Loading…
Reference in New Issue