added missing casts to malloc() results

master
Ozkan Sezer 3 years ago
parent bb178a0a5a
commit 425adebf7b
  1. 2
      src/sound_aiff.c
  2. 2
      src/sound_alsa05.c
  3. 4
      src/sound_file.c
  4. 2
      src/sound_sb.c
  5. 4
      src/sound_wav.c
  6. 2
      src/sound_win32.c

@ -108,7 +108,7 @@ static int init(struct options *options)
static void play(void *b, int len)
{
if (swap_endian && bits == 16) {
convert_endian(b, len);
convert_endian((unsigned char *)b, len);
}
fwrite(b, 1, len, fd);
size += len;

@ -106,7 +106,7 @@ static int init(struct options *options)
// dev = snd_defaults_pcm_device(); /* ? */
parm_end();
mybuffer = malloc(frag_size);
mybuffer = (char*)malloc(frag_size);
if (mybuffer) {
mybuffer_nextfree = mybuffer;
} else {

@ -41,7 +41,7 @@ static int init(struct options *options)
if (strcmp(options->out_file, "-")) {
int len = strlen(sound_file.description) +
strlen(options->out_file) + 8;
if ((buf = malloc(len)) == NULL)
if ((buf = (char *)malloc(len)) == NULL)
return -1;
snprintf(buf, len, "%s: %s", sound_file.description,
options->out_file);
@ -56,7 +56,7 @@ static int init(struct options *options)
static void play(void *b, int len)
{
if (swap_endian) {
convert_endian(b, len);
convert_endian((unsigned char *)b, len);
}
fwrite(b, 1, len, fd);
size += len;

@ -130,7 +130,7 @@ static void deinit(void)
static void play(void *data, int siz) {
int i;
for (;;) {
i = write_sb_output(data, siz);
i = write_sb_output((char *)data, siz);
if ((siz -= i) <= 0) return;
data = (char *)data + i;
/*delay_ms(1);*/

@ -68,7 +68,7 @@ static int init(struct options *options)
if (strcmp(options->out_file, "-")) {
int len = strlen(sound_wav.description) +
strlen(options->out_file) + 8;
if ((buf = malloc(len)) == NULL)
if ((buf = (char *)malloc(len)) == NULL)
return -1;
snprintf(buf, len, "%s: %s", sound_wav.description,
options->out_file);
@ -117,7 +117,7 @@ static int init(struct options *options)
static void play(void *b, int len)
{
if (swap_endian && format_16bit) {
convert_endian(b, len);
convert_endian((unsigned char *)b, len);
}
fwrite(b, 1, len, fd);
size += len;

@ -109,7 +109,7 @@ static int init(struct options *options)
waveOutReset(hwaveout);
for (i = 0; i < num_buffers; i++) {
buffer[i] = malloc(OUT_MAXLEN);
buffer[i] = (LPSTR) malloc(OUT_MAXLEN);
header[i].lpData = buffer[i];
if (!buffer[i] || res != MMSYSERR_NOERROR) {

Loading…
Cancel
Save