Skip to content

Commit 3a36067

Browse files
committed
Update
1 parent f192b7b commit 3a36067

9 files changed

Lines changed: 161 additions & 146 deletions

File tree

audio/resampler/drivers/sinc_resampler.c

Lines changed: 101 additions & 80 deletions
Large diffs are not rendered by default.

cdrom/cdrom.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ void increment_msf(unsigned char *min, unsigned char *sec, unsigned char *frame)
9696
*frame = (*frame < 74) ? (*frame + 1) : 0;
9797
}
9898

99+
#ifdef CDROM_DEBUG
99100
static void cdrom_print_sense_data(const unsigned char *sense, size_t len)
100101
{
101102
unsigned i;
@@ -252,6 +253,7 @@ static void cdrom_print_sense_data(const unsigned char *sense, size_t len)
252253

253254
fflush(stdout);
254255
}
256+
#endif
255257

256258
#if defined(_WIN32) && !defined(_XBOX)
257259
static int cdrom_send_command_win32(const libretro_vfs_implementation_file *stream, CDROM_CMD_Direction dir, void *buf, size_t len, unsigned char *cmd, size_t cmd_len, unsigned char *sense, size_t sense_len)
@@ -519,7 +521,9 @@ static int cdrom_send_command(libretro_vfs_implementation_file *stream, CDROM_CM
519521
}
520522
else
521523
{
524+
#ifdef CDROM_DEBUG
522525
cdrom_print_sense_data(sense, sizeof(sense));
526+
#endif
523527

524528
/* INQUIRY/TEST/SENSE should never fail, don't retry. */
525529
/* READ ATIP seems to fail outright on some drives with pressed discs, skip retries. */
@@ -672,7 +676,9 @@ int cdrom_get_sense(libretro_vfs_implementation_file *stream, unsigned char *sen
672676
if (rv)
673677
return 1;
674678

679+
#ifdef CDROM_DEBUG
675680
cdrom_print_sense_data(buf, sizeof(buf));
681+
#endif
676682

677683
return 0;
678684
}

include/audio/audio_resampler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ typedef unsigned resampler_simd_mask_t;
6767

6868
struct resampler_data
6969
{
70-
const float *data_in;
71-
float *data_out;
70+
const void *data_in;
71+
void *data_out;
7272

7373
size_t input_frames;
7474
size_t output_frames;

queues/task_queue.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static retro_task_t *task_queue_get(task_queue_t *queue)
126126
if (task)
127127
{
128128
queue->front = task->next;
129-
task->next = NULL;
129+
task->next = NULL;
130130
}
131131

132132
return task;
@@ -208,13 +208,8 @@ static void retro_task_regular_reset(void)
208208
task->cancelled = true;
209209
}
210210

211-
static void retro_task_regular_init(void)
212-
{
213-
}
214-
215-
static void retro_task_regular_deinit(void)
216-
{
217-
}
211+
static void retro_task_regular_init(void) { }
212+
static void retro_task_regular_deinit(void) { }
218213

219214
static bool retro_task_regular_find(retro_task_finder_t func, void *user_data)
220215
{
@@ -407,7 +402,7 @@ static bool retro_task_threaded_find(
407402
retro_task_finder_t func, void *user_data)
408403
{
409404
retro_task_t *task = NULL;
410-
bool result = false;
405+
bool result = false;
411406

412407
slock_lock(running_lock);
413408
for (task = tasks_running.front; task; task = task->next)
@@ -442,7 +437,7 @@ static void threaded_worker(void *userdata)
442437
for (;;)
443438
{
444439
retro_task_t *task = NULL;
445-
bool finished = false;
440+
bool finished = false;
446441

447442
if (!worker_continue)
448443
break; /* should we keep running until all tasks finished? */
@@ -598,7 +593,7 @@ void task_queue_check(void)
598593
{
599594
#ifdef HAVE_THREADS
600595
bool current_threaded = (impl_current == &impl_threaded);
601-
bool want_threaded = task_queue_is_threaded();
596+
bool want_threaded = task_threaded_enable;
602597

603598
if (want_threaded != current_threaded)
604599
task_queue_deinit();
@@ -616,7 +611,7 @@ bool task_queue_push(retro_task_t *task)
616611
if (task->type == TASK_TYPE_BLOCKING)
617612
{
618613
retro_task_t *running = NULL;
619-
bool found = false;
614+
bool found = false;
620615

621616
SLOCK_LOCK(queue_lock);
622617
running = tasks_running.front;
@@ -669,7 +664,7 @@ void *task_queue_retriever_info_next(task_retriever_info_t **link)
669664
/* Grab data and move to next link */
670665
if (*link)
671666
{
672-
data = (*link)->data;
667+
data = (*link)->data;
673668
*link = (*link)->next;
674669
}
675670

rthreads/ctr_pthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static INLINE int pthread_cond_wait(pthread_cond_t *cond,
145145
static INLINE int pthread_cond_timedwait(pthread_cond_t *cond,
146146
pthread_mutex_t *mutex, const struct timespec *abstime)
147147
{
148-
while (true)
148+
for (;;)
149149
{
150150
struct timespec now = {0};
151151
/* Missing clock_gettime*/

rthreads/tpool.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static void tpool_worker(void *arg)
104104
tpool_work_t *work = NULL;
105105
tpool_t *tp = (tpool_t*)arg;
106106

107-
while (true)
107+
for (;;)
108108
{
109109
slock_lock(tp->work_mutex);
110110
/* Keep running until told to stop. */
@@ -252,7 +252,8 @@ void tpool_wait(tpool_t *tp)
252252
return;
253253

254254
slock_lock(tp->work_mutex);
255-
while (true)
255+
256+
for (;;)
256257
{
257258
/* working_cond is dual use. It signals when we're not stopping but the
258259
* working_cnt is 0 indicating there isn't any work processing. If we
@@ -262,5 +263,6 @@ void tpool_wait(tpool_t *tp)
262263
else
263264
break;
264265
}
266+
265267
slock_unlock(tp->work_mutex);
266268
}

samples/core_options/example_default/libretro_core_options.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,11 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
166166
char **values_buf = NULL;
167167

168168
/* Determine number of options */
169-
while (true)
169+
for (;;)
170170
{
171-
if (option_defs_us[num_options].key)
172-
num_options++;
173-
else
171+
if (!option_defs_us[num_options].key)
174172
break;
173+
num_options++;
175174
}
176175

177176
/* Allocate arrays */
@@ -198,20 +197,18 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
198197
size_t num_values = 0;
199198

200199
/* Determine number of values */
201-
while (true)
200+
for (;;)
202201
{
203-
if (values[num_values].value)
204-
{
205-
/* Check if this is the default value */
206-
if (default_value)
207-
if (strcmp(values[num_values].value, default_value) == 0)
208-
default_index = num_values;
209-
210-
buf_len += strlen(values[num_values].value);
211-
num_values++;
212-
}
213-
else
202+
if (!values[num_values].value)
214203
break;
204+
205+
/* Check if this is the default value */
206+
if (default_value)
207+
if (strcmp(values[num_values].value, default_value) == 0)
208+
default_index = num_values;
209+
210+
buf_len += strlen(values[num_values].value);
211+
num_values++;
215212
}
216213

217214
/* Build values string */

samples/core_options/example_hide_option/libretro_core_options.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,11 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
187187
* but we'll allocate space for all of them. The difference
188188
* in resource usage is negligible, and this allows us to
189189
* keep the code 'cleaner' */
190-
while (true)
190+
for (;;)
191191
{
192-
if (option_defs_us[num_options].key)
193-
num_options++;
194-
else
192+
if (!option_defs_us[num_options].key)
195193
break;
194+
num_options++;
196195
}
197196

198197
/* Allocate arrays */
@@ -224,20 +223,18 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
224223
size_t num_values = 0;
225224

226225
/* Determine number of values */
227-
while (true)
226+
for (;;)
228227
{
229-
if (values[num_values].value)
230-
{
231-
/* Check if this is the default value */
232-
if (default_value)
233-
if (strcmp(values[num_values].value, default_value) == 0)
234-
default_index = num_values;
235-
236-
buf_len += strlen(values[num_values].value);
237-
num_values++;
238-
}
239-
else
228+
if (!values[num_values].value)
240229
break;
230+
231+
/* Check if this is the default value */
232+
if (default_value)
233+
if (strcmp(values[num_values].value, default_value) == 0)
234+
default_index = num_values;
235+
236+
buf_len += strlen(values[num_values].value);
237+
num_values++;
241238
}
242239

243240
/* Build values string */

samples/core_options/example_translation/libretro_core_options.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,11 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
166166
char **values_buf = NULL;
167167

168168
/* Determine number of options */
169-
while (true)
169+
for (;;)
170170
{
171-
if (option_defs_us[num_options].key)
172-
num_options++;
173-
else
171+
if (!option_defs_us[num_options].key)
174172
break;
173+
num_options++;
175174
}
176175

177176
/* Allocate arrays */
@@ -198,20 +197,18 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
198197
size_t num_values = 0;
199198

200199
/* Determine number of values */
201-
while (true)
200+
for (;;)
202201
{
203-
if (values[num_values].value)
204-
{
205-
/* Check if this is the default value */
206-
if (default_value)
207-
if (strcmp(values[num_values].value, default_value) == 0)
208-
default_index = num_values;
209-
210-
buf_len += strlen(values[num_values].value);
211-
num_values++;
212-
}
213-
else
202+
if (!values[num_values].value)
214203
break;
204+
205+
/* Check if this is the default value */
206+
if (default_value)
207+
if (strcmp(values[num_values].value, default_value) == 0)
208+
default_index = num_values;
209+
210+
buf_len += strlen(values[num_values].value);
211+
num_values++;
215212
}
216213

217214
/* Build values string */

0 commit comments

Comments
 (0)