Fixed sending string to FormatLine

varargs does not support type String.
This commit is contained in:
Chris Teubert
2015-05-20 10:18:13 -07:00
parent be8f92eaa2
commit 2889f4e3ce
3 changed files with 9 additions and 9 deletions

View File

@@ -313,12 +313,12 @@ namespace XPC
}
if (!xdref) // DREF does not exist
{
Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid DREF %s", dref);
Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid DREF %s", dref.c_str());
return 0;
}
XPLMDataTypeID dataType = XPLMGetDataRefTypes(xdref);
Log::FormatLine(LOG_INFO, "DMAN", "Get DREF %s (x:%X) Type: %i", dref, xdref, dataType);
Log::FormatLine(LOG_INFO, "DMAN", "Get DREF %s (x:%X) Type: %i", dref.c_str(), xdref, dataType);
// XPLMDataTypeID is a bit flag, so it may contain more than one of the
// following types. We prefer types as close to float as possible.
if ((dataType & 2) == 2) // Float
@@ -518,7 +518,7 @@ namespace XPC
if (!xdref)
{
// DREF does not exist
Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid DREF %s", dref);
Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid DREF %s", dref.c_str());
return;
}
if (isnan(values[0]))

View File

@@ -121,7 +121,7 @@ namespace XPC
{
Log::WriteLine(LOG_DEBUG, "DBUG", ss.str());
std::string dref((char*)buffer + 6, buffer[5]);
Log::FormatLine(LOG_DEBUG, "DBUG", " DREF (size %i) = %s", dref.length(), dref);
Log::FormatLine(LOG_DEBUG, "DBUG", " DREF (size %i) = %s", dref.length(), dref.c_str());
ss.str("");
int values = buffer[6 + buffer[5]];
ss << " Values(size " << values << ") =";
@@ -140,7 +140,7 @@ namespace XPC
{
std::string dref((char*)buffer + cur + 1, buffer[cur]);
Log::FormatLine(LOG_DEBUG, "DBUG", " #%i/%i (size:%i) %s",
i + 1, buffer[5], dref.length(), dref);
i + 1, buffer[5], dref.length(), dref.c_str());
cur += 1 + buffer[cur];
}
break;

View File

@@ -89,7 +89,7 @@ namespace XPC
// Set current connection
sockaddr sourceaddr = msg.GetSource();
connectionKey = UDPSocket::GetHost(&sourceaddr);
Log::FormatLine(LOG_INFO, "MSGH", "Handling message from %s", connectionKey);
Log::FormatLine(LOG_INFO, "MSGH", "Handling message from %s", connectionKey.c_str());
std::map<std::string, ConnectionInfo>::iterator conn = connections.find(connectionKey);
if (conn == connections.end()) // New connection
{
@@ -102,13 +102,13 @@ namespace XPC
connection.getdCount = 0;
connections[connectionKey] = connection;
Log::FormatLine(LOG_DEBUG, "MSGH", "New connection. ID=%u, Remote=%s",
connection.id, connectionKey);
connection.id, connectionKey.c_str());
}
else
{
connection = (*conn).second;
Log::FormatLine(LOG_DEBUG, "MSGH", "Existing connection. ID=%u, Remote=%s",
connection.id, connectionKey);
connection.id, connectionKey.c_str());
}
msg.PrintToLog();
@@ -417,7 +417,7 @@ namespace XPC
pos += 4 * valueCount;
DataManager::Set(dref, values, valueCount);
Log::FormatLine(LOG_DEBUG, "DREF", "Set %d values for %s", valueCount, dref);
Log::FormatLine(LOG_DEBUG, "DREF", "Set %d values for %s", valueCount, dref.c_str());
}
if (pos != size)
{