Skip to content

Commit 1c340dd

Browse files
committed
Resync
1 parent c38e69d commit 1c340dd

29 files changed

Lines changed: 192 additions & 221 deletions

audio/audio_mixer.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,56 +73,50 @@ struct audio_mixer_sound
7373
struct
7474
{
7575
/* wav */
76-
unsigned frames;
7776
const float* pcm;
77+
unsigned frames;
7878
} wav;
7979

8080
#ifdef HAVE_STB_VORBIS
8181
struct
8282
{
8383
/* ogg */
84-
unsigned size;
8584
const void* data;
85+
unsigned size;
8686
} ogg;
8787
#endif
8888

8989
#ifdef HAVE_DR_FLAC
9090
struct
9191
{
9292
/* flac */
93-
unsigned size;
9493
const void* data;
94+
unsigned size;
9595
} flac;
9696
#endif
9797

9898
#ifdef HAVE_DR_MP3
9999
struct
100100
{
101101
/* mp */
102-
unsigned size;
103102
const void* data;
103+
unsigned size;
104104
} mp3;
105105
#endif
106106

107107
#ifdef HAVE_IBXM
108108
struct
109109
{
110110
/* mod/s3m/xm */
111-
unsigned size;
112111
const void* data;
112+
unsigned size;
113113
} mod;
114114
#endif
115115
} types;
116116
};
117117

118118
struct audio_mixer_voice
119119
{
120-
bool repeat;
121-
unsigned type;
122-
float volume;
123-
audio_mixer_sound_t *sound;
124-
audio_mixer_stop_cb_t stop_cb;
125-
126120
union
127121
{
128122
struct
@@ -133,61 +127,67 @@ struct audio_mixer_voice
133127
#ifdef HAVE_STB_VORBIS
134128
struct
135129
{
130+
stb_vorbis *stream;
131+
void *resampler_data;
132+
const retro_resampler_t *resampler;
133+
float *buffer;
136134
unsigned position;
137135
unsigned samples;
138136
unsigned buf_samples;
139-
float* buffer;
140137
float ratio;
141-
stb_vorbis *stream;
142-
void *resampler_data;
143-
const retro_resampler_t *resampler;
144138
} ogg;
145139
#endif
146140

147141
#ifdef HAVE_DR_FLAC
148142
struct
149143
{
150-
unsigned position;
151-
unsigned samples;
152-
unsigned buf_samples;
153144
float* buffer;
154-
float ratio;
155145
drflac *stream;
156146
void *resampler_data;
157147
const retro_resampler_t *resampler;
148+
unsigned position;
149+
unsigned samples;
150+
unsigned buf_samples;
151+
float ratio;
158152
} flac;
159153
#endif
160154

161155
#ifdef HAVE_DR_MP3
162156
struct
163157
{
158+
drmp3 stream;
159+
void *resampler_data;
160+
const retro_resampler_t *resampler;
161+
float* buffer;
164162
unsigned position;
165163
unsigned samples;
166164
unsigned buf_samples;
167-
float* buffer;
168165
float ratio;
169-
drmp3 stream;
170-
void *resampler_data;
171-
const retro_resampler_t *resampler;
172166
} mp3;
173167
#endif
174168

175169
#ifdef HAVE_IBXM
176170
struct
177171
{
178-
unsigned position;
179-
unsigned samples;
180-
unsigned buf_samples;
181172
int* buffer;
182173
struct replay* stream;
183174
struct module* module;
175+
unsigned position;
176+
unsigned samples;
177+
unsigned buf_samples;
184178
} mod;
185179
#endif
186180
} types;
181+
audio_mixer_sound_t *sound;
182+
audio_mixer_stop_cb_t stop_cb;
183+
unsigned type;
184+
float volume;
185+
bool repeat;
186+
187187
};
188188

189189
/* TODO/FIXME - static globals */
190-
static struct audio_mixer_voice s_voices[AUDIO_MIXER_MAX_VOICES] = {{0}};
190+
static struct audio_mixer_voice s_voices[AUDIO_MIXER_MAX_VOICES] = {0};
191191
static unsigned s_rate = 0;
192192

193193
#ifdef HAVE_RWAV

