summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-03 03:23:44 +0200
committerwm4 <wm4@nowhere>2012-08-03 03:34:38 +0200
commit719d1260231ff41e804626328abc4570eded66dc (patch)
tree649ab35f8cba3be1bf13665f7319821757559f84
parent772d93c81ae3086d8db42cd1847bdb337fa9c28f (diff)
downloadmpv-719d1260231ff41e804626328abc4570eded66dc.tar.bz2
mpv-719d1260231ff41e804626328abc4570eded66dc.tar.xz
bstr.h: fix compilation with C++
-rw-r--r--bstr.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/bstr.h b/bstr.h
index 1ce624cf08..5f04a75db8 100644
--- a/bstr.h
+++ b/bstr.h
@@ -45,11 +45,11 @@ static inline struct bstr bstrdup(void *talloc_ctx, struct bstr str)
{
struct bstr r = { NULL, str.len };
if (str.start)
- r.start = talloc_memdup(talloc_ctx, str.start, str.len);
+ r.start = (unsigned char *)talloc_memdup(talloc_ctx, str.start, str.len);
return r;
}
-static inline struct bstr bstr0(const unsigned char *s)
+static inline struct bstr bstr0(const char *s)
{
return (struct bstr){(unsigned char *)s, s ? strlen(s) : 0};
}
@@ -108,7 +108,7 @@ static inline struct bstr bstr_cut(struct bstr str, int n)
if (n < 0)
n = 0;
}
- if (n > str.len)
+ if (((size_t)n) > str.len)
n = str.len;
return (struct bstr){str.start + n, str.len - n};
}