Commit 3322d07e authored by Mathis Rosenhauer's avatar Mathis Rosenhauer Committed by Thomas Jahns

remove casts from malloc

parent e7330ab0
......@@ -69,7 +69,7 @@
static void flush_##KIND(struct aec_stream *strm) \
{ \
int i; \
int64_t x, d, th, D, lower, m, sample; \
int64_t x, d, th, D, lower, m; \
int64_t data; \
struct internal_state *state = strm->state; \
\
......@@ -605,11 +605,11 @@ int aec_decode_init(struct aec_stream *strm)
if (strm->bits_per_sample > 32 || strm->bits_per_sample == 0)
return AEC_CONF_ERROR;
state = (struct internal_state *) malloc(sizeof(struct internal_state));
state = malloc(sizeof(struct internal_state));
if (state == NULL)
return AEC_MEM_ERROR;
state->se_table = (int *) malloc(182 * sizeof(int));
state->se_table = malloc(182 * sizeof(int));
if (state->se_table == NULL)
return AEC_MEM_ERROR;
......@@ -674,12 +674,12 @@ int aec_decode_init(struct aec_stream *strm)
}
state->id_table[modi - 1] = m_uncomp;
state->block = (int64_t *)malloc(strm->block_size * sizeof(int64_t));
state->block = malloc(strm->block_size * sizeof(int64_t));
if (state->block == NULL)
return AEC_MEM_ERROR;
state->buf_size = strm->rsi * strm->block_size;
state->buf = (uint32_t *)malloc(state->buf_size * sizeof(uint32_t));
state->buf = malloc(state->buf_size * sizeof(uint32_t));
if (state->buf == NULL)
return AEC_MEM_ERROR;
......
......@@ -744,7 +744,7 @@ int aec_encode_init(struct aec_stream *strm)
if (strm->rsi > 4096)
return AEC_CONF_ERROR;
state = (struct internal_state *)malloc(sizeof(struct internal_state));
state = malloc(sizeof(struct internal_state));
if (state == NULL)
return AEC_MEM_ERROR;
......@@ -809,14 +809,14 @@ int aec_encode_init(struct aec_stream *strm)
state->kmax = (1U << state->id_len) - 3;
state->data_pp = (uint32_t *)malloc(strm->rsi
state->data_pp = malloc(strm->rsi
* strm->block_size
* sizeof(uint32_t));
if (state->data_pp == NULL)
return AEC_MEM_ERROR;
if (strm->flags & AEC_DATA_PREPROCESS) {
state->data_raw = (uint32_t *)malloc(strm->rsi
state->data_raw = malloc(strm->rsi
* strm->block_size
* sizeof(uint32_t));
if (state->data_raw == NULL)
......@@ -829,7 +829,7 @@ int aec_encode_init(struct aec_stream *strm)
/* Largest possible CDS according to specs */
state->cds_len = (5 + 64 * 32) / 8 + 3;
state->cds_buf = (uint8_t *)malloc(state->cds_len);
state->cds_buf = malloc(state->cds_len);
if (state->cds_buf == NULL)
return AEC_MEM_ERROR;
......
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