audio/resampler/drivers/nearest_resampler.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,9 @@ static void *resampler_nearest_init(const struct resampler_config *config,
6868
{
6969
rarch_nearest_resampler_t *re = (rarch_nearest_resampler_t*)
7070
calloc(1, sizeof(rarch_nearest_resampler_t));
71-
72-
(void)config;
73-
(void)mask;
74-
7571
if (!re)
7672
return NULL;
77-
7873
re->fraction = 0;
79-
8074
return re;
8175
}
8276

audio/resampler/drivers/sinc_resampler.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ enum sinc_window
6767

6868
typedef struct rarch_sinc_resampler
6969
{
70+
/* A buffer for phase_table, buffer_l and buffer_r
71+
* are created in a single calloc().
72+
* Ensure that we get as good cache locality as we can hope for. */
73+
float *main_buffer;
74+
float *phase_table;
75+
float *buffer_l;
76+
float *buffer_r;
7077
unsigned enable_avx;
7178
unsigned phase_bits;
7279
unsigned subphase_bits;
@@ -77,14 +84,6 @@ typedef struct rarch_sinc_resampler
7784
float subphase_mod;
7885
float kaiser_beta;
7986
enum sinc_window window_type;
80-
81-
/* A buffer for phase_table, buffer_l and buffer_r
82-
* are created in a single calloc().
83-
* Ensure that we get as good cache locality as we can hope for. */
84-
float *main_buffer;
85-
float *phase_table;
86-
float *buffer_l;
87-
float *buffer_r;
8887
} rarch_sinc_resampler_t;
8988

9089
#if defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)

file/archive_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ const struct file_archive_file_backend* file_archive_get_file_backend(const char
667667
uint32_t file_archive_get_file_crc32(const char *path)
668668
{
669669
file_archive_transfer_t state;
670-
struct archive_extract_userdata userdata = {{0}};
670+
struct archive_extract_userdata userdata = {0};
671671
bool returnerr = false;
672672
const char *archive_path = NULL;
673673
bool contains_compressed = path_contains_compressed_file(path);

file/archive_file_7z.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
struct sevenzip_context_t
5050
{
51+
uint8_t *output;
5152
CFileInStream archiveStream;
5253
CLookToRead lookStream;
5354
ISzAlloc allocImp;
@@ -58,7 +59,6 @@ struct sevenzip_context_t
5859
uint32_t parse_index;
5960
uint32_t decompress_index;
6061
uint32_t packIndex;
61-
uint8_t *output;
6262
};
6363

6464
static void *sevenzip_stream_alloc_impl(void *p, size_t size)

file/archive_file_zlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ static int64_t zip_file_read(
330330
{
331331
file_archive_transfer_t state = {ARCHIVE_TRANSFER_INIT};
332332
decomp_state_t decomp = {0};
333-
struct archive_extract_userdata userdata = {{0}};
333+
struct archive_extract_userdata userdata = {0};
334334
bool returnerr = true;
335335
int ret = 0;
336336

file/nbio/nbio_linux.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,12 @@
4040

4141
struct nbio_linux_t
4242
{
43-
int fd;
44-
bool busy;
45-
43+
void* ptr;
4644
aio_context_t ctx;
4745
struct iocb cb;
48-
49-
void* ptr;
5046
size_t len;
47+
int fd;
48+
bool busy;
5149
};
5250

5351
/* there's also a Unix AIO thingy, but it's not in glibc

file/nbio/nbio_orbis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@
3131

3232
struct nbio_orbis_t
3333
{
34-
int fd;
3534
void* data;
3635
size_t progress;
3736
size_t len;
37+
int fd;
38+
unsigned int mode;
3839
/*
3940
* possible values:
4041
* NBIO_READ, NBIO_WRITE - obvious
4142
* -1 - currently doing nothing
4243
* -2 - the pointer was reallocated since the last operation
4344
*/
4445
signed char op;
45-
unsigned int mode;
4646
};
4747

4848
static void *nbio_orbis_open(const char * filename, unsigned int mode)

file/nbio/nbio_unixmmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@
5555

5656
struct nbio_mmap_unix_t
5757
{
58+
void* ptr;
59+
size_t len;
5860
int fd;
5961
int map_flags;
60-
size_t len;
61-
void* ptr;
6262
};
6363

6464
static void *nbio_mmap_unix_open(const char * filename, unsigned mode)

file/nbio/nbio_windowsmmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
struct nbio_mmap_win32_t
6464
{
6565
HANDLE file;
66-
bool is_write;
67-
size_t len;
6866
void* ptr;
67+
size_t len;
68+
bool is_write;
6969
};
7070

7171
static void *nbio_mmap_win32_open(const char * filename, unsigned mode)

0 commit comments

Comments
 (0)