Skip to content

Commit 59d74a0

Browse files
committed
Buildfixes
1 parent 11018c8 commit 59d74a0

8 files changed

Lines changed: 30 additions & 30 deletions

File tree

frontend/drivers/platform_switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ char *realpath(const char *name, char *resolved)
486486

487487
if (!resolved)
488488
{
489-
rpath = malloc(path_max);
489+
rpath = (char*)malloc(path_max);
490490
if (!rpath)
491491
return NULL;
492492
}

input/common/wayland_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ static ssize_t wl_read_pipe(int fd, void** buffer, size_t* total_length,
882882
if (null_terminate)
883883
new_buffer_length = *total_length + 1;
884884
else
885-
new_buffer_length = *total_length;
885+
new_buffer_length = *total_length;
886886

887887
if (*buffer == NULL)
888888
output_buffer = malloc(new_buffer_length);

libretro-common/audio/dsp_filters/reverb.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,27 +187,26 @@ static void revmodel_setmode(struct revmodel *rev, float value)
187187

188188
static void revmodel_init(struct revmodel *rev,int srate)
189189
{
190-
191-
static const int comb_lengths[8] = { 1116,1188,1277,1356,1422,1491,1557,1617 };
190+
unsigned c;
191+
static const int comb_lengths[8] = { 1116,1188,1277,1356,1422,1491,1557,1617 };
192192
static const int allpass_lengths[4] = { 225,341,441,556 };
193193
double r = srate * (1 / 44100.0);
194-
unsigned c;
195194

196195
for (c = 0; c < numcombs; ++c)
197196
{
198-
rev->bufcomb[c] = malloc(r*comb_lengths[c]*sizeof(float));
199-
rev->combL[c].buffer = rev->bufcomb[c];
200-
memset(rev->combL[c].buffer,0,r*comb_lengths[c]*sizeof(float));
201-
rev->combL[c].bufsize=r*comb_lengths[c];
197+
rev->bufcomb[c] = (float*)malloc(r * comb_lengths[c] * sizeof(float));
198+
rev->combL[c].buffer = rev->bufcomb[c];
199+
memset(rev->combL[c].buffer, 0, r * comb_lengths[c] * sizeof(float));
200+
rev->combL[c].bufsize=r*comb_lengths[c];
202201
}
203202

204203
for (c = 0; c < numallpasses; ++c)
205204
{
206-
rev->bufallpass[c] = malloc(r*allpass_lengths[c]*sizeof(float));
207-
rev->allpassL[c].buffer = rev->bufallpass[c];
208-
memset(rev->allpassL[c].buffer,0,r*allpass_lengths[c]*sizeof(float));
209-
rev->allpassL[c].bufsize=r*allpass_lengths[c];
210-
rev->allpassL[c].feedback = 0.5f;
205+
rev->bufallpass[c] = (float*)malloc(r * allpass_lengths[c] * sizeof(float));
206+
rev->allpassL[c].buffer = rev->bufallpass[c];
207+
memset(rev->allpassL[c].buffer, 0, r * allpass_lengths[c] * sizeof(float));
208+
rev->allpassL[c].bufsize=r*allpass_lengths[c];
209+
rev->allpassL[c].feedback = 0.5f;
211210
}
212211

213212
revmodel_setwet(rev, initialwet);
@@ -225,7 +224,7 @@ struct reverb_data
225224

226225
static void reverb_free(void *data)
227226
{
228-
unsigned i;
227+
int i;
229228
struct reverb_data *rev = (struct reverb_data*)data;
230229

231230
for (i = 0; i < numcombs; i++)
@@ -245,7 +244,7 @@ static void reverb_free(void *data)
245244
static void reverb_process(void *data, struct dspfilter_output *output,
246245
const struct dspfilter_input *input)
247246
{
248-
unsigned i;
247+
int i;
249248
float *out;
250249
struct reverb_data *rev = (struct reverb_data*)data;
251250

libretro-common/audio/dsp_filters/tremolo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static void tremolocore_init(struct tremolo_core *core,float depth,int samplerat
5959
const double offset = 1. - depth / 2.;
6060
core->index = 0;
6161
core->maxindex = samplerate / freq;
62-
core->wavetable = malloc(core->maxindex * sizeof(float));
62+
core->wavetable = (float*)malloc(core->maxindex * sizeof(float));
6363
memset(core->wavetable, 0, core->maxindex * sizeof(float));
6464
for (i = 0; i < core->maxindex; i++)
6565
{

libretro-common/audio/dsp_filters/vibrato.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static void vibrato_free(void *data)
7272
static void vibratocore_init(struct vibrato_core *core,float depth,int samplerate,float freq)
7373
{
7474
core->size = VIBRATO_BASE_DELAY_SEC * samplerate * 2;
75-
core->buffer = malloc((core->size + VIBRATO_ADD_DELAY) * sizeof(float));
75+
core->buffer = (float*)malloc((core->size + VIBRATO_ADD_DELAY) * sizeof(float));
7676
memset(core->buffer, 0, (core->size + VIBRATO_ADD_DELAY) * sizeof(float));
7777
core->samplerate = samplerate;
7878
core->freq = freq;

libretro-common/formats/libchdr/libchdr_chd.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static chd_error huff_codec_decompress(void *codec, const uint8_t *src, uint32_t
375375
free(bitbuf);
376376
return result;
377377
}
378-
378+
379379

380380
/***************************************************************************
381381
CODEC INTERFACES
@@ -514,7 +514,7 @@ static const codec_interface codec_interfaces[] =
514514
NULL
515515
}
516516
#endif
517-
517+
518518
};
519519

520520
/***************************************************************************
@@ -757,7 +757,7 @@ static chd_error decompress_v5_map(chd_file* chd, chd_header* header)
757757
uint8_t rawbuf[16];
758758
struct huffman_decoder* decoder;
759759
enum huffman_error err;
760-
uint64_t curoffset;
760+
uint64_t curoffset;
761761
int rawmapsize = map_size_v5(header);
762762

763763
if (!chd_compressed(header))
@@ -931,8 +931,9 @@ static INLINE void map_extract_old(const uint8_t *base, map_entry *entry, uint32
931931
chd_open_file - open a CHD file for access
932932
-------------------------------------------------*/
933933

934-
CHD_EXPORT chd_error chd_open_file(FILE *file, int mode, chd_file *parent, chd_file **chd) {
935-
core_file *stream = malloc(sizeof(core_file));
934+
CHD_EXPORT chd_error chd_open_file(FILE *file, int mode, chd_file *parent, chd_file **chd)
935+
{
936+
core_file *stream = (core_file*)malloc(sizeof(core_file));
936937
if (!stream)
937938
return CHDERR_OUT_OF_MEMORY;
938939
stream->argp = file;
@@ -1032,11 +1033,11 @@ CHD_EXPORT chd_error chd_open_core_file(core_file *file, int mode, chd_file *par
10321033

10331034
#ifdef NEED_CACHE_HUNK
10341035
/* allocate and init the hunk cache */
1035-
newchd->cache = (uint8_t *)malloc(newchd->header.hunkbytes);
1036+
newchd->cache = (uint8_t *)malloc(newchd->header.hunkbytes);
10361037
newchd->compare = (uint8_t *)malloc(newchd->header.hunkbytes);
10371038
if (newchd->cache == NULL || newchd->compare == NULL)
10381039
EARLY_EXIT(err = CHDERR_OUT_OF_MEMORY);
1039-
newchd->cachehunk = ~0;
1040+
newchd->cachehunk = ~0;
10401041
newchd->comparehunk = ~0;
10411042
#endif
10421043

@@ -2089,7 +2090,7 @@ static chd_error hunk_read_into_memory(chd_file *chd, uint32_t hunknum, uint8_t
20892090
#endif
20902091
break;
20912092
}
2092-
2093+
20932094
if (codec==NULL)
20942095
return CHDERR_CODEC_ERROR;
20952096
err = chd->codecintf[rawmap[0]]->decompress(codec, compressed_bytes, blocklen, dest, chd->header.hunkbytes);

libretro-common/formats/wav/rwav.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ enum rwav_state rwav_iterate(rwav_iterator_t *iter)
9595

9696
rwav->subchunk2size = data[40] | data[41] << 8 | data[42] << 16 | data[43] << 24;
9797

98-
if ((rwav->subchunk2size < 1) ||
99-
(rwav->subchunk2size > iter->size - 44))
98+
if ( (rwav->subchunk2size < 1)
99+
|| (rwav->subchunk2size > iter->size - 44))
100100
return RWAV_ITERATE_ERROR; /* too few bytes in buffer */
101101

102102
samples = malloc(rwav->subchunk2size);

libretro-common/libco/scefiber.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ cothread_t co_active(void)
4646
cothread_t co_create(unsigned int heapsize, void (*coentry)(void))
4747
{
4848
int ret;
49-
SceFiber* tail_fiber = malloc(sizeof(SceFiber));
50-
char * m_ctxbuf = malloc(sizeof(char)*heapsize);
49+
SceFiber* tail_fiber = (SceFiber*)malloc(sizeof(SceFiber));
50+
char * m_ctxbuf = (char*)malloc(heapsize * sizeof(char));
5151
if (!co_active_)
5252
{
5353
sceSysmoduleLoadModule(SCE_SYSMODULE_FIBER);

0 commit comments

Comments
 (0)