@@ -10,9 +10,9 @@ typedef int bool;
1010/////////////////////////////////////////////////////////////////////
1111// TYPES
1212
13−int static inline end(str s) { return s.start + s.length; }
13+static inline int end(str s) { return s.start + s.length; }
1414
15−str static inline start_length(int32_t start, int32_t length)
15+static inline str start_length(int32_t start, int32_t length)
1616{
1717 if (start < 0 || length < 0) assert(0);
1818 str res;
@@ -21,7 +21,7 @@ str static inline start_length(int32_t start, int32_t length)
2121 return res;
2222}
2323
24−str static inline start_end(int32_t start, int32_t end)
24+static inline str start_end(int32_t start, int32_t end)
2525{
2626 return start_length(start, end - start);
2727}
@@ -63,8 +63,8 @@ struct document
6363 attr_buffer attrs;
6464};
6565
66−int static inline doc_length(document* d) { return (int) (d->end - d->body); }
67−int static inline doc_position(document* d) { return (int) (d->cursor - d->body); }
66+static inline int doc_length(document* d) { return (int) (d->end - d->body); }
67+static inline int doc_position(document* d) { return (int) (d->cursor - d->body); }
6868
6969
7070/////////////////////////////////////////////////////////////////////
@@ -78,14 +78,14 @@ typedef struct
7878 int cursor;
7979} render;
8080
81−void static inline render_char(render* r, char c)
81+static inline void render_char(render* r, char c)
8282{
8383 if (r->cursor < r->length)
8484 r->buffer[r->cursor] = c;
8585 r->cursor++;
8686}
8787
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)
8989{
9090 if (index < mn || index > mx)
9191 {
@@ -94,7 +94,7 @@ void static inline bound(char* msg, int index, int mn, int mx)
9494 }
9595}
9696
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)
9898{
9999 if (s.length < 0) assert(0);
100100 bound(msg, s.start, mn, mx);
@@ -244,22 +244,22 @@ void init_parse_table()
244244 done = 1;
245245}
246246
247−bool static inline is(char c, char tag) { return parse_table[c] & tag; }
248−bool static inline is_name1(char c) { return is(c, tag_name1); }
249−bool static inline is_name(char c) { return is(c, tag_name); }
250−bool static inline is_space(char c) { return is(c, tag_space); }
247+static inline bool is(char c, char tag) { return parse_table[c] & tag; }
248+static inline bool is_name1(char c) { return is(c, tag_name1); }
249+static inline bool is_name(char c) { return is(c, tag_name); }
250+static inline bool is_space(char c) { return is(c, tag_space); }
251251
252252
253253/////////////////////////////////////////////////////////////////////
254254// PARSER COMBINATORS
255255
256−char static inline peekAt(document* d, int i) { return d->cursor[i]; }
257−void static inline skip(document* d, int i) { d->cursor += i; }
258−char static inline peek(document* d) { return peekAt(d, 0); }
259−char static inline get(document* d) { char c = peek(d); skip(d, 1); return c; }
256+static inline char peekAt(document* d, int i) { return d->cursor[i]; }
257+static inline void skip(document* d, int i) { d->cursor += i; }
258+static inline char peek(document* d) { return peekAt(d, 0); }
259+static inline char get(document* d) { char c = peek(d); skip(d, 1); return c; }
260260
261261// 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)
263263{
264264 while (is_space(peek(d)))
265265 skip(d, 1);
@@ -285,7 +285,7 @@ bool find(document* d, char c)
285285/////////////////////////////////////////////////////////////////////
286286// PARSING CODE
287287
288−void static inline node_alloc(node_buffer* b, int ask)
288+static inline void node_alloc(node_buffer* b, int ask)
289289{
290290 int space = b->size - b->used_back - b->used_front;
291291 if (space >= ask) return;
@@ -300,7 +300,7 @@ void static inline node_alloc(node_buffer* b, int ask)
300300 b->alloc = buf2;
301301}
302302
303−void static inline attr_alloc(attr_buffer* b, int ask)
303+static inline void attr_alloc(attr_buffer* b, int ask)
304304{
305305 int space = b->size - b->used;
306306 if (space >= ask) return;
@@ -324,7 +324,7 @@ void set_error(document* d, char* msg)
324324
325325// you now expect a name, perhaps preceeded by whitespace
326326// the name may be empty
327−str static inline parse_name(document* d)
327+static inline str parse_name(document* d)
328328{
329329 int start = doc_position(d);
330330 if (!is_name1(peek(d)))
@@ -335,7 +335,7 @@ str static inline parse_name(document* d)
335335 return start_end(start, doc_position(d));
336336}
337337
338−str static inline parse_attrval(document* d)
338+static inline str parse_attrval(document* d)
339339{
340340 trim(d);
341341 if (get(d) != '=')
@@ -368,7 +368,7 @@ str static inline parse_attrval(document* d)
368368
369369// seen a tag name, now looking for attributes terminated by >
370370// 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)
372372{
373373 int start = d->attrs.used;
374374 for (int i = 0; ; i++)
@@ -388,7 +388,7 @@ str parse_content(document* d);
388388
389389
390390// 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)
392392{
393393 node_alloc(&d->nodes, 1);
394394 d->nodes.used_back++;