Fix most of the warnings with -Wextra -Wshadow

This commit is contained in:
Hubert Figuiere 2009-07-19 18:42:18 -04:00
parent e2cde7d225
commit 340dc8a667
22 changed files with 154 additions and 147 deletions

View file

@ -72,211 +72,211 @@ private:
struct DXXAPI ErrorFailed : public Error struct DXXAPI ErrorFailed : public Error
{ {
ErrorFailed(const char *message) ErrorFailed(const char *msg)
: Error("org.freedesktop.DBus.Error.Failed", message) : Error("org.freedesktop.DBus.Error.Failed", msg)
{} {}
}; };
struct DXXAPI ErrorNoMemory : public Error struct DXXAPI ErrorNoMemory : public Error
{ {
ErrorNoMemory(const char *message) ErrorNoMemory(const char *msg)
: Error("org.freedesktop.DBus.Error.NoMemory", message) : Error("org.freedesktop.DBus.Error.NoMemory", msg)
{} {}
}; };
struct DXXAPI ErrorServiceUnknown : public Error struct DXXAPI ErrorServiceUnknown : public Error
{ {
ErrorServiceUnknown(const char *message) ErrorServiceUnknown(const char *msg)
: Error("org.freedesktop.DBus.Error.ServiceUnknown", message) : Error("org.freedesktop.DBus.Error.ServiceUnknown", msg)
{} {}
}; };
struct DXXAPI ErrorNameHasNoOwner : public Error struct DXXAPI ErrorNameHasNoOwner : public Error
{ {
ErrorNameHasNoOwner(const char *message) ErrorNameHasNoOwner(const char *msg)
: Error("org.freedesktop.DBus.Error.NameHasNoOwner", message) : Error("org.freedesktop.DBus.Error.NameHasNoOwner", msg)
{} {}
}; };
struct DXXAPI ErrorNoReply : public Error struct DXXAPI ErrorNoReply : public Error
{ {
ErrorNoReply(const char *message) ErrorNoReply(const char *msg)
: Error("org.freedesktop.DBus.Error.NoReply", message) : Error("org.freedesktop.DBus.Error.NoReply", msg)
{} {}
}; };
struct DXXAPI ErrorIOError : public Error struct DXXAPI ErrorIOError : public Error
{ {
ErrorIOError(const char *message) ErrorIOError(const char *msg)
: Error("org.freedesktop.DBus.Error.IOError", message) : Error("org.freedesktop.DBus.Error.IOError", msg)
{} {}
}; };
struct DXXAPI ErrorBadAddress : public Error struct DXXAPI ErrorBadAddress : public Error
{ {
ErrorBadAddress(const char *message) ErrorBadAddress(const char *msg)
: Error("org.freedesktop.DBus.Error.BadAddress", message) : Error("org.freedesktop.DBus.Error.BadAddress", msg)
{} {}
}; };
struct DXXAPI ErrorNotSupported : public Error struct DXXAPI ErrorNotSupported : public Error
{ {
ErrorNotSupported(const char *message) ErrorNotSupported(const char *msg)
: Error("org.freedesktop.DBus.Error.NotSupported", message) : Error("org.freedesktop.DBus.Error.NotSupported", msg)
{} {}
}; };
struct DXXAPI ErrorLimitsExceeded : public Error struct DXXAPI ErrorLimitsExceeded : public Error
{ {
ErrorLimitsExceeded(const char *message) ErrorLimitsExceeded(const char *msg)
: Error("org.freedesktop.DBus.Error.LimitsExceeded", message) : Error("org.freedesktop.DBus.Error.LimitsExceeded", msg)
{} {}
}; };
struct DXXAPI ErrorAccessDenied : public Error struct DXXAPI ErrorAccessDenied : public Error
{ {
ErrorAccessDenied(const char *message) ErrorAccessDenied(const char *msg)
: Error("org.freedesktop.DBus.Error.AccessDenied", message) : Error("org.freedesktop.DBus.Error.AccessDenied", msg)
{} {}
}; };
struct DXXAPI ErrorAuthFailed : public Error struct DXXAPI ErrorAuthFailed : public Error
{ {
ErrorAuthFailed(const char *message) ErrorAuthFailed(const char *msg)
: Error("org.freedesktop.DBus.Error.AuthFailed", message) : Error("org.freedesktop.DBus.Error.AuthFailed", msg)
{} {}
}; };
struct DXXAPI ErrorNoServer : public Error struct DXXAPI ErrorNoServer : public Error
{ {
ErrorNoServer(const char *message) ErrorNoServer(const char *msg)
: Error("org.freedesktop.DBus.Error.NoServer", message) : Error("org.freedesktop.DBus.Error.NoServer", msg)
{} {}
}; };
struct DXXAPI ErrorTimeout : public Error struct DXXAPI ErrorTimeout : public Error
{ {
ErrorTimeout(const char *message) ErrorTimeout(const char *msg)
: Error("org.freedesktop.DBus.Error.Timeout", message) : Error("org.freedesktop.DBus.Error.Timeout", msg)
{} {}
}; };
struct DXXAPI ErrorNoNetwork : public Error struct DXXAPI ErrorNoNetwork : public Error
{ {
ErrorNoNetwork(const char *message) ErrorNoNetwork(const char *msg)
: Error("org.freedesktop.DBus.Error.NoNetwork", message) : Error("org.freedesktop.DBus.Error.NoNetwork", msg)
{} {}
}; };
struct DXXAPI ErrorAddressInUse : public Error struct DXXAPI ErrorAddressInUse : public Error
{ {
ErrorAddressInUse(const char *message) ErrorAddressInUse(const char *msg)
: Error("org.freedesktop.DBus.Error.AddressInUse", message) : Error("org.freedesktop.DBus.Error.AddressInUse", msg)
{} {}
}; };
struct DXXAPI ErrorDisconnected : public Error struct DXXAPI ErrorDisconnected : public Error
{ {
ErrorDisconnected(const char *message) ErrorDisconnected(const char *msg)
: Error("org.freedesktop.DBus.Error.Disconnected", message) : Error("org.freedesktop.DBus.Error.Disconnected", msg)
{} {}
}; };
struct DXXAPI ErrorInvalidArgs : public Error struct DXXAPI ErrorInvalidArgs : public Error
{ {
ErrorInvalidArgs(const char *message) ErrorInvalidArgs(const char *msg)
: Error("org.freedesktop.DBus.Error.InvalidArgs", message) : Error("org.freedesktop.DBus.Error.InvalidArgs", msg)
{} {}
}; };
struct DXXAPI ErrorFileNotFound : public Error struct DXXAPI ErrorFileNotFound : public Error
{ {
ErrorFileNotFound(const char *message) ErrorFileNotFound(const char *msg)
: Error("org.freedesktop.DBus.Error.FileNotFound", message) : Error("org.freedesktop.DBus.Error.FileNotFound", msg)
{} {}
}; };
struct DXXAPI ErrorUnknownMethod : public Error struct DXXAPI ErrorUnknownMethod : public Error
{ {
ErrorUnknownMethod(const char *message) ErrorUnknownMethod(const char *msg)
: Error("org.freedesktop.DBus.Error.UnknownMethod", message) : Error("org.freedesktop.DBus.Error.UnknownMethod", msg)
{} {}
}; };
struct DXXAPI ErrorTimedOut : public Error struct DXXAPI ErrorTimedOut : public Error
{ {
ErrorTimedOut(const char *message) ErrorTimedOut(const char *msg)
: Error("org.freedesktop.DBus.Error.TimedOut", message) : Error("org.freedesktop.DBus.Error.TimedOut", msg)
{} {}
}; };
struct DXXAPI ErrorMatchRuleNotFound : public Error struct DXXAPI ErrorMatchRuleNotFound : public Error
{ {
ErrorMatchRuleNotFound(const char *message) ErrorMatchRuleNotFound(const char *msg)
: Error("org.freedesktop.DBus.Error.MatchRuleNotFound", message) : Error("org.freedesktop.DBus.Error.MatchRuleNotFound", msg)
{} {}
}; };
struct DXXAPI ErrorMatchRuleInvalid : public Error struct DXXAPI ErrorMatchRuleInvalid : public Error
{ {
ErrorMatchRuleInvalid(const char *message) ErrorMatchRuleInvalid(const char *msg)
: Error("org.freedesktop.DBus.Error.MatchRuleInvalid", message) : Error("org.freedesktop.DBus.Error.MatchRuleInvalid", msg)
{} {}
}; };
struct DXXAPI ErrorSpawnExecFailed : public Error struct DXXAPI ErrorSpawnExecFailed : public Error
{ {
ErrorSpawnExecFailed(const char *message) ErrorSpawnExecFailed(const char *msg)
: Error("org.freedesktop.DBus.Error.Spawn.ExecFailed", message) : Error("org.freedesktop.DBus.Error.Spawn.ExecFailed", msg)
{} {}
}; };
struct DXXAPI ErrorSpawnForkFailed : public Error struct DXXAPI ErrorSpawnForkFailed : public Error
{ {
ErrorSpawnForkFailed(const char *message) ErrorSpawnForkFailed(const char *msg)
: Error("org.freedesktop.DBus.Error.Spawn.ForkFailed", message) : Error("org.freedesktop.DBus.Error.Spawn.ForkFailed", msg)
{} {}
}; };
struct DXXAPI ErrorSpawnChildExited : public Error struct DXXAPI ErrorSpawnChildExited : public Error
{ {
ErrorSpawnChildExited(const char *message) ErrorSpawnChildExited(const char *msg)
: Error("org.freedesktop.DBus.Error.Spawn.ChildExited", message) : Error("org.freedesktop.DBus.Error.Spawn.ChildExited", msg)
{} {}
}; };
struct DXXAPI ErrorSpawnChildSignaled : public Error struct DXXAPI ErrorSpawnChildSignaled : public Error
{ {
ErrorSpawnChildSignaled(const char *message) ErrorSpawnChildSignaled(const char *msg)
: Error("org.freedesktop.DBus.Error.Spawn.ChildSignaled", message) : Error("org.freedesktop.DBus.Error.Spawn.ChildSignaled", msg)
{} {}
}; };
struct DXXAPI ErrorSpawnFailed : public Error struct DXXAPI ErrorSpawnFailed : public Error
{ {
ErrorSpawnFailed(const char *message) ErrorSpawnFailed(const char *msg)
: Error("org.freedesktop.DBus.Error.Spawn.Failed", message) : Error("org.freedesktop.DBus.Error.Spawn.Failed", msg)
{} {}
}; };
struct DXXAPI ErrorInvalidSignature : public Error struct DXXAPI ErrorInvalidSignature : public Error
{ {
ErrorInvalidSignature(const char *message) ErrorInvalidSignature(const char *msg)
: Error("org.freedesktop.DBus.Error.InvalidSignature", message) : Error("org.freedesktop.DBus.Error.InvalidSignature", msg)
{} {}
}; };
struct DXXAPI ErrorUnixProcessIdUnknown : public Error struct DXXAPI ErrorUnixProcessIdUnknown : public Error
{ {
ErrorUnixProcessIdUnknown(const char *message) ErrorUnixProcessIdUnknown(const char *msg)
: Error("org.freedesktop.DBus.Error.UnixProcessIdUnknown", message) : Error("org.freedesktop.DBus.Error.UnixProcessIdUnknown", msg)
{} {}
}; };
struct DXXAPI ErrorSELinuxSecurityContextUnknown : public Error struct DXXAPI ErrorSELinuxSecurityContextUnknown : public Error
{ {
ErrorSELinuxSecurityContextUnknown(const char *message) ErrorSELinuxSecurityContextUnknown(const char *msg)
: Error("org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown", message) : Error("org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown", msg)
{} {}
}; };

