aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGergely Risko <gergely+context@risko.hu>2009-12-09 10:55:25 +0200
committerGergely Risko <gergely+context@risko.hu>2009-12-09 10:55:25 +0200
commit8d6a43aa2470a746d613e87e953a673b399dba45 (patch)
treed712fc1c2c7d2f3eef9890cf5a23c55f88c3a2e9
parent106c1d369ad332af4ba6db84bbc4abce3a9d24ce (diff)
Do not warn the user if she includes contextjson.h, but doesn't actually use all (or any) part of it.
-rw-r--r--libcontextsubscriber/src/contextjson.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libcontextsubscriber/src/contextjson.h b/libcontextsubscriber/src/contextjson.h
index 5be0a20c..ec6e5077 100644
--- a/libcontextsubscriber/src/contextjson.h
+++ b/libcontextsubscriber/src/contextjson.h
@@ -27,6 +27,13 @@
#include <qjson/serializer.h>
#include <qjson/parser.h>
+// stolen from glib
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define CKIT_GNUC_UNUSED __attribute__((__unused__))
+#else
+#define CKIT_GNUC_UNUSED
+#endif
+
namespace ContextSubscriber {
// Please note that it is intentional that this header file contains
@@ -40,12 +47,14 @@ namespace ContextSubscriber {
///
/// If you use this function, you have to add libqjson to the list of
/// libraries you link against.
+CKIT_GNUC_UNUSED
static QString qVariantToJSON(const QVariant &v) {
QJson::Serializer serializer;
return serializer.serialize(v);
}
/// Loads json data into a QVariant. On parse error it returns QVariant().
+CKIT_GNUC_UNUSED
static QVariant jsonToQVariant(const QString &s) {
QJson::Parser parser;
bool ok;