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:
Mark de Wever 2010-06-12 16:03:53 +00:00
parent 9af4c11072
commit b1e7df8100

View file

@ -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_) {