MSVC debugger gets confused when two structs have the same name

This commit is contained in:
Enno Rehling 2019-01-18 22:26:55 +01:00
parent 1f95a46e64
commit dea177cc5e

View file

@ -15,14 +15,14 @@
#define ESCAPE_CHAR '\\' #define ESCAPE_CHAR '\\'
#define MAXTOKENSIZE 8192 #define MAXTOKENSIZE 8192
typedef struct parser_state { typedef struct parse_state {
const char *current_token; const char *current_token;
struct parser_state *next; struct parse_state *next;
void *data; void *data;
void(*dtor)(void *); void(*dtor)(void *);
} parser_state; } parse_state;
static parser_state *states; static parse_state *states;
static int eatwhitespace_c(const char **str_p) static int eatwhitespace_c(const char **str_p)
{ {
@ -57,7 +57,7 @@ static int eatwhitespace_c(const char **str_p)
void init_tokens_ex(const char *initstr, void *data, void (*dtor)(void *)) void init_tokens_ex(const char *initstr, void *data, void (*dtor)(void *))
{ {
if (states == NULL) { if (states == NULL) {
states = calloc(1, sizeof(parser_state)); states = calloc(1, sizeof(parse_state));
if (!states) abort(); if (!states) abort();
} }
else if (states->dtor) { else if (states->dtor) {
@ -74,7 +74,7 @@ void init_tokens_str(const char *initstr) {
void parser_pushstate(void) void parser_pushstate(void)
{ {
parser_state *new_state = calloc(1, sizeof(parser_state)); parse_state *new_state = calloc(1, sizeof(parse_state));
if (!new_state) abort(); if (!new_state) abort();
new_state->current_token = NULL; new_state->current_token = NULL;
new_state->next = states; new_state->next = states;
@ -83,7 +83,7 @@ void parser_pushstate(void)
void parser_popstate(void) void parser_popstate(void)
{ {
parser_state *new_state = states->next; parse_state *new_state = states->next;
if (states->dtor) { if (states->dtor) {
states->dtor(states->data); states->dtor(states->data);
} }