mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Fix cppcheck warnings
This commit is contained in:
@@ -190,7 +190,7 @@ namespace XSwiftBus
|
||||
return true;
|
||||
}
|
||||
|
||||
void CDBusDispatcher::dbusRemoveWatch(DBusWatch *watch)
|
||||
void CDBusDispatcher::dbusRemoveWatch(const DBusWatch *watch)
|
||||
{
|
||||
for (auto it = m_watchers.begin(); it != m_watchers.end();)
|
||||
{
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace XSwiftBus
|
||||
void dispatch();
|
||||
|
||||
dbus_bool_t dbusAddWatch(DBusWatch *watch);
|
||||
void dbusRemoveWatch(DBusWatch *watch);
|
||||
void dbusRemoveWatch(const DBusWatch *watch);
|
||||
void dbusWatchToggled(DBusWatch *watch);
|
||||
|
||||
dbus_bool_t dbusAddTimeout(DBusTimeout *timeout);
|
||||
|
||||
@@ -103,6 +103,7 @@ namespace XSwiftBus
|
||||
return { XPLMCreateMenu(name.c_str(), m_data->id, XPLMAppendMenuItem(m_data->id, name.c_str(), nullptr, false), handler, itemsVoidPtr), false, std::move(items) };
|
||||
}
|
||||
|
||||
// cppcheck-suppress constParameter
|
||||
void CMenu::handler(void *menuRef, void *itemRef)
|
||||
{
|
||||
if (menuRef && itemRef)
|
||||
|
||||
@@ -980,8 +980,7 @@ namespace XSwiftBus
|
||||
int h = top - bottom;
|
||||
x -= left;
|
||||
y -= bottom;
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (DEBUG) { DEBUG_LOG("Follow aircraft coordinates w,h,x,y: " + std::to_string(w) + " " + std::to_string(h) + " " + std::to_string(x) + " " + std::to_string(y)); }
|
||||
if (DEBUG) { DEBUG_LOG("Follow aircraft coordinates w,h,x,y: " + std::to_string(w) + " " + std::to_string(h) + " " + std::to_string(x) + " " + std::to_string(y)); } // cppcheck-suppress knownConditionTrueFalse
|
||||
if (traffic->m_lastMouseX == x && traffic->m_lastMouseY == y && traffic->m_lastMouseX >= 0 && traffic->m_lastMouseY >= 0)
|
||||
{
|
||||
// mouse NOT moving, we lost focus or we do NOT move anymore
|
||||
@@ -1099,8 +1098,7 @@ namespace XSwiftBus
|
||||
return 0;
|
||||
}
|
||||
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (DEBUG)
|
||||
if (DEBUG) // cppcheck-suppress knownConditionTrueFalse
|
||||
{
|
||||
DEBUG_LOG("Camera: " + pos2String(cameraPosition));
|
||||
DEBUG_LOG("Follow aircraft " + traffic->m_followPlaneViewCallsign + " " + modelName);
|
||||
|
||||
Reference in New Issue
Block a user