@@ -436,9 +436,9 @@ static int fetch_float64le(void *context, int length)
436
436
static int MS_ADPCM_Init (ADPCM_DecoderState * state , const Uint8 * chunk_data , Uint32 chunk_length )
437
437
{
438
438
const WaveFMTEx * fmt = (WaveFMTEx * )chunk_data ;
439
- const Uint16 channels = SDL_SwapLE16 (fmt -> format .channels );
440
- const Uint16 blockalign = SDL_SwapLE16 (fmt -> format .blockalign );
441
- const Uint16 bitspersample = SDL_SwapLE16 (fmt -> format .bitspersample );
439
+ const Uint16 channels = SDL_Swap16LE (fmt -> format .channels );
440
+ const Uint16 blockalign = SDL_Swap16LE (fmt -> format .blockalign );
441
+ const Uint16 bitspersample = SDL_Swap16LE (fmt -> format .bitspersample );
442
442
const size_t blockheadersize = (size_t )channels * 7 ;
443
443
const size_t blockdatasize = (size_t )blockalign - blockheadersize ;
444
444
const size_t blockframebitsize = (size_t )bitspersample * channels ;
@@ -474,8 +474,8 @@ static int MS_ADPCM_Init(ADPCM_DecoderState *state, const Uint8 *chunk_data, Uin
474
474
return Mix_SetError ("Could not read MS ADPCM format header" );
475
475
}
476
476
477
- cbExtSize = SDL_SwapLE16 (fmt -> cbSize );
478
- samplesperblock = SDL_SwapLE16 (fmt -> Samples .samplesperblock );
477
+ cbExtSize = SDL_Swap16LE (fmt -> cbSize );
478
+ samplesperblock = SDL_Swap16LE (fmt -> Samples .samplesperblock );
479
479
/* Number of coefficient pairs. A pair has two 16-bit integers. */
480
480
coeffcount = chunk_data [20 ] | ((size_t )chunk_data [21 ] << 8 );
481
481
/* bPredictor, the integer offset into the coefficients array, is only
@@ -711,10 +711,10 @@ static int MS_ADPCM_DecodeBlockData(ADPCM_DecoderState *state)
711
711
static int IMA_ADPCM_Init (ADPCM_DecoderState * state , const Uint8 * chunk_data , Uint32 chunk_length )
712
712
{
713
713
const WaveFMTEx * fmt = (WaveFMTEx * )chunk_data ;
714
- const Uint16 formattag = SDL_SwapLE16 (fmt -> format .encoding );
715
- const Uint16 channels = SDL_SwapLE16 (fmt -> format .channels );
716
- const Uint16 blockalign = SDL_SwapLE16 (fmt -> format .blockalign );
717
- const Uint16 bitspersample = SDL_SwapLE16 (fmt -> format .bitspersample );
714
+ const Uint16 formattag = SDL_Swap16LE (fmt -> format .encoding );
715
+ const Uint16 channels = SDL_Swap16LE (fmt -> format .channels );
716
+ const Uint16 blockalign = SDL_Swap16LE (fmt -> format .blockalign );
717
+ const Uint16 bitspersample = SDL_Swap16LE (fmt -> format .bitspersample );
718
718
const size_t blockheadersize = (size_t )channels * 4 ;
719
719
const size_t blockdatasize = (size_t )blockalign - blockheadersize ;
720
720
const size_t blockframebitsize = (size_t )bitspersample * channels ;
@@ -742,9 +742,9 @@ static int IMA_ADPCM_Init(ADPCM_DecoderState *state, const Uint8 *chunk_data, Ui
742
742
* format because the extensible header has wSampePerBlocks too.
743
743
*/
744
744
} else if (chunk_length >= 20 ) {
745
- Uint16 cbExtSize = SDL_SwapLE16 (fmt -> cbSize );
745
+ Uint16 cbExtSize = SDL_Swap16LE (fmt -> cbSize );
746
746
if (cbExtSize >= 2 ) {
747
- samplesperblock = SDL_SwapLE16 (fmt -> Samples .samplesperblock );
747
+ samplesperblock = SDL_Swap16LE (fmt -> Samples .samplesperblock );
748
748
}
749
749
}
750
750
@@ -1365,15 +1365,15 @@ static SDL_bool ParseFMT(WAV_Music *wave, Uint32 chunk_length)
1365
1365
SDL_zero (fmt );
1366
1366
SDL_memcpy (& fmt , chunk , size );
1367
1367
1368
- wave -> encoding = SDL_SwapLE16 (fmt .format .encoding );
1368
+ wave -> encoding = SDL_Swap16LE (fmt .format .encoding );
1369
1369
1370
1370
if (wave -> encoding == EXTENSIBLE_CODE ) {
1371
1371
if (size < sizeof (fmt )) {
1372
1372
Mix_SetError ("Wave format chunk too small" );
1373
1373
SDL_free (chunk );
1374
1374
return SDL_FALSE ;
1375
1375
}
1376
- wave -> encoding = (Uint16 )SDL_SwapLE32 (fmt .subencoding );
1376
+ wave -> encoding = (Uint16 )SDL_Swap32LE (fmt .subencoding );
1377
1377
}
1378
1378
1379
1379
/* Decode the audio data format */
@@ -1410,8 +1410,8 @@ static SDL_bool ParseFMT(WAV_Music *wave, Uint32 chunk_length)
1410
1410
}
1411
1411
SDL_free (chunk );
1412
1412
1413
- spec -> freq = (int )SDL_SwapLE32 (fmt .format .frequency );
1414
- bits = (int )SDL_SwapLE16 (fmt .format .bitspersample );
1413
+ spec -> freq = (int )SDL_Swap32LE (fmt .format .frequency );
1414
+ bits = (int )SDL_Swap16LE (fmt .format .bitspersample );
1415
1415
switch (bits ) {
1416
1416
case 4 :
1417
1417
switch (wave -> encoding ) {
@@ -1464,7 +1464,7 @@ static SDL_bool ParseFMT(WAV_Music *wave, Uint32 chunk_length)
1464
1464
Mix_SetError ("Unknown PCM format with %d bits" , bits );
1465
1465
return SDL_FALSE ;
1466
1466
}
1467
- spec -> channels = (Uint8 ) SDL_SwapLE16 (fmt .format .channels );
1467
+ spec -> channels = (Uint8 ) SDL_Swap16LE (fmt .format .channels );
1468
1468
wave -> samplesize = spec -> channels * (bits / 8 );
1469
1469
/* SDL_CalculateAudioSpec */
1470
1470
wave -> buflen = SDL_AUDIO_BITSIZE (spec -> format ) / 8 ;
@@ -1520,11 +1520,11 @@ static SDL_bool ParseSMPL(WAV_Music *wave, Uint32 chunk_length)
1520
1520
}
1521
1521
chunk = (SamplerChunk * )data ;
1522
1522
1523
- for (i = 0 ; i < SDL_SwapLE32 (chunk -> sample_loops ); ++ i ) {
1523
+ for (i = 0 ; i < SDL_Swap32LE (chunk -> sample_loops ); ++ i ) {
1524
1524
const Uint32 LOOP_TYPE_FORWARD = 0 ;
1525
- Uint32 loop_type = SDL_SwapLE32 (chunk -> loops [i ].type );
1525
+ Uint32 loop_type = SDL_Swap32LE (chunk -> loops [i ].type );
1526
1526
if (loop_type == LOOP_TYPE_FORWARD ) {
1527
- AddLoopPoint (wave , SDL_SwapLE32 (chunk -> loops [i ].play_count ), SDL_SwapLE32 (chunk -> loops [i ].start ), SDL_SwapLE32 (chunk -> loops [i ].end ));
1527
+ AddLoopPoint (wave , SDL_Swap32LE (chunk -> loops [i ].play_count ), SDL_Swap32LE (chunk -> loops [i ].start ), SDL_Swap32LE (chunk -> loops [i ].end ));
1528
1528
}
1529
1529
}
1530
1530
@@ -1540,8 +1540,8 @@ static void read_meta_field(Mix_MusicMetaTags *tags, Mix_MusicMetaTag tag_type,
1540
1540
char * field = NULL ;
1541
1541
* i += 4 ;
1542
1542
len = isID3 ?
1543
- SDL_SwapBE32 (* ((Uint32 * )(data + * i ))) : /* ID3 */
1544
- SDL_SwapLE32 (* ((Uint32 * )(data + * i ))); /* LIST */
1543
+ SDL_Swap32BE (* ((Uint32 * )(data + * i ))) : /* ID3 */
1544
+ SDL_Swap32LE (* ((Uint32 * )(data + * i ))); /* LIST */
1545
1545
if (len > chunk_length ) {
1546
1546
return ; /* Do nothing due to broken lenght */
1547
1547
}
0 commit comments