]> git.kaiwu.me - klib.git/commitdiff
fixed a compiling error using g++ (not gcc)
authorHeng Li <lh3@live.co.uk>
Mon, 10 Oct 2011 18:12:46 +0000 (14:12 -0400)
committerHeng Li <lh3@live.co.uk>
Mon, 10 Oct 2011 18:12:46 +0000 (14:12 -0400)
kseq.h

diff --git a/kseq.h b/kseq.h
index 0bbc7dc9370e910b19286167bd0862c64855387c..8b2bd3b5b32c0efc42dea5720eb106fce659c92e 100644 (file)
--- a/kseq.h
+++ b/kseq.h
@@ -51,7 +51,7 @@
        {                                                                                                                               \
                kstream_t *ks = (kstream_t*)calloc(1, sizeof(kstream_t));       \
                ks->f = f;                                                                                                      \
-               ks->buf = malloc(__bufsize);                                                            \
+               ks->buf = (unsigned char*)malloc(__bufsize);                            \
                return ks;                                                                                                      \
        }                                                                                                                               \
        static inline void ks_destroy(kstream_t *ks)                                    \
@@ -113,7 +113,7 @@ typedef struct __kstring_t {
                                for (i = ks->begin; i < ks->end; ++i)                                   \
                                        if (isspace(ks->buf[i]) && ks->buf[i] != ' ') break; \
                        } else i = 0; /* never come to here! */                                         \
-                       if (str->m - str->l < i - ks->begin + 1) {                                      \
+                       if (str->m - str->l < (size_t)i - ks->begin + 1) {                      \
                                str->m = str->l + (i - ks->begin) + 1;                                  \
                                kroundup32(str->m);                                                                             \
                                str->s = (char*)realloc(str->s, str->m);                                \