src/json.c

changeset 1688
27073814f654
parent 1675
36c0fb2b60b2
--- a/src/json.c	Wed Dec 31 12:38:01 2025 +0100
+++ b/src/json.c	Wed Dec 31 12:51:12 2025 +0100
@@ -1427,7 +1427,7 @@
     CxBuffer buffer;
     if (cxBufferInit(&buffer, allocator, NULL, 128,
                      CX_BUFFER_AUTO_EXTEND | CX_BUFFER_DO_NOT_FREE)) {
-        return CX_NULLSTR;
+        return CX_NULLSTR; // LCOV_EXCL_LINE
     }
     if (cx_json_write_rec(&buffer, value, cxBufferWriteFunc, writer, 0)
             || cxBufferTerminate(&buffer)) {
@@ -1485,8 +1485,7 @@
             return cx_vcmp_double(json->number, cxJsonAsDouble(other));
         case CX_JSON_LITERAL:
             return json->literal == other->literal ? 0 : -1;
-        default:
-            // LCOV_EXCL_START
+        default: // LCOV_EXCL_START
             // unreachable
             assert(false);
             return -1;
@@ -1536,8 +1535,7 @@
             arr->array.size = elem_count;
             for (size_t i = 0 ; i < elem_count ; i++) {
                 CxJsonValue *e = cx_json_clone_func(NULL, source->array.data[i], allocator, NULL);
-                if (e == NULL) {
-                    // LCOV_EXCL_START
+                if (e == NULL) { // LCOV_EXCL_START
                     cxJsonValueFree(arr);
                     return NULL;
                     // LCOV_EXCL_STOP
@@ -1554,8 +1552,7 @@
             return_value(cxJsonCreateNumber(allocator, source->number));
         case CX_JSON_LITERAL:
             return_value(cxJsonCreateLiteral(allocator, source->literal));
-        default:
-            // LCOV_EXCL_START
+        default: // LCOV_EXCL_START
             // unreachable
             assert(false);
             return NULL;

mercurial