Fix up ~14 warnings about 'Implicit conversion loses integer precision' on iOS.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1281 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
dmaclach 2014-02-18 22:52:02 +00:00
parent 0c18b07255
commit 9315301a56
7 changed files with 29 additions and 25 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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_;