Permalink
Browse files

DSPAssembler: In-class initialize members where applicable

Avoids repeating ourself in the initializer list and makes the class
have a predictable initial state.
  • Loading branch information...
lioncash committed Jun 18, 2018
1 parent 091efcc commit 1389bf35bd7bd62364d9221e825b392d9d330d7d
Showing with 10 additions and 12 deletions.
  1. +1 −3 Source/Core/Core/DSP/DSPAssembler.cpp
  2. +9 −9 Source/Core/Core/DSP/DSPAssembler.h
@@ -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 @@ class DSPAssembler
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

0 comments on commit 1389bf3

Please sign in to comment.