Skip to content

Commit

Permalink
More static code analysis nits
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Sep 28, 2015
1 parent 6db07f7 commit b1c47d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
14 changes: 5 additions & 9 deletions audio/librsound.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,16 +1002,14 @@ static int rsnd_send_info_query(rsound_t *rd)
// In that case, we read the packet.
static int rsnd_update_server_info(rsound_t *rd)
{

ssize_t rc;

long long int client_ptr = -1;
long long int serv_ptr = -1;
char temp[RSD_PROTO_MAXSIZE + 1] = {0};

// We read until we have the last (most recent) data in the network buffer.
for (;;)
{
ssize_t rc;
const char *substr;
char *tmpstr;
memset(temp, 0, sizeof(temp));
Expand Down Expand Up @@ -1315,21 +1313,19 @@ int rsd_stop(rsound_t *rd)

size_t rsd_write( rsound_t *rsound, const void* buf, size_t size)
{
size_t max_write, written = 0;
assert(rsound != NULL);
if ( !rsound->ready_for_data )
return 0;

size_t result;
size_t max_write = (rsound->buffer_size - rsound->backend_info.chunk_size)/2;

size_t written = 0;
size_t write_size;
max_write = (rsound->buffer_size - rsound->backend_info.chunk_size)/2;

/* Makes sure that we can handle arbitrary large write sizes */

while ( written < size )
{
write_size = (size - written) > max_write ? max_write : (size - written);
size_t result;
size_t write_size = (size - written) > max_write ? max_write : (size - written);
result = rsnd_fill_buffer(rsound, (const char*)buf + written, write_size);

if ( result <= 0 )
Expand Down
13 changes: 8 additions & 5 deletions cores/ffmpeg_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,14 @@ void CORE_PREFIX(retro_reset)(void)

static void check_variables(void)
{
struct retro_variable color_var, var, fft_var, fft_ms_var;

(void)var;
(void)fft_var;
(void)fft_ms_var;
struct retro_variable color_var = {0};
#ifdef HAVE_OPENGL
struct retro_variable var = {0};
#endif
#ifdef HAVE_GL_FFT
struct retro_variable fft_var = {0};
struct retro_variable fft_ms_var = {0};
#endif

#ifdef HAVE_OPENGL
var.key = "ffmpeg_temporal_interp";
Expand Down

0 comments on commit b1c47d6

Please sign in to comment.