Define Genode::size_t as unsigned long

Fixes #2105
This commit is contained in:
Norman Feske
2016-09-15 14:40:37 +02:00
committed by Christian Helmuth
parent 7bed3967ae
commit e370e08e01
128 changed files with 280 additions and 257 deletions

View File

@ -11,18 +11,13 @@
* under the terms of the GNU General Public License version 2.
*/
#include <util/construct_at.h>
#include <base/allocator_avl.h>
#include <base/log.h>
using namespace Genode;
/**
* Placement operator - tool for directly calling a constructor
*/
inline void *operator new(size_t, void *at) { return at; }
/**************************
** Block Implementation **
**************************/
@ -102,13 +97,11 @@ void Allocator_avl_base::Block::recompute()
Allocator_avl_base::Block *Allocator_avl_base::_alloc_block_metadata()
{
void *b = 0;
void *b = nullptr;
if (_md_alloc->alloc(sizeof(Block), &b))
return construct_at<Block>(b, 0, 0, 0);
/* call constructor by using the placement new operator */
return new((Block *)b) Block(0, 0, 0);
return 0;
return nullptr;
}
@ -131,7 +124,7 @@ int Allocator_avl_base::_add_block(Block *block_metadata,
return -1;
/* call constructor for new block */
new (block_metadata) Block(base, size, used);
construct_at<Block>(block_metadata, base, size, used);
/* insert block into avl tree */
_addr_tree.insert(block_metadata);

View File

@ -237,7 +237,7 @@ Signal_context_capability Signal_receiver::manage(Signal_context *context)
[&] () {
size_t const quota = 1024*sizeof(long);
char buf[64];
snprintf(buf, sizeof(buf), "ram_quota=%zu", quota);
snprintf(buf, sizeof(buf), "ram_quota=%ld", quota);
log("upgrading quota donation for PD session (", quota, " bytes)");

View File

@ -54,7 +54,7 @@ bool Sliced_heap::alloc(size_t size, void **out_addr)
_ram_session.free(ds_cap);
return false;
} catch (Ram_session::Alloc_failed) {
error("Could not allocate dataspace with size %zu", size);
error("Could not allocate dataspace with size %lu", size);
return false;
}

View File

@ -30,10 +30,10 @@ static void *try_alloc(Allocator *alloc, size_t size)
}
void *operator new (size_t s, Allocator *a) { return try_alloc(a, s); }
void *operator new [] (size_t s, Allocator *a) { return try_alloc(a, s); }
void *operator new (size_t s, Allocator &a) { return a.alloc(s); }
void *operator new [] (size_t s, Allocator &a) { return a.alloc(s); }
void *operator new (__SIZE_TYPE__ s, Allocator *a) { return try_alloc(a, s); }
void *operator new [] (__SIZE_TYPE__ s, Allocator *a) { return try_alloc(a, s); }
void *operator new (__SIZE_TYPE__ s, Allocator &a) { return a.alloc(s); }
void *operator new [] (__SIZE_TYPE__ s, Allocator &a) { return a.alloc(s); }
static void try_dealloc(void *ptr, Deallocator &dealloc)