From 76ed9a65b03b2477628c0bf72855cc4686642574 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 16 Jun 2015 14:15:32 -0700 Subject: Mark entity data structures as const. --- src/entities.h | 4 ++-- tools/make_entities_h.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/entities.h b/src/entities.h index 28e2ccd..2637c7f 100644 --- 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}, /* ⃛ */ {5862221, (unsigned char*)"\342\205\205", 0, -1}, /* ⅅ */ {5862336, (unsigned char*)"\76", 1, 3}, /* > */ @@ -2143,7 +2143,7 @@ static struct cmark_entity_node cmark_entities[] = { {4287033576, (unsigned char*)"\342\252\224", -1, -1}, /* ⪔ */ }; -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 index 90831a9..a993246 100644 --- 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 -- cgit v1.2.3