Make struct preproc_ops const

Make the preproc function pointer arrays const.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2016-02-18 02:20:59 -08:00
parent 7e3b12d6da
commit e746971582
4 changed files with 5 additions and 5 deletions

2
nasm.c
View File

@ -126,7 +126,7 @@ static struct RAA *offsets;
static struct SAA *forwrefs; /* keep track of forward references */ static struct SAA *forwrefs; /* keep track of forward references */
static const struct forwrefinfo *forwref; static const struct forwrefinfo *forwref;
static struct preproc_ops *preproc; static const struct preproc_ops *preproc;
#define OP_NORMAL (1u << 0) #define OP_NORMAL (1u << 0)
#define OP_PREPROCESS (1u << 1) #define OP_PREPROCESS (1u << 1)

4
nasm.h
View File

@ -345,8 +345,8 @@ struct preproc_ops {
void (*include_path)(char *path); void (*include_path)(char *path);
}; };
extern struct preproc_ops nasmpp; extern const struct preproc_ops nasmpp;
extern struct preproc_ops preproc_nop; extern const struct preproc_ops preproc_nop;
/* /*
* Some lexical properties of the NASM source language, included * Some lexical properties of the NASM source language, included

View File

@ -170,7 +170,7 @@ static void nop_include_path(char *path)
(void)path; (void)path;
} }
struct preproc_ops preproc_nop = { const struct preproc_ops preproc_nop = {
nop_reset, nop_reset,
nop_getline, nop_getline,
nop_cleanup, nop_cleanup,

View File

@ -5237,7 +5237,7 @@ static void make_tok_num(Token * tok, int64_t val)
tok->type = TOK_NUMBER; tok->type = TOK_NUMBER;
} }
struct preproc_ops nasmpp = { const struct preproc_ops nasmpp = {
pp_reset, pp_reset,
pp_getline, pp_getline,
pp_cleanup, pp_cleanup,