summaryrefslogtreecommitdiffstats
path: root/src/uscxml/messages
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2017-01-27 21:54:43 (GMT)
committerStefan Radomski <github@mintwerk.de>2017-01-27 21:54:43 (GMT)
commit7f83038a1ef642b883417cc984d1f8ca9f0bc64b (patch)
treefd9236e866a06b250992e84bbf41324adf93a9fd /src/uscxml/messages
parentb450411ee8f0a57f3ec3909d65ecc289189e2b35 (diff)
downloaduscxml-7f83038a1ef642b883417cc984d1f8ca9f0bc64b.zip
uscxml-7f83038a1ef642b883417cc984d1f8ca9f0bc64b.tar.gz
uscxml-7f83038a1ef642b883417cc984d1f8ca9f0bc64b.tar.bz2
Reactivated BUILD_AS_PLUGINS
Diffstat (limited to 'src/uscxml/messages')
-rw-r--r--src/uscxml/messages/Data.cpp7
-rw-r--r--src/uscxml/messages/Data.h8
-rw-r--r--src/uscxml/messages/Event.cpp5
3 files changed, 13 insertions, 7 deletions
diff --git a/src/uscxml/messages/Data.cpp b/src/uscxml/messages/Data.cpp
index 6c48c46..8853b19 100644
--- a/src/uscxml/messages/Data.cpp
+++ b/src/uscxml/messages/Data.cpp
@@ -73,6 +73,7 @@ void Data::merge(const Data& other) {
}
Data Data::fromJSON(const std::string& jsonString) {
+
Data data;
std::string trimmed = boost::trim_copy(jsonString);
@@ -129,7 +130,7 @@ Data Data::fromJSON(const std::string& jsonString) {
return data;
}
- if (t[0].end != trimmed.length())
+ if ((size_t)t[0].end != trimmed.length())
return data;
// jsmntok_t* token = t;
@@ -218,7 +219,7 @@ std::string Data::toJSON(const Data& data) {
}
if (false) {
} else if (data.compound.size() > 0) {
- int longestKey = 0;
+ size_t longestKey = 0;
std::map<std::string, Data>::const_iterator compoundIter = data.compound.begin();
while(compoundIter != data.compound.end()) {
if (compoundIter->first.size() > longestKey)
@@ -226,7 +227,7 @@ std::string Data::toJSON(const Data& data) {
compoundIter++;
}
std::string keyPadding;
- for (unsigned int i = 0; i < longestKey; i++)
+ for (size_t i = 0; i < longestKey; i++)
keyPadding += " ";
std::string seperator;
diff --git a/src/uscxml/messages/Data.h b/src/uscxml/messages/Data.h
index 48323ed..5e4df87 100644
--- a/src/uscxml/messages/Data.h
+++ b/src/uscxml/messages/Data.h
@@ -39,7 +39,7 @@ class DOMNode;
namespace uscxml {
-static int _dataIndentation = 1;
+static unsigned int _dataIndentation = 1;
class USCXML_API Data {
public:
@@ -48,7 +48,10 @@ public:
INTERPRETED,
};
- Data() : node(NULL), type(INTERPRETED) {}
+ Data() : node(NULL), type(INTERPRETED) {
+ // silence stupid not used error for statics in gcc
+ (void)_dataIndentation;
+ }
explicit Data(const char* data, size_t size, const std::string& mimeType, bool adopt = false);
@@ -87,7 +90,6 @@ public:
compound.clear();
array.clear();
atom.clear();
-// adoptedDoc.reset();
binary = Blob();
node = NULL;
}
diff --git a/src/uscxml/messages/Event.cpp b/src/uscxml/messages/Event.cpp
index f372798..f667e92 100644
--- a/src/uscxml/messages/Event.cpp
+++ b/src/uscxml/messages/Event.cpp
@@ -84,7 +84,10 @@ std::ostream& operator<< (std::ostream& os, const Event& event) {
indent += " ";
}
-// os << indent << (event.eventType == Event::EXTERNAL ? "External" : "Internal") << " Event " << (event.dom ? "with DOM attached" : "") << std::endl;
+ os << indent
+ << (event.eventType == Event::INTERNAL ? "Internal" : "")
+ << (event.eventType == Event::EXTERNAL ? "External" : "")
+ << (event.eventType == Event::PLATFORM ? "Platform" : "") << " Event " << std::endl;
if (event.name.size() > 0)
os << indent << " name: " << event.name << std::endl;