aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-09-15 14:05:15 -0400
committerAndrew Kelley <superjoe30@gmail.com>2016-09-19 11:54:01 -0400
commit3239b3cb6957aa5f5f04c9d7d9035da14ccd0741 (patch)
tree49045063682e47114d3ca51c81907c6adcb3e0e5 /src/buffer.cpp
parent4c0259b107236b39f7b1e8f423d2bf9f48e89b54 (diff)
downloadzig-3239b3cb6957aa5f5f04c9d7d9035da14ccd0741.tar.gz
zig-3239b3cb6957aa5f5f04c9d7d9035da14ccd0741.zip
use size_t for indexes
protect against incorrect copies in debug mode
Diffstat (limited to 'src/buffer.cpp')
-rw-r--r--src/buffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer.cpp b/src/buffer.cpp
index a03ab333f3..59972cc856 100644
--- a/src/buffer.cpp
+++ b/src/buffer.cpp
@@ -41,7 +41,7 @@ void buf_appendf(Buf *buf, const char *format, ...) {
size_t required_size = len1 + 1;
- int orig_len = buf_len(buf);
+ size_t orig_len = buf_len(buf);
buf_resize(buf, orig_len + len1);
@@ -62,7 +62,7 @@ uint32_t buf_hash(Buf *buf) {
assert(buf->list.length);
// FNV 32-bit hash
uint32_t h = 2166136261;
- for (int i = 0; i < buf_len(buf); i += 1) {
+ for (size_t i = 0; i < buf_len(buf); i += 1) {
h = h ^ ((uint8_t)buf->list.at(i));
h = h * 16777619;
}