aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/md5.cc2
-rw-r--r--src/common/md5.h2
-rw-r--r--src/common/memory.h8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/common/md5.cc b/src/common/md5.cc
index bccf61c6..76f8ed14 100644
--- a/src/common/md5.cc
+++ b/src/common/md5.cc
@@ -58,7 +58,7 @@ void MD5Init(struct MD5Context *ctx)
* Update context to reflect the concatenation of another buffer full
* of bytes.
*/
-void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
+void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len)
{
u32 t;
diff --git a/src/common/md5.h b/src/common/md5.h
index e96521ee..2ab0ab95 100644
--- a/src/common/md5.h
+++ b/src/common/md5.h
@@ -18,7 +18,7 @@ struct MD5Context {
void MD5Init(struct MD5Context *ctx);
-void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len);
+void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len);
void MD5Final(unsigned char digest[16], struct MD5Context *ctx);
diff --git a/src/common/memory.h b/src/common/memory.h
index 5f944452..f2e39104 100644
--- a/src/common/memory.h
+++ b/src/common/memory.h
@@ -67,7 +67,7 @@ class PageAllocator {
FreeAll();
}
- void *Alloc(unsigned bytes) {
+ void *Alloc(size_t bytes) {
if (!bytes)
return NULL;
@@ -82,7 +82,7 @@ class PageAllocator {
return ret;
}
- const unsigned pages =
+ const size_t pages =
(bytes + sizeof(PageHeader) + page_size_ - 1) / page_size_;
uint8_t *const ret = GetNPages(pages);
if (!ret)
@@ -109,7 +109,7 @@ class PageAllocator {
}
private:
- uint8_t *GetNPages(unsigned num_pages) {
+ uint8_t *GetNPages(size_t num_pages) {
#ifdef __x86_64
void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
@@ -139,7 +139,7 @@ class PageAllocator {
struct PageHeader {
PageHeader *next; // pointer to the start of the next set of pages.
- unsigned num_pages; // the number of pages in this set.
+ size_t num_pages; // the number of pages in this set.
};
const unsigned page_size_;