From 78a920a5fc00f3a533d1caca61d6d461c2d53058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Blanchon?= Date: Thu, 3 Jul 2014 13:58:08 +0200 Subject: [PATCH] Now use #pragma once --- JsonParser/JsonArray.cpp | 8 ++++---- JsonParser/JsonArray.h | 15 ++++++--------- JsonParser/JsonHashTable.cpp | 6 +++--- JsonParser/JsonHashTable.h | 15 ++++++--------- JsonParser/JsonObjectBase.cpp | 9 ++++----- JsonParser/JsonObjectBase.h | 15 +++++---------- JsonParser/JsonParser.h | 16 ++++++---------- JsonParserTests/TestArrayExample.cpp | 5 +++++ JsonParserTests/TestArrays.cpp | 5 +++++ JsonParserTests/TestGbathreeStrings.cpp | 5 +++++ JsonParserTests/TestHashTableExample.cpp | 5 +++++ 11 files changed, 54 insertions(+), 50 deletions(-) diff --git a/JsonParser/JsonArray.cpp b/JsonParser/JsonArray.cpp index 8a071f6c..dab52fbb 100644 --- a/JsonParser/JsonArray.cpp +++ b/JsonParser/JsonArray.cpp @@ -1,7 +1,7 @@ -/* -* malloc-free JSON parser for Arduino -* Benoit Blanchon 2014 - MIT License -*/ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ #include "JsonArray.h" #include "JsonHashTable.h" diff --git a/JsonParser/JsonArray.h b/JsonParser/JsonArray.h index b9cdfd07..eb14ecfa 100644 --- a/JsonParser/JsonArray.h +++ b/JsonParser/JsonArray.h @@ -1,10 +1,9 @@ -/* - * malloc-free JSON parser for Arduino - * Benoit Blanchon 2014 - MIT License - */ +/* + * Arduino JSON library + * Benoit Blanchon 2014 - MIT License + */ -#ifndef __JSONARRAY_H -#define __JSONARRAY_H +#pragma once #include "JsonObjectBase.h" @@ -37,6 +36,4 @@ private: JsonArray(char* json, jsmntok_t* tokens); jsmntok_t* getToken(int index); -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/JsonParser/JsonHashTable.cpp b/JsonParser/JsonHashTable.cpp index 1e1e0c6b..1073fbd3 100644 --- a/JsonParser/JsonHashTable.cpp +++ b/JsonParser/JsonHashTable.cpp @@ -1,6 +1,6 @@ -/* -* malloc-free JSON parser for Arduino -* Benoit Blanchon 2014 - MIT License +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License */ #include "JsonArray.h" diff --git a/JsonParser/JsonHashTable.h b/JsonParser/JsonHashTable.h index 87103821..5fe62c7e 100644 --- a/JsonParser/JsonHashTable.h +++ b/JsonParser/JsonHashTable.h @@ -1,10 +1,9 @@ -/* -* malloc-free JSON parser for Arduino -* Benoit Blanchon 2014 - MIT License -*/ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ -#ifndef __JSONHASHTABLE_H -#define __JSONHASHTABLE_H +#pragma once #include "JsonObjectBase.h" @@ -34,6 +33,4 @@ private: JsonHashTable(char* json, jsmntok_t* tokens); jsmntok_t* getToken(const char* key); -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/JsonParser/JsonObjectBase.cpp b/JsonParser/JsonObjectBase.cpp index 52baee0f..994790ff 100644 --- a/JsonParser/JsonObjectBase.cpp +++ b/JsonParser/JsonObjectBase.cpp @@ -1,8 +1,7 @@ -/* - * malloc-free JSON parser for Arduino - * Benoit Blanchon 2014 - * MIT License - */ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ #include "JsonObjectBase.h" diff --git a/JsonParser/JsonObjectBase.h b/JsonParser/JsonObjectBase.h index 348a4e99..9b9d8a60 100644 --- a/JsonParser/JsonObjectBase.h +++ b/JsonParser/JsonObjectBase.h @@ -1,11 +1,9 @@ -/* - * malloc-free JSON parser for Arduino - * Benoit Blanchon 2014 - * MIT License - */ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ -#ifndef __JSONOBJECTBASE_H -#define __JSONOBJECTBASE_H +#pragma once #include "jsmn.h" @@ -47,6 +45,3 @@ protected: char* json; jsmntok_t* tokens; }; - -#endif - diff --git a/JsonParser/JsonParser.h b/JsonParser/JsonParser.h index b977befd..ff21f7ff 100644 --- a/JsonParser/JsonParser.h +++ b/JsonParser/JsonParser.h @@ -1,10 +1,9 @@ -/* -* malloc-free JSON parser for Arduino -* Benoit Blanchon 2014 - MIT License -*/ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ -#ifndef __JSONPARSER_H -#define __JSONPARSER_H +#pragma once #include "JsonHashTable.h" #include "JsonArray.h" @@ -63,7 +62,4 @@ private: } jsmntok_t tokens[MAX_TOKENS]; -}; - -#endif - +}; \ No newline at end of file diff --git a/JsonParserTests/TestArrayExample.cpp b/JsonParserTests/TestArrayExample.cpp index 3fc7abb7..01aa9578 100644 --- a/JsonParserTests/TestArrayExample.cpp +++ b/JsonParserTests/TestArrayExample.cpp @@ -1,3 +1,8 @@ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ + #include "CppUnitTest.h" #include "JsonParser.h" diff --git a/JsonParserTests/TestArrays.cpp b/JsonParserTests/TestArrays.cpp index a459d24f..eae07f2f 100644 --- a/JsonParserTests/TestArrays.cpp +++ b/JsonParserTests/TestArrays.cpp @@ -1,3 +1,8 @@ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ + #include "CppUnitTest.h" #include "JsonParser.h" diff --git a/JsonParserTests/TestGbathreeStrings.cpp b/JsonParserTests/TestGbathreeStrings.cpp index 4c9baea8..d5fa22b7 100644 --- a/JsonParserTests/TestGbathreeStrings.cpp +++ b/JsonParserTests/TestGbathreeStrings.cpp @@ -1,3 +1,8 @@ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ + #include "CppUnitTest.h" #include "JsonParser.h" #include diff --git a/JsonParserTests/TestHashTableExample.cpp b/JsonParserTests/TestHashTableExample.cpp index 2eac9927..214a2d66 100644 --- a/JsonParserTests/TestHashTableExample.cpp +++ b/JsonParserTests/TestHashTableExample.cpp @@ -1,3 +1,8 @@ +/* +* Arduino JSON library +* Benoit Blanchon 2014 - MIT License +*/ + #include "CppUnitTest.h" #include "JsonParser.h" #include