diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-08-10 20:19:09 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-08-10 20:19:09 -0700 |
commit | 735098e097ad62bdc4b1121c6c0c983eb7483485 (patch) | |
tree | a858fedc30e6149ed430784942413a2b06741ec9 /src/chunk.h | |
parent | a541e39f69cfa75422fbe70c59c2ac40fbdbe1d7 (diff) | |
parent | ce0e58469f7c4abf3f51bde6d3298215d6ef99d1 (diff) |
Merge pull request #76 from kainjow/msvc-warnings
Fix some MSVC warnings
Diffstat (limited to 'src/chunk.h')
-rw-r--r-- | src/chunk.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/chunk.h b/src/chunk.h index db1bf0d..90cf568 100644 --- a/src/chunk.h +++ b/src/chunk.h @@ -16,7 +16,7 @@ typedef struct { bufsize_t alloc; // also implies a NULL-terminated string } cmark_chunk; -static inline void cmark_chunk_free(cmark_chunk *c) { +CMARK_INLINE void cmark_chunk_free(cmark_chunk *c) { if (c->alloc) free(c->data); @@ -25,7 +25,7 @@ static inline void cmark_chunk_free(cmark_chunk *c) { c->len = 0; } -static inline void cmark_chunk_ltrim(cmark_chunk *c) { +CMARK_INLINE void cmark_chunk_ltrim(cmark_chunk *c) { assert(!c->alloc); while (c->len && cmark_isspace(c->data[0])) { @@ -34,7 +34,7 @@ static inline void cmark_chunk_ltrim(cmark_chunk *c) { } } -static inline void cmark_chunk_rtrim(cmark_chunk *c) { +CMARK_INLINE void cmark_chunk_rtrim(cmark_chunk *c) { while (c->len > 0) { if (!cmark_isspace(c->data[c->len - 1])) break; @@ -43,19 +43,19 @@ static inline void cmark_chunk_rtrim(cmark_chunk *c) { } } -static inline void cmark_chunk_trim(cmark_chunk *c) { +CMARK_INLINE void cmark_chunk_trim(cmark_chunk *c) { cmark_chunk_ltrim(c); cmark_chunk_rtrim(c); } -static inline bufsize_t cmark_chunk_strchr(cmark_chunk *ch, int c, +CMARK_INLINE bufsize_t cmark_chunk_strchr(cmark_chunk *ch, int c, bufsize_t offset) { const unsigned char *p = (unsigned char *)memchr(ch->data + offset, c, ch->len - offset); return p ? (bufsize_t)(p - ch->data) : ch->len; } -static inline const char *cmark_chunk_to_cstr(cmark_chunk *c) { +CMARK_INLINE const char *cmark_chunk_to_cstr(cmark_chunk *c) { unsigned char *str; if (c->alloc) { @@ -74,7 +74,7 @@ static inline const char *cmark_chunk_to_cstr(cmark_chunk *c) { return (char *)str; } -static inline void cmark_chunk_set_cstr(cmark_chunk *c, const char *str) { +CMARK_INLINE void cmark_chunk_set_cstr(cmark_chunk *c, const char *str) { if (c->alloc) { free(c->data); } @@ -90,19 +90,19 @@ static inline void cmark_chunk_set_cstr(cmark_chunk *c, const char *str) { } } -static inline cmark_chunk cmark_chunk_literal(const char *data) { +CMARK_INLINE cmark_chunk cmark_chunk_literal(const char *data) { bufsize_t len = data ? cmark_strbuf_safe_strlen(data) : 0; cmark_chunk c = {(unsigned char *)data, len, 0}; return c; } -static inline cmark_chunk cmark_chunk_dup(const cmark_chunk *ch, bufsize_t pos, +CMARK_INLINE cmark_chunk cmark_chunk_dup(const cmark_chunk *ch, bufsize_t pos, bufsize_t len) { cmark_chunk c = {ch->data + pos, len, 0}; return c; } -static inline cmark_chunk cmark_chunk_buf_detach(cmark_strbuf *buf) { +CMARK_INLINE cmark_chunk cmark_chunk_buf_detach(cmark_strbuf *buf) { cmark_chunk c; c.len = buf->size; |