on master help sign in
More FlexeLint inspired tweaks
2f89e5eNeil Mitchell
cbits/hexml.c+3−3
@@ -249,9 +249,9 @@ static inline bool is_space(char c) { return is(c, tag_space); }
249/////////////////////////////////////////////////////////////////////
249/////////////////////////////////////////////////////////////////////
250// PARSER COMBINATORS
250// PARSER COMBINATORS
251
251
252−static inline char peekAt(document* d, int i) { return d->cursor[i]; }
252+static inline char peekAt(const document* d, int i) { return d->cursor[i]; }
253+static inline char peek(const document* d) { return peekAt(d, 0); }
253static inline void skip(document* d, int i) { d->cursor += i; }
254static inline void skip(document* d, int i) { d->cursor += i; }
254−static inline char peek(document* d) { return peekAt(d, 0); }
255static inline char get(document* d) { char c = peek(d); skip(d, 1); return c; }
255static inline char get(document* d) { char c = peek(d); skip(d, 1); return c; }
256
256
257// Remove whitespace characters from the cursor while they are still whitespace
257// Remove whitespace characters from the cursor while they are still whitespace
@@ -310,7 +310,7 @@ static inline void attr_alloc(attr_buffer* b, int ask)
310 b->alloc = buf2;
310 b->alloc = buf2;
311}
311}
312
312
313−void set_error(document* d, char* msg)
313+void set_error(document* d, const char* msg)
314{
314{
315 if (d->error_message != NULL) return; // keep the first error message
315 if (d->error_message != NULL) return; // keep the first error message
316 d->error_message = malloc(strlen(msg)+1);
316 d->error_message = malloc(strlen(msg)+1);