Skip to content

Commit 75869dd

Browse files
Sackzementslouken
authored andcommitted
Removed redundant casts
1 parent 9b91843 commit 75869dd

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/SDL_mixer_metadata_tags.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static size_t id3v22_parse_frame(SDL_PropertiesID props, SDL_IOStream *io, Uint8
372372

373373
handle_id3v2x2_string(props, key, buffer, read_size);
374374

375-
return (size_t)(size + ID3v2_2_FRAME_HEADER_SIZE); // data size + size of the header
375+
return size + ID3v2_2_FRAME_HEADER_SIZE; // data size + size of the header
376376
}
377377

378378
// Parse a frame in ID3v2.3 and ID3v2.4 formats
@@ -417,7 +417,7 @@ static size_t id3v2x_parse_frame(SDL_PropertiesID props, SDL_IOStream *io, Uint8
417417
buffer[read_size] = '\0'; // make sure it's definitely null-terminated.
418418
handle_id3v2_string(props, key, buffer, read_size);
419419

420-
return (size_t)(size + ID3v2_3_FRAME_HEADER_SIZE); // data size + size of the header
420+
return size + ID3v2_3_FRAME_HEADER_SIZE; // data size + size of the header
421421
}
422422

423423
// Parse content of ID3v2. This expects the stream to be seeked to the start of the potential header.
@@ -715,7 +715,7 @@ static Sint64 get_lyrics3v1_len(SDL_IOStream *io)
715715
if (flen < 20) {
716716
return -1;
717717
}
718-
Sint64 len = (Sint64) SDL_min(flen, LYRICS3v1_SEARCH_BUFFER);
718+
Sint64 len = SDL_min(flen, LYRICS3v1_SEARCH_BUFFER);
719719
if (SDL_SeekIO(io, -len, SDL_IO_SEEK_END) == -1) {
720720
return -1;
721721
}
@@ -1036,7 +1036,7 @@ static void ParseTrackNumString(const char *str, Sint64 *track, Sint64 *total_tr
10361036
const char *trackstr = str;
10371037
const char *totalstr = NULL;
10381038
char *cpy = NULL;
1039-
char *ptr = (char *) SDL_strchr(str, '/'); // see if it has both track _and_ total tracks.
1039+
char *ptr = SDL_strchr(str, '/'); // see if it has both track _and_ total tracks.
10401040

10411041
if (ptr) {
10421042
cpy = SDL_strdup(str);

src/decoder_opus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static bool SDLCALL OPUS_decode(void *track_userdata, SDL_AudioStream *stream)
227227
float samples[256];
228228

229229
const int channels = tdata->current_channels;
230-
int amount = (int)opus.op_read_float(tdata->of, samples, SDL_arraysize(samples), &bitstream);
230+
int amount = opus.op_read_float(tdata->of, samples, SDL_arraysize(samples), &bitstream);
231231
if (amount < 0) {
232232
return set_op_error("op_read_float", amount);
233233
} else if (amount == 0) {

src/decoder_voc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static bool ParseVocFile(SDL_IOStream *io, VOC_AudioData *adata, SDL_PropertiesI
154154
return SDL_SetError("Unsupported VOC data format");
155155
}
156156

157-
current_spec.freq = (int) (1000000 / (256 - rateu8));
157+
current_spec.freq = 1000000 / (256 - rateu8);
158158
current_spec.channels = 1;
159159
current_spec.format = (codec == 0) ? SDL_AUDIO_U8 : SDL_AUDIO_S16LE;
160160

src/decoder_wav.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static bool MS_ADPCM_Init(ADPCM_DecoderInfo *info, const Uint8 *chunk_data, Uint
242242
Uint16 samplesperblock = SDL_Swap16LE(fmt->Samples.samplesperblock);
243243

244244
// Number of coefficient pairs. A pair has two 16-bit integers.
245-
size_t coeffcount = (size_t) (chunk_data[20] | ((size_t)chunk_data[21] << 8));
245+
size_t coeffcount = (size_t)chunk_data[20] | ((size_t)chunk_data[21] << 8);
246246

247247
// bPredictor, the integer offset into the coefficients array, is only
248248
// 8 bits. It can only address the first 256 coefficients. Let's limit
@@ -1094,7 +1094,7 @@ static void CalcSeekBlockSeek(const WAV_AudioData *adata, Uint32 actual_frame, W
10941094
if (IsADPCM(adata->encoding)) {
10951095
seekblock->seek_position = (Sint64) (adata->start + ((actual_frame / adata->adpcm_info.samplesperblock) * adata->adpcm_info.blocksize));
10961096
} else {
1097-
seekblock->seek_position = (Sint64) (adata->start + (actual_frame * adata->framesize));
1097+
seekblock->seek_position = adata->start + (actual_frame * adata->framesize);
10981098
}
10991099
}
11001100

@@ -1169,7 +1169,7 @@ static bool BuildSeekBlocks(WAV_AudioData *adata)
11691169
const Sint64 stop_frame_block = loop_stop_frame / frames_per_block;
11701170
const Sint64 offset_into_stop_block = loop_stop_frame % frames_per_block;
11711171
const Sint64 frames_left_in_stop_block = frames_per_block - offset_into_stop_block;
1172-
const Sint64 all_blocks_in_file = ((Sint64) (adata->stop - adata->start)) / frames_per_block;
1172+
const Sint64 all_blocks_in_file = (adata->stop - adata->start) / frames_per_block;
11731173
const Sint64 blocks_left_after_stop_block = all_blocks_in_file - stop_frame_block;
11741174
seekblocks->num_frames = frames_left_in_stop_block + (blocks_left_after_stop_block * frames_per_block);
11751175
} else {

src/decoder_wavpack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static bool SDLCALL WAVPACK_init_audio(SDL_IOStream *io, SDL_AudioSpec *spec, SD
417417
wavpack.WavpackGetNumSamples(ctx);
418418
adata->bps = wavpack.WavpackGetBytesPerSample(ctx) << 3;
419419
adata->mode = wavpack.WavpackGetMode(ctx);
420-
adata->channels = (int) wavpack.WavpackGetNumChannels(ctx);
420+
adata->channels = wavpack.WavpackGetNumChannels(ctx);
421421
adata->samplerate = wavpack.WavpackGetSampleRate(ctx);
422422
adata->decimation = 1;
423423

0 commit comments

Comments
 (0)