View file

@ -143,7 +143,7 @@ public:
void set_property(const std::string &name, Variant &value); void set_property(const std::string &name, Variant &value);
virtual IntrospectedInterface *const introspect() const virtual const IntrospectedInterface * introspect() const
{ {
return NULL; return NULL;
} }

View file

@ -69,7 +69,7 @@ public:
protected: protected:
IntrospectedInterface *const introspect() const; const IntrospectedInterface * introspect() const;
}; };
class DXXAPI IntrospectableProxy : public InterfaceProxy class DXXAPI IntrospectableProxy : public InterfaceProxy

View file

@ -137,7 +137,7 @@ public:
private: private:
DXXAPILOCAL MessageIter(Message &msg) : _msg(&msg) {} DXXAPILOCAL MessageIter(Message &m) : _msg(&m) {}
DXXAPILOCAL bool append_basic(int type_id, void *value); DXXAPILOCAL bool append_basic(int type_id, void *value);

View file

@ -82,7 +82,7 @@ protected:
virtual void on_set_property(InterfaceAdaptor &/*interface*/, const std::string &/*property*/, const Variant &/*value*/) virtual void on_set_property(InterfaceAdaptor &/*interface*/, const std::string &/*property*/, const Variant &/*value*/)
{} {}
IntrospectedInterface *const introspect() const; const IntrospectedInterface *introspect() const;
}; };
class DXXAPI PropertiesProxy : public InterfaceProxy class DXXAPI PropertiesProxy : public InterfaceProxy

