cmark

My personal build of CMark ✏️

Commit
76ed9a65b03b2477628c0bf72855cc4686642574
Parent
9f1bb45d9b1a43daa229714d4eb83e981a187f92
Author
John MacFarlane <jgm@berkeley.edu>
Date

Mark entity data structures as const.

Diffstat

2 files changed, 4 insertions, 4 deletions

Status File Name N° Changes Insertions Deletions
Modified src/entities.h 4 2 2
Modified tools/make_entities_h.py 4 2 2
diff --git a/src/entities.h b/src/entities.h
@@ -15,7 +15,7 @@ struct cmark_entity_node {
 #define CMARK_ENTITY_MIN_LENGTH 2
 #define CMARK_ENTITY_MAX_LENGTH 31
 
-static struct cmark_entity_node cmark_entities[] = {
+static const struct cmark_entity_node cmark_entities[] = {
 {132476, (unsigned char*)"\342\203\233", -1, -1}, /* &TripleDot; */
 {5862221, (unsigned char*)"\342\205\205", 0, -1}, /* &DD; */
 {5862336, (unsigned char*)"\76", 1, 3}, /* &GT; */
@@ -2143,7 +2143,7 @@ static struct cmark_entity_node cmark_entities[] = {
 {4287033576, (unsigned char*)"\342\252\224", -1, -1}, /* &gesles; */
 };
 
-static int cmark_entities_root = 1062;
+static const int cmark_entities_root = 1062;
 
 #ifdef __cplusplus
 }
diff --git a/tools/make_entities_h.py b/tools/make_entities_h.py
@@ -89,14 +89,14 @@ struct cmark_entity_node {
 #define CMARK_ENTITY_MAX_LENGTH 31
 """)
 
-print("static struct cmark_entity_node cmark_entities[] = {");
+print("static const struct cmark_entity_node cmark_entities[] = {");
 
 for line in lines:
   print(line);
 
 print("};\n");
 
-print("static int cmark_entities_root = " + str(mid) + ";");
+print("static const int cmark_entities_root = " + str(mid) + ";");
 
 print("""
 #ifdef __cplusplus