Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
d1f70beb
Commit
d1f70beb
authored
Sep 29, 2019
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some Clang warnings.
parent
0d898911
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
miniaudio.h
miniaudio.h
+13
-11
No files found.
miniaudio.h
View file @
d1f70beb
...
@@ -461,13 +461,16 @@ All formats are native-endian.
...
@@ -461,13 +461,16 @@ All formats are native-endian.
extern "C" {
extern "C" {
#endif
#endif
#if defined(_MSC_VER)
#if defined(_MSC_VER)
&& !defined(__clang__)
#pragma warning(push)
#pragma warning(push)
#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */
#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */
#pragma warning(disable:4324) /* structure was padded due to alignment specifier */
#pragma warning(disable:4324) /* structure was padded due to alignment specifier */
#else
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic" /* For ISO C99 doesn't support unnamed structs/unions [-Wpedantic] */
#pragma GCC diagnostic ignored "-Wpedantic" /* For ISO C99 doesn't support unnamed structs/unions [-Wpedantic] */
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wc11-extensions" /* anonymous unions are a C11 extension */
#endif
#endif
#endif
/* Platform/backend detection. */
/* Platform/backend detection. */
...
@@ -509,6 +512,7 @@ extern "C" {
...
@@ -509,6 +512,7 @@ extern "C" {
#if defined(__clang__)
#if defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wlanguage-extension-token"
#pragma GCC diagnostic ignored "-Wlanguage-extension-token"
#pragma GCC diagnostic ignored "-Wlong-long"
#pragma GCC diagnostic ignored "-Wc++11-long-long"
#pragma GCC diagnostic ignored "-Wc++11-long-long"
#endif
#endif
typedef signed __int8 ma_int8;
typedef signed __int8 ma_int8;
...
@@ -765,7 +769,7 @@ typedef int ma_result;
...
@@ -765,7 +769,7 @@ typedef int ma_result;
typedef enum
typedef enum
{
{
ma_stream_format_pcm = 0
,
ma_stream_format_pcm = 0
} ma_stream_format;
} ma_stream_format;
typedef enum
typedef enum
...
@@ -932,10 +936,7 @@ typedef struct
...
@@ -932,10 +936,7 @@ typedef struct
ma_bool32 noNEON : 1;
ma_bool32 noNEON : 1;
ma_src_read_deinterleaved_proc onReadDeinterleaved;
ma_src_read_deinterleaved_proc onReadDeinterleaved;
void* pUserData;
void* pUserData;
union
ma_src_config_sinc sinc;
{
ma_src_config_sinc sinc;
};
} ma_src_config;
} ma_src_config;
MA_ALIGNED_STRUCT(MA_SIMD_ALIGNMENT) ma_src
MA_ALIGNED_STRUCT(MA_SIMD_ALIGNMENT) ma_src
...
@@ -1844,7 +1845,7 @@ typedef enum
...
@@ -1844,7 +1845,7 @@ typedef enum
typedef enum
typedef enum
{
{
ma_share_mode_shared = 0,
ma_share_mode_shared = 0,
ma_share_mode_exclusive
,
ma_share_mode_exclusive
} ma_share_mode;
} ma_share_mode;
typedef union
typedef union
...
@@ -2618,7 +2619,7 @@ MA_ALIGNED_STRUCT(MA_SIMD_ALIGNMENT) ma_device
...
@@ -2618,7 +2619,7 @@ MA_ALIGNED_STRUCT(MA_SIMD_ALIGNMENT) ma_device
#endif
#endif
};
};
};
};
#if defined(_MSC_VER)
#if defined(_MSC_VER)
&& !defined(__clang__)
#pragma warning(pop)
#pragma warning(pop)
#else
#else
#pragma GCC diagnostic pop /* For ISO C99 doesn't support unnamed structs/unions [-Wpedantic] */
#pragma GCC diagnostic pop /* For ISO C99 doesn't support unnamed structs/unions [-Wpedantic] */
...
@@ -4359,7 +4360,7 @@ void ma_split_buffer(void* pBuffer, size_t bufferSize, size_t splitCount, size_t
...
@@ -4359,7 +4360,7 @@ void ma_split_buffer(void* pBuffer, size_t bufferSize, size_t splitCount, size_t
Atomics
Atomics
******************************************************************************/
******************************************************************************/
#if defined(_WIN32) && !defined(__GNUC__)
#if defined(_WIN32) && !defined(__GNUC__)
&& !defined(__clang__)
#define ma_memory_barrier() MemoryBarrier()
#define ma_memory_barrier() MemoryBarrier()
#define ma_atomic_exchange_32(a, b) InterlockedExchange((LONG*)a, (LONG)b)
#define ma_atomic_exchange_32(a, b) InterlockedExchange((LONG*)a, (LONG)b)
#define ma_atomic_exchange_64(a, b) InterlockedExchange64((LONGLONG*)a, (LONGLONG)b)
#define ma_atomic_exchange_64(a, b) InterlockedExchange64((LONGLONG*)a, (LONGLONG)b)
...
@@ -9421,7 +9422,7 @@ ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
...
@@ -9421,7 +9422,7 @@ ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
if (pDevice->playback.shareMode == ma_share_mode_exclusive) {
if (pDevice->playback.shareMode == ma_share_mode_exclusive) {
WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE);
WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE);
} else {
} else {
ma_uint32 prevFramesAvaialablePlayback = (
size_t
)-1;
ma_uint32 prevFramesAvaialablePlayback = (
ma_uint32
)-1;
ma_uint32 framesAvailablePlayback;
ma_uint32 framesAvailablePlayback;
for (;;) {
for (;;) {
result = ma_device__get_available_frames__wasapi(pDevice, (ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &framesAvailablePlayback);
result = ma_device__get_available_frames__wasapi(pDevice, (ma_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &framesAvailablePlayback);
...
@@ -30543,11 +30544,12 @@ void ma_channel_router__do_routing(ma_channel_router* pRouter, ma_uint64 frameCo
...
@@ -30543,11 +30544,12 @@ void ma_channel_router__do_routing(ma_channel_router* pRouter, ma_uint64 frameCo
}
}
}
}
} else if (pRouter->isStereoToMono) {
} else if (pRouter->isStereoToMono) {
ma_uint64 iFrame;
/* Simple case for going from stereo to mono. */
/* Simple case for going from stereo to mono. */
ma_assert(pRouter->config.channelsIn == 2);
ma_assert(pRouter->config.channelsIn == 2);
ma_assert(pRouter->config.channelsOut == 1);
ma_assert(pRouter->config.channelsOut == 1);
ma_uint64 iFrame;
for (iFrame = 0; iFrame < frameCount; ++iFrame) {
for (iFrame = 0; iFrame < frameCount; ++iFrame) {
ppSamplesOut[0][iFrame] = (ppSamplesIn[0][iFrame] + ppSamplesIn[1][iFrame]) * 0.5f;
ppSamplesOut[0][iFrame] = (ppSamplesIn[0][iFrame] + ppSamplesIn[1][iFrame]) * 0.5f;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment