Skip to content

Commit

Permalink
Clean up trailing whitespace
Browse files Browse the repository at this point in the history
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
  • Loading branch information
gblues committed Dec 12, 2017
1 parent 767a1f3 commit 6904101
Show file tree
Hide file tree
Showing 765 changed files with 23,368 additions and 23,369 deletions.
76 changes: 38 additions & 38 deletions audio/audio_driver.c
@@ -1,7 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
*
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
Expand Down Expand Up @@ -111,7 +111,7 @@ static const audio_driver_t *audio_drivers[] = {
#endif
#if defined(PSP) || defined(VITA)
&audio_psp,
#endif
#endif
#ifdef _3DS
&audio_ctr_csnd,
&audio_ctr_dsp,
Expand Down Expand Up @@ -150,7 +150,7 @@ static uint64_t audio_driver_free_samples_count = 0;
static size_t audio_driver_buffer_size = 0;
static size_t audio_driver_data_ptr = 0;

static bool audio_driver_control = false;
static bool audio_driver_control = false;
static bool audio_driver_mixer_mute_enable = false;
static bool audio_driver_mute_enable = false;
static bool audio_driver_use_float = false;
Expand Down Expand Up @@ -212,12 +212,12 @@ static void compute_audio_buffer_statistics(void)
accum_var += diff * diff;
}

#if defined(_MSC_VER) && _MSC_VER <= 1200
#if defined(_MSC_VER) && _MSC_VER <= 1200
/* FIXME: error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64 */
#else
stddev = (unsigned)sqrt((double)accum_var / (samples - 2));
avg_filled = 1.0f - (float)avg / audio_driver_buffer_size;
deviation = (float)stddev / audio_driver_buffer_size;
#else
stddev = (unsigned)sqrt((double)accum_var / (samples - 2));
avg_filled = 1.0f - (float)avg / audio_driver_buffer_size;
deviation = (float)stddev / audio_driver_buffer_size;
#endif
low_water_size = (unsigned)(audio_driver_buffer_size * 3 / 4);
high_water_size = (unsigned)(audio_driver_buffer_size / 4);
Expand Down Expand Up @@ -335,13 +335,13 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
size_t max_bufsamples = AUDIO_CHUNK_SIZE_NONBLOCKING * 2;
settings_t *settings = config_get_ptr();
/* Accomodate rewind since at some point we might have two full buffers. */
size_t outsamples_max = AUDIO_CHUNK_SIZE_NONBLOCKING * 2 * AUDIO_MAX_RATIO *
size_t outsamples_max = AUDIO_CHUNK_SIZE_NONBLOCKING * 2 * AUDIO_MAX_RATIO *
settings->floats.slowmotion_ratio;

convert_s16_to_float_init_simd();
convert_float_to_s16_init_simd();

conv_buf = (int16_t*)malloc(outsamples_max
conv_buf = (int16_t*)malloc(outsamples_max
* sizeof(int16_t));
/* Used for recording even if audio isn't enabled. */
retro_assert(conv_buf != NULL);
Expand Down Expand Up @@ -379,9 +379,9 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
if (!audio_init_thread(
&current_audio,
&audio_driver_context_audio_data,
*settings->arrays.audio_device
*settings->arrays.audio_device
? settings->arrays.audio_device : NULL,
settings->uints.audio_out_rate, &new_rate,
settings->uints.audio_out_rate, &new_rate,
settings->uints.audio_latency,
settings->uints.audio_block_frames,
current_audio))
Expand All @@ -393,7 +393,7 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
else
#endif
{
audio_driver_context_audio_data =
audio_driver_context_audio_data =
current_audio->init(*settings->arrays.audio_device ?
settings->arrays.audio_device : NULL,
settings->uints.audio_out_rate,
Expand All @@ -414,7 +414,7 @@ static bool audio_driver_init_internal(bool audio_cb_inited)
}

audio_driver_use_float = false;
if ( audio_driver_active
if ( audio_driver_active
&& current_audio->use_float(audio_driver_context_audio_data))
audio_driver_use_float = true;

Expand Down Expand Up @@ -470,15 +470,15 @@ static bool audio_driver_init_internal(bool audio_cb_inited)

if (
!audio_cb_inited
&& audio_driver_active
&& audio_driver_active
&& settings->bools.audio_rate_control
)
{
/* Audio rate control requires write_avail
* and buffer_size to be implemented. */
if (current_audio->buffer_size)
{
audio_driver_buffer_size =
audio_driver_buffer_size =
current_audio->buffer_size(audio_driver_context_audio_data);
audio_driver_control = true;
}
Expand Down Expand Up @@ -516,8 +516,8 @@ void audio_driver_set_nonblocking_state(bool enable)
audio_driver_context_audio_data,
settings->bools.audio_sync ? enable : true);

audio_driver_chunk_size = enable ?
audio_driver_chunk_nonblock_size :
audio_driver_chunk_size = enable ?
audio_driver_chunk_nonblock_size :
audio_driver_chunk_block_size;
}

Expand All @@ -541,7 +541,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
bool is_slowmotion = false;
const void *output_data = NULL;
unsigned output_frames = 0;
float audio_volume_gain = !audio_driver_mute_enable ?
float audio_volume_gain = !audio_driver_mute_enable ?
audio_driver_volume_gain : 0.0f;

src_data.data_in = NULL;
Expand Down Expand Up @@ -597,7 +597,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
unsigned write_idx = audio_driver_free_samples_count++ &
(AUDIO_BUFFER_FREE_SAMPLES_COUNT - 1);
int half_size = (int)(audio_driver_buffer_size / 2);
int avail =
int avail =
(int)current_audio->write_avail(audio_driver_context_audio_data);
int delta_mid = avail - half_size;
double direction = (double)delta_mid / half_size;
Expand All @@ -610,7 +610,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)

audio_driver_free_samples_buf
[write_idx] = avail;
audio_source_ratio_current =
audio_source_ratio_current =
audio_source_ratio_original * adjust;

#if 0
Expand All @@ -632,9 +632,9 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)

if (audio_mixer_active)
{
bool override = audio_driver_mixer_mute_enable ? true :
bool override = audio_driver_mixer_mute_enable ? true :
(audio_driver_mixer_volume_gain != 0.0f) ? true : false;
float mixer_gain = !audio_driver_mixer_mute_enable ?
float mixer_gain = !audio_driver_mixer_mute_enable ?
audio_driver_mixer_volume_gain : 0.0f;
audio_mixer_mix(audio_driver_output_samples_buf,
src_data.output_frames, mixer_gain, override);
Expand Down Expand Up @@ -679,7 +679,7 @@ void audio_driver_sample(int16_t left, int16_t right)
if (audio_driver_data_ptr < audio_driver_chunk_size)
return;

audio_driver_flush(audio_driver_output_samples_conv_buf,
audio_driver_flush(audio_driver_output_samples_conv_buf,
audio_driver_data_ptr);

audio_driver_data_ptr = 0;
Expand Down Expand Up @@ -710,8 +710,8 @@ size_t audio_driver_sample_batch(const int16_t *data, size_t frames)
* @left : value of the left audio channel.
* @right : value of the right audio channel.
*
* Audio sample render callback function (rewind version).
* This callback function will be used instead of
* Audio sample render callback function (rewind version).
* This callback function will be used instead of
* audio_driver_sample when rewinding is activated.
**/
void audio_driver_sample_rewind(int16_t left, int16_t right)
Expand All @@ -725,9 +725,9 @@ void audio_driver_sample_rewind(int16_t left, int16_t right)
* @data : pointer to audio buffer.
* @frames : amount of audio frames to push.
*
* Batched audio sample render callback function (rewind version).
* Batched audio sample render callback function (rewind version).
*
* This callback function will be used instead of
* This callback function will be used instead of
* audio_driver_sample_batch when rewinding is activated.
*
* Returns: amount of frames sampled. Will be equal to @frames
Expand Down Expand Up @@ -800,9 +800,9 @@ void audio_driver_monitor_adjust_system_rates(void)
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
float video_refresh_rate = settings->floats.video_refresh_rate;
float max_timing_skew = settings->floats.audio_max_timing_skew;
const struct retro_system_timing *info = av_info ?
const struct retro_system_timing *info = av_info ?
(const struct retro_system_timing*)&av_info->timing : NULL;

if (!info || info->sample_rate <= 0.0)
return;

Expand Down Expand Up @@ -882,7 +882,7 @@ bool audio_driver_free_devices_list(void)
if (!current_audio || !current_audio->device_list_free
|| !audio_driver_context_audio_data)
return false;
current_audio->device_list_free(audio_driver_context_audio_data,
current_audio->device_list_free(audio_driver_context_audio_data,
audio_driver_devices_list);
audio_driver_devices_list = NULL;
return true;
Expand Down Expand Up @@ -1003,7 +1003,7 @@ bool audio_driver_mixer_add_stream(audio_mixer_stream_params_t *params)
audio_mixer_stop_cb_t stop_cb = audio_mixer_play_stop_cb;
bool looped = false;
void *buf = NULL;

if (audio_mixer_current_max_idx >= AUDIO_MIXER_MAX_STREAMS)
return false;

Expand Down Expand Up @@ -1132,7 +1132,7 @@ bool audio_driver_set_callback(const void *data)
bool audio_driver_enable_callback(void)
{
if (!audio_callback.callback)
return false;
return false;
if (audio_callback.set_state)
audio_callback.set_state(true);
return true;
Expand All @@ -1152,7 +1152,7 @@ bool audio_driver_disable_callback(void)
void audio_driver_monitor_set_rate(void)
{
settings_t *settings = config_get_ptr();
double new_src_ratio = (double)settings->uints.audio_out_rate /
double new_src_ratio = (double)settings->uints.audio_out_rate /
audio_driver_input;

audio_source_ratio_original = new_src_ratio;
Expand Down Expand Up @@ -1191,16 +1191,16 @@ bool audio_driver_mixer_toggle_mute(void)

static INLINE bool audio_driver_alive(void)
{
if ( current_audio
&& current_audio->alive
if ( current_audio
&& current_audio->alive
&& audio_driver_context_audio_data)
return current_audio->alive(audio_driver_context_audio_data);
return false;
}

bool audio_driver_start(bool is_shutdown)
{
if (!current_audio || !current_audio->start
if (!current_audio || !current_audio->start
|| !audio_driver_context_audio_data)
goto error;
if (!current_audio->start(audio_driver_context_audio_data, is_shutdown))
Expand All @@ -1218,7 +1218,7 @@ bool audio_driver_start(bool is_shutdown)

bool audio_driver_stop(void)
{
if (!current_audio || !current_audio->stop
if (!current_audio || !current_audio->stop
|| !audio_driver_context_audio_data)
return false;
if (!audio_driver_alive())
Expand Down
6 changes: 3 additions & 3 deletions audio/audio_driver.h
@@ -1,7 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
*
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
Expand Down Expand Up @@ -90,7 +90,7 @@ typedef struct audio_driver
/* Is the audio driver currently running? */
bool (*alive)(void *data);

/* Should we care about blocking in audio thread? Fast forwarding.
/* Should we care about blocking in audio thread? Fast forwarding.
*
* If state is true, nonblocking operation is assumed.
* This is typically used for fast-forwarding. If driver cannot
Expand All @@ -103,7 +103,7 @@ typedef struct audio_driver
void (*free)(void *data);

/* Defines if driver will take standard floating point samples,
* or int16_t samples.
* or int16_t samples.
*
* If true is returned, the audio driver is capable of using
* floating point data. This will likely increase performance as the
Expand Down
10 changes: 5 additions & 5 deletions audio/audio_thread_wrapper.c
@@ -1,7 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
*
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
Expand Down Expand Up @@ -56,7 +56,7 @@ static void audio_thread_loop(void *data)
return;

RARCH_LOG("[Audio Thread]: Initializing audio driver.\n");
thr->driver_data = thr->driver->init(thr->device, thr->out_rate, thr->latency,
thr->driver_data = thr->driver->init(thr->device, thr->out_rate, thr->latency,
thr->block_frames, thr->new_rate);
slock_lock(thr->lock);
thr->inited = thr->driver_data ? 1 : -1;
Expand All @@ -68,7 +68,7 @@ static void audio_thread_loop(void *data)
if (thr->inited < 0)
return;

/* Wait until we start to avoid calling
/* Wait until we start to avoid calling
* stop immediately after initialization. */
slock_lock(thr->lock);
while (thr->stopped)
Expand Down Expand Up @@ -188,7 +188,7 @@ static bool audio_thread_stop(void *data)
audio_thread_t *thr = (audio_thread_t*)data;

if (!thr)
return false;
return false;

audio_thread_block(thr);
thr->is_paused = true;
Expand Down Expand Up @@ -274,7 +274,7 @@ static const audio_driver_t audio_thread = {
*
* Starts a audio driver in a new thread.
* Access to audio driver will be mediated through this driver.
* This driver interfaces with audio callback and is
* This driver interfaces with audio callback and is
* only used in that case.
*
* Returns: true (1) if successful, otherwise false (0).
Expand Down
2 changes: 1 addition & 1 deletion audio/audio_thread_wrapper.h
@@ -1,7 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
*
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
Expand Down
4 changes: 2 additions & 2 deletions audio/drivers/alsa.c
@@ -1,7 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
*
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
Expand Down Expand Up @@ -121,7 +121,7 @@ static void *alsa_init(const char *device, unsigned rate, unsigned latency,
if (snd_pcm_hw_params(alsa->pcm, params) < 0)
goto error;

/* Shouldn't have to bother with this,
/* Shouldn't have to bother with this,
* but some drivers are apparently broken. */
if (snd_pcm_hw_params_get_period_size(params, &buffer_size, NULL))
snd_pcm_hw_params_get_period_size_min(params, &buffer_size, NULL);
Expand Down

0 comments on commit 6904101

Please sign in to comment.