apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1836039 - in /apr/apr-util/branches/1.7.x: include/apr_json.h json/apr_json.c json/apr_json_decode.c test/testjson.c
Date Mon, 16 Jul 2018 13:50:13 GMT
Author: minfrin
Date: Mon Jul 16 13:50:13 2018
New Revision: 1836039

URL: http://svn.apache.org/viewvc?rev=1836039&view=rev
Log:
Be banished, oh tabs of angst and woe.

Modified:
    apr/apr-util/branches/1.7.x/include/apr_json.h
    apr/apr-util/branches/1.7.x/json/apr_json.c
    apr/apr-util/branches/1.7.x/json/apr_json_decode.c
    apr/apr-util/branches/1.7.x/test/testjson.c

Modified: apr/apr-util/branches/1.7.x/include/apr_json.h
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/include/apr_json.h?rev=1836039&r1=1836038&r2=1836039&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/include/apr_json.h (original)
+++ apr/apr-util/branches/1.7.x/include/apr_json.h Mon Jul 16 13:50:13 2018
@@ -178,8 +178,8 @@ APU_DECLARE(apr_json_value_t *) apr_json
  * @return The apr_json_value_t structure.
  */
 APU_DECLARE(apr_json_value_t *)
-		apr_json_string_create(apr_pool_t *pool, const char *val,
-				apr_ssize_t len) __attribute__((nonnull(1)));
+        apr_json_string_create(apr_pool_t *pool, const char *val,
+                apr_ssize_t len) __attribute__((nonnull(1)));
 
 /**
  * Allocate and return a JSON array.
@@ -189,8 +189,8 @@ APU_DECLARE(apr_json_value_t *)
  * @return The apr_json_value_t structure.
  */
 APU_DECLARE(apr_json_value_t *)
-		apr_json_array_create(apr_pool_t *pool, int nelts)
-		__attribute__((nonnull(1)));
+        apr_json_array_create(apr_pool_t *pool, int nelts)
+        __attribute__((nonnull(1)));
 
 /**
  * Allocate and return a JSON object.
@@ -209,8 +209,8 @@ APU_DECLARE(apr_json_value_t *) apr_json
  * @return The apr_json_value_t structure.
  */
 APU_DECLARE(apr_json_value_t *)
-		apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber)
-		__attribute__((nonnull(1)));
+        apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber)
+        __attribute__((nonnull(1)));
 
 /**
  * Allocate and return a JSON double.
@@ -220,8 +220,8 @@ APU_DECLARE(apr_json_value_t *)
  * @return The apr_json_value_t structure.
  */
 APU_DECLARE(apr_json_value_t *)
-		apr_json_double_create(apr_pool_t *pool, double dnumber)
-		__attribute__((nonnull(1)));
+        apr_json_double_create(apr_pool_t *pool, double dnumber)
+        __attribute__((nonnull(1)));
 
 /**
  * Allocate and return a JSON boolean.
@@ -231,8 +231,8 @@ APU_DECLARE(apr_json_value_t *)
  * @return The apr_json_value_t structure.
  */
 APU_DECLARE(apr_json_value_t *)
-		apr_json_boolean_create(apr_pool_t *pool, int boolean)
-		__attribute__((nonnull(1)));
+        apr_json_boolean_create(apr_pool_t *pool, int boolean)
+        __attribute__((nonnull(1)));
 
 /**
  * Allocate and return a JSON null.
@@ -241,8 +241,8 @@ APU_DECLARE(apr_json_value_t *)
  * @return The apr_json_value_t structure.
  */
 APU_DECLARE(apr_json_value_t *)
