mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-28 14:08:28 +00:00
Cleanup add brace (#6545)
* Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line
This commit is contained in:
@@ -818,7 +818,7 @@ IMA_ADPCM_Init(WaveFile *file, size_t datalength)
|
||||
/* There's no specification for this, but it's basically the same
|
||||
* format because the extensible header has wSampePerBlocks too.
|
||||
*/
|
||||
} else {
|
||||
} else {
|
||||
/* The Standards Update says there 'should' be 2 bytes for wSamplesPerBlock. */
|
||||
if (chunk->size >= 20 && format->extsize >= 2) {
|
||||
format->samplesperblock = chunk->data[18] | ((Uint16)chunk->data[19] << 8);
|
||||
@@ -899,14 +899,18 @@ IMA_ADPCM_ProcessNibble(Sint8 *cindex, Sint16 lastsample, Uint8 nybble)
|
||||
* (nybble & 0x8 ? -1 : 1) * ((nybble & 0x7) * step / 4 + step / 8)
|
||||
*/
|
||||
delta = step >> 3;
|
||||
if (nybble & 0x04)
|
||||
if (nybble & 0x04) {
|
||||
delta += step;
|
||||
if (nybble & 0x02)
|
||||
}
|
||||
if (nybble & 0x02) {
|
||||
delta += step >> 1;
|
||||
if (nybble & 0x01)
|
||||
}
|
||||
if (nybble & 0x01) {
|
||||
delta += step >> 2;
|
||||
if (nybble & 0x08)
|
||||
}
|
||||
if (nybble & 0x08) {
|
||||
delta = -delta;
|
||||
}
|
||||
|
||||
sample = lastsample + delta;
|
||||
|
||||
|
Reference in New Issue
Block a user