diff --git a/audio/audio_mixer.c b/audio/audio_mixer.c index a0e49f40f8..a44ba38d6a 100644 --- a/audio/audio_mixer.c +++ b/audio/audio_mixer.c @@ -1050,7 +1050,7 @@ static void audio_mixer_mix_flac(float* buffer, size_t num_frames, if (voice->types.flac.position == voice->types.flac.samples) { again: - temp_samples = drflac_read_f32( voice->types.flac.stream, AUDIO_MIXER_TEMP_BUFFER, temp_buffer); + temp_samples = (unsigned)drflac_read_f32( voice->types.flac.stream, AUDIO_MIXER_TEMP_BUFFER, temp_buffer); if (temp_samples == 0) { if (voice->repeat) @@ -1122,7 +1122,7 @@ static void audio_mixer_mix_mp3(float* buffer, size_t num_frames, if (voice->types.mp3.position == voice->types.mp3.samples) { again: - temp_samples = drmp3_read_f32(&voice->types.mp3.stream, AUDIO_MIXER_TEMP_BUFFER/2, temp_buffer) * 2; + temp_samples = (unsigned)drmp3_read_f32(&voice->types.mp3.stream, AUDIO_MIXER_TEMP_BUFFER/2, temp_buffer) * 2; if (temp_samples == 0) { diff --git a/audio/dsp_filter.c b/audio/dsp_filter.c index c7bb2dc9c9..e28eaa9f64 100644 --- a/audio/dsp_filter.c +++ b/audio/dsp_filter.c @@ -178,8 +178,8 @@ static bool append_plugs(retro_dsp_filter_t *dsp, struct string_list *list) static bool append_plugs(retro_dsp_filter_t *dsp, struct string_list *list) { unsigned i; - dspfilter_simd_mask_t mask = cpu_features_get(); - unsigned list_size = list ? list->size : 0; + dspfilter_simd_mask_t mask = (dspfilter_simd_mask_t)cpu_features_get(); + unsigned list_size = list ? (unsigned)list->size : 0; for (i = 0; i < list_size; i++) { diff --git a/formats/bmp/rbmp.c b/formats/bmp/rbmp.c index 1e7eaa9349..96ea616509 100644 --- a/formats/bmp/rbmp.c +++ b/formats/bmp/rbmp.c @@ -113,7 +113,10 @@ static unsigned char *rbmp__convert_format( { case ((1)*8+(2)): for(i=x-1; i >= 0; --i, src += 1, dest += 2) - dest[0]=src[0], dest[1]=255; + { + dest[0]=src[0]; + dest[1]=255; + } break; case ((1)*8+(3)): for(i=x-1; i >= 0; --i, src += 1, dest += 3) @@ -121,7 +124,10 @@ static unsigned char *rbmp__convert_format( break; case ((1)*8+(4)): for(i=x-1; i >= 0; --i, src += 1, dest += 4) - dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; + { + dest[0]=dest[1]=dest[2]=src[0]; + dest[3]=255; + } break; case ((2)*8+(1)): for(i=x-1; i >= 0; --i, src += 2, dest += 1) @@ -133,11 +139,19 @@ static unsigned char *rbmp__convert_format( break; case ((2)*8+(4)): for(i=x-1; i >= 0; --i, src += 2, dest += 4) - dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; + { + dest[0]=dest[1]=dest[2]=src[0]; + dest[3]=src[1]; + } break; case ((3)*8+(4)): for(i=x-1; i >= 0; --i, src += 3, dest += 4) - dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; + { + dest[0]=src[0]; + dest[1]=src[1]; + dest[2]=src[2]; + dest[3]=255; + } break; case ((3)*8+(1)): for(i=x-1; i >= 0; --i, src += 3, dest += 1) @@ -157,7 +171,11 @@ static unsigned char *rbmp__convert_format( break; case ((4)*8+(3)): for(i=x-1; i >= 0; --i, src += 4, dest += 3) - dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; + { + dest[0]=src[0]; + dest[1]=src[1]; + dest[2]=src[2]; + } break; default: break; @@ -176,11 +194,31 @@ static int rbmp__high_bit(unsigned int z) int n=0; if (z == 0) return -1; - if (z >= 0x10000) n += 16, z >>= 16; - if (z >= 0x00100) n += 8, z >>= 8; - if (z >= 0x00010) n += 4, z >>= 4; - if (z >= 0x00004) n += 2, z >>= 2; - if (z >= 0x00002) n += 1, z >>= 1; + if (z >= 0x10000) + { + n += 16; + z >>= 16; + } + if (z >= 0x00100) + { + n += 8; + z >>= 8; + } + if (z >= 0x00010) + { + n += 4; + z >>= 4; + } + if (z >= 0x00004) + { + n += 2; + z >>= 2; + } + if (z >= 0x00002) + { + n += 1; + z >>= 1; + } return n; } @@ -525,7 +563,9 @@ static unsigned char *rbmp__bmp_load(rbmp__context *s, unsigned *x, unsigned *y, unsigned char *p2 = out + (s->img_y-1-j)*s->img_x*target; for (i=0; i < (int) s->img_x*target; ++i) { - t = p1[i], p1[i] = p2[i], p2[i] = t; + t = p1[i]; + p1[i] = p2[i]; + p2[i] = t; } } } diff --git a/formats/jpeg/rjpeg.c b/formats/jpeg/rjpeg.c index 0b1f7ea2c6..9ef95e4f08 100644 --- a/formats/jpeg/rjpeg.c +++ b/formats/jpeg/rjpeg.c @@ -2523,7 +2523,10 @@ static uint8_t *rjpeg_load_jpeg_image(rjpeg__jpeg *z, out[i] = y[i]; else for (i=0; i < z->s->img_x; ++i) - *out++ = y[i], *out++ = 255; + { + *out++ = y[i]; + *out++ = 255; + } } } diff --git a/formats/tga/rtga.c b/formats/tga/rtga.c index c96e7ba8f4..f66b2926e0 100644 --- a/formats/tga/rtga.c +++ b/formats/tga/rtga.c @@ -117,7 +117,10 @@ static unsigned char *rtga__convert_format( { case ((1)*8+(2)): for(i=x-1; i >= 0; --i, src += 1, dest += 2) - dest[0]=src[0], dest[1]=255; + { + dest[0]=src[0]; + dest[1]=255; + } break; case ((1)*8+(3)): for(i=x-1; i >= 0; --i, src += 1, dest += 3) @@ -141,7 +144,12 @@ static unsigned char *rtga__convert_format( break; case ((3)*8+(4)): for(i=x-1; i >= 0; --i, src += 3, dest += 4) - dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; + { + dest[0]=src[0]; + dest[1]=src[1]; + dest[2]=src[2]; + dest[3]=255; + } break; case ((3)*8+(1)): for(i=x-1; i >= 0; --i, src += 3, dest += 1) @@ -161,7 +169,11 @@ static unsigned char *rtga__convert_format( break; case ((4)*8+(3)): for(i=x-1; i >= 0; --i, src += 4, dest += 3) - dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; + { + dest[0]=src[0]; + dest[1]=src[1]; + dest[2]=src[2]; + } break; default: break; diff --git a/include/libretro.h b/include/libretro.h index e5c7e58a2d..39f80e03a0 100644 --- a/include/libretro.h +++ b/include/libretro.h @@ -1176,6 +1176,41 @@ struct retro_led_interface * * State will never be saved when using Hard Disable Audio. */ +#define RETRO_ENVIRONMENT_GET_MIDI_INTERFACE (48 | RETRO_ENVIRONMENT_EXPERIMENTAL) + /* struct retro_midi_interface ** -- + * Returns a MIDI interface that can be used for raw data I/O. + */ + +/* Retrieves the current state of the MIDI input. + * Returns true if it's enabled, false otherwise. */ +typedef bool (RETRO_CALLCONV *retro_midi_input_enabled_t)(void); + +/* Retrieves the current state of the MIDI output. + * Returns true if it's enabled, false otherwise */ +typedef bool (RETRO_CALLCONV *retro_midi_output_enabled_t)(void); + +/* Reads next byte from the input stream. + * Returns true if byte is read, false otherwise. */ +typedef bool (RETRO_CALLCONV *retro_midi_read_t)(uint8_t *byte); + +/* Writes byte to the output stream. + * 'delta_time' is in microseconds and represent time elapsed since previous write. + * Returns true if byte is written, false otherwise. */ +typedef bool (RETRO_CALLCONV *retro_midi_write_t)(uint8_t byte, uint32_t delta_time); + +/* Flushes previously written data. + * Returns true if successful, false otherwise. */ +typedef bool (RETRO_CALLCONV *retro_midi_flush_t)(void); + +struct retro_midi_interface +{ + retro_midi_input_enabled_t input_enabled; + retro_midi_output_enabled_t output_enabled; + retro_midi_read_t read; + retro_midi_write_t write; + retro_midi_flush_t flush; +}; + #define RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE (41 | RETRO_ENVIRONMENT_EXPERIMENTAL) /* const struct retro_hw_render_interface ** -- * Returns an API specific rendering interface for accessing API specific data. diff --git a/include/string/stdstring.h b/include/string/stdstring.h index eb2954b825..3d278d7cf2 100644 --- a/include/string/stdstring.h +++ b/include/string/stdstring.h @@ -45,7 +45,10 @@ static INLINE bool string_is_equal(const char *a, const char *b) if (!a || !b) return false; while(*a && (*a == *b)) - a++, b++; + { + a++; + b++; + } return (*(const unsigned char*)a - *(const unsigned char*)b) == 0; } diff --git a/string/stdstring.c b/string/stdstring.c index 6e1555dbfe..71b2ea2442 100644 --- a/string/stdstring.c +++ b/string/stdstring.c @@ -109,7 +109,10 @@ char *string_trim_whitespace_left(char *const s) char *cur = s; while(*cur && isspace((unsigned char)*cur)) - ++cur, --len; + { + ++cur; + --len; + } if(s != cur) memmove(s, cur, len + 1); @@ -128,7 +131,10 @@ char *string_trim_whitespace_right(char *const s) char *cur = s + len - 1; while(cur != s && isspace((unsigned char)*cur)) - --cur, --len; + { + --cur; + --len; + } cur[isspace((unsigned char)*cur) ? 0 : 1] = '\0'; }