Commit 9543fd55 authored by Michael Beck's avatar Michael Beck
Browse files

Further pushed size_t: ir_initializer_t uses size_t now.

parent 33fe506a
......@@ -481,19 +481,19 @@ FIRM_API ir_node *get_initializer_const_value(const ir_initializer_t *initialize
FIRM_API ir_tarval *get_initializer_tarval_value(const ir_initializer_t *initialzier);
/** creates a compound initializer which holds @p n_entries entries */
FIRM_API ir_initializer_t *create_initializer_compound(unsigned n_entries);
FIRM_API ir_initializer_t *create_initializer_compound(size_t n_entries);
/** returns the number of entries in a compound initializer */
FIRM_API unsigned get_initializer_compound_n_entries(const ir_initializer_t *initializer);
FIRM_API size_t get_initializer_compound_n_entries(const ir_initializer_t *initializer);
/** sets entry with index @p index to the initializer @p value */
FIRM_API void set_initializer_compound_value(ir_initializer_t *initializer,
unsigned index,
size_t index,
ir_initializer_t *value);
/** returns the value with index @p index of a compound initializer */
FIRM_API ir_initializer_t *get_initializer_compound_value(
const ir_initializer_t *initializer, unsigned index);
const ir_initializer_t *initializer, size_t index);
/** Sets the new style initializers of an entity. */
FIRM_API void set_entity_initializer(ir_entity *entity, ir_initializer_t *initializer);
......
/*
* Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -1082,8 +1082,8 @@ static void init_entity_usage(ir_type *tp)
*/
static void check_initializer_nodes(ir_initializer_t *initializer)
{
unsigned i;
ir_node *n;
size_t i;
ir_node *n;
switch (initializer->kind) {
case IR_INITIALIZER_CONST:
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -622,13 +622,14 @@ ir_initializer_t *create_initializer_tarval(ir_tarval *tv)
return initializer;
}
ir_initializer_t *create_initializer_compound(unsigned n_entries)
ir_initializer_t *create_initializer_compound(size_t n_entries)
{
struct obstack *obst = get_irg_obstack(get_const_code_irg());
size_t i;
size_t size = sizeof(ir_initializer_compound_t)
+ (n_entries-1) * sizeof(ir_initializer_t*);
+ n_entries * sizeof(ir_initializer_t*)
- sizeof(ir_initializer_t*);
ir_initializer_t *initializer
= (ir_initializer_t*)obstack_alloc(obst, size);
......@@ -654,14 +655,14 @@ ir_tarval *get_initializer_tarval_value(const ir_initializer_t *initializer)
return initializer->tarval.value;
}
unsigned get_initializer_compound_n_entries(const ir_initializer_t *initializer)
size_t get_initializer_compound_n_entries(const ir_initializer_t *initializer)
{
assert(initializer->kind == IR_INITIALIZER_COMPOUND);
return initializer->compound.n_initializers;
}
void set_initializer_compound_value(ir_initializer_t *initializer,
unsigned index, ir_initializer_t *value)
size_t index, ir_initializer_t *value)
{
assert(initializer->kind == IR_INITIALIZER_COMPOUND);
assert(index < initializer->compound.n_initializers);
......@@ -670,7 +671,7 @@ void set_initializer_compound_value(ir_initializer_t *initializer,
}
ir_initializer_t *get_initializer_compound_value(
const ir_initializer_t *initializer, unsigned index)
const ir_initializer_t *initializer, size_t index)
{
assert(initializer->kind == IR_INITIALIZER_COMPOUND);
assert(index < initializer->compound.n_initializers);
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -42,7 +42,7 @@ typedef struct ir_initializer_base_t {
*/
typedef struct ir_initializer_compound_t {
ir_initializer_base_t base;
unsigned n_initializers;
size_t n_initializers;
ir_initializer_t *initializers[1];
} ir_initializer_compound_t;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment