@@ -10,9 +10,9 @@ typedef int bool;
10/////////////////////////////////////////////////////////////////////
10/////////////////////////////////////////////////////////////////////
13−int static inline end(str s) { return s.start + s.length; }
13+static inline int end(str s) { return s.start + s.length; }
15−str static inline start_length(int32_t start, int32_t length)
15+static inline str start_length(int32_t start, int32_t length)
17 if (start < 0 || length < 0) assert(0);
17 if (start < 0 || length < 0) assert(0);
@@ -21,7 +21,7 @@ str static inline start_length(int32_t start, int32_t length)
21 return res;
21 return res;
24−str static inline start_end(int32_t start, int32_t end)
24+static inline str start_end(int32_t start, int32_t end)
26 return start_length(start, end - start);
26 return start_length(start, end - start);
@@ -63,8 +63,8 @@ struct document
63 attr_buffer attrs;
63 attr_buffer attrs;
66−int static inline doc_length(document* d) { return (int) (d->end - d->body); }
66+static inline int doc_length(document* d) { return (int) (d->end - d->body); }
67−int static inline doc_position(document* d) { return (int) (d->cursor - d->body); }
67+static inline int doc_position(document* d) { return (int) (d->cursor - d->body); }
70/////////////////////////////////////////////////////////////////////
70/////////////////////////////////////////////////////////////////////
@@ -78,14 +78,14 @@ typedef struct
78 int cursor;
78 int cursor;
81−void static inline render_char(render* r, char c)
81+static inline void render_char(render* r, char c)
83 if (r->cursor < r->length)
83 if (r->cursor < r->length)
84 r->buffer[r->cursor] = c;
84 r->buffer[r->cursor] = c;
85 r->cursor++;
85 r->cursor++;
88−void static inline bound(char* msg, int index, int mn, int mx)
88+static inline void bound(char* msg, int index, int mn, int mx)
90 if (index < mn || index > mx)
90 if (index < mn || index > mx)
@@ -94,7 +94,7 @@ void static inline bound(char* msg, int index, int mn, int mx)
97−void static inline bound_str(char* msg, str s, int mn, int mx)
97+static inline void bound_str(char* msg, str s, int mn, int mx)
99 if (s.length < 0) assert(0);
99 if (s.length < 0) assert(0);
100 bound(msg, s.start, mn, mx);
100 bound(msg, s.start, mn, mx);
@@ -244,22 +244,22 @@ void init_parse_table()
244 done = 1;
244 done = 1;
247−bool static inline is(char c, char tag) { return parse_table[c] & tag; }
247+static inline bool is(char c, char tag) { return parse_table[c] & tag; }
248−bool static inline is_name1(char c) { return is(c, tag_name1); }
248+static inline bool is_name1(char c) { return is(c, tag_name1); }
249−bool static inline is_name(char c) { return is(c, tag_name); }
249+static inline bool is_name(char c) { return is(c, tag_name); }
250−bool static inline is_space(char c) { return is(c, tag_space); }
250+static inline bool is_space(char c) { return is(c, tag_space); }
253/////////////////////////////////////////////////////////////////////
253/////////////////////////////////////////////////////////////////////
254// PARSER COMBINATORS
254// PARSER COMBINATORS
256−char static inline peekAt(document* d, int i) { return d->cursor[i]; }
256+static inline char peekAt(document* d, int i) { return d->cursor[i]; }
257−void static inline skip(document* d, int i) { d->cursor += i; }
257+static inline void skip(document* d, int i) { d->cursor += i; }
258−char static inline peek(document* d) { return peekAt(d, 0); }
258+static inline char peek(document* d) { return peekAt(d, 0); }
259−char static inline get(document* d) { char c = peek(d); skip(d, 1); return c; }
259+static inline char get(document* d) { char c = peek(d); skip(d, 1); return c; }
261// Remove whitespace characters from the cursor while they are still whitespace
261// Remove whitespace characters from the cursor while they are still whitespace
262−void static inline trim(document* d)
262+static inline void trim(document* d)
264 while (is_space(peek(d)))
264 while (is_space(peek(d)))
265 skip(d, 1);
265 skip(d, 1);
@@ -285,7 +285,7 @@ bool find(document* d, char c)
285/////////////////////////////////////////////////////////////////////
285/////////////////////////////////////////////////////////////////////
286// PARSING CODE
286// PARSING CODE
288−void static inline node_alloc(node_buffer* b, int ask)
288+static inline void node_alloc(node_buffer* b, int ask)
290 int space = b->size - b->used_back - b->used_front;
290 int space = b->size - b->used_back - b->used_front;
291 if (space >= ask) return;
291 if (space >= ask) return;
@@ -300,7 +300,7 @@ void static inline node_alloc(node_buffer* b, int ask)
300 b->alloc = buf2;
300 b->alloc = buf2;
303−void static inline attr_alloc(attr_buffer* b, int ask)
303+static inline void attr_alloc(attr_buffer* b, int ask)
305 int space = b->size - b->used;
305 int space = b->size - b->used;
306 if (space >= ask) return;
306 if (space >= ask) return;
@@ -324,7 +324,7 @@ void set_error(document* d, char* msg)
325// you now expect a name, perhaps preceeded by whitespace
325// you now expect a name, perhaps preceeded by whitespace
326// the name may be empty
326// the name may be empty
327−str static inline parse_name(document* d)
327+static inline str parse_name(document* d)
329 int start = doc_position(d);
329 int start = doc_position(d);
330 if (!is_name1(peek(d)))
330 if (!is_name1(peek(d)))
@@ -335,7 +335,7 @@ str static inline parse_name(document* d)
335 return start_end(start, doc_position(d));
335 return start_end(start, doc_position(d));
338−str static inline parse_attrval(document* d)
338+static inline str parse_attrval(document* d)
341 if (get(d) != '=')
341 if (get(d) != '=')
@@ -368,7 +368,7 @@ str static inline parse_attrval(document* d)
369// seen a tag name, now looking for attributes terminated by >
369// seen a tag name, now looking for attributes terminated by >
370// puts the attributes it finds in the attribute buffer
370// puts the attributes it finds in the attribute buffer
371−str static inline parse_attributes(document* d)
371+static inline str parse_attributes(document* d)
373 int start = d->attrs.used;
373 int start = d->attrs.used;
374 for (int i = 0; ; i++)
374 for (int i = 0; ; i++)
@@ -388,7 +388,7 @@ str parse_content(document* d);
390// Add a new entry into tag, am at a '<'
390// Add a new entry into tag, am at a '<'
391−void static inline parse_tag(document* d)
391+static inline void parse_tag(document* d)
393 node_alloc(&d->nodes, 1);
393 node_alloc(&d->nodes, 1);
394 d->nodes.used_back++;
394 d->nodes.used_back++;