Some compiler warning fixes
This commit is contained in:
parent
07628903b7
commit
0caaa2c926
5 changed files with 24 additions and 20 deletions
|
@ -207,9 +207,9 @@ CommandLineParser::init_ini(Options* opts)
|
|||
("square-axis", &opts->square_axis)
|
||||
("four-way-restrictor", &opts->four_way_restrictor)
|
||||
("dpad-rotation", &opts->dpad_rotation)
|
||||
("evdev-device", &opts->evdev_device);
|
||||
("evdev-device", &opts->evdev_device)
|
||||
|
||||
m_ini.section("uinput")
|
||||
// uinput stuff
|
||||
("device-name", &opts->uinput_config.device_name)
|
||||
("trigger-as-button", &opts->uinput_config.trigger_as_button)
|
||||
("trigger-as-zaxis", &opts->uinput_config.trigger_as_zaxis)
|
||||
|
@ -550,6 +550,10 @@ CommandLineParser::parse_args(int argc, char** argv, Options* options)
|
|||
|
||||
case OPTION_WID:
|
||||
opts.wireless_id = boost::lexical_cast<int>(opt.argument);
|
||||
if (opts.wireless_id < 0 || opts.wireless_id > 3)
|
||||
{
|
||||
throw std::runtime_error("wireless id must be within 0 and 3");
|
||||
}
|
||||
break;
|
||||
|
||||
case OPTION_LED:
|
||||
|
|
|
@ -181,7 +181,7 @@ EvdevController::read_data_to_buffer()
|
|||
int rd = 0;
|
||||
while((rd = ::read(m_fd, ev, sizeof(struct input_event) * 128)) > 0)
|
||||
{
|
||||
for (int i = 0; i < rd / (int)sizeof(struct input_event); ++i)
|
||||
for (size_t i = 0; i < rd / sizeof(struct input_event); ++i)
|
||||
{
|
||||
m_event_buffer.push(ev[i]);
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ INIParser::get_value()
|
|||
std::ostringstream str;
|
||||
while(peek() != ' ' && peek() != '\t' && peek() != '\n')
|
||||
{
|
||||
str << (char)peek();
|
||||
str << static_cast<char>(peek());
|
||||
next();
|
||||
}
|
||||
return str.str();
|
||||
|
@ -179,7 +179,7 @@ INIParser::get_ident()
|
|||
std::ostringstream str;
|
||||
while(peek() != '=' && peek() != ' ' && peek() != '\t')
|
||||
{
|
||||
str << (char)peek();
|
||||
str << static_cast<char>(peek());
|
||||
next();
|
||||
}
|
||||
return str.str();
|
||||
|
@ -203,12 +203,12 @@ INIParser::get_string()
|
|||
case 't': str << '\t'; break;
|
||||
case 'r': str << '\r'; break;
|
||||
case 'n': str << '\n'; break;
|
||||
default: str << '\\' << (char)peek(); break;
|
||||
default: str << '\\' << static_cast<char>(peek()); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
str << (char)peek();
|
||||
str << static_cast<char>(peek());
|
||||
}
|
||||
next();
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ INIParser::get_section()
|
|||
std::ostringstream str;
|
||||
while(peek() != ']')
|
||||
{
|
||||
str << (char)peek();
|
||||
str << static_cast<char>(peek());
|
||||
next();
|
||||
}
|
||||
return str.str();
|
||||
|
|
|
@ -70,9 +70,9 @@ public:
|
|||
|
||||
std::string str() const
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << *m_data;
|
||||
return str.str();
|
||||
std::ostringstream out;
|
||||
out << *m_data;
|
||||
return out.str();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -90,9 +90,9 @@ public:
|
|||
|
||||
std::string str() const
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << *m_data;
|
||||
return str.str();
|
||||
std::ostringstream out;
|
||||
out << *m_data;
|
||||
return out.str();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -254,9 +254,9 @@ INISchema::section(const std::string& name,
|
|||
delete i->second;
|
||||
}
|
||||
|
||||
INISchemaSection* section = new INISchemaSection(callback);
|
||||
m_sections.insert(std::pair<std::string, INISchemaSection*>(name, section));
|
||||
return *section;
|
||||
INISchemaSection* sec = new INISchemaSection(callback);
|
||||
m_sections.insert(std::pair<std::string, INISchemaSection*>(name, sec));
|
||||
return *sec;
|
||||
}
|
||||
|
||||
INISchemaSection*
|
||||
|
|
|
@ -520,10 +520,10 @@ uInput::send_button(XboxButton code, bool value)
|
|||
{
|
||||
for(int j = 0; j < XBOX_BTN_MAX; ++j) // iterate over all shift buttons
|
||||
{
|
||||
const ButtonEvent& event = cfg.btn_map.lookup(static_cast<XboxButton>(j),
|
||||
const ButtonEvent& event2 = cfg.btn_map.lookup(static_cast<XboxButton>(j),
|
||||
static_cast<XboxButton>(i));
|
||||
if (event.is_valid())
|
||||
event.send(*this, false);
|
||||
if (event2.is_valid())
|
||||
event2.send(*this, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue