Rename SDL_Swap(16|32|64)(LE|BE) to SDL_Swap(LE|BE)(16|32|64)

This commit is contained in:
Anonymous Maarten authored and Anonymous Maarten committed 2024-06-12 02:29:39 +02:00
1 parent ef6123886e
commit 32907a9606
18 files changed
+172 -116

No files matched your search

+12 -12
View File
@@ -144,9 +144,9 @@ int SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
len /= 2;
while (len--) {
src1 = SDL_SwapLE16(*(Sint16 *)src);
src1 = SDL_Swap16LE(*(Sint16 *)src);
ADJUST_VOLUME(Sint16, src1, volume);
src2 = SDL_SwapLE16(*(Sint16 *)dst);
src2 = SDL_Swap16LE(*(Sint16 *)dst);
src += 2;
dst_sample = src1 + src2;
if (dst_sample > max_audioval) {
@@ -154,7 +154,7 @@ int SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
} else if (dst_sample < min_audioval) {
dst_sample = min_audioval;
}
*(Sint16 *)dst = SDL_SwapLE16((Sint16)dst_sample);
*(Sint16 *)dst = SDL_Swap16LE((Sint16)dst_sample);
dst += 2;
}
} break;
@@ -168,9 +168,9 @@ int SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
len /= 2;
while (len--) {
src1 = SDL_SwapBE16(*(Sint16 *)src);
src1 = SDL_Swap16BE(*(Sint16 *)src);
ADJUST_VOLUME(Sint16, src1, volume);
src2 = SDL_SwapBE16(*(Sint16 *)dst);
src2 = SDL_Swap16BE(*(Sint16 *)dst);
src += 2;
dst_sample = src1 + src2;
if (dst_sample > max_audioval) {
@@ -178,7 +178,7 @@ int SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
} else if (dst_sample < min_audioval) {
dst_sample = min_audioval;
}
*(Sint16 *)dst = SDL_SwapBE16((Sint16)dst_sample);
*(Sint16 *)dst = SDL_Swap16BE((Sint16)dst_sample);
dst += 2;
}
} break;
@@ -194,17 +194,17 @@ int SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
len /= 4;
while (len--) {
src1 = (Sint64)((Sint32)SDL_SwapLE32(*src32));
src1 = (Sint64)((Sint32)SDL_Swap32LE(*src32));
src32++;
ADJUST_VOLUME(Sint64, src1, volume);
src2 = (Sint64)((Sint32)SDL_SwapLE32(*dst32));
src2 = (Sint64)((Sint32)SDL_Swap32LE(*dst32));
dst_sample = src1 + src2;
if (dst_sample > max_audioval) {
dst_sample = max_audioval;
} else if (dst_sample < min_audioval) {
dst_sample = min_audioval;
}
*(dst32++) = SDL_SwapLE32((Uint32)((Sint32)dst_sample));
*(dst32++) = SDL_Swap32LE((Uint32)((Sint32)dst_sample));
}
} break;
@@ -219,17 +219,17 @@ int SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
len /= 4;
while (len--) {
src1 = (Sint64)((Sint32)SDL_SwapBE32(*src32));
src1 = (Sint64)((Sint32)SDL_Swap32BE(*src32));
src32++;
ADJUST_VOLUME(Sint64, src1, volume);
src2 = (Sint64)((Sint32)SDL_SwapBE32(*dst32));
src2 = (Sint64)((Sint32)SDL_Swap32BE(*dst32));
dst_sample = src1 + src2;
if (dst_sample > max_audioval) {
dst_sample = max_audioval;
} else if (dst_sample < min_audioval) {
dst_sample = min_audioval;
}
*(dst32++) = SDL_SwapBE32((Uint32)((Sint32)dst_sample));
*(dst32++) = SDL_Swap32BE((Uint32)((Sint32)dst_sample));
}
} break;
+2 -2
View File
@@ -1527,8 +1527,8 @@ static int WaveNextChunk(SDL_IOStream *src, WaveChunk *chunk)
return -1;
}
chunk->fourcc = SDL_SwapLE32(chunkheader[0]);
chunk->length = SDL_SwapLE32(chunkheader[1]);
chunk->fourcc = SDL_Swap32LE(chunkheader[0]);
chunk->length = SDL_Swap32LE(chunkheader[1]);
chunk->position = nextposition + 8;
return 0;