[Spice-commits] SpiceXPI/src
Hans de Goede
jwrdegoede at kemper.freedesktop.org
Tue Jun 7 05:21:28 PDT 2011
SpiceXPI/src/plugin/controller.cpp | 4 ++--
SpiceXPI/src/plugin/debug.h | 2 --
SpiceXPI/src/plugin/nsScriptablePeer.cpp | 2 +-
SpiceXPI/src/plugin/nsScriptablePeer.h | 2 --
SpiceXPI/src/plugin/nsScriptablePeerBase.cpp | 2 +-
SpiceXPI/src/plugin/plugin.cpp | 7 +++++--
6 files changed, 9 insertions(+), 10 deletions(-)
New commits:
commit 636f3eabaa2511747623805e08eadeb3ffc4dfb9
Author: Hans de Goede <hdegoede at redhat.com>
Date: Tue Jun 7 14:06:37 2011 +0200
Fix compiler warnings
diff --git a/SpiceXPI/src/plugin/controller.cpp b/SpiceXPI/src/plugin/controller.cpp
index 2c1d9f4..256dbf9 100644
--- a/SpiceXPI/src/plugin/controller.cpp
+++ b/SpiceXPI/src/plugin/controller.cpp
@@ -148,9 +148,9 @@ void SpiceController::Disconnect()
uint32_t SpiceController::Write(const void *lpBuffer, uint32_t nBytesToWrite)
{
- int len = send(m_client_socket, lpBuffer, nBytesToWrite, 0);
+ ssize_t len = send(m_client_socket, lpBuffer, nBytesToWrite, 0);
- if (len != nBytesToWrite)
+ if (len != (ssize_t)nBytesToWrite)
{
LOG_WARN("send error, bytes to write = " << nBytesToWrite <<
", bytes actually written = " << len << ", errno = " << errno);
diff --git a/SpiceXPI/src/plugin/debug.h b/SpiceXPI/src/plugin/debug.h
index c89e368..4b58491 100644
--- a/SpiceXPI/src/plugin/debug.h
+++ b/SpiceXPI/src/plugin/debug.h
@@ -85,8 +85,6 @@ static inline std::string pretty_func_to_func_name(const std::string& f_name)
# define FUNC_NAME __FUNCTION__
#endif
-#define LOGGER_SECTION(section) LOG4CPP_LOGGER(section)
-
LOG4CPP_LOGGER("spice")
#define LOG(func, message) { \
diff --git a/SpiceXPI/src/plugin/nsScriptablePeer.cpp b/SpiceXPI/src/plugin/nsScriptablePeer.cpp
index 68a74fb..b9319a7 100644
--- a/SpiceXPI/src/plugin/nsScriptablePeer.cpp
+++ b/SpiceXPI/src/plugin/nsScriptablePeer.cpp
@@ -175,7 +175,7 @@ bool ScriptablePluginObject::GetProperty(NPIdentifier name, NPVariant *result)
VOID_TO_NPVARIANT(*result);
if (!m_plugin)
- return true;
+ return false;
if (name == m_id_host_ip)
STRINGZ_TO_NPVARIANT(m_plugin->GetHostIP(), *result);
diff --git a/SpiceXPI/src/plugin/nsScriptablePeer.h b/SpiceXPI/src/plugin/nsScriptablePeer.h
index 5c22612..dd97d14 100644
--- a/SpiceXPI/src/plugin/nsScriptablePeer.h
+++ b/SpiceXPI/src/plugin/nsScriptablePeer.h
@@ -124,8 +124,6 @@ static NPClass s##_class##_NPClass = { \
#define GET_NPOBJECT_CLASS(_class) &s##_class##_NPClass
NPObject *AllocateScriptablePluginObject(NPP npp, NPClass *aClass);
-DECLARE_NPOBJECT_CLASS_WITH_BASE(ScriptablePluginObject,
- AllocateScriptablePluginObject);
//void NPIdentifiersInit();
diff --git a/SpiceXPI/src/plugin/nsScriptablePeerBase.cpp b/SpiceXPI/src/plugin/nsScriptablePeerBase.cpp
index 9897be1..eaf3661 100644
--- a/SpiceXPI/src/plugin/nsScriptablePeerBase.cpp
+++ b/SpiceXPI/src/plugin/nsScriptablePeerBase.cpp
@@ -173,7 +173,7 @@ bool ScriptablePluginObjectBase::_HasProperty(NPObject * npobj, NPIdentifier nam
bool ScriptablePluginObjectBase::_GetProperty(NPObject *npobj, NPIdentifier name,
NPVariant *result)
{
- static_cast<ScriptablePluginObjectBase *>(npobj)->GetProperty(name, result);
+ return static_cast<ScriptablePluginObjectBase *>(npobj)->GetProperty(name, result);
}
// static
diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index bd116e5..793f2ba 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -86,6 +86,9 @@ static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
#include "plugin.h"
#include "nsScriptablePeer.h"
+DECLARE_NPOBJECT_CLASS_WITH_BASE(ScriptablePluginObject,
+ AllocateScriptablePluginObject);
+
namespace {
const std::string ver(PACKAGE_VERSION);
const std::string PLUGIN_NAME = "Spice Firefox Plugin " + ver;
@@ -202,8 +205,6 @@ nsPluginInstance::nsPluginInstance(NPP aInstance):
char tmp_dir[] = "/tmp/spicec-XXXXXX";
m_tmp_dir = mkdtemp(tmp_dir);
- LOGGER_SECTION("spice.plugin");
-
// configure log4cpp
std::ifstream log_init(LOGGER_CONFIG.c_str());
if (log_init.good())
@@ -467,6 +468,7 @@ unsigned short nsPluginInstance::GetUsbListenPort() const
// this method exists due to RHEVM 2.2
// and should be removed some time in future,
// when fixed in RHEVM
+ return 0;
}
void nsPluginInstance::SetUsbListenPort(unsigned short aUsbPort)
@@ -482,6 +484,7 @@ PRBool nsPluginInstance::GetUsbAutoShare() const
// this method exists due to RHEVM 2.2
// and should be removed some time in future,
// when fixed in RHEVM
+ return false;
}
void nsPluginInstance::SetUsbAutoShare(PRBool aUsbAutoShare)
More information about the Spice-commits
mailing list