Change LBL_NONE to LBL_none

NASM convention is to use all-upper-case for "real" information, and
mixed-case (upper case common prefix, lower case description) for
meta-information. This is a highly useful distinction.

Thus "LBL_NONE" implies an actual label of type "NONE", as opposed to
no label at all.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2019-09-12 20:26:23 -04:00
parent 90b1ccff86
commit 7ad25b2e18
5 changed files with 7 additions and 7 deletions

View File

@ -974,7 +974,7 @@ static expr *expr6(void)
} else { } else {
enum label_type ltype; enum label_type ltype;
ltype = lookup_label(tokval->t_charptr, &label_seg, &label_ofs); ltype = lookup_label(tokval->t_charptr, &label_seg, &label_ofs);
if (ltype == LBL_NONE) { if (ltype == LBL_none) {
scope = local_scope(tokval->t_charptr); scope = local_scope(tokval->t_charptr);
if (critical) { if (critical) {
nasm_nonfatal("symbol `%s%s' not defined%s", nasm_nonfatal("symbol `%s%s' not defined%s",

View File

@ -272,7 +272,7 @@ enum label_type lookup_label(const char *label,
union label *lptr; union label *lptr;
if (!initialized) if (!initialized)
return LBL_NONE; return LBL_none;
lptr = find_label(label, false, NULL); lptr = find_label(label, false, NULL);
if (lptr && lptr->defn.defined) { if (lptr && lptr->defn.defined) {
@ -284,7 +284,7 @@ enum label_type lookup_label(const char *label,
return lptr->defn.type; return lptr->defn.type;
} }
return LBL_NONE; return LBL_none;
} }
static inline bool is_global(enum label_type type) static inline bool is_global(enum label_type type)

View File

@ -48,7 +48,7 @@ enum mangle_index {
}; };
enum label_type { enum label_type {
LBL_NONE = -1, /* No label */ LBL_none = -1, /* No label */
LBL_LOCAL = 0, /* Must be zero */ LBL_LOCAL = 0, /* Must be zero */
LBL_STATIC, LBL_STATIC,
LBL_GLOBAL, LBL_GLOBAL,

View File

@ -655,7 +655,7 @@ static void bin_cleanup(void)
fprintf(rf, "\n\nValue Name\n"); fprintf(rf, "\n\nValue Name\n");
list_for_each(l, no_seg_labels) { list_for_each(l, no_seg_labels) {
found_label = lookup_label(l->name, &segment, &offset); found_label = lookup_label(l->name, &segment, &offset);
nasm_assert(found_label != LBL_NONE); nasm_assert(found_label != LBL_none);
fprintf(rf, "%08"PRIX64" %s\n", offset, l->name); fprintf(rf, "%08"PRIX64" %s\n", offset, l->name);
} }
fprintf(rf, "\n\n"); fprintf(rf, "\n\n");
@ -668,7 +668,7 @@ static void bin_cleanup(void)
fprintf(rf, "\n\nReal Virtual Name\n"); fprintf(rf, "\n\nReal Virtual Name\n");
list_for_each(l, s->labels) { list_for_each(l, s->labels) {
found_label = lookup_label(l->name, &segment, &offset); found_label = lookup_label(l->name, &segment, &offset);
nasm_assert(found_label != LBL_NONE); nasm_assert(found_label != LBL_none);
fprintf(rf, "%16"PRIX64" %16"PRIX64" %s\n", fprintf(rf, "%16"PRIX64" %16"PRIX64" %s\n",
s->start + offset, s->vstart + offset, s->start + offset, s->vstart + offset,
l->name); l->name);

View File

@ -1740,7 +1740,7 @@ static bool macho_set_section_attribute_by_symbol(const char *label, uint32_t fl
int32_t nasm_seg; int32_t nasm_seg;
int64_t offset; int64_t offset;
if (lookup_label(label, &nasm_seg, &offset) == LBL_NONE) { if (lookup_label(label, &nasm_seg, &offset) == LBL_none) {
nasm_error(ERR_NONFATAL, "unknown symbol `%s' in no_dead_strip", label); nasm_error(ERR_NONFATAL, "unknown symbol `%s' in no_dead_strip", label);
return false; return false;
} }