summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2016-02-18 02:20:59 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2016-02-18 02:20:59 -0800
commite746971582cf43306f3e1282af561cfaebc0d244 (patch)
tree6f90446b7d07173bfd1ec6616ea040eb35758372
parent7e3b12d6daaa2f9a51115e735c8ccfcb03e5fdbc (diff)
downloadnasm-e746971582cf43306f3e1282af561cfaebc0d244.tar.gz
Make struct preproc_ops const
Make the preproc function pointer arrays const. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--nasm.c2
-rw-r--r--nasm.h4
-rw-r--r--preproc-nop.c2
-rw-r--r--preproc.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/nasm.c b/nasm.c
index 01e0628c..0ba96f68 100644
--- a/nasm.c
+++ b/nasm.c
@@ -126,7 +126,7 @@ static struct RAA *offsets;
static struct SAA *forwrefs; /* keep track of forward references */
static const struct forwrefinfo *forwref;
-static struct preproc_ops *preproc;
+static const struct preproc_ops *preproc;
#define OP_NORMAL (1u << 0)
#define OP_PREPROCESS (1u << 1)
diff --git a/nasm.h b/nasm.h
index 71eb148f..517d924e 100644
--- a/nasm.h
+++ b/nasm.h
@@ -345,8 +345,8 @@ struct preproc_ops {
void (*include_path)(char *path);
};
-extern struct preproc_ops nasmpp;
-extern struct preproc_ops preproc_nop;
+extern const struct preproc_ops nasmpp;
+extern const struct preproc_ops preproc_nop;
/*
* Some lexical properties of the NASM source language, included
diff --git a/preproc-nop.c b/preproc-nop.c
index 8024cac2..c5835ea9 100644
--- a/preproc-nop.c
+++ b/preproc-nop.c
@@ -170,7 +170,7 @@ static void nop_include_path(char *path)
(void)path;
}
-struct preproc_ops preproc_nop = {
+const struct preproc_ops preproc_nop = {
nop_reset,
nop_getline,
nop_cleanup,
diff --git a/preproc.c b/preproc.c
index d2b9bb7f..fe62428f 100644
--- a/preproc.c
+++ b/preproc.c
@@ -5237,7 +5237,7 @@ static void make_tok_num(Token * tok, int64_t val)
tok->type = TOK_NUMBER;
}
-struct preproc_ops nasmpp = {
+const struct preproc_ops nasmpp = {
pp_reset,
pp_getline,
pp_cleanup,