-		apr_json_null_create(apr_pool_t *pool)
-		__attribute__((nonnull(1)));
+        apr_json_null_create(apr_pool_t *pool)
+        __attribute__((nonnull(1)));
 
 /**
  * Associate a value with a key in a JSON object.

Modified: apr/apr-util/branches/1.7.x/json/apr_json.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/json/apr_json.c?rev=1836039&r1=1836038&r2=1836039&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/json/apr_json.c (original)
+++ apr/apr-util/branches/1.7.x/json/apr_json.c Mon Jul 16 13:50:13 2018
@@ -32,12 +32,12 @@ apr_json_value_t *apr_json_value_create(
 
 apr_json_value_t *apr_json_object_create(apr_pool_t *pool)
 {
-	apr_json_object_t *object;
+    apr_json_object_t *object;
 
-	apr_json_value_t *json = apr_json_value_create(pool);
+    apr_json_value_t *json = apr_json_value_create(pool);
 
-	json->type = APR_JSON_OBJECT;
-	json->value.object = object = apr_pcalloc(pool, sizeof(apr_json_object_t));
+    json->type = APR_JSON_OBJECT;
+    json->value.object = object = apr_pcalloc(pool, sizeof(apr_json_object_t));
     APR_RING_INIT(&object->list, apr_json_kv_t, link);
     object->hash = apr_hash_make(pool);
 
@@ -45,80 +45,80 @@ apr_json_value_t *apr_json_object_create
 }
 
 apr_json_value_t *apr_json_string_create(apr_pool_t *pool, const char *val,
-		apr_ssize_t len) {
-	apr_json_value_t *json = apr_json_value_create(pool);
+        apr_ssize_t len) {
+    apr_json_value_t *json = apr_json_value_create(pool);
 
-	if (json) {
-		if (val) {
-			json->type = APR_JSON_STRING;
-			json->value.string.p = val;
-			json->value.string.len = len;
-		} else {
-			json->type = APR_JSON_NULL;
-		}
-	}
+    if (json) {
+        if (val) {
+            json->type = APR_JSON_STRING;
+            json->value.string.p = val;
+            json->value.string.len = len;
+        } else {
+            json->type = APR_JSON_NULL;
+        }
+    }
 
-	return json;
+    return json;
 }
 
 apr_json_value_t *apr_json_array_create(apr_pool_t *pool, int nelts)
 {
-	apr_json_value_t *json = apr_json_value_create(pool);
+    apr_json_value_t *json = apr_json_value_create(pool);
 
-	if (json) {
-		json->type = APR_JSON_ARRAY;
-		json->value.array = apr_array_make(pool, nelts,
-				sizeof(apr_json_value_t *));
-	}
+    if (json) {
+        json->type = APR_JSON_ARRAY;
+        json->value.array = apr_array_make(pool, nelts,
+                sizeof(apr_json_value_t *));
+    }
 
-	return json;
+    return json;
 }
 
 apr_json_value_t *apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber)
 {
-	apr_json_value_t *json = apr_json_value_create(pool);
+    apr_json_value_t *json = apr_json_value_create(pool);
 
-	if (json) {
-		json->type = APR_JSON_LONG;
-		json->value.lnumber = lnumber;
-	}
+    if (json) {
+        json->type = APR_JSON_LONG;
+        json->value.lnumber = lnumber;
+    }
 
-	return json;
+    return json;
 }
 
 apr_json_value_t *apr_json_double_create(apr_pool_t *pool, double dnumber)
 {
-	apr_json_value_t *json = apr_json_value_create(pool);
+    apr_json_value_t *json = apr_json_value_create(pool);
 
-	if (json) {
-		json->type = APR_JSON_DOUBLE;
-		json->value.lnumber = dnumber;
-	}
+    if (json) {
+        json->type = APR_JSON_DOUBLE;
+        json->value.lnumber = dnumber;
+    }
 
-	return json;
+    return json;
 }
 
 apr_json_value_t *apr_json_boolean_create(apr_pool_t *pool, int boolean)
 {
-	apr_json_value_t *json = apr_json_value_create(pool);
+    apr_json_value_t *json = apr_json_value_create(pool);
 
-	if (json) {
-		json->type = APR_JSON_BOOLEAN;
-		json->value.boolean = boolean;
-	}
+    if (json) {
+        json->type = APR_JSON_BOOLEAN;
+        json->value.boolean = boolean;
+    }
 
-	return json;
+    return json;
 }
 
 apr_json_value_t *apr_json_null_create(apr_pool_t *pool)
 {
-	apr_json_value_t *json = apr_json_value_create(pool);
+    apr_json_value_t *json = apr_json_value_create(pool);
 
-	if (json) {
-		json->type = APR_JSON_NULL;
-	}
+    if (json) {
+        json->type = APR_JSON_NULL;
+    }
 
-	return json;
+    return json;
 }
 
 apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key,
@@ -127,12 +127,12 @@ apr_status_t apr_json_object_set(apr_jso
     apr_json_kv_t *kv;
     apr_hash_t *hash;
 
-	if (object->type != APR_JSON_OBJECT || !key
-			|| key->type != APR_JSON_STRING) {
-		return APR_EINVAL;
-	}
+    if (object->type != APR_JSON_OBJECT || !key
+            || key->type != APR_JSON_STRING) {
+        return APR_EINVAL;
+    }
 
-	hash = object->value.object->hash;
+    hash = object->value.object->hash;
 
     kv = apr_hash_get(hash, key->value.string.p, key->value.string.len);
 

Modified: apr/apr-util/branches/1.7.x/json/apr_json_decode.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/json/apr_json_decode.c?rev=1836039&r1=1836038&r2=1836039&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/json/apr_json_decode.c (original)
+++ apr/apr-util/branches/1.7.x/json/apr_json_decode.c Mon Jul 16 13:50:13 2018
@@ -439,8 +439,8 @@ static apr_status_t apr_json_decode_obje
 {
     apr_status_t status = APR_SUCCESS;
 
-	apr_json_object_t *object = apr_pcalloc(self->pool,
-			sizeof(apr_json_object_t));
+    apr_json_object_t *object = apr_pcalloc(self->pool,
+            sizeof(apr_json_object_t));
     APR_RING_INIT(&object->list, apr_json_kv_t, link);
     object->hash = apr_hash_make(self->pool);
 

Modified: apr/apr-util/branches/1.7.x/test/testjson.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/test/testjson.c?rev=1836039&r1=1836038&r2=1836039&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/test/testjson.c (original)
+++ apr/apr-util/branches/1.7.x/test/testjson.c Mon Jul 16 13:50:13 2018
@@ -135,7 +135,7 @@ static void test_json_string(abts_case *
     apr_off_t offset = 0;
 
     /* "턞\"\t/\b\f\n\r\t"; */
-	const unsigned char expected[] = {237, 132, 158, 34, 9, 47, 8, 12, 10, 13, 9, 0};
+    const unsigned char expected[] = {237, 132, 158, 34, 9, 47, 8, 12, 10, 13, 9, 0};
 
     src = "\"\\uD834\\uDD1E\\\"\\t\\/\\b\\f\\n\\r\\t\"";
 
@@ -145,8 +145,8 @@ static void test_json_string(abts_case *
     ABTS_INT_EQUAL(tc, APR_SUCCESS, status);
     ABTS_INT_EQUAL(tc, APR_JSON_STRING, json->type);
 
-	ABTS_ASSERT(tc, "check for string unescape match",
-			(memcmp(expected, json->value.string.p, json->value.string.len) == 0));
+    ABTS_ASSERT(tc, "check for string unescape match",
+            (memcmp(expected, json->value.string.p, json->value.string.len) == 0));
 }
 
 abts_suite *testjson(abts_suite * suite)



Mime
View raw message