Browse Source

Frozen INVALID value is 0

PUBLISHED_FROM=c13554fa36eb63e8eefaa28d99842f13fcb7732f
Dmitry Frank 9 years ago
parent
commit
4b1776cf19
2 changed files with 2 additions and 2 deletions
  1. 1 2
      frozen.h
  2. 1 0
      unit_test.c

+ 1 - 2
frozen.h

@@ -29,6 +29,7 @@ extern "C" {
 #include <stdio.h>
 
 enum json_token_type {
+  JSON_TYPE_INVALID = 0, /* memsetting to 0 should create INVALID value */
   JSON_TYPE_STRING,
   JSON_TYPE_NUMBER,
   JSON_TYPE_TRUE,
@@ -42,8 +43,6 @@ enum json_token_type {
   JSON_TYPES_CNT,
 };
 
-#define JSON_TYPE_INVALID JSON_TYPES_CNT
-
 struct json_token {
   const char *ptr;           /* Points to the beginning of the value */
   int len;                   /* Value length */

+ 1 - 0
unit_test.c

@@ -33,6 +33,7 @@
 #include <string.h>
 
 const char *tok_type_names[] = {
+  "INVALID",
   "STRING",
   "NUMBER",
   "TRUE",