diff options
author | Hubert Figuiere <hub@figuiere.net> | 2009-07-19 18:42:18 -0400 |
---|---|---|
committer | Hubert Figuiere <hub@figuiere.net> | 2009-07-24 15:59:36 -0400 |
commit | 340dc8a66701487e7a61a16a266bb819170e32e0 (patch) | |
tree | 1f4a51caf1e45ff3e6c8a6e2a9e2925f53b6aa1a | |
parent | e2cde7d2259a14664d979ecd321ea4171335f719 (diff) | |
download | dbus-c++-340dc8a66701487e7a61a16a266bb819170e32e0.tar.gz |
Fix most of the warnings with -Wextra -Wshadow
-rw-r--r-- | include/dbus-c++/error.h | 120 | ||||
-rw-r--r-- | include/dbus-c++/interface.h | 2 | ||||
-rw-r--r-- | include/dbus-c++/introspection.h | 2 | ||||
-rw-r--r-- | include/dbus-c++/message.h | 2 | ||||
-rw-r--r-- | include/dbus-c++/property.h | 2 | ||||
-rw-r--r-- | include/dbus-c++/server.h | 2 | ||||
-rw-r--r-- | include/dbus-c++/util.h | 6 | ||||
-rw-r--r-- | src/connection.cpp | 2 | ||||
-rw-r--r-- | src/debug.cpp | 2 | ||||
-rw-r--r-- | src/dispatcher.cpp | 11 | ||||
-rw-r--r-- | src/error.cpp | 8 | ||||
-rw-r--r-- | src/eventloop.cpp | 10 | ||||
-rw-r--r-- | src/glib-integration.cpp | 32 | ||||
-rw-r--r-- | src/interface.cpp | 46 | ||||
-rw-r--r-- | src/introspection.cpp | 4 | ||||
-rw-r--r-- | src/message.cpp | 16 | ||||
-rw-r--r-- | src/object.cpp | 18 | ||||
-rw-r--r-- | src/pendingcall.cpp | 2 | ||||
-rw-r--r-- | src/property.cpp | 6 | ||||
-rw-r--r-- | src/server.cpp | 2 | ||||
-rw-r--r-- | src/types.cpp | 4 | ||||
-rw-r--r-- | tools/generate_adaptor.cpp | 2 |
22 files changed, 154 insertions, 147 deletions
diff --git a/include/dbus-c++/error.h b/include/dbus-c++/error.h index 7dec7bf..62cbe89 100644 --- a/include/dbus-c++/error.h +++ b/include/dbus-c++/error.h @@ -72,211 +72,211 @@ private: struct DXXAPI ErrorFailed : public Error { - ErrorFailed(const char *message) - : Error("org.freedesktop.DBus.Error.Failed", message) + ErrorFailed(const char *msg) + : Error("org.freedesktop.DBus.Error.Failed", msg) {} }; struct DXXAPI ErrorNoMemory : public Error { - ErrorNoMemory(const char *message) - : Error("org.freedesktop.DBus.Error.NoMemory", message) + ErrorNoMemory(const char *msg) + : Error("org.freedesktop.DBus.Error.NoMemory", msg) {} }; struct DXXAPI ErrorServiceUnknown : public Error { - ErrorServiceUnknown(const char *message) - : Error("org.freedesktop.DBus.Error.ServiceUnknown", message) + ErrorServiceUnknown(const char *msg) + : Error("org.freedesktop.DBus.Error.ServiceUnknown", msg) {} }; struct DXXAPI ErrorNameHasNoOwner : public Error { - ErrorNameHasNoOwner(const char *message) - : Error("org.freedesktop.DBus.Error.NameHasNoOwner", message) + ErrorNameHasNoOwner(const char *msg) + : Error("org.freedesktop.DBus.Error.NameHasNoOwner", msg) {} }; struct DXXAPI ErrorNoReply : public Error { - ErrorNoReply(const char *message) - : Error("org.freedesktop.DBus.Error.NoReply", message) + ErrorNoReply(const char *msg) + : Error("org.freedesktop.DBus.Error.NoReply", msg) {} }; struct DXXAPI ErrorIOError : public Error { - ErrorIOError(const char *message) - : Error("org.freedesktop.DBus.Error.IOError", message) + ErrorIOError(const char *msg) + : Error("org.freedesktop.DBus.Error.IOError", msg) {} }; struct DXXAPI ErrorBadAddress : public Error { - ErrorBadAddress(const char *message) - : Error("org.freedesktop.DBus.Error.BadAddress", message) + ErrorBadAddress(const char *msg) + : Error("org.freedesktop.DBus.Error.BadAddress", msg) {} }; struct DXXAPI ErrorNotSupported : public Error { - ErrorNotSupported(const char *message) - : Error("org.freedesktop.DBus.Error.NotSupported", message) + ErrorNotSupported(const char *msg) + : Error("org.freedesktop.DBus.Error.NotSupported", msg) {} }; struct DXXAPI ErrorLimitsExceeded : public Error { - ErrorLimitsExceeded(const char *message) - : Error("org.freedesktop.DBus.Error.LimitsExceeded", message) + ErrorLimitsExceeded(const char *msg) + : Error("org.freedesktop.DBus.Error.LimitsExceeded", msg) {} }; struct DXXAPI ErrorAccessDenied : public Error { - ErrorAccessDenied(const char *message) - : Error("org.freedesktop.DBus.Error.AccessDenied", message) + ErrorAccessDenied(const char *msg) + : Error("org.freedesktop.DBus.Error.AccessDenied", msg) {} }; struct DXXAPI ErrorAuthFailed : public Error { - ErrorAuthFailed(const char *message) - : Error("org.freedesktop.DBus.Error.AuthFailed", message) + ErrorAuthFailed(const char *msg) + : Error("org.freedesktop.DBus.Error.AuthFailed", msg) {} }; struct DXXAPI ErrorNoServer : public Error { - ErrorNoServer(const char *message) - : Error("org.freedesktop.DBus.Error.NoServer", message) + ErrorNoServer(const char *msg) + : Error("org.freedesktop.DBus.Error.NoServer", msg) {} }; struct DXXAPI ErrorTimeout : public Error { - ErrorTimeout(const char *message) - : Error("org.freedesktop.DBus.Error.Timeout", message) + ErrorTimeout(const char *msg) + : Error("org.freedesktop.DBus.Error.Timeout", msg) {} }; struct DXXAPI ErrorNoNetwork : public Error { - ErrorNoNetwork(const char *message) - : Error("org.freedesktop.DBus.Error.NoNetwork", message) + ErrorNoNetwork(const char *msg) + : Error("org.freedesktop.DBus.Error.NoNetwork", msg) {} }; struct DXXAPI ErrorAddressInUse : public Error { - ErrorAddressInUse(const char *message) - : Error("org.freedesktop.DBus.Error.AddressInUse", message) + ErrorAddressInUse(const char *msg) + : Error("org.freedesktop.DBus.Error.AddressInUse", msg) {} }; struct DXXAPI ErrorDisconnected : public Error { - ErrorDisconnected(const char *message) - : Error("org.freedesktop.DBus.Error.Disconnected", message) + ErrorDisconnected(const char *msg) + : Error("org.freedesktop.DBus.Error.Disconnected", msg) {} }; struct DXXAPI ErrorInvalidArgs : public Error { - ErrorInvalidArgs(const char *message) - : Error("org.freedesktop.DBus.Error.InvalidArgs", message) + ErrorInvalidArgs(const char *msg) + : Error("org.freedesktop.DBus.Error.InvalidArgs", msg) {} }; struct DXXAPI ErrorFileNotFound : public Error { - ErrorFileNotFound(const char *message) - : Error("org.freedesktop.DBus.Error.FileNotFound", message) + ErrorFileNotFound(const char *msg) + : Error("org.freedesktop.DBus.Error.FileNotFound", msg) {} }; struct DXXAPI ErrorUnknownMethod : public Error { - ErrorUnknownMethod(const char *message) - : Error("org.freedesktop.DBus.Error.UnknownMethod", message) + ErrorUnknownMethod(const char *msg) + : Error("org.freedesktop.DBus.Error.UnknownMethod", msg) {} }; struct DXXAPI ErrorTimedOut : public Error { - ErrorTimedOut(const char *message) - : Error("org.freedesktop.DBus.Error.TimedOut", message) + ErrorTimedOut(const char *msg) + : Error("org.freedesktop.DBus.Error.TimedOut", msg) {} }; struct DXXAPI ErrorMatchRuleNotFound : public Error { - ErrorMatchRuleNotFound(const char *message) - : Error("org.freedesktop.DBus.Error.MatchRuleNotFound", message) + ErrorMatchRuleNotFound(const char *msg) + : Error("org.freedesktop.DBus.Error.MatchRuleNotFound", msg) {} }; struct DXXAPI ErrorMatchRuleInvalid : public Error { - ErrorMatchRuleInvalid(const char *message) - : Error("org.freedesktop.DBus.Error.MatchRuleInvalid", message) + ErrorMatchRuleInvalid(const char *msg) + : Error("org.freedesktop.DBus.Error.MatchRuleInvalid", msg) {} }; struct DXXAPI ErrorSpawnExecFailed : public Error { - ErrorSpawnExecFailed(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.ExecFailed", message) + ErrorSpawnExecFailed(const char *msg) + : Error("org.freedesktop.DBus.Error.Spawn.ExecFailed", msg) {} }; struct DXXAPI ErrorSpawnForkFailed : public Error { - ErrorSpawnForkFailed(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.ForkFailed", message) + ErrorSpawnForkFailed(const char *msg) + : Error("org.freedesktop.DBus.Error.Spawn.ForkFailed", msg) {} }; struct DXXAPI ErrorSpawnChildExited : public Error { - ErrorSpawnChildExited(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.ChildExited", message) + ErrorSpawnChildExited(const char *msg) + : Error("org.freedesktop.DBus.Error.Spawn.ChildExited", msg) {} }; struct DXXAPI ErrorSpawnChildSignaled : public Error { - ErrorSpawnChildSignaled(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.ChildSignaled", message) + ErrorSpawnChildSignaled(const char *msg) + : Error("org.freedesktop.DBus.Error.Spawn.ChildSignaled", msg) {} }; struct DXXAPI ErrorSpawnFailed : public Error { - ErrorSpawnFailed(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.Failed", message) + ErrorSpawnFailed(const char *msg) + : Error("org.freedesktop.DBus.Error.Spawn.Failed", msg) {} }; struct DXXAPI ErrorInvalidSignature : public Error { - ErrorInvalidSignature(const char *message) - : Error("org.freedesktop.DBus.Error.InvalidSignature", message) + ErrorInvalidSignature(const char *msg) + : Error("org.freedesktop.DBus.Error.InvalidSignature", msg) {} }; struct DXXAPI ErrorUnixProcessIdUnknown : public Error { - ErrorUnixProcessIdUnknown(const char *message) - : Error("org.freedesktop.DBus.Error.UnixProcessIdUnknown", message) + ErrorUnixProcessIdUnknown(const char *msg) + : Error("org.freedesktop.DBus.Error.UnixProcessIdUnknown", msg) {} }; struct DXXAPI ErrorSELinuxSecurityContextUnknown : public Error { - ErrorSELinuxSecurityContextUnknown(const char *message) - : Error("org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown", message) + ErrorSELinuxSecurityContextUnknown(const char *msg) + : Error("org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown", msg) {} }; diff --git a/include/dbus-c++/interface.h b/include/dbus-c++/interface.h index 86c8d18..0da848a 100644 --- a/include/dbus-c++/interface.h +++ b/include/dbus-c++/interface.h @@ -143,7 +143,7 @@ public: void set_property(const std::string &name, Variant &value); - virtual IntrospectedInterface *const introspect() const + virtual const IntrospectedInterface * introspect() const { return NULL; } diff --git a/include/dbus-c++/introspection.h b/include/dbus-c++/introspection.h index 5f0d1e4..d12c683 100644 --- a/include/dbus-c++/introspection.h +++ b/include/dbus-c++/introspection.h @@ -69,7 +69,7 @@ public: protected: - IntrospectedInterface *const introspect() const; + const IntrospectedInterface * introspect() const; }; class DXXAPI IntrospectableProxy : public InterfaceProxy diff --git a/include/dbus-c++/message.h b/include/dbus-c++/message.h index ba326b7..b64b101 100644 --- a/include/dbus-c++/message.h +++ b/include/dbus-c++/message.h @@ -137,7 +137,7 @@ public: private: - DXXAPILOCAL MessageIter(Message &msg) : _msg(&msg) {} + DXXAPILOCAL MessageIter(Message &m) : _msg(&m) {} DXXAPILOCAL bool append_basic(int type_id, void *value); diff --git a/include/dbus-c++/property.h b/include/dbus-c++/property.h index 2e909cb..33f0a62 100644 --- a/include/dbus-c++/property.h +++ b/include/dbus-c++/property.h @@ -82,7 +82,7 @@ protected: 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 diff --git a/include/dbus-c++/server.h b/include/dbus-c++/server.h index 30879bf..25bd5ff 100644 --- a/include/dbus-c++/server.h +++ b/include/dbus-c++/server.h @@ -59,7 +59,7 @@ public: protected: - Server(const Server &s) + Server(const Server &) {} virtual void on_new_connection(Connection &c) = 0; diff --git a/include/dbus-c++/util.h b/include/dbus-c++/util.h index 225e1ca..bfec11d 100644 --- a/include/dbus-c++/util.h +++ b/include/dbus-c++/util.h @@ -55,11 +55,11 @@ public: unref(); } - RefCnt &operator = (const RefCnt &ref) + RefCnt &operator = (const RefCnt &rc) { - ref.ref(); + rc.ref(); unref(); - __ref = ref.__ref; + __ref = rc.__ref; return *this; } diff --git a/src/connection.cpp b/src/connection.cpp index 9fb85a1..db38d17 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -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); diff --git a/src/debug.cpp b/src/debug.cpp index 4f97dae..790deb1 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -48,6 +48,8 @@ static void _debug_log_default(const char *format, ...) va_end(args); } +#else + (void)format; #endif//DEBUG } diff --git a/src/dispatcher.cpp b/src/dispatcher.cpp index 2da4e86..354bd0d 100644 --- a/src/dispatcher.cpp +++ b/src/dispatcher.cpp @@ -86,9 +86,9 @@ bool Watch::enabled() const 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); } -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)); @@ -141,7 +141,7 @@ void Dispatcher::Private::on_rem_timeout(DBusTimeout *timeout, void *data) 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)); @@ -266,7 +266,8 @@ void DBus::_init_threading( (DBusRecursiveMutexNewFunction) m1, (DBusRecursiveMutexFreeFunction) m2, (DBusRecursiveMutexLockFunction) m3, - (DBusRecursiveMutexUnlockFunction) m4 + (DBusRecursiveMutexUnlockFunction) m4, + 0, 0, 0, 0 }; #endif//DBUS_HAS_RECURSIVE_MUTEX dbus_threads_init(&functions); diff --git a/src/error.cpp b/src/error.cpp index 840365b..39755d7 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -46,10 +46,10 @@ Error::Error(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) { - set(name, message); + set(n, msg); } Error::Error(Message &m) @@ -77,9 +77,9 @@ bool Error::is_set() const 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() diff --git a/src/eventloop.cpp b/src/eventloop.cpp index 7fac42c..b112039 100644 --- a/src/eventloop.cpp +++ b/src/eventloop.cpp @@ -40,13 +40,13 @@ static double millis(timeval tv) return (tv.tv_sec *1000.0 + tv.tv_usec/1000.0); } -DefaultTimeout::DefaultTimeout(int interval, bool repeat, DefaultMainLoop *ed) -: _enabled(true), _interval(interval), _repeat(repeat), _expiration(0), _data(0), _disp(ed) +DefaultTimeout::DefaultTimeout(int interval_, bool repeat_, DefaultMainLoop *ed) +: _enabled(true), _interval(interval_), _repeat(repeat_), _expiration(0), _data(0), _disp(ed) { timeval now; gettimeofday(&now, NULL); - _expiration = millis(now) + interval; + _expiration = millis(now) + interval_; _disp->_mutex_t.lock(); _disp->_timeouts.push_back(this); @@ -60,8 +60,8 @@ DefaultTimeout::~DefaultTimeout() _disp->_mutex_t.unlock(); } -DefaultWatch::DefaultWatch(int fd, int flags, DefaultMainLoop *ed) -: _enabled(true), _fd(fd), _flags(flags), _state(0), _data(0), _disp(ed) +DefaultWatch::DefaultWatch(int fd, int flags_, DefaultMainLoop *ed) +: _enabled(true), _fd(fd), _flags(flags_), _state(0), _data(0), _disp(ed) { _disp->_mutex_w.lock(); _disp->_watches.push_back(this); diff --git a/src/glib-integration.cpp b/src/glib-integration.cpp index 491c950..ddd3c6f 100644 --- a/src/glib-integration.cpp +++ b/src/glib-integration.cpp @@ -31,7 +31,7 @@ using namespace DBus; 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()) _enable(); @@ -85,7 +85,7 @@ struct BusSource GPollFD poll; }; -static gboolean watch_prepare(GSource *source, gint *timeout) +static gboolean watch_prepare(GSource *, gint *timeout) { //debug_log("glib: watch_prepare"); @@ -101,7 +101,7 @@ static gboolean watch_check(GSource *source) 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"); @@ -113,11 +113,13 @@ static GSourceFuncs watch_funcs = { watch_prepare, watch_check, watch_dispatch, - NULL + NULL, + NULL, + NULL }; 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()) _enable(); @@ -165,16 +167,16 @@ void Glib::BusWatch::_enable() g_source_set_priority(_source, _priority); g_source_set_callback(_source, watch_handler, this, NULL); - int flags = Watch::flags(); + int flags_ = Watch::flags(); int condition = 0; - if (flags &DBUS_WATCH_READABLE) + if (flags_ &DBUS_WATCH_READABLE) condition |= G_IO_IN; - if (flags &DBUS_WATCH_WRITABLE) + if (flags_ &DBUS_WATCH_WRITABLE) condition |= G_IO_OUT; - if (flags &DBUS_WATCH_ERROR) + if (flags_ &DBUS_WATCH_ERROR) condition |= G_IO_ERR; - if (flags &DBUS_WATCH_HANGUP) + if (flags_ &DBUS_WATCH_HANGUP) condition |= G_IO_HUP; 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; } -static gboolean dispatcher_check(GSource *source) +static gboolean dispatcher_check(GSource *) { return FALSE; } static gboolean dispatcher_dispatch(GSource *source, - GSourceFunc callback, - gpointer user_data) + GSourceFunc, + gpointer) { Dispatcher *dispatcher = ((DispatcherSource*)source)->dispatcher; @@ -237,7 +239,9 @@ static const GSourceFuncs dispatcher_funcs = { dispatcher_prepare, dispatcher_check, dispatcher_dispatch, - NULL + NULL, + NULL, + NULL }; Glib::BusDispatcher::BusDispatcher() diff --git a/src/interface.cpp b/src/interface.cpp index b0360ac..8cf27a9 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -32,40 +32,40 @@ using namespace DBus; -Interface::Interface(const std::string &name) -: _name(name) +Interface::Interface(const std::string &n) +: _name(n) {} 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; } -InterfaceAdaptor::InterfaceAdaptor(const std::string &name) -: Interface(name) +InterfaceAdaptor::InterfaceAdaptor(const std::string &n) +: 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) { - 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()) { return mi->second.call(msg); } 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); } -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()) { @@ -93,9 +93,9 @@ Variant *InterfaceAdaptor::get_property(const std::string &name) 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()) { @@ -113,26 +113,26 @@ void InterfaceAdaptor::set_property(const std::string &name, Variant &value) 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; } -InterfaceProxy::InterfaceProxy(const std::string &name) -: Interface(name) +InterfaceProxy::InterfaceProxy(const std::string &n) +: 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) { - 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()) { si->second.call(msg); diff --git a/src/introspection.cpp b/src/introspection.cpp index 11fa883..1e5b806 100644 --- a/src/introspection.cpp +++ b/src/introspection.cpp @@ -61,7 +61,7 @@ Message IntrospectableAdaptor::Introspect(const CallMessage &call) { debug_log("introspecting interface %s", iti->first.c_str()); - IntrospectedInterface *const intro = iti->second->introspect(); + const IntrospectedInterface * intro = iti->second->introspect(); if (intro) { xml << "\n\t<interface name=\"" << intro->name << "\">"; @@ -144,7 +144,7 @@ Message IntrospectableAdaptor::Introspect(const CallMessage &call) return reply; } -IntrospectedInterface *const IntrospectableAdaptor::introspect() const +const IntrospectedInterface * IntrospectableAdaptor::introspect() const { static IntrospectedArgument Introspect_args[] = { diff --git a/src/message.cpp b/src/message.cpp index aa920b3..651b5c1 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -236,9 +236,9 @@ char *MessageIter::signature() const 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() @@ -491,9 +491,9 @@ ErrorMessage::ErrorMessage() _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 @@ -520,9 +520,9 @@ SignalMessage::SignalMessage(const char *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 @@ -575,9 +575,9 @@ CallMessage::CallMessage() _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 diff --git a/src/object.cpp b/src/object.cpp index f7d0916..53f3714 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -39,8 +39,8 @@ using namespace DBus; -Object::Object(Connection &conn, const Path &path, const char *service) -: _conn(conn), _path(path), _service(service ? service : "") +Object::Object(Connection &conn_, const Path &path_, const char *service_) +: _conn(conn_), _path(path_), _service(service_ ? service_ : "") { } @@ -61,7 +61,7 @@ static DBusObjectPathVTable _vtable = 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 ? } @@ -148,8 +148,8 @@ ObjectPathList ObjectAdaptor::child_nodes_from_prefix(const std::string &prefix) return ali; } -ObjectAdaptor::ObjectAdaptor(Connection &conn, const Path &path) -: Object(conn, path, conn.unique_name()) +ObjectAdaptor::ObjectAdaptor(Connection &conn_, const Path &path_) +: Object(conn_, path_, conn_.unique_name()) { register_obj(); } @@ -270,8 +270,8 @@ ObjectAdaptor::Continuation *ObjectAdaptor::find_continuation(const Tag *tag) return di != _continuations.end() ? di->second : NULL; } -ObjectAdaptor::Continuation::Continuation(Connection &conn, const CallMessage &call, const Tag *tag) -: _conn(conn), _call(call), _return(_call), _tag(tag) +ObjectAdaptor::Continuation::Continuation(Connection &conn, const CallMessage &call, const Tag *tag_) +: _conn(conn), _call(call), _return(_call), _tag(tag_) { _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) -: Object(conn, path, service) +ObjectProxy::ObjectProxy(Connection &conn_, const Path &path_, const char *service_) +: Object(conn_, path_, service_) { register_obj(); } diff --git a/src/pendingcall.cpp b/src/pendingcall.cpp index 3757d8f..fbc7542 100644 --- a/src/pendingcall.cpp +++ b/src/pendingcall.cpp @@ -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); diff --git a/src/property.cpp b/src/property.cpp index 15a2f5b..f4db402 100644 --- a/src/property.cpp +++ b/src/property.cpp @@ -96,7 +96,7 @@ Message PropertiesAdaptor::Set(const CallMessage &call) return reply; } -IntrospectedInterface *const PropertiesAdaptor::introspect() const +const IntrospectedInterface *PropertiesAdaptor::introspect() const { 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 Variant 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 } diff --git a/src/server.cpp b/src/server.cpp index 0c652e5..423d576 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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); diff --git a/src/types.cpp b/src/types.cpp index 117cca3..0ca60ca 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -68,11 +68,11 @@ const Signature Variant::signature() const { char *sigbuf = reader().signature(); - Signature signature = sigbuf; + Signature sig = sigbuf; free(sigbuf); - return signature; + return sig; } MessageIter &operator << (MessageIter &iter, const Variant &val) diff --git a/tools/generate_adaptor.cpp b/tools/generate_adaptor.cpp index 891ecfc..38975c9 100644 --- a/tools/generate_adaptor.cpp +++ b/tools/generate_adaptor.cpp @@ -145,7 +145,7 @@ void generate_adaptor(Xml::Document &doc, const char *filename) body << tab << "}" << endl << endl; - body << tab << "::DBus::IntrospectedInterface *const introspect() const " << endl + body << tab << "const ::DBus::IntrospectedInterface *introspect() const " << endl << tab << "{" << endl; // generate the introspect arguments |