Commit 5509f22e authored by Elsa Gonsiorowski (Uranus)'s avatar Elsa Gonsiorowski (Uranus)
Browse files

compiling for C++

parent 8dce9c05
...@@ -70,8 +70,8 @@ extern int64_t * var; ...@@ -70,8 +70,8 @@ extern int64_t * var;
extern int * inst_ready; extern int * inst_ready;
extern int * group_rank; extern int * group_rank;
extern int * group_size; extern int * group_size;
int temp_group_rank; extern int temp_group_rank;
int temp_group_size; extern int temp_group_size;
#endif #endif
/* /*
......
...@@ -332,7 +332,7 @@ static inline int quickhash_string_hash(void *k, int table_size) ...@@ -332,7 +332,7 @@ static inline int quickhash_string_hash(void *k, int table_size)
/* used for cases where we the key is already in good shape for hashing */ /* used for cases where we the key is already in good shape for hashing */
static inline int quickhash_null32_hash(void *k, int table_size) static inline int quickhash_null32_hash(void *k, int table_size)
{ {
uint32_t *tmp = k; uint32_t *tmp = (uint32_t*)k;
return(int)(*tmp & (table_size - 1)); return(int)(*tmp & (table_size - 1));
} }
......
...@@ -223,7 +223,7 @@ int codes_kernel_helper_parse_input(CodesIOKernel_pstate * ps, CodesIOKernelCont ...@@ -223,7 +223,7 @@ int codes_kernel_helper_parse_input(CodesIOKernel_pstate * ps, CodesIOKernelCont
do do
{ {
c->locval = CodesIOKernel_get_lloc(*((yyscan_t *)c->scanner_)); c->locval = CodesIOKernel_get_lloc(*((yyscan_t *)c->scanner_));
yychar = CodesIOKernel_lex(c->lval, c->locval, c->scanner_); yychar = CodesIOKernel_lex((codesYYType*)c->lval, (YYLTYPE*)c->locval, c->scanner_);
c->locval = NULL; c->locval = NULL;
/* for each instructions */ /* for each instructions */
...@@ -242,14 +242,14 @@ int codes_kernel_helper_parse_input(CodesIOKernel_pstate * ps, CodesIOKernelCont ...@@ -242,14 +242,14 @@ int codes_kernel_helper_parse_input(CodesIOKernel_pstate * ps, CodesIOKernelCont
case DELETE: case DELETE:
{ {
c->inst_ready = 0; c->inst_ready = 0;
status = CodesIOKernel_push_parse(ps, yychar, c->lval, c->locval, c); status = CodesIOKernel_push_parse(ps, yychar, (codesYYType*)c->lval, (YYLTYPE*)c->locval, c);
codes_inst = convertKLInstToEvent(yychar); codes_inst = convertKLInstToEvent(yychar);
break; break;
} }
/* not a simulator event */ /* not a simulator event */
default: default:
{ {
status = CodesIOKernel_push_parse(ps, yychar, c->lval, c->locval, c); status = CodesIOKernel_push_parse(ps, yychar, (codesYYType*)c->lval, (YYLTYPE*)c->locval, c);
break; break;
} }
}; };
......
...@@ -99,7 +99,8 @@ int64_t * var = NULL; ...@@ -99,7 +99,8 @@ int64_t * var = NULL;
int * inst_ready = NULL; int * inst_ready = NULL;
int * group_rank = NULL; int * group_rank = NULL;
int * group_size = NULL; int * group_size = NULL;
int temp_group_rank = 0;
int temp_group_size = 0;
/* Line 268 of yacc.c */ /* Line 268 of yacc.c */
#line 106 "src/iokernellang/codesparser.c" #line 106 "src/iokernellang/codesparser.c"
...@@ -2422,7 +2423,7 @@ nodeType * con(int64_t value) ...@@ -2422,7 +2423,7 @@ nodeType * con(int64_t value)
/* allocate node */ /* allocate node */
nodeSize = SIZEOF_NODETYPE + sizeof(conNodeType); nodeSize = SIZEOF_NODETYPE + sizeof(conNodeType);
if((p = malloc(nodeSize)) == NULL) if((p = (nodeType*)malloc(nodeSize)) == NULL)
{ {
fprintf(stderr, "out of memory\n"); fprintf(stderr, "out of memory\n");
} }
...@@ -2441,7 +2442,7 @@ nodeType * id(int64_t i) ...@@ -2441,7 +2442,7 @@ nodeType * id(int64_t i)
/* allocate node */ /* allocate node */
nodeSize = SIZEOF_NODETYPE + sizeof(idNodeType); nodeSize = SIZEOF_NODETYPE + sizeof(idNodeType);
if((p = malloc(nodeSize)) == NULL) if((p = (nodeType*)malloc(nodeSize)) == NULL)
{ {
fprintf(stderr, "out of memory\n"); fprintf(stderr, "out of memory\n");
} }
...@@ -2464,7 +2465,7 @@ nodeType * opr(int64_t oper, int64_t nops, ...) ...@@ -2464,7 +2465,7 @@ nodeType * opr(int64_t oper, int64_t nops, ...)
nodeSize = SIZEOF_NODETYPE + sizeof(oprNodeType) + nodeSize = SIZEOF_NODETYPE + sizeof(oprNodeType) +
(nops - 1) * sizeof(nodeType*); (nops - 1) * sizeof(nodeType*);
if ((p = malloc(nodeSize)) == NULL) if ((p = (nodeType*)malloc(nodeSize)) == NULL)
{ {
fprintf(stderr, "out of memory\n"); fprintf(stderr, "out of memory\n");
} }
......
...@@ -25,6 +25,8 @@ int64_t * var = NULL; ...@@ -25,6 +25,8 @@ int64_t * var = NULL;
int * inst_ready = NULL; int * inst_ready = NULL;
int * group_rank = NULL; int * group_rank = NULL;
int * group_size = NULL; int * group_size = NULL;
int temp_group_size = 0;
int temp_group_rank = 0;
%} %}
/* start autogenerated code from CODES build system */ /* start autogenerated code from CODES build system */
...@@ -151,7 +153,7 @@ nodeType * con(int64_t value) ...@@ -151,7 +153,7 @@ nodeType * con(int64_t value)
/* allocate node */ /* allocate node */
nodeSize = SIZEOF_NODETYPE + sizeof(conNodeType); nodeSize = SIZEOF_NODETYPE + sizeof(conNodeType);
if((p = malloc(nodeSize)) == NULL) if((p = (nodeType*)malloc(nodeSize)) == NULL)
{ {
fprintf(stderr, "out of memory\n"); fprintf(stderr, "out of memory\n");
} }
...@@ -170,7 +172,7 @@ nodeType * id(int64_t i) ...@@ -170,7 +172,7 @@ nodeType * id(int64_t i)
/* allocate node */ /* allocate node */
nodeSize = SIZEOF_NODETYPE + sizeof(idNodeType); nodeSize = SIZEOF_NODETYPE + sizeof(idNodeType);
if((p = malloc(nodeSize)) == NULL) if((p = (nodeType*)malloc(nodeSize)) == NULL)
{ {
fprintf(stderr, "out of memory\n"); fprintf(stderr, "out of memory\n");
} }
...@@ -193,7 +195,7 @@ nodeType * opr(int64_t oper, int64_t nops, ...) ...@@ -193,7 +195,7 @@ nodeType * opr(int64_t oper, int64_t nops, ...)
nodeSize = SIZEOF_NODETYPE + sizeof(oprNodeType) + nodeSize = SIZEOF_NODETYPE + sizeof(oprNodeType) +
(nops - 1) * sizeof(nodeType*); (nops - 1) * sizeof(nodeType*);
if ((p = malloc(nodeSize)) == NULL) if ((p = (nodeType*)malloc(nodeSize)) == NULL)
{ {
fprintf(stderr, "out of memory\n"); fprintf(stderr, "out of memory\n");
} }
......
...@@ -124,7 +124,7 @@ multikeyentry : multikeynonzero multikeyentry | ; ...@@ -124,7 +124,7 @@ multikeyentry : multikeynonzero multikeyentry | ;
multikeyinit : /* empty */ { multikeyinit : /* empty */ {
param->maxsize = 1000; param->maxsize = 1000;
param->count = 0; param->count = 0;
param->keyvals = malloc (sizeof(char*)*param->maxsize); param->keyvals = (char**) malloc (sizeof(char*)*param->maxsize);
} }
multikeystart : LITERAL_STRING { multikeystart : LITERAL_STRING {
......
...@@ -31,7 +31,7 @@ struct mcs_entry ...@@ -31,7 +31,7 @@ struct mcs_entry
static inline mcs_entry * mcs_allocentry () static inline mcs_entry * mcs_allocentry ()
{ {
mcs_entry * n = malloc (sizeof (mcs_entry)); mcs_entry * n = (mcs_entry *) malloc (sizeof (mcs_entry));
memset (n, 0, sizeof (mcs_entry)); memset (n, 0, sizeof (mcs_entry));
return n; return n;
} }
......
...@@ -86,7 +86,7 @@ static int cfsa_getMultiKey (void * handle, SectionHandle section, const char *n ...@@ -86,7 +86,7 @@ static int cfsa_getMultiKey (void * handle, SectionHandle section, const char *n
if (count < 0) if (count < 0)
return -2; return -2;
*buf = malloc (sizeof (char **) * count); *buf = (char **) malloc (sizeof (char **) * count);
dcount = count; dcount = count;
mcs_getvaluemultiple (key, *buf, &dcount); mcs_getvaluemultiple (key, *buf, &dcount);
*e = dcount; *e = dcount;
...@@ -106,7 +106,7 @@ static int cfsa_listSection (void * handle, SectionHandle section, ...@@ -106,7 +106,7 @@ static int cfsa_listSection (void * handle, SectionHandle section,
section = handle; section = handle;
count = mcs_childcount (section); count = mcs_childcount ((mcs_entry *)section);
if (count < 0) if (count < 0)
{ {
*maxentries = 0; *maxentries = 0;
...@@ -122,9 +122,9 @@ static int cfsa_listSection (void * handle, SectionHandle section, ...@@ -122,9 +122,9 @@ static int cfsa_listSection (void * handle, SectionHandle section,
ret = count; ret = count;
out = malloc (sizeof(mcs_section_entry)* *maxentries); out = (mcs_section_entry*) malloc (sizeof(mcs_section_entry)* *maxentries);
count = mcs_listsection (section, out, *maxentries); count = mcs_listsection ((mcs_entry*)section, (mcs_section_entry*)out, *maxentries);
if (count < 0) if (count < 0)
{ {
*maxentries = 0; *maxentries = 0;
...@@ -217,7 +217,7 @@ static ConfigVTable cfsa_template = { ...@@ -217,7 +217,7 @@ static ConfigVTable cfsa_template = {
ConfigHandle cfsa_create (mcs_entry * e) ConfigHandle cfsa_create (mcs_entry * e)
{ {
ConfigHandle newh = malloc (sizeof (ConfigVTable)); ConfigHandle newh = (ConfigHandle) malloc (sizeof (ConfigVTable));
*newh = cfsa_template; *newh = cfsa_template;
newh->data = e; newh->data = e;
return newh; return newh;
......
...@@ -105,7 +105,7 @@ static int dump_section (FILE * f, ConfigHandle h, SectionHandle s, unsigned ...@@ -105,7 +105,7 @@ static int dump_section (FILE * f, ConfigHandle h, SectionHandle s, unsigned
count = sectionsize; count = sectionsize;
entries = malloc (sizeof (SectionEntry) * sectionsize); entries = (SectionEntry*)malloc (sizeof (SectionEntry) * sectionsize);
ret = mymin(ret, cf_listSection (h, s, &entries[0], &count)); ret = mymin(ret, cf_listSection (h, s, &entries[0], &count));
...@@ -174,7 +174,7 @@ ConfigHandle txtfile_openStream (FILE * f, char ** err) ...@@ -174,7 +174,7 @@ ConfigHandle txtfile_openStream (FILE * f, char ** err)
cfgp_lex_init_extra (&p, &scanner); cfgp_lex_init_extra (&p, &scanner);
cfgp_set_in (f, scanner); cfgp_set_in (f, scanner);
cfgp_initparams (&p, cfsa_create (mcs_initroot ())); cfgp_initparams (&p, cfsa_create (mcs_initroot ()));
reject = cfgp_parse(scanner, &p); reject = cfgp_parse((yyscan_t*)scanner, &p);
cfgp_lex_destroy (scanner); cfgp_lex_destroy (scanner);
/* either we have a valid confighandle or we have a parser error... */ /* either we have a valid confighandle or we have a parser error... */
......
...@@ -40,7 +40,7 @@ int configuration_load (const char *filepath, ...@@ -40,7 +40,7 @@ int configuration_load (const char *filepath,
rc = MPI_File_get_size(fh, &txtsize); rc = MPI_File_get_size(fh, &txtsize);
if (rc != MPI_SUCCESS) goto finalize; if (rc != MPI_SUCCESS) goto finalize;
txtdata = malloc(txtsize); txtdata = (char*) malloc(txtsize);
assert(txtdata); assert(txtdata);
rc = MPI_File_read_all(fh, txtdata, txtsize, MPI_BYTE, &status); rc = MPI_File_read_all(fh, txtdata, txtsize, MPI_BYTE, &status);
...@@ -122,7 +122,7 @@ int configuration_get_value_relpath( ...@@ -122,7 +122,7 @@ int configuration_get_value_relpath(
const char *annotation, const char *annotation,
char *value, char *value,
size_t length){ size_t length){
char *tmp = malloc(length); char *tmp = (char*) malloc(length);
int w = configuration_get_value(handle, section_name, key_name, annotation, tmp, int w = configuration_get_value(handle, section_name, key_name, annotation, tmp,
length); length);
......
...@@ -313,9 +313,9 @@ tw_event* lsm_event_new(const char* category, ...@@ -313,9 +313,9 @@ tw_event* lsm_event_new(const char* category,
delta += tmp; delta += tmp;
} }
e = codes_event_new(lsm_gid, delta, sender); e = codes_event_new(lsm_gid, delta, sender);
m = tw_event_data(e); m = (lsm_message_t*)tw_event_data(e);
m->magic = lsm_magic; m->magic = lsm_magic;
m->event = io_type; m->event = (lsm_event_t)io_type;
m->u.data.object = io_object; m->u.data.object = io_object;
m->u.data.offset = io_offset; m->u.data.offset = io_offset;
m->u.data.size = io_size_bytes; m->u.data.size = io_size_bytes;
...@@ -540,7 +540,7 @@ static void handle_io_request(lsm_state_t *ns, ...@@ -540,7 +540,7 @@ static void handle_io_request(lsm_state_t *ns,
ns->current_object = m_in->u.data.object; ns->current_object = m_in->u.data.object;
e = codes_event_new(lp->gid, queue_time, lp); e = codes_event_new(lp->gid, queue_time, lp);
m_out = tw_event_data(e); m_out = (lsm_message_t*)tw_event_data(e);
memcpy(m_out, m_in, sizeof(*m_in)+m_in->wrap.size); memcpy(m_out, m_in, sizeof(*m_in)+m_in->wrap.size);
if (m_out->event == LSM_WRITE_REQUEST) if (m_out->event == LSM_WRITE_REQUEST)
...@@ -693,7 +693,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model) ...@@ -693,7 +693,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc = configuration_get_multivalue(ch, LSM_NAME, "request_sizes", anno, rc = configuration_get_multivalue(ch, LSM_NAME, "request_sizes", anno,
&values,&length); &values,&length);
assert(rc == 1); assert(rc == 1);
model->request_sizes = malloc(sizeof(int)*length); model->request_sizes = (unsigned int*)malloc(sizeof(int)*length);
assert(model->request_sizes); assert(model->request_sizes);
model->bins = length; model->bins = length;
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
...@@ -706,7 +706,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model) ...@@ -706,7 +706,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc = configuration_get_multivalue(ch, LSM_NAME, "write_rates", anno, rc = configuration_get_multivalue(ch, LSM_NAME, "write_rates", anno,
&values,&length); &values,&length);
assert(rc == 1); assert(rc == 1);
model->write_rates = malloc(sizeof(double)*length); model->write_rates = (double*)malloc(sizeof(double)*length);
assert(model->write_rates); assert(model->write_rates);
assert(length == model->bins); assert(length == model->bins);
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
...@@ -719,7 +719,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model) ...@@ -719,7 +719,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc = configuration_get_multivalue(ch, LSM_NAME, "read_rates", anno, rc = configuration_get_multivalue(ch, LSM_NAME, "read_rates", anno,
&values,&length); &values,&length);
assert(rc == 1); assert(rc == 1);
model->read_rates = malloc(sizeof(double)*length); model->read_rates = (double*)malloc(sizeof(double)*length);
assert(model->read_rates); assert(model->read_rates);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
...@@ -732,7 +732,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model) ...@@ -732,7 +732,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc = configuration_get_multivalue(ch, LSM_NAME, "write_overheads", anno, rc = configuration_get_multivalue(ch, LSM_NAME, "write_overheads", anno,
&values,&length); &values,&length);
assert(rc == 1); assert(rc == 1);
model->write_overheads = malloc(sizeof(double)*length); model->write_overheads = (double*)malloc(sizeof(double)*length);
assert(model->write_overheads); assert(model->write_overheads);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
...@@ -745,7 +745,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model) ...@@ -745,7 +745,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc = configuration_get_multivalue(ch, LSM_NAME, "read_overheads", anno, rc = configuration_get_multivalue(ch, LSM_NAME, "read_overheads", anno,
&values,&length); &values,&length);
assert(rc == 1); assert(rc == 1);
model->read_overheads = malloc(sizeof(double)*length); model->read_overheads = (double*)malloc(sizeof(double)*length);
assert(model->read_overheads); assert(model->read_overheads);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
...@@ -758,7 +758,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model) ...@@ -758,7 +758,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc = configuration_get_multivalue(ch, LSM_NAME, "write_seeks", anno, rc = configuration_get_multivalue(ch, LSM_NAME, "write_seeks", anno,
&values,&length); &values,&length);
assert(rc == 1); assert(rc == 1);
model->write_seeks = malloc(sizeof(double)*length); model->write_seeks = (double*)malloc(sizeof(double)*length);
assert(model->write_seeks); assert(model->write_seeks);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
...@@ -771,7 +771,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model) ...@@ -771,7 +771,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc = configuration_get_multivalue(ch, LSM_NAME, "read_seeks", anno, rc = configuration_get_multivalue(ch, LSM_NAME, "read_seeks", anno,
&values,&length); &values,&length);
assert(rc == 1); assert(rc == 1);
model->read_seeks = malloc(sizeof(double)*length); model->read_seeks = (double*)malloc(sizeof(double)*length);
assert(model->read_seeks); assert(model->read_seeks);
assert(model->bins == length); assert(model->bins == length);
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
...@@ -790,7 +790,7 @@ void lsm_configure(void) ...@@ -790,7 +790,7 @@ void lsm_configure(void)
anno_map = codes_mapping_get_lp_anno_map(LSM_NAME); anno_map = codes_mapping_get_lp_anno_map(LSM_NAME);
assert(anno_map); assert(anno_map);
models_anno = malloc(anno_map->num_annos * sizeof(*models_anno)); models_anno = (disk_model_t*)malloc(anno_map->num_annos * sizeof(*models_anno));
// read the configuration for unannotated entries // read the configuration for unannotated entries
if (anno_map->has_unanno_lp > 0){ if (anno_map->has_unanno_lp > 0){
......
...@@ -48,7 +48,7 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer) ...@@ -48,7 +48,7 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer)
return(-1); return(-1);
} }
buf = malloc(sizeof(*buf)); buf = (io_buffer*)malloc(sizeof(*buf));
if(!buf) if(!buf)
return(-1); return(-1);
...@@ -80,7 +80,7 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer) ...@@ -80,7 +80,7 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer)
else else
{ {
/* new identifier */ /* new identifier */
id = malloc(sizeof(*id)); id = (struct identifier*)malloc(sizeof(*id));
if(!id) if(!id)
{ {
free(buf->buffer); free(buf->buffer);
...@@ -172,7 +172,7 @@ int lp_io_prepare(char *directory, int flags, lp_io_handle* handle, MPI_Comm com ...@@ -172,7 +172,7 @@ int lp_io_prepare(char *directory, int flags, lp_io_handle* handle, MPI_Comm com
if(flags & LP_IO_UNIQ_SUFFIX) if(flags & LP_IO_UNIQ_SUFFIX)
{ {
*handle = malloc(256); *handle = (lp_io_handle)malloc(256);
if(!(*handle)) if(!(*handle))
{ {
return(-1); return(-1);
...@@ -352,9 +352,9 @@ static int write_id(char* directory, char* identifier, MPI_Comm comm) ...@@ -352,9 +352,9 @@ static int write_id(char* directory, char* identifier, MPI_Comm comm)
/* build datatype for our buffers */ /* build datatype for our buffers */
if(id) if(id)
{ {
lengths = malloc(id->buffers_count*sizeof(int)); lengths = (int*)malloc(id->buffers_count*sizeof(int));
assert(lengths); assert(lengths);
displacements = malloc(id->buffers_count*sizeof(MPI_Aint)); displacements = (MPI_Aint*)malloc(id->buffers_count*sizeof(MPI_Aint));
assert(displacements); assert(displacements);
/* NOTE: some versions of MPI-IO have a bug related to using /* NOTE: some versions of MPI-IO have a bug related to using
......
...@@ -21,7 +21,7 @@ struct rc_stack { ...@@ -21,7 +21,7 @@ struct rc_stack {
}; };
void rc_stack_create(struct rc_stack **s){ void rc_stack_create(struct rc_stack **s){
struct rc_stack *ss = malloc(sizeof(*ss)); struct rc_stack *ss = (struct rc_stack*)malloc(sizeof(*ss));
if (ss) { if (ss) {
INIT_QLIST_HEAD(&ss->head); INIT_QLIST_HEAD(&ss->head);
ss->count = 0; ss->count = 0;
...@@ -54,7 +54,7 @@ void rc_stack_push( ...@@ -54,7 +54,7 @@ void rc_stack_push(
tw_lp *lp, tw_lp *lp,
void * data, void * data,
struct rc_stack *s){ struct rc_stack *s){
rc_entry * ent = malloc(sizeof(*ent)); rc_entry * ent = (rc_entry*)malloc(sizeof(*ent));
assert(ent); assert(ent);
ent->time = tw_now(lp); ent->time = tw_now(lp);
ent->data = data; ent->data = data;
......
...@@ -212,7 +212,7 @@ static void handle_resource_get( ...@@ -212,7 +212,7 @@ static void handle_resource_get(
if (m->i.block_on_unavail){ if (m->i.block_on_unavail){
/* queue up operation, save til later */ /* queue up operation, save til later */
b->c0 = 1; b->c0 = 1;
pending_op *op = malloc(sizeof(pending_op)); pending_op *op = (pending_op*)malloc(sizeof(pending_op));
op->m = m->i; /* no need to set rc msg here */ op->m = m->i; /* no need to set rc msg here */
qlist_add_tail(&op->ql, &ns->pending[m->i.tok]); qlist_add_tail(&op->ql, &ns->pending[m->i.tok]);
send_ack = 0; send_ack = 0;
...@@ -258,7 +258,7 @@ static void handle_resource_free( ...@@ -258,7 +258,7 @@ static void handle_resource_free(
assert(!resource_free(m->i.req, m->i.tok, &ns->r)); assert(!resource_free(m->i.req, m->i.tok, &ns->r));
/* create an event to pop the next queue item */ /* create an event to pop the next queue item */
tw_event *e = codes_event_new(lp->gid, codes_local_latency(lp), lp); tw_event *e = codes_event_new(lp->gid, codes_local_latency(lp), lp);
resource_msg *m_deq = tw_event_data(e); resource_msg *m_deq = (resource_msg*)tw_event_data(e);
msg_set_header(resource_magic, RESOURCE_DEQ, lp->gid, &m_deq->i.h); msg_set_header(resource_magic, RESOURCE_DEQ, lp->gid, &m_deq->i.h);
m_deq->i.tok = m->i.tok; /* only tok is needed, all others grabbed from q */ m_deq->i.tok = m->i.tok; /* only tok is needed, all others grabbed from q */
tw_event_send(e); tw_event_send(e);
...@@ -300,7 +300,7 @@ static void handle_resource_deq( ...@@ -300,7 +300,7 @@ static void handle_resource_deq(
free(p); free(p);
/* additionally attempt to dequeue next one down */ /* additionally attempt to dequeue next one down */
tw_event *e = codes_event_new(lp->gid, codes_local_latency(lp), lp); tw_event *e = codes_event_new(lp->gid, codes_local_latency(lp), lp);
resource_msg *m_deq = tw_event_data(e); resource_msg *m_deq = (resource_msg*)tw_event_data(e);
msg_set_header(resource_magic, RESOURCE_DEQ, lp->gid, &m_deq->i.h); msg_set_header(resource_magic, RESOURCE_DEQ, lp->gid, &m_deq->i.h);
/* only tok is needed, all others grabbed from q */ /* only tok is needed, all others grabbed from q */
m_deq->i.tok = m->i.tok; m_deq->i.tok = m->i.tok;
...@@ -322,7 +322,7 @@ static void handle_resource_deq_rc( ...@@ -322,7 +322,7 @@ static void handle_resource_deq_rc(
if (b->c1){ if (b->c1){
/* add operation back to the front of the queue */ /* add operation back to the front of the queue */
pending_op *op = malloc(sizeof(pending_op)); pending_op *op = (pending_op*)malloc(sizeof(pending_op));
op->m = m->i_rc; op->m = m->i_rc;
qlist_add(&op->ql, &ns->pending[