* @{
*/
- XBT_PUBLIC(void) xbt_dynar_get_cpy(const xbt_dynar_t dynar, const int idx, void * const dst);
+ XBT_PUBLIC(void) xbt_dynar_get_cpy(const xbt_dynar_t dynar, const unsigned long idx, void * const dst);
XBT_PUBLIC(void) xbt_dynar_set(xbt_dynar_t dynar, const int idx, const void *src);
- XBT_PUBLIC(void) xbt_dynar_replace(xbt_dynar_t dynar, const int idx, const void *object);
+ XBT_PUBLIC(void) xbt_dynar_replace(xbt_dynar_t dynar, const unsigned long idx, const void *object);
XBT_PUBLIC(void) xbt_dynar_insert_at(xbt_dynar_t const dynar, const int idx, const void *src);
XBT_PUBLIC(void) xbt_dynar_remove_at(xbt_dynar_t const dynar, const int idx, void * const dst);
* @{
*/
- XBT_PUBLIC(void*) xbt_dynar_get_ptr(const xbt_dynar_t dynar, const int idx);
+ XBT_PUBLIC(void*) xbt_dynar_get_ptr(const xbt_dynar_t dynar, const unsigned long idx);
XBT_PUBLIC(void*) xbt_dynar_insert_at_ptr(xbt_dynar_t const dynar, const int idx);
XBT_PUBLIC(void*) xbt_dynar_push_ptr(xbt_dynar_t const dynar);
XBT_PUBLIC(void*) xbt_dynar_pop_ptr(xbt_dynar_t const dynar);
XBT_PUBLIC(void) xbt_matrix_free_voidp(void *d);
XBT_PUBLIC(void) xbt_matrix_copy_values(xbt_matrix_t dest, xbt_matrix_t src,
- int lsize, int rsize,
- int lpos_dst,int rpos_dst,
- int lpos_src,int rpos_src,
+ unsigned int lsize, unsigned int rsize,
+ unsigned int lpos_dst,unsigned int rpos_dst,
+ unsigned int lpos_src,unsigned int rpos_src,
pvoid_f_pvoid_t const cpy_f);
XBT_PUBLIC(void) xbt_matrix_dump(xbt_matrix_t matrix, const char *name, int coords,
void amok_pm_modulecreate() {
gras_module_add("amok_pm", sizeof(s_amok_pm_moddata_t), &amok_pm_moddata_id,
- &_amok_pm_init,&_amok_pm_exit,&_amok_pm_join,&_amok_pm_leave);
+ _amok_pm_init,_amok_pm_exit,_amok_pm_join,_amok_pm_leave);
}
res->cycle = 0;
xbt_set_add(gras_datadesc_set_local,
- (xbt_set_elm_t)res,&gras_ddt_freev);
+ (xbt_set_elm_t)res,gras_ddt_freev);
XBT_OUT;
return res;
}
res->category_code = e_gras_datadesc_type_cat_struct;
res->category.struct_data.fields =
xbt_dynar_new(sizeof(gras_dd_cat_field_t),
- &gras_dd_cat_field_free);
+ gras_dd_cat_field_free);
XBT_OUT;
return res;
res->category_code = e_gras_datadesc_type_cat_union;
res->category.union_data.fields =
xbt_dynar_new(sizeof(gras_dd_cat_field_t*),
- &gras_dd_cat_field_free);
+ gras_dd_cat_field_free);
res->category.union_data.selector = selector;
return res;
THROW1(unknown_error,0,"MayDay: two modules use '%s' as libdata name", fab.name);
/* Add the data in place, after some more sanity checking */
- elem = (*fab.constructor)();
+ elem = (*(fab.constructor))();
if (elem->name_len && elem->name_len != strlen(elem->name)) {
elem->name_len = strlen(elem->name);
WARN1("Module '%s' constructor is borken: it does not set elem->name_len",
static double duration = 0.0;
static char* locbuf = NULL;
-static int locbufsize;
+static unsigned int locbufsize;
void gras_emul_init(void)
{
gras_msg_procdata_t msg_pd;
VERB0("Initialize GRAS");
- xbt_getpid = &gras_os_getpid;
+ xbt_getpid = gras_os_getpid;
/* First initialize the XBT */
xbt_init(argc,argv);
int i;
char *path = NULL;
FILE *file = NULL;
- int path_name_len = 0; /* don't count '\0' */
+ unsigned int path_name_len = 0; /* don't count '\0' */
xbt_assert0(name, "Need a non-NULL file name");
break;
case xbt_cfgelm_string:
- res->content = xbt_dynar_new(sizeof(char*),&xbt_cfg_str_free);
+ res->content = xbt_dynar_new(sizeof(char*),xbt_cfg_str_free);
break;
case xbt_cfgelm_peer:
- res->content = xbt_dynar_new(sizeof(xbt_peer_t),&xbt_peer_free_voidp);
+ res->content = xbt_dynar_new(sizeof(xbt_peer_t),xbt_peer_free_voidp);
break;
default:
va_list ap;
if (!_xbt_test_suites)
- _xbt_test_suites = xbt_dynar_new(sizeof(xbt_test_suite_t),&xbt_test_suite_free);
+ _xbt_test_suites = xbt_dynar_new(sizeof(xbt_test_suite_t),xbt_test_suite_free);
va_start(ap, fmt);
vasprintf(&suite->title,fmt, ap);
xbt_dynar_t keys,
void *data, void_f_pvoid_t free_ctn) {
xbt_dynar_t lens = xbt_dynar_new(sizeof(unsigned long int),NULL);
- int i;
+ unsigned long i;
xbt_ex_t e;
for (i = 0; i < xbt_dynar_length(keys); i++) {
void *
xbt_multidict_get(xbt_dict_t mdict, xbt_dynar_t keys) {
xbt_dynar_t lens = xbt_dynar_new(sizeof(unsigned long int),NULL);
- int i;
+ unsigned long i;
void *res;
for (i = 0; i < xbt_dynar_length(keys); i++) {
xbt_ex_t e;
xbt_dynar_t lens = xbt_dynar_new(sizeof(unsigned long int),NULL);
- int i;
+ unsigned long i;
for (i = 0; i < xbt_dynar_length(keys); i++) {
char *thiskey = xbt_dynar_get_as(keys, i, char*);
static XBT_INLINE
void
_xbt_dynar_expand(xbt_dynar_t const dynar,
- const int nb) {
+ const unsigned long nb) {
const unsigned long old_size = dynar->size;
if (nb > old_size) {
static XBT_INLINE
void
_xbt_dynar_remove_at(xbt_dynar_t const dynar,
- const int idx,
+ const unsigned long idx,
void * const object) {
unsigned long nb_shift;
* array is not expanded and nothing is done.
*/
void xbt_dynar_shrink(xbt_dynar_t dynar, int empty_slots_wanted) {
- int size_wanted;
+ unsigned long size_wanted;
_dynar_lock(dynar);
*/
void
xbt_dynar_get_cpy(const xbt_dynar_t dynar,
- const int idx,
+ const unsigned long idx,
void * const dst) {
_dynar_lock(dynar);
_sanity_check_dynar(dynar);
* Make a copy before fooling with it.
*/
void*
-xbt_dynar_get_ptr(const xbt_dynar_t dynar, const int idx) {
+xbt_dynar_get_ptr(const xbt_dynar_t dynar, const unsigned long idx) {
void *res;
_dynar_lock(dynar);
static void XBT_INLINE /* not synchronized */
_xbt_dynar_set(xbt_dynar_t dynar,
- const int idx,
+ const unsigned long idx,
const void * const src) {
_sanity_check_dynar(dynar);
*/
void
xbt_dynar_replace(xbt_dynar_t dynar,
- const int idx,
+ const unsigned long idx,
const void * const object) {
_dynar_lock(dynar);
_sanity_check_dynar(dynar);
if (idx < dynar->used && dynar->free_f) {
void * const old_object = _xbt_dynar_elm(dynar, idx);
- dynar->free_f(old_object);
+ (*(dynar->free_f))(old_object);
}
_xbt_dynar_set(dynar, idx, object);
static XBT_INLINE void *
_xbt_dynar_insert_at_ptr(xbt_dynar_t const dynar,
- const int idx) {
+ const unsigned long idx) {
void *res;
unsigned long old_used;
unsigned long new_used;
int
xbt_dynar_search(xbt_dynar_t const dynar,
void *const elem) {
- int it;
+ unsigned long it;
_dynar_lock(dynar);
for (it=0; it< dynar->used; it++)
for (i = 0; i < used; i++) {
_xbt_dynar_get_elm(elm, dynar, i);
- op(elm);
+ (*op)(elm);
}
}
*/
void
xbt_dynar_map(const xbt_dynar_t dynar,
- void_f_pvoid_t const op) {
+ void_f_pvoid_t const op) {
_dynar_lock(dynar);
_sanity_check_dynar(dynar);
_sanity_check_dynar(dynar);
{
- const int idx = *cursor;
+ const unsigned long idx = *cursor;
if (idx >= dynar->used) {
DEBUG1("Cursor on %p already on last elem",(void*)dynar);
void_f_pvoid_t edge_free_function)
{
unsigned long nbr;
- int i;
+ unsigned long i;
int cursor = 0;
xbt_node_t node = NULL;
xbt_edge_t edge = NULL;
{
int cursor = 0;
int in_cursor = 0;
- int idx, i;
+ unsigned long idx, i;
unsigned long n;
xbt_edge_t edge = NULL;
xbt_node_t node = NULL;
void xbt_floyd_algorithm(xbt_graph_t g, double *adj, double *d,
xbt_node_t * p)
{
- int i, j, k;
+ unsigned long i, j, k;
unsigned long n;
n = xbt_dynar_length(g->nodes);
{
xbt_node_t *p;
xbt_node_t *r;
- int i, j, k;
+ unsigned long i, j, k;
unsigned long n;
double *adj = NULL;
ETag_graphxml_edge_fun = __parse_edge;
xbt_graph_parse_open(filename);
- xbt_assert1((!xbt_graph_parse()), "Parse error in %s", filename);
+ xbt_assert1((!(*xbt_graph_parse)()), "Parse error in %s", filename);
xbt_graph_parse_close();
graph = parsed_graph;
int i;
if (H->free)
for (i = 0; i < H->count; i++)
- (*H->free)(H->items[i].content);
+ (*(H->free))(H->items[i].content);
free(H->items);
free(H);
return;
for (i = 0; i < m->current_size; i++) {
- m->free_f(m->objects[i]);
+ (*(m->free_f))(m->objects[i]);
}
xbt_free(m->objects);
xbt_free(m);
}
else {
/* otherwise we must allocate a new object */
- object = m->new_f();
+ object = (*(m->new_f))();
}
- m->reset_f(object);
+ (*(m->reset_f))(object);
return object;
}
}
else {
/* otherwise we don't have a choice, we must free the object */
- m->free_f(object);
+ (*(m->free_f))(object);
}
}
/** \brief destructor */
void xbt_matrix_free(xbt_matrix_t mat) {
- int i;
+ unsigned int i;
if (mat) {
if (mat->free_f) {
for (i=0; i < (mat->lines * mat->rows) ; i++) {
* \param coords: boolean indicating whether we should add the coords of each cell to the output*/
void xbt_matrix_dump(xbt_matrix_t matrix, const char*name, int coords,
void_f_pvoid_t display_fun) {
- int i,j;
+ unsigned int i,j;
fprintf(stderr,">>> Matrix %s dump (%d x %d)\n",name,matrix->lines,matrix->rows);
for (i=0; i<matrix->lines; i++) {
* \param rpos_src: row offset on destination matrix
*/
void xbt_matrix_copy_values(xbt_matrix_t dst, xbt_matrix_t src,
- int lsize, int rsize,
- int lpos_dst,int rpos_dst,
- int lpos_src,int rpos_src,
+ unsigned int lsize, unsigned int rsize,
+ unsigned int lpos_dst,unsigned int rpos_dst,
+ unsigned int lpos_src,unsigned int rpos_src,
pvoid_f_pvoid_t const cpy_f) {
- int i,j;
+ unsigned int i,j;
DEBUG10("Copy a %dx%d submatrix from %dx%d(of %dx%d) to %dx%d (of %dx%d)",
lsize,rsize,
/** \brief add to C the result of A*B */
void xbt_matrix_double_addmult(xbt_matrix_t A,xbt_matrix_t B,
/*OUT*/ xbt_matrix_t C) {
- int i,j,k;
+ unsigned int i,j,k;
xbt_assert2(A->lines == C->lines,
"A->lines != C->lines (%d vs %d)",A->lines,C->lines);
*/
long getline(char **buf, size_t *n, FILE *stream) {
- int i, ch;
+ size_t i;
+ int ch;
if (!*buf) {
*buf = xbt_malloc(512);
static xbt_matrix_t diff_build_LCS(xbt_dynar_t da, xbt_dynar_t db) {
xbt_matrix_t C = xbt_matrix_new(xbt_dynar_length(da),xbt_dynar_length(db),
sizeof(int),NULL);
- int i,j;
+ unsigned long i,j;
/* Compute the LCS */
/*