View file

@ -59,7 +59,7 @@ public:
protected: protected:
Server(const Server &s) Server(const Server &)
{} {}
virtual void on_new_connection(Connection &c) = 0; virtual void on_new_connection(Connection &c) = 0;

View file

@ -55,11 +55,11 @@ public:
unref(); unref();
} }
RefCnt &operator = (const RefCnt &ref) RefCnt &operator = (const RefCnt &rc)
{ {
ref.ref(); rc.ref();
unref(); unref();
__ref = ref.__ref; __ref = rc.__ref;
return *this; return *this;
} }

View file

@ -152,7 +152,7 @@ void Connection::Private::dispatch_status_stub(DBusConnection *dc, DBusDispatchS
} }
} }
DBusHandlerResult Connection::Private::message_filter_stub(DBusConnection *conn, DBusMessage *dmsg, void *data) DBusHandlerResult Connection::Private::message_filter_stub(DBusConnection *, DBusMessage *dmsg, void *data)
{ {
MessageSlot *slot = static_cast<MessageSlot *>(data); MessageSlot *slot = static_cast<MessageSlot *>(data);

View file

@ -48,6 +48,8 @@ static void _debug_log_default(const char *format, ...)
va_end(args); va_end(args);
} }
#else
(void)format;
#endif//DEBUG #endif//DEBUG
} }

View file

@ -86,9 +86,9 @@ bool Watch::enabled() const
return dbus_watch_get_enabled((DBusWatch *)_int); return dbus_watch_get_enabled((DBusWatch *)_int);
} }
bool Watch::handle(int flags) bool Watch::handle(int flags_)
{ {
return dbus_watch_handle((DBusWatch *)_int, flags); return dbus_watch_handle((DBusWatch *)_int, flags_);
} }
/* /*
@ -114,7 +114,7 @@ void Dispatcher::Private::on_rem_watch(DBusWatch *watch, void *data)
d->rem_watch(w); d->rem_watch(w);
} }
void Dispatcher::Private::on_toggle_watch(DBusWatch *watch, void *data) void Dispatcher::Private::on_toggle_watch(DBusWatch *watch, void *)
{ {
Watch *w = static_cast<Watch *>(dbus_watch_get_data(watch)); Watch *w = static_cast<Watch *>(dbus_watch_get_data(watch));
@ -141,7 +141,7 @@ void Dispatcher::Private::on_rem_timeout(DBusTimeout *timeout, void *data)
d->rem_timeout(t); d->rem_timeout(t);
} }
void Dispatcher::Private::on_toggle_timeout(DBusTimeout *timeout, void *data) void Dispatcher::Private::on_toggle_timeout(DBusTimeout *timeout, void *)
{ {
Timeout *t = static_cast<Timeout *>(dbus_timeout_get_data(timeout)); Timeout *t = static_cast<Timeout *>(dbus_timeout_get_data(timeout));
@ -266,7 +266,8 @@ void DBus::_init_threading(
(DBusRecursiveMutexNewFunction) m1, (DBusRecursiveMutexNewFunction) m1,
(DBusRecursiveMutexFreeFunction) m2, (DBusRecursiveMutexFreeFunction) m2,
(DBusRecursiveMutexLockFunction) m3, (DBusRecursiveMutexLockFunction) m3,
(DBusRecursiveMutexUnlockFunction) m4 (DBusRecursiveMutexUnlockFunction) m4,
0, 0, 0, 0
}; };
#endif//DBUS_HAS_RECURSIVE_MUTEX #endif//DBUS_HAS_RECURSIVE_MUTEX
dbus_threads_init(&functions); dbus_threads_init(&functions);

View file

@ -46,10 +46,10 @@ Error::Error(InternalError &i)
: _int(new InternalError(i)) : _int(new InternalError(i))
{} {}
Error::Error(const char *name, const char *message) Error::Error(const char *n, const char *msg)
: _int(new InternalError) : _int(new InternalError)
{ {
set(name, message); set(n, msg);
} }
Error::Error(Message &m) Error::Error(Message &m)
@ -77,9 +77,9 @@ bool Error::is_set() const
return *(_int); return *(_int);
} }
void Error::set(const char *name, const char *message) void Error::set(const char *n, const char *msg)
{ {
dbus_set_error_const(&(_int->error), name, message); dbus_set_error_const(&(_int->error), n, msg);
} }
const char *Error::what() const throw() const char *Error::what() const throw()

View file

@ -40,13 +40,13 @@ static double millis(timeval tv)
return (tv.tv_sec *1000.0 + tv.tv_usec/1000.0); return (tv.tv_sec *1000.0 + tv.tv_usec/1000.0);
} }
DefaultTimeout::DefaultTimeout(int interval, bool repeat, DefaultMainLoop *ed) DefaultTimeout::DefaultTimeout(int interval_, bool repeat_, DefaultMainLoop *ed)
: _enabled(true), _interval(interval), _repeat(repeat), _expiration(0), _data(0), _disp(ed) : _enabled(true), _interval(interval_), _repeat(repeat_), _expiration(0), _data(0), _disp(ed)
{ {
timeval now; timeval now;
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
_expiration = millis(now) + interval; _expiration = millis(now) + interval_;
_disp->_mutex_t.lock(); _disp->_mutex_t.lock();
_disp->_timeouts.push_back(this); _disp->_timeouts.push_back(this);
@ -60,8 +60,8 @@ DefaultTimeout::~DefaultTimeout()
_disp->_mutex_t.unlock(); _disp->_mutex_t.unlock();
} }
DefaultWatch::DefaultWatch(int fd, int flags, DefaultMainLoop *ed) DefaultWatch::DefaultWatch(int fd, int flags_, DefaultMainLoop *ed)
: _enabled(true), _fd(fd), _flags(flags), _state(0), _data(0), _disp(ed) : _enabled(true), _fd(fd), _flags(flags_), _state(0), _data(0), _disp(ed)
{ {
_disp->_mutex_w.lock(); _disp->_mutex_w.lock();
_disp->_watches.push_back(this); _disp->_watches.push_back(this);

View file

@ -31,7 +31,7 @@
using namespace DBus; using namespace DBus;
Glib::BusTimeout::BusTimeout(Timeout::Internal *ti, GMainContext *ctx, int priority) Glib::BusTimeout::BusTimeout(Timeout::Internal *ti, GMainContext *ctx, int priority)
: Timeout(ti), _ctx(ctx), _priority(priority), _source(NULL) : Timeout(ti), _source(NULL), _ctx(ctx), _priority(priority)
{ {
if (Timeout::enabled()) if (Timeout::enabled())
_enable(); _enable();
@ -85,7 +85,7 @@ struct BusSource
GPollFD poll; GPollFD poll;
}; };
static gboolean watch_prepare(GSource *source, gint *timeout) static gboolean watch_prepare(GSource *, gint *timeout)
{ {
//debug_log("glib: watch_prepare"); //debug_log("glib: watch_prepare");
@ -101,7 +101,7 @@ static gboolean watch_check(GSource *source)
return io->poll.revents ? TRUE : FALSE; return io->poll.revents ? TRUE : FALSE;
} }
static gboolean watch_dispatch(GSource *source, GSourceFunc callback, gpointer data) static gboolean watch_dispatch(GSource *, GSourceFunc callback, gpointer data)
{ {
debug_log("glib: watch_dispatch"); debug_log("glib: watch_dispatch");
@ -113,11 +113,13 @@ static GSourceFuncs watch_funcs = {
watch_prepare, watch_prepare,
watch_check, watch_check,
watch_dispatch, watch_dispatch,
NULL,
NULL,
NULL NULL
}; };
Glib::BusWatch::BusWatch(Watch::Internal *wi, GMainContext *ctx, int priority) Glib::BusWatch::BusWatch(Watch::Internal *wi, GMainContext *ctx, int priority)
: Watch(wi), _ctx(ctx), _priority(priority), _source(NULL) : Watch(wi), _source(NULL), _ctx(ctx), _priority(priority)
{ {
if (Watch::enabled()) if (Watch::enabled())
_enable(); _enable();
@ -165,16 +167,16 @@ void Glib::BusWatch::_enable()
g_source_set_priority(_source, _priority); g_source_set_priority(_source, _priority);
g_source_set_callback(_source, watch_handler, this, NULL); g_source_set_callback(_source, watch_handler, this, NULL);
int flags = Watch::flags(); int flags_ = Watch::flags();
int condition = 0; int condition = 0;
if (flags &DBUS_WATCH_READABLE) if (flags_ &DBUS_WATCH_READABLE)
condition |= G_IO_IN; condition |= G_IO_IN;
if (flags &DBUS_WATCH_WRITABLE) if (flags_ &DBUS_WATCH_WRITABLE)
condition |= G_IO_OUT; condition |= G_IO_OUT;
if (flags &DBUS_WATCH_ERROR) if (flags_ &DBUS_WATCH_ERROR)
condition |= G_IO_ERR; condition |= G_IO_ERR;
if (flags &DBUS_WATCH_HANGUP) if (flags_ &DBUS_WATCH_HANGUP)
condition |= G_IO_HUP; condition |= G_IO_HUP;
GPollFD *poll = &(((BusSource *)_source)->poll); GPollFD *poll = &(((BusSource *)_source)->poll);
@ -217,15 +219,15 @@ static gboolean dispatcher_prepare(GSource *source, gint *timeout)
return dispatcher->has_something_to_dispatch()? TRUE:FALSE; return dispatcher->has_something_to_dispatch()? TRUE:FALSE;
} }
static gboolean dispatcher_check(GSource *source) static gboolean dispatcher_check(GSource *)
{ {
return FALSE; return FALSE;
} }
static gboolean static gboolean
dispatcher_dispatch(GSource *source, dispatcher_dispatch(GSource *source,
GSourceFunc callback, GSourceFunc,
gpointer user_data) gpointer)
{ {
Dispatcher *dispatcher = ((DispatcherSource*)source)->dispatcher; Dispatcher *dispatcher = ((DispatcherSource*)source)->dispatcher;
@ -237,6 +239,8 @@ static const GSourceFuncs dispatcher_funcs = {
dispatcher_prepare, dispatcher_prepare,
dispatcher_check, dispatcher_check,
dispatcher_dispatch, dispatcher_dispatch,
NULL,
NULL,
NULL NULL
}; };

View file

@ -32,40 +32,40 @@
using namespace DBus; using namespace DBus;
Interface::Interface(const std::string &name) Interface::Interface(const std::string &n)
: _name(name) : _name(n)
{} {}
Interface::~Interface() Interface::~Interface()
{} {}
InterfaceAdaptor *AdaptorBase::find_interface(const std::string &name) InterfaceAdaptor *AdaptorBase::find_interface(const std::string &n)
{ {
InterfaceAdaptorTable::const_iterator ii = _interfaces.find(name); InterfaceAdaptorTable::const_iterator ii = _interfaces.find(n);
return ii != _interfaces.end() ? ii->second : NULL; return ii != _interfaces.end() ? ii->second : NULL;
} }
InterfaceAdaptor::InterfaceAdaptor(const std::string &name) InterfaceAdaptor::InterfaceAdaptor(const std::string &n)
: Interface(name) : Interface(n)
{ {
debug_log("adding interface %s", name.c_str()); debug_log("adding interface %s", n.c_str());
_interfaces[name] = this; _interfaces[n] = this;
} }
Message InterfaceAdaptor::dispatch_method(const CallMessage &msg) Message InterfaceAdaptor::dispatch_method(const CallMessage &msg)
{ {
const char *name = msg.member(); const char *n = msg.member();
MethodTable::iterator mi = _methods.find(name); MethodTable::iterator mi = _methods.find(n);
if (mi != _methods.end()) if (mi != _methods.end())
{ {
return mi->second.call(msg); return mi->second.call(msg);
} }
else else
{ {
return ErrorMessage(msg, DBUS_ERROR_UNKNOWN_METHOD, name); return ErrorMessage(msg, DBUS_ERROR_UNKNOWN_METHOD, n);
} }
} }
@ -79,9 +79,9 @@ void InterfaceAdaptor::emit_signal(const SignalMessage &sig)
_emit_signal(sig2); _emit_signal(sig2);
} }
Variant *InterfaceAdaptor::get_property(const std::string &name) Variant *InterfaceAdaptor::get_property(const std::string &n)
{ {
PropertyTable::iterator pti = _properties.find(name); PropertyTable::iterator pti = _properties.find(n);
if (pti != _properties.end()) if (pti != _properties.end())
{ {
@ -93,9 +93,9 @@ Variant *InterfaceAdaptor::get_property(const std::string &name)
return NULL; return NULL;
} }
void InterfaceAdaptor::set_property(const std::string &name, Variant &value) void InterfaceAdaptor::set_property(const std::string &n, Variant &value)
{ {
PropertyTable::iterator pti = _properties.find(name); PropertyTable::iterator pti = _properties.find(n);
if (pti != _properties.end()) if (pti != _properties.end())
{ {
@ -113,26 +113,26 @@ void InterfaceAdaptor::set_property(const std::string &name, Variant &value)
throw ErrorFailed("requested property not found"); throw ErrorFailed("requested property not found");
} }
InterfaceProxy *ProxyBase::find_interface(const std::string &name) InterfaceProxy *ProxyBase::find_interface(const std::string &n)
{ {
InterfaceProxyTable::const_iterator ii = _interfaces.find(name); InterfaceProxyTable::const_iterator ii = _interfaces.find(n);
return ii != _interfaces.end() ? ii->second : NULL; return ii != _interfaces.end() ? ii->second : NULL;
} }
InterfaceProxy::InterfaceProxy(const std::string &name) InterfaceProxy::InterfaceProxy(const std::string &n)
: Interface(name) : Interface(n)
{ {
debug_log("adding interface %s", name.c_str()); debug_log("adding interface %s", n.c_str());
_interfaces[name] = this; _interfaces[n] = this;
} }
bool InterfaceProxy::dispatch_signal(const SignalMessage &msg) bool InterfaceProxy::dispatch_signal(const SignalMessage &msg)
{ {
const char *name = msg.member(); const char *n = msg.member();
SignalTable::iterator si = _signals.find(name); SignalTable::iterator si = _signals.find(n);
if (si != _signals.end()) if (si != _signals.end())
{ {
si->second.call(msg); si->second.call(msg);

View file

@ -61,7 +61,7 @@ Message IntrospectableAdaptor::Introspect(const CallMessage &call)
{ {
debug_log("introspecting interface %s", iti->first.c_str()); debug_log("introspecting interface %s", iti->first.c_str());
IntrospectedInterface *const intro = iti->second->introspect(); const IntrospectedInterface * intro = iti->second->introspect();
if (intro) if (intro)
{ {
xml << "\n\t<interface name=\"" << intro->name << "\">"; xml << "\n\t<interface name=\"" << intro->name << "\">";
@ -144,7 +144,7 @@ Message IntrospectableAdaptor::Introspect(const CallMessage &call)
return reply; return reply;
} }
IntrospectedInterface *const IntrospectableAdaptor::introspect() const const IntrospectedInterface * IntrospectableAdaptor::introspect() const
{ {
static IntrospectedArgument Introspect_args[] = static IntrospectedArgument Introspect_args[] =
{ {

View file

@ -236,9 +236,9 @@ char *MessageIter::signature() const
return dbus_message_iter_get_signature((DBusMessageIter *)&_iter); return dbus_message_iter_get_signature((DBusMessageIter *)&_iter);
} }
bool MessageIter::append_array(char type, const void *ptr, size_t length) bool MessageIter::append_array(char type_, const void *ptr, size_t length)
{ {
return dbus_message_iter_append_fixed_array((DBusMessageIter *)&_iter, type, &ptr, length); return dbus_message_iter_append_fixed_array((DBusMessageIter *)&_iter, type_, &ptr, length);
} }
int MessageIter::array_type() int MessageIter::array_type()
@ -491,9 +491,9 @@ ErrorMessage::ErrorMessage()
_pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR); _pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR);
} }
ErrorMessage::ErrorMessage(const Message &to_reply, const char *name, const char *message) ErrorMessage::ErrorMessage(const Message &to_reply, const char *name_, const char *message)
{ {
_pvt->msg = dbus_message_new_error(to_reply._pvt->msg, name, message); _pvt->msg = dbus_message_new_error(to_reply._pvt->msg, name_, message);
} }
bool ErrorMessage::operator == (const ErrorMessage &m) const bool ErrorMessage::operator == (const ErrorMessage &m) const
@ -520,9 +520,9 @@ SignalMessage::SignalMessage(const char *name)
member(name); member(name);
} }
SignalMessage::SignalMessage(const char *path, const char *interface, const char *name) SignalMessage::SignalMessage(const char *path_, const char *interface_, const char *name)
{ {
_pvt->msg = dbus_message_new_signal(path, interface, name); _pvt->msg = dbus_message_new_signal(path_, interface_, name);
} }
bool SignalMessage::operator == (const SignalMessage &m) const bool SignalMessage::operator == (const SignalMessage &m) const
@ -575,9 +575,9 @@ CallMessage::CallMessage()
_pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL); _pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL);
} }
CallMessage::CallMessage(const char *dest, const char *path, const char *iface, const char *method) CallMessage::CallMessage(const char *dest, const char *path_, const char *iface, const char *method)
{ {
_pvt->msg = dbus_message_new_method_call(dest, path, iface, method); _pvt->msg = dbus_message_new_method_call(dest, path_, iface, method);
} }
bool CallMessage::operator == (const CallMessage &m) const bool CallMessage::operator == (const CallMessage &m) const

View file

@ -39,8 +39,8 @@
using namespace DBus; using namespace DBus;
Object::Object(Connection &conn, const Path &path, const char *service) Object::Object(Connection &conn_, const Path &path_, const char *service_)
: _conn(conn), _path(path), _service(service ? service : "") : _conn(conn_), _path(path_), _service(service_ ? service_ : "")
{ {
} }
@ -61,7 +61,7 @@ static DBusObjectPathVTable _vtable =
NULL, NULL, NULL, NULL NULL, NULL, NULL, NULL
}; };
void ObjectAdaptor::Private::unregister_function_stub(DBusConnection *conn, void *data) void ObjectAdaptor::Private::unregister_function_stub(DBusConnection *, void *)
{ {
//TODO: what do we have to do here ? //TODO: what do we have to do here ?
} }
@ -148,8 +148,8 @@ ObjectPathList ObjectAdaptor::child_nodes_from_prefix(const std::string &prefix)
return ali; return ali;
} }
ObjectAdaptor::ObjectAdaptor(Connection &conn, const Path &path) ObjectAdaptor::ObjectAdaptor(Connection &conn_, const Path &path_)
: Object(conn, path, conn.unique_name()) : Object(conn_, path_, conn_.unique_name())
{ {
register_obj(); register_obj();
} }
@ -270,8 +270,8 @@ ObjectAdaptor::Continuation *ObjectAdaptor::find_continuation(const Tag *tag)
return di != _continuations.end() ? di->second : NULL; return di != _continuations.end() ? di->second : NULL;
} }
ObjectAdaptor::Continuation::Continuation(Connection &conn, const CallMessage &call, const Tag *tag) ObjectAdaptor::Continuation::Continuation(Connection &conn, const CallMessage &call, const Tag *tag_)
: _conn(conn), _call(call), _return(_call), _tag(tag) : _conn(conn), _call(call), _return(_call), _tag(tag_)
{ {
_writer = _return.writer(); //todo: verify _writer = _return.writer(); //todo: verify
} }
@ -279,8 +279,8 @@ ObjectAdaptor::Continuation::Continuation(Connection &conn, const CallMessage &c
/* /*
*/ */
ObjectProxy::ObjectProxy(Connection &conn, const Path &path, const char *service) ObjectProxy::ObjectProxy(Connection &conn_, const Path &path_, const char *service_)
: Object(conn, path, service) : Object(conn_, path_, service_)
{ {
register_obj(); register_obj();
} }

View file

@ -52,7 +52,7 @@ PendingCall::Private::~Private()
} }
} }
void PendingCall::Private::notify_stub(DBusPendingCall *dpc, void *data) void PendingCall::Private::notify_stub(DBusPendingCall *, void *data)
{ {
PendingCall::Private *pvt = static_cast<PendingCall::Private *>(data); PendingCall::Private *pvt = static_cast<PendingCall::Private *>(data);

View file

@ -96,7 +96,7 @@ Message PropertiesAdaptor::Set(const CallMessage &call)
return reply; return reply;
} }
IntrospectedInterface *const PropertiesAdaptor::introspect() const const IntrospectedInterface *PropertiesAdaptor::introspect() const
{ {
static IntrospectedArgument Get_args[] = static IntrospectedArgument Get_args[] =
{ {
@ -141,14 +141,14 @@ PropertiesProxy::PropertiesProxy()
{ {
} }
Variant PropertiesProxy::Get(const std::string &iface, const std::string &property) Variant PropertiesProxy::Get(const std::string &/*iface*/, const std::string &/*property*/)
{ {
//todo //todo
Variant v; Variant v;
return v; return v;
} }
void PropertiesProxy::Set(const std::string &iface, const std::string &property, const Variant &value) void PropertiesProxy::Set(const std::string &/*iface*/, const std::string &/*property*/, const Variant &/*value*/)
{ {
//todo //todo
} }

View file

@ -44,7 +44,7 @@ Server::Private::~Private()
{ {
} }
void Server::Private::on_new_conn_cb(DBusServer *server, DBusConnection *conn, void *data) void Server::Private::on_new_conn_cb(DBusServer *, DBusConnection *conn, void *data)
{ {
Server *s = static_cast<Server *>(data); Server *s = static_cast<Server *>(data);

View file

@ -68,11 +68,11 @@ const Signature Variant::signature() const
{ {
char *sigbuf = reader().signature(); char *sigbuf = reader().signature();
Signature signature = sigbuf; Signature sig = sigbuf;
free(sigbuf); free(sigbuf);
return signature; return sig;
} }
MessageIter &operator << (MessageIter &iter, const Variant &val) MessageIter &operator << (MessageIter &iter, const Variant &val)

View file

@ -145,7 +145,7 @@ void generate_adaptor(Xml::Document &doc, const char *filename)
body << tab << "}" << endl body << tab << "}" << endl
<< endl; << endl;
body << tab << "::DBus::IntrospectedInterface *const introspect() const " << endl body << tab << "const ::DBus::IntrospectedInterface *introspect() const " << endl
<< tab << "{" << endl; << tab << "{" << endl;
// generate the introspect arguments // generate the introspect arguments