aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-04-13 09:53:26 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-06-13 17:14:33 +0200
commitc8558c8a28966110aa3a356f95d3c60afe32b64a (patch)
treece678c874399b9da80c42f51fe7ec71a0722148b
parent99720bff24a6cda13357dde624c4822c9a96d20e (diff)
wrap-json: Sync with app-afb-helpers-submodule
Change-Id: Idc3360e7b96d5d9dd3fbb39ef97b3dc5d50c54bb Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/wrap-json.c11
-rw-r--r--src/wrap-json.md4
2 files changed, 6 insertions, 9 deletions
diff --git a/src/wrap-json.c b/src/wrap-json.c
index 3b8a6df3..46a4d675 100644
--- a/src/wrap-json.c
+++ b/src/wrap-json.c
@@ -103,8 +103,8 @@ static int encode_base64(
int pad,
int url)
{
- uint16_t u16;
- uint8_t u8;
+ uint16_t u16 = 0;
+ uint8_t u8 = 0;
size_t in, out, rlen, n3, r3, iout, nout;
int iw;
char *result, c;
@@ -517,7 +517,7 @@ static int vunpack(struct json_object *object, const char *desc, va_list args, i
int64_t *pI = NULL;
size_t *pz = NULL;
uint8_t **py = NULL;
- struct { struct json_object *parent; const char *acc; int index, count; char type; } stack[STACKCOUNT], *top;
+ struct { struct json_object *parent; const char *acc; int index; size_t count; char type; } stack[STACKCOUNT], *top;
struct json_object *obj;
struct json_object **po;
@@ -845,7 +845,7 @@ static void object_for_all(struct json_object *object, void (*callback)(void*,st
static void array_for_all(struct json_object *object, void (*callback)(void*,struct json_object*), void *closure)
{
- int n = json_object_array_length(object);
+ size_t n = json_object_array_length(object);
int i = 0;
while(i < n)
callback(closure, json_object_array_get_idx(object, i++));
@@ -888,7 +888,7 @@ void wrap_json_for_all(struct json_object *object, void (*callback)(void*,struct
else if (!json_object_is_type(object, json_type_array))
callback(closure, object, NULL);
else {
- int n = json_object_array_length(object);
+ size_t n = json_object_array_length(object);
int i = 0;
while(i < n)
callback(closure, json_object_array_get_idx(object, i++), NULL);
@@ -1139,4 +1139,3 @@ int main()
json_decref(j);
#endif
-
diff --git a/src/wrap-json.md b/src/wrap-json.md
index 97dc2f50..a86d2a50 100644
--- a/src/wrap-json.md
+++ b/src/wrap-json.md
@@ -2,7 +2,7 @@ WRAP-JSON facility
==================
The facility wrap-json is based on the pack/unpack API on the
-libray jansson. The two chapters below are copied from the
+library jansson. The two chapters below are copied from the
documentation of jansson library copyrighted by Petri Lehtinen
(see at end).
@@ -298,7 +298,6 @@ Examples:
"bar", &myint2, &myint3);
/* myint1, myint2 or myint3 is no touched as "foo" and "bar" don't exist */
-
Copyright
---------
@@ -321,4 +320,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-