reverted state to use long type
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
# Oct. 17, 2014; Daniel Holden
|
||||
- Reverted state to use long type
|
||||
|
||||
# Oct. 16, 2014; Daniel Holden
|
||||
- Removed comments describing changes
|
||||
- Fixed warnings reported by gcc in test suite under the new compilation flags
|
||||
|
||||
# Oct. 14, 2014; Dalton Woodard
|
||||
- Fixed all compilation warnings in `mpc.h` and `mpc.c`; both now compile successfully on OS X under clang-600.0.51
|
||||
and gcc 4.9.1 with the following flags:
|
||||
|
10
mpc.c
10
mpc.c
@@ -6,9 +6,9 @@
|
||||
|
||||
static mpc_state_t mpc_state_invalid(void) {
|
||||
mpc_state_t s;
|
||||
s.pos = SIZE_MAX;
|
||||
s.row = SIZE_MAX;
|
||||
s.col = SIZE_MAX;
|
||||
s.pos = -1;
|
||||
s.row = -1;
|
||||
s.col = -1;
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ static void mpc_input_rewind(mpc_input_t *i) {
|
||||
}
|
||||
|
||||
static int mpc_input_buffer_in_range(mpc_input_t *i) {
|
||||
return i->state.pos < (strlen(i->buffer) + i->marks[0].pos);
|
||||
return i->state.pos < (long)(strlen(i->buffer) + i->marks[0].pos);
|
||||
}
|
||||
|
||||
static char mpc_input_buffer_get(mpc_input_t *i) {
|
||||
@@ -473,7 +473,7 @@ static char mpc_input_buffer_get(mpc_input_t *i) {
|
||||
}
|
||||
|
||||
static int mpc_input_terminated(mpc_input_t *i) {
|
||||
if (i->type == MPC_INPUT_STRING && i->state.pos == strlen(i->string)) { return 1; }
|
||||
if (i->type == MPC_INPUT_STRING && i->state.pos == (long)strlen(i->string)) { return 1; }
|
||||
if (i->type == MPC_INPUT_FILE && feof(i->file)) { return 1; }
|
||||
if (i->type == MPC_INPUT_PIPE && feof(i->file)) { return 1; }
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user