Skip to content

Commit fffa108

Browse files
committed
avoid more warnings in C code
1 parent 1950d07 commit fffa108

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/6model/reprs/CArray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static void serialize_repr_data(PARROT_INTERP, STable *st, SerializationWriter *
418418

419419
/* Deserializes the REPR data. */
420420
static void deserialize_repr_data(PARROT_INTERP, STable *st, SerializationReader *reader) {
421-
CArrayREPRData *repr_data = st->REPR_data = mem_sys_allocate_zeroed(sizeof(CArrayREPRData));
421+
CArrayREPRData *repr_data = st->REPR_data = (CArrayREPRData *) mem_sys_allocate_zeroed(sizeof(CArrayREPRData));
422422
repr_data->elem_size = reader->read_int(interp, reader);
423423
repr_data->elem_type = reader->read_ref(interp, reader);
424424
repr_data->elem_kind = reader->read_int(interp, reader);

src/ops/nqp_dyncall.ops

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ static void dyncall_wb_ca(PMC *obj) {
331331
case CARRAY_ELEM_KIND_CSTRUCT:
332332
objptr = (CStructBody *) OBJECT_BODY(body->child_objs[i]);
333333
break;
334+
default:
335+
objptr = NULL;
334336
}
335337
}
336338
else {
@@ -468,7 +470,7 @@ inline op nqp_native_call_build(in PMC, in STR, in STR, in STR, in PMC, in PMC)
468470

469471
/* Transform each of the args info structures into a flag. */
470472
body->num_args = VTABLE_elements(interp, arg_info);
471-
body->arg_types = mem_sys_allocate(sizeof(INTVAL) * (body->num_args ? body->num_args : 1));
473+
body->arg_types = (INTVAL *) mem_sys_allocate(sizeof(INTVAL) * (body->num_args ? body->num_args : 1));
472474
for (i = 0; i < body->num_args; i++) {
473475
PMC *info = VTABLE_get_pmc_keyed_int(interp, arg_info, i);
474476
body->arg_types[i] = get_arg_type(interp, info, 0);
@@ -567,7 +569,7 @@ inline op nqp_native_call(out PMC, in PMC, in PMC, in PMC) :base_core {
567569
Parrot_utf8_encoding_ptr);
568570
if (body->arg_types[i] & DYNCALL_ARG_FREE_STR_MASK) {
569571
if (!free_strs)
570-
free_strs = mem_sys_allocate(body->num_args * sizeof(char *));
572+
free_strs = (char**) mem_sys_allocate(body->num_args * sizeof(char *));
571573
free_strs[num_strs] = str;
572574
num_strs++;
573575
}

0 commit comments

Comments
 (0)