cmark

Unnamed repository; edit this file 'description' to name the repository.

commit e176f939862d4846859ce3ad3a003b38d98a6424
parent 6baeaf39441895c0374974d96da84f2e3979cfb2
Author: John MacFarlane <jgm@berkeley.edu>
Date:   Fri,  5 Dec 2014 10:05:27 -0800

Changed CMARK_NODE_NONE from -1 to 0.

This is more consistent with CMARK_LIST_NONE, etc.

Diffstat:
Mman/man3/cmark.3 | 5+++--
Msrc/cmark.h | 5+++--
Msrc/node.c | 2+-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/man/man3/cmark.3 b/man/man3/cmark.3
@@ -30,6 +30,9 @@ UTF-8-encoded string.
 \f[C]
 .RS 0n
 typedef enum {
+	/* Error status */
+	CMARK_NODE_NONE,
+
 	/* Block */
 	CMARK_NODE_DOCUMENT,
 	CMARK_NODE_BLOCK_QUOTE,
@@ -58,8 +61,6 @@ typedef enum {
 
 	CMARK_NODE_FIRST_INLINE = CMARK_NODE_TEXT,
 	CMARK_NODE_LAST_INLINE  = CMARK_NODE_IMAGE,
-
-	CMARK_NODE_NONE = -1
 } cmark_node_type;
 .RE
 \f[]
diff --git a/src/cmark.h b/src/cmark.h
@@ -34,6 +34,9 @@ char *cmark_markdown_to_html(const char *text, int len);
 /**
  */
 typedef enum {
+	/* Error status */
+	CMARK_NODE_NONE,
+
 	/* Block */
 	CMARK_NODE_DOCUMENT,
 	CMARK_NODE_BLOCK_QUOTE,
@@ -62,8 +65,6 @@ typedef enum {
 
 	CMARK_NODE_FIRST_INLINE = CMARK_NODE_TEXT,
 	CMARK_NODE_LAST_INLINE  = CMARK_NODE_IMAGE,
-
-	CMARK_NODE_NONE = -1
 } cmark_node_type;
 
 
diff --git a/src/node.c b/src/node.c
@@ -88,6 +88,7 @@ static const char*
 S_type_string(cmark_node *node)
 {
 	switch (node->type) {
+	case CMARK_NODE_NONE:          return "NONE";
 	case CMARK_NODE_DOCUMENT:      return "DOCUMENT";
 	case CMARK_NODE_BLOCK_QUOTE:   return "BLOCK_QUOTE";
 	case CMARK_NODE_LIST:          return "LIST";
@@ -107,7 +108,6 @@ S_type_string(cmark_node *node)
 	case CMARK_NODE_STRONG:        return "STRONG";
 	case CMARK_NODE_LINK:          return "LINK";
 	case CMARK_NODE_IMAGE:         return "IMAGE";
-	case CMARK_NODE_NONE:          return "NONE";
 	}
 
 	return "<unknown>";