Make Wesnoth more compatible with C++0x (g++-4.5).
Prevent narrowing when using an initializer list to initialize token_desc.
This commit is contained in:
parent
9af4c11072
commit
b1e7df8100
1 changed files with 7 additions and 1 deletions
|
@ -349,6 +349,12 @@ class preprocessor_data: preprocessor
|
|||
/** Description of a preprocessing chunk. */
|
||||
struct token_desc
|
||||
{
|
||||
token_desc(const char type, const int stack_pos, const int linenum)
|
||||
: type(type)
|
||||
, stack_pos(stack_pos)
|
||||
, linenum(linenum)
|
||||
{
|
||||
}
|
||||
/** @todo FIXME: add enum for token type. */
|
||||
/**
|
||||
* Preprocessor state.
|
||||
|
@ -493,7 +499,7 @@ preprocessor_data::~preprocessor_data()
|
|||
|
||||
void preprocessor_data::push_token(char t)
|
||||
{
|
||||
token_desc token = { t, strings_.size(), linenum_ };
|
||||
token_desc token(t, strings_.size(), linenum_);
|
||||
tokens_.push_back(token);
|
||||
std::ostringstream s;
|
||||
if (!skipping_ && slowpath_) {
|
||||
|
|
Loading…
Add table
Reference in a new issue