Use consistent style for pointer declarations and casts

This commit is contained in:
Sam Lantinga 2025-06-18 09:26:51 -07:00
parent 390fe65323
commit d7939abf42
105 changed files with 339 additions and 346 deletions

View File

@ -87,7 +87,7 @@ static void SDLCALL CleanupHintProperty(void *userdata, void *value)
SDL_free(hint);
}
static const char* GetHintEnvironmentVariable(const char *name)
static const char *GetHintEnvironmentVariable(const char *name)
{
const char *result = SDL_getenv(name);
if (!result && name && *name) {

View File

@ -163,7 +163,7 @@ bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval)
#elif defined(HAVE_GCC_ATOMICS)
return __sync_bool_compare_and_swap(&a->value, oldval, newval);
#elif defined(SDL_PLATFORM_MACOS) // this is deprecated in 10.12 sdk; favor gcc atomics.
return OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t*)&a->value);
return OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t *)&a->value);
#elif defined(SDL_PLATFORM_SOLARIS)
SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(uint_t) == sizeof(a->value));
return ((Uint32)atomic_cas_uint((volatile uint_t *)&a->value, (uint_t)oldval, (uint_t)newval) == oldval);

View File

@ -280,7 +280,7 @@ void ConvertAudio(int num_frames,
// swizzle input to "standard" format if necessary.
if (src_map) {
void* buf = scratch ? scratch : dst; // use scratch if available, since it has to be big enough to hold src, unless it's NULL, then dst has to be.
void *buf = scratch ? scratch : dst; // use scratch if available, since it has to be big enough to hold src, unless it's NULL, then dst has to be.
SwizzleAudio(num_frames, buf, src, src_channels, src_map, src_format);
src = buf;
}
@ -318,7 +318,7 @@ void ConvertAudio(int num_frames,
// get us to float format.
if (srcconvert) {
void* buf = (channelconvert || dstconvert) ? scratch : dst;
void *buf = (channelconvert || dstconvert) ? scratch : dst;
ConvertAudioToFloat((float *) buf, src, num_frames * src_channels, src_format);
src = buf;
}
@ -368,7 +368,7 @@ void ConvertAudio(int num_frames,
channel_converter = override;
}
void* buf = dstconvert ? scratch : dst;
void *buf = dstconvert ? scratch : dst;
channel_converter((float *) buf, (const float *) src, num_frames);
src = buf;
}
@ -399,7 +399,7 @@ static int CalculateMaxFrameSize(SDL_AudioFormat src_format, int src_channels, S
return max_format_size * max_channels;
}
static Sint64 GetAudioStreamResampleRate(SDL_AudioStream* stream, int src_freq, Sint64 resample_offset)
static Sint64 GetAudioStreamResampleRate(SDL_AudioStream *stream, int src_freq, Sint64 resample_offset)
{
src_freq = (int)((float)src_freq * stream->freq_ratio);
@ -778,9 +778,9 @@ static bool CheckAudioStreamIsFullySetup(SDL_AudioStream *stream)
}
// you MUST hold `stream->lock` when calling this, and validate your parameters!
static bool PutAudioStreamBufferInternal(SDL_AudioStream *stream, const SDL_AudioSpec *spec, const int *chmap, const void *buf, int len, SDL_ReleaseAudioBufferCallback callback, void* userdata)
static bool PutAudioStreamBufferInternal(SDL_AudioStream *stream, const SDL_AudioSpec *spec, const int *chmap, const void *buf, int len, SDL_ReleaseAudioBufferCallback callback, void *userdata)
{
SDL_AudioTrack* track = NULL;
SDL_AudioTrack *track = NULL;
if (callback) {
track = SDL_CreateAudioTrack(stream->queue, spec, chmap, (Uint8 *)buf, len, len, callback, userdata);
@ -809,7 +809,7 @@ static bool PutAudioStreamBufferInternal(SDL_AudioStream *stream, const SDL_Audi
return retval;
}
static bool PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int len, SDL_ReleaseAudioBufferCallback callback, void* userdata)
static bool PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int len, SDL_ReleaseAudioBufferCallback callback, void *userdata)
{
#if DEBUG_AUDIOSTREAM
SDL_Log("AUDIOSTREAM: wants to put %d bytes", len);
@ -836,7 +836,7 @@ static bool PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int l
static void SDLCALL FreeAllocatedAudioBuffer(void *userdata, const void *buf, int len)
{
SDL_free((void*) buf);
SDL_free((void *)buf);
}
bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len)
@ -1081,8 +1081,8 @@ static Uint8 *EnsureAudioStreamWorkBufferSize(SDL_AudioStream *stream, size_t ne
return ptr;
}
static Sint64 NextAudioStreamIter(SDL_AudioStream* stream, void** inout_iter,
Sint64* inout_resample_offset, SDL_AudioSpec* out_spec, int **out_chmap, bool* out_flushed)
static Sint64 NextAudioStreamIter(SDL_AudioStream *stream, void **inout_iter,
Sint64 *inout_resample_offset, SDL_AudioSpec *out_spec, int **out_chmap, bool *out_flushed)
{
SDL_AudioSpec spec;
bool flushed;
@ -1136,9 +1136,9 @@ static Sint64 NextAudioStreamIter(SDL_AudioStream* stream, void** inout_iter,
return output_frames;
}
static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream* stream, Sint64* out_resample_offset)
static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream *stream, Sint64 *out_resample_offset)
{
void* iter = SDL_BeginAudioQueueIter(stream->queue);
void *iter = SDL_BeginAudioQueueIter(stream->queue);
Sint64 resample_offset = stream->resample_offset;
Sint64 output_frames = 0;
@ -1160,9 +1160,9 @@ static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream* stream, Sint64* out
return output_frames;
}
static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spec, int **out_chmap, bool* out_flushed)
static Sint64 GetAudioStreamHead(SDL_AudioStream *stream, SDL_AudioSpec *out_spec, int **out_chmap, bool *out_flushed)
{
void* iter = SDL_BeginAudioQueueIter(stream->queue);
void *iter = SDL_BeginAudioQueueIter(stream->queue);
if (!iter) {
SDL_zerop(out_spec);
@ -1178,8 +1178,8 @@ static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spe
// Enough input data MUST be available!
static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int output_frames, float gain)
{
const SDL_AudioSpec* src_spec = &stream->input_spec;
const SDL_AudioSpec* dst_spec = &stream->dst_spec;
const SDL_AudioSpec *src_spec = &stream->input_spec;
const SDL_AudioSpec *dst_spec = &stream->dst_spec;
const SDL_AudioFormat src_format = src_spec->format;
const int src_channels = src_spec->channels;
@ -1199,7 +1199,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
// Not resampling? It's an easy conversion (and maybe not even that!)
if (resample_rate == 0) {
Uint8* work_buffer = NULL;
Uint8 *work_buffer = NULL;
// Ensure we have enough scratch space for any conversions
if ((src_format != dst_format) || (src_channels != dst_channels) || (gain != 1.0f)) {
@ -1269,7 +1269,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
work_buffer_capacity += resample_bytes;
}
Uint8* work_buffer = EnsureAudioStreamWorkBufferSize(stream, work_buffer_capacity);
Uint8 *work_buffer = EnsureAudioStreamWorkBufferSize(stream, work_buffer_capacity);
if (!work_buffer) {
return false;
@ -1281,7 +1281,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
const float postresample_gain = (input_frames > output_frames) ? gain : 1.0f;
// (dst channel map is NULL because we'll do the final swizzle on ConvertAudio after resample.)
const Uint8* input_buffer = SDL_ReadFromAudioQueue(stream->queue,
const Uint8 *input_buffer = SDL_ReadFromAudioQueue(stream->queue,
NULL, resample_format, resample_channels, NULL,
padding_frames, input_frames, padding_frames, work_buffer, preresample_gain);
@ -1292,11 +1292,11 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
input_buffer += padding_frames * resample_frame_size;
// Decide where the resampled output goes
void* resample_buffer = (resample_buffer_offset != -1) ? (work_buffer + resample_buffer_offset) : buf;
void *resample_buffer = (resample_buffer_offset != -1) ? (work_buffer + resample_buffer_offset) : buf;
SDL_ResampleAudio(resample_channels,
(const float *) input_buffer, input_frames,
(float*) resample_buffer, output_frames,
(const float *)input_buffer, input_frames,
(float *)resample_buffer, output_frames,
resample_rate, &stream->resample_offset);
// Convert to the final format, if necessary (src channel map is NULL because SDL_ReadFromAudioQueue already handled this).

View File

@ -185,7 +185,7 @@ static void SDL_Convert_F32_to_S32_Scalar(Sint32 *dst, const float *src, int num
#undef SIGNMASK
static void SDL_Convert_Swap16_Scalar(Uint16* dst, const Uint16* src, int num_samples)
static void SDL_Convert_Swap16_Scalar(Uint16 *dst, const Uint16 *src, int num_samples)
{
int i;
@ -194,7 +194,7 @@ static void SDL_Convert_Swap16_Scalar(Uint16* dst, const Uint16* src, int num_sa
}
}
static void SDL_Convert_Swap32_Scalar(Uint32* dst, const Uint32* src, int num_samples)
static void SDL_Convert_Swap32_Scalar(Uint32 *dst, const Uint32 *src, int num_samples)
{
int i;
@ -375,7 +375,7 @@ static void SDL_TARGETING("sse2") SDL_Convert_F32_to_S8_SSE2(Sint8 *dst, const f
const __m128i bytes = _mm_packus_epi16(shorts0, shorts1);
_mm_store_si128((__m128i*)&dst[i], bytes);
_mm_store_si128((__m128i *)&dst[i], bytes);
})
}
@ -409,7 +409,7 @@ static void SDL_TARGETING("sse2") SDL_Convert_F32_to_U8_SSE2(Uint8 *dst, const f
const __m128i bytes = _mm_packus_epi16(shorts0, shorts1);
_mm_store_si128((__m128i*)&dst[i], bytes);
_mm_store_si128((__m128i *)&dst[i], bytes);
})
}
@ -441,8 +441,8 @@ static void SDL_TARGETING("sse2") SDL_Convert_F32_to_S16_SSE2(Sint16 *dst, const
const __m128i shorts0 = _mm_packs_epi32(ints0, ints1);
const __m128i shorts1 = _mm_packs_epi32(ints2, ints3);
_mm_store_si128((__m128i*)&dst[i], shorts0);
_mm_store_si128((__m128i*)&dst[i + 8], shorts1);
_mm_store_si128((__m128i *)&dst[i], shorts0);
_mm_store_si128((__m128i *)&dst[i + 8], shorts1);
})
}
@ -477,55 +477,55 @@ static void SDL_TARGETING("sse2") SDL_Convert_F32_to_S32_SSE2(Sint32 *dst, const
const __m128i ints2 = _mm_xor_si128(_mm_cvttps_epi32(values3), _mm_castps_si128(_mm_cmpge_ps(values3, limit)));
const __m128i ints3 = _mm_xor_si128(_mm_cvttps_epi32(values4), _mm_castps_si128(_mm_cmpge_ps(values4, limit)));
_mm_store_si128((__m128i*)&dst[i], ints0);
_mm_store_si128((__m128i*)&dst[i + 4], ints1);
_mm_store_si128((__m128i*)&dst[i + 8], ints2);
_mm_store_si128((__m128i*)&dst[i + 12], ints3);
_mm_store_si128((__m128i *)&dst[i], ints0);
_mm_store_si128((__m128i *)&dst[i + 4], ints1);
_mm_store_si128((__m128i *)&dst[i + 8], ints2);
_mm_store_si128((__m128i *)&dst[i + 12], ints3);
})
}
#endif
// FIXME: SDL doesn't have SSSE3 detection, so use the next one up
#ifdef SDL_SSE4_1_INTRINSICS
static void SDL_TARGETING("ssse3") SDL_Convert_Swap16_SSSE3(Uint16* dst, const Uint16* src, int num_samples)
static void SDL_TARGETING("ssse3") SDL_Convert_Swap16_SSSE3(Uint16 *dst, const Uint16 *src, int num_samples)
{
const __m128i shuffle = _mm_set_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);
CONVERT_16_FWD({
dst[i] = SDL_Swap16(src[i]);
}, {
__m128i ints0 = _mm_loadu_si128((const __m128i*)&src[i]);
__m128i ints1 = _mm_loadu_si128((const __m128i*)&src[i + 8]);
__m128i ints0 = _mm_loadu_si128((const __m128i *)&src[i]);
__m128i ints1 = _mm_loadu_si128((const __m128i *)&src[i + 8]);
ints0 = _mm_shuffle_epi8(ints0, shuffle);
ints1 = _mm_shuffle_epi8(ints1, shuffle);
_mm_store_si128((__m128i*)&dst[i], ints0);
_mm_store_si128((__m128i*)&dst[i + 8], ints1);
_mm_store_si128((__m128i *)&dst[i], ints0);
_mm_store_si128((__m128i *)&dst[i + 8], ints1);
})
}
static void SDL_TARGETING("ssse3") SDL_Convert_Swap32_SSSE3(Uint32* dst, const Uint32* src, int num_samples)
static void SDL_TARGETING("ssse3") SDL_Convert_Swap32_SSSE3(Uint32 *dst, const Uint32 *src, int num_samples)
{
const __m128i shuffle = _mm_set_epi8(12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3);
CONVERT_16_FWD({
dst[i] = SDL_Swap32(src[i]);
}, {
__m128i ints0 = _mm_loadu_si128((const __m128i*)&src[i]);
__m128i ints1 = _mm_loadu_si128((const __m128i*)&src[i + 4]);
__m128i ints2 = _mm_loadu_si128((const __m128i*)&src[i + 8]);
__m128i ints3 = _mm_loadu_si128((const __m128i*)&src[i + 12]);
__m128i ints0 = _mm_loadu_si128((const __m128i *)&src[i]);
__m128i ints1 = _mm_loadu_si128((const __m128i *)&src[i + 4]);
__m128i ints2 = _mm_loadu_si128((const __m128i *)&src[i + 8]);
__m128i ints3 = _mm_loadu_si128((const __m128i *)&src[i + 12]);
ints0 = _mm_shuffle_epi8(ints0, shuffle);
ints1 = _mm_shuffle_epi8(ints1, shuffle);
ints2 = _mm_shuffle_epi8(ints2, shuffle);
ints3 = _mm_shuffle_epi8(ints3, shuffle);
_mm_store_si128((__m128i*)&dst[i], ints0);
_mm_store_si128((__m128i*)&dst[i + 4], ints1);
_mm_store_si128((__m128i*)&dst[i + 8], ints2);
_mm_store_si128((__m128i*)&dst[i + 12], ints3);
_mm_store_si128((__m128i *)&dst[i], ints0);
_mm_store_si128((__m128i *)&dst[i + 4], ints1);
_mm_store_si128((__m128i *)&dst[i + 8], ints2);
_mm_store_si128((__m128i *)&dst[i + 12], ints3);
})
}
#endif
@ -774,41 +774,41 @@ static void SDL_Convert_F32_to_S32_NEON(Sint32 *dst, const float *src, int num_s
fesetenv(&fenv);
}
static void SDL_Convert_Swap16_NEON(Uint16* dst, const Uint16* src, int num_samples)
static void SDL_Convert_Swap16_NEON(Uint16 *dst, const Uint16 *src, int num_samples)
{
CONVERT_16_FWD({
dst[i] = SDL_Swap16(src[i]);
}, {
uint8x16_t ints0 = vld1q_u8((const Uint8*)&src[i]);
uint8x16_t ints1 = vld1q_u8((const Uint8*)&src[i + 8]);
uint8x16_t ints0 = vld1q_u8((const Uint8 *)&src[i]);
uint8x16_t ints1 = vld1q_u8((const Uint8 *)&src[i + 8]);
ints0 = vrev16q_u8(ints0);
ints1 = vrev16q_u8(ints1);
vst1q_u8((Uint8*)&dst[i], ints0);
vst1q_u8((Uint8*)&dst[i + 8], ints1);
vst1q_u8((Uint8 *)&dst[i], ints0);
vst1q_u8((Uint8 *)&dst[i + 8], ints1);
})
}
static void SDL_Convert_Swap32_NEON(Uint32* dst, const Uint32* src, int num_samples)
static void SDL_Convert_Swap32_NEON(Uint32 *dst, const Uint32 *src, int num_samples)
{
CONVERT_16_FWD({
dst[i] = SDL_Swap32(src[i]);
}, {
uint8x16_t ints0 = vld1q_u8((const Uint8*)&src[i]);
uint8x16_t ints1 = vld1q_u8((const Uint8*)&src[i + 4]);
uint8x16_t ints2 = vld1q_u8((const Uint8*)&src[i + 8]);
uint8x16_t ints3 = vld1q_u8((const Uint8*)&src[i + 12]);
uint8x16_t ints0 = vld1q_u8((const Uint8 *)&src[i]);
uint8x16_t ints1 = vld1q_u8((const Uint8 *)&src[i + 4]);
uint8x16_t ints2 = vld1q_u8((const Uint8 *)&src[i + 8]);
uint8x16_t ints3 = vld1q_u8((const Uint8 *)&src[i + 12]);
ints0 = vrev32q_u8(ints0);
ints1 = vrev32q_u8(ints1);
ints2 = vrev32q_u8(ints2);
ints3 = vrev32q_u8(ints3);
vst1q_u8((Uint8*)&dst[i], ints0);
vst1q_u8((Uint8*)&dst[i + 4], ints1);
vst1q_u8((Uint8*)&dst[i + 8], ints2);
vst1q_u8((Uint8*)&dst[i + 12], ints3);
vst1q_u8((Uint8 *)&dst[i], ints0);
vst1q_u8((Uint8 *)&dst[i + 4], ints1);
vst1q_u8((Uint8 *)&dst[i + 8], ints2);
vst1q_u8((Uint8 *)&dst[i + 12], ints3);
})
}
@ -839,8 +839,8 @@ static void (*SDL_Convert_F32_to_U8)(Uint8 *dst, const float *src, int num_sampl
static void (*SDL_Convert_F32_to_S16)(Sint16 *dst, const float *src, int num_samples) = NULL;
static void (*SDL_Convert_F32_to_S32)(Sint32 *dst, const float *src, int num_samples) = NULL;
static void (*SDL_Convert_Swap16)(Uint16* dst, const Uint16* src, int num_samples) = NULL;
static void (*SDL_Convert_Swap32)(Uint32* dst, const Uint32* src, int num_samples) = NULL;
static void (*SDL_Convert_Swap16)(Uint16 *dst, const Uint16 *src, int num_samples) = NULL;
static void (*SDL_Convert_Swap32)(Uint32 *dst, const Uint32 *src, int num_samples) = NULL;
void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SDL_AudioFormat src_fmt)
{
@ -858,7 +858,7 @@ void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SDL_Audio
break;
case SDL_AUDIO_S16 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
SDL_Convert_Swap16((Uint16*) dst, (const Uint16*) src, num_samples);
SDL_Convert_Swap16((Uint16 *)dst, (const Uint16 *)src, num_samples);
SDL_Convert_S16_to_F32(dst, (const Sint16 *) dst, num_samples);
break;
@ -867,12 +867,12 @@ void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SDL_Audio
break;
case SDL_AUDIO_S32 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) src, num_samples);
SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)src, num_samples);
SDL_Convert_S32_to_F32(dst, (const Sint32 *) dst, num_samples);
break;
case SDL_AUDIO_F32 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) src, num_samples);
SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)src, num_samples);
break;
default: SDL_assert(!"Unexpected audio format!"); break;
@ -896,7 +896,7 @@ void ConvertAudioFromFloat(void *dst, const float *src, int num_samples, SDL_Aud
case SDL_AUDIO_S16 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
SDL_Convert_F32_to_S16((Sint16 *) dst, src, num_samples);
SDL_Convert_Swap16((Uint16*) dst, (const Uint16*) dst, num_samples);
SDL_Convert_Swap16((Uint16 *)dst, (const Uint16 *)dst, num_samples);
break;
case SDL_AUDIO_S32:
@ -905,22 +905,22 @@ void ConvertAudioFromFloat(void *dst, const float *src, int num_samples, SDL_Aud
case SDL_AUDIO_S32 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
SDL_Convert_F32_to_S32((Sint32 *) dst, src, num_samples);
SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) dst, num_samples);
SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)dst, num_samples);
break;
case SDL_AUDIO_F32 ^ SDL_AUDIO_MASK_BIG_ENDIAN:
SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) src, num_samples);
SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)src, num_samples);
break;
default: SDL_assert(!"Unexpected audio format!"); break;
}
}
void ConvertAudioSwapEndian(void* dst, const void* src, int num_samples, int bitsize)
void ConvertAudioSwapEndian(void *dst, const void *src, int num_samples, int bitsize)
{
switch (bitsize) {
case 16: SDL_Convert_Swap16((Uint16*) dst, (const Uint16*) src, num_samples); break;
case 32: SDL_Convert_Swap32((Uint32*) dst, (const Uint32*) src, num_samples); break;
case 16: SDL_Convert_Swap16((Uint16 *)dst, (const Uint16 *)src, num_samples); break;
case 32: SDL_Convert_Swap32((Uint32 *)dst, (const Uint32 *)src, num_samples); break;
default: SDL_assert(!"Unexpected audio format!"); break;
}
}

View File

@ -112,7 +112,7 @@ extern void SDL_AudioThreadFinalize(SDL_AudioDevice *device);
extern void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SDL_AudioFormat src_fmt);
extern void ConvertAudioFromFloat(void *dst, const float *src, int num_samples, SDL_AudioFormat dst_fmt);
extern void ConvertAudioSwapEndian(void* dst, const void* src, int num_samples, int bitsize);
extern void ConvertAudioSwapEndian(void *dst, const void *src, int num_samples, int bitsize);
extern bool SDL_ChannelMapIsDefault(const int *map, int channels);
extern bool SDL_ChannelMapIsBogus(const int *map, int channels);
@ -121,7 +121,7 @@ extern bool SDL_ChannelMapIsBogus(const int *map, int channels);
extern void ConvertAudio(int num_frames,
const void *src, SDL_AudioFormat src_format, int src_channels, const int *src_map,
void *dst, SDL_AudioFormat dst_format, int dst_channels, const int *dst_map,
void* scratch, float gain);
void *scratch, float gain);
// Compare two SDL_AudioSpecs, return true if they match exactly.
// Using SDL_memcmp directly isn't safe, since potential padding might not be initialized.
@ -201,7 +201,7 @@ struct SDL_AudioQueue; // forward decl.
struct SDL_AudioStream
{
SDL_Mutex* lock;
SDL_Mutex *lock;
SDL_PropertiesID props;
@ -217,7 +217,7 @@ struct SDL_AudioStream
float freq_ratio;
float gain;
struct SDL_AudioQueue* queue;
struct SDL_AudioQueue *queue;
SDL_AudioSpec input_spec; // The spec of input data currently being processed
int *input_chmap;

View File

@ -87,7 +87,7 @@ static int (*ALSA_snd_device_name_free_hint)(void **);
static snd_pcm_sframes_t (*ALSA_snd_pcm_avail)(snd_pcm_t *);
static size_t (*ALSA_snd_ctl_card_info_sizeof)(void);
static size_t (*ALSA_snd_pcm_info_sizeof)(void);
static int (*ALSA_snd_card_next)(int*);
static int (*ALSA_snd_card_next)(int *);
static int (*ALSA_snd_ctl_open)(snd_ctl_t **,const char *,int);
static int (*ALSA_snd_ctl_close)(snd_ctl_t *);
static int (*ALSA_snd_ctl_card_info)(snd_ctl_t *, snd_ctl_card_info_t *);
@ -670,7 +670,7 @@ static void swizzle_map_compute(const struct ALSA_pcm_cfg_ctx *ctx, int *swizzle
static int alsa_chmap_install(struct ALSA_pcm_cfg_ctx *ctx, const unsigned int *chmap)
{
bool isstack;
snd_pcm_chmap_t *chmap_to_install = (snd_pcm_chmap_t*)SDL_small_alloc(unsigned int, 1 + ctx->chans_n, &isstack);
snd_pcm_chmap_t *chmap_to_install = (snd_pcm_chmap_t *)SDL_small_alloc(unsigned int, 1 + ctx->chans_n, &isstack);
if (!chmap_to_install) {
return -1;
}
@ -1214,7 +1214,7 @@ static int hotplug_device_process(snd_ctl_t *ctl, snd_ctl_card_info_t *ctl_card_
unsigned int subdev_idx = 0;
const bool recording = direction == SND_PCM_STREAM_CAPTURE ? true : false; // used for the unicity of the device
bool isstack;
snd_pcm_info_t *pcm_info = (snd_pcm_info_t*)SDL_small_alloc(Uint8, ALSA_snd_pcm_info_sizeof(), &isstack);
snd_pcm_info_t *pcm_info = (snd_pcm_info_t *)SDL_small_alloc(Uint8, ALSA_snd_pcm_info_sizeof(), &isstack);
SDL_memset(pcm_info, 0, ALSA_snd_pcm_info_sizeof());
while (true) {
@ -1453,10 +1453,10 @@ static void ALSA_DetectDevices(SDL_AudioDevice **default_playback, SDL_AudioDevi
bool has_default_playback = false, has_default_recording = false;
ALSA_HotplugIteration(&has_default_playback, &has_default_recording); // run once now before a thread continues to check.
if (has_default_playback) {
*default_playback = SDL_AddAudioDevice(/*recording=*/false, "ALSA default playback device", NULL, (void*)&default_playback_handle);
*default_playback = SDL_AddAudioDevice(/*recording=*/false, "ALSA default playback device", NULL, (void *)&default_playback_handle);
}
if (has_default_recording) {
*default_recording = SDL_AddAudioDevice(/*recording=*/true, "ALSA default recording device", NULL, (void*)&default_recording_handle);
*default_recording = SDL_AddAudioDevice(/*recording=*/true, "ALSA default recording device", NULL, (void *)&default_recording_handle);
}
#if SDL_ALSA_HOTPLUG_THREAD

View File

@ -56,7 +56,7 @@ static bool EMSCRIPTENAUDIO_PlayDevice(SDL_AudioDevice *device, const Uint8 *buf
}
for (var j = 0; j < $1; ++j) {
channelData[j] = HEAPF32[buf + (j*numChannels + c)];
channelData[j] = HEAPF32[buf + (j * numChannels + c)];
}
}
}, buffer, buffer_size / framelen);

View File

@ -546,7 +546,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
// Need to parse the parameters to get the sample rate
for (i = 0; i < info->n_params; ++i) {
pw_node_enum_params((struct pw_node*)node->proxy, 0, info->params[i].id, 0, 0, NULL);
pw_node_enum_params((struct pw_node *)node->proxy, 0, info->params[i].id, 0, 0, NULL);
}
hotplug_core_sync(node);

View File

@ -750,7 +750,7 @@ static bool mgmtthrtask_PrepDevice(void *userdata)
// Try querying IAudioClient3 if sharemode is AUDCLNT_SHAREMODE_SHARED
if (sharemode == AUDCLNT_SHAREMODE_SHARED) {
IAudioClient3 *client3 = NULL;
ret = IAudioClient_QueryInterface(client, &SDL_IID_IAudioClient3, (void**)&client3);
ret = IAudioClient_QueryInterface(client, &SDL_IID_IAudioClient3, (void **)&client3);
if (SUCCEEDED(ret)) {
UINT32 default_period_in_frames = 0;
UINT32 fundamental_period_in_frames = 0;

View File

@ -239,7 +239,7 @@ static void COREMEDIA_CloseDevice(SDL_Camera *device)
hidden.session = nil;
[session stopRunning];
[session removeInput:[session.inputs objectAtIndex:0]];
[session removeOutput:(AVCaptureVideoDataOutput*)[session.outputs objectAtIndex:0]];
[session removeOutput:(AVCaptureVideoDataOutput *)[session.outputs objectAtIndex:0]];
session = nil;
}

View File

@ -675,7 +675,7 @@ static HRESULT GetDefaultStride(IMFMediaType *pType, LONG *plStride)
LONG lStride = 0;
// Try to get the default stride from the media type.
HRESULT ret = IMFMediaType_GetUINT32(pType, &SDL_MF_MT_DEFAULT_STRIDE, (UINT32*)&lStride);
HRESULT ret = IMFMediaType_GetUINT32(pType, &SDL_MF_MT_DEFAULT_STRIDE, (UINT32 *)&lStride);
if (FAILED(ret)) {
// Attribute not set. Try to calculate the default stride.
@ -1001,7 +1001,7 @@ static void MaybeAddDevice(IMFActivate *activation)
if (name && symlink) {
IMFMediaSource *source = NULL;
// "activating" here only creates an object, it doesn't open the actual camera hardware or start recording.
HRESULT ret = IMFActivate_ActivateObject(activation, &SDL_IID_IMFMediaSource, (void**)&source);
HRESULT ret = IMFActivate_ActivateObject(activation, &SDL_IID_IMFMediaSource, (void **)&source);
if (SUCCEEDED(ret) && source) {
CameraFormatAddData add_data;
GatherCameraSpecs(source, &add_data);

View File

@ -838,7 +838,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
if (!(info->params[i].flags & SPA_PARAM_INFO_READ))
continue;
res = pw_node_enum_params((struct pw_node*)g->proxy,
res = pw_node_enum_params((struct pw_node *)g->proxy,
++SPA_PARAMS_INFO_SEQ(info->params[i]), id, 0, -1, NULL);
if (SPA_RESULT_IS_ASYNC(res))
SPA_PARAMS_INFO_SEQ(info->params[i]) = res;

View File

@ -193,7 +193,7 @@ static SDL_CameraFrameResult V4L2_AcquireFrame(SDL_Camera *device, SDL_Surface *
*timestampNS = (((Uint64) buf.timestamp.tv_sec) * SDL_NS_PER_SECOND) + SDL_US_TO_NS(buf.timestamp.tv_usec);
#if DEBUG_CAMERA
SDL_Log("CAMERA: debug mmap: image %d/%d data[0]=%p", buf.index, device->hidden->nb_buffers, (void*)frame->pixels);
SDL_Log("CAMERA: debug mmap: image %d/%d data[0]=%p", buf.index, device->hidden->nb_buffers, (void *)frame->pixels);
#endif
break;
@ -230,7 +230,7 @@ static SDL_CameraFrameResult V4L2_AcquireFrame(SDL_Camera *device, SDL_Surface *
return SDL_CAMERA_FRAME_ERROR;
}
frame->pixels = (void*)buf.m.userptr;
frame->pixels = (void *)buf.m.userptr;
if (device->hidden->driver_pitch) {
frame->pitch = device->hidden->driver_pitch;
} else {
@ -241,7 +241,7 @@ static SDL_CameraFrameResult V4L2_AcquireFrame(SDL_Camera *device, SDL_Surface *
*timestampNS = (((Uint64) buf.timestamp.tv_sec) * SDL_NS_PER_SECOND) + SDL_US_TO_NS(buf.timestamp.tv_usec);
#if DEBUG_CAMERA
SDL_Log("CAMERA: debug userptr: image %d/%d data[0]=%p", buf.index, device->hidden->nb_buffers, (void*)frame->pixels);
SDL_Log("CAMERA: debug userptr: image %d/%d data[0]=%p", buf.index, device->hidden->nb_buffers, (void *)frame->pixels);
#endif
break;

View File

@ -93,7 +93,7 @@ static void MaybeAddDevice(Sint32 devid)
GatherCameraSpecs(devid, &add_data, &fullname, &position);
if (add_data.num_specs > 0) {
SDL_AddCamera(fullname, position, add_data.num_specs, add_data.specs, (void*)devid);
SDL_AddCamera(fullname, position, add_data.num_specs, add_data.specs, (void *)devid);
}
SDL_free(fullname);
@ -102,7 +102,7 @@ static void MaybeAddDevice(Sint32 devid)
static SceUID imbUid = -1;
static void freeBuffers(SceCameraInfo* info)
static void freeBuffers(SceCameraInfo *info)
{
if (imbUid != -1) {
sceKernelFreeMemBlock(imbUid);
@ -118,7 +118,7 @@ static bool VITACAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec
return SDL_SetError("Only one camera can be active");
}
SceCameraInfo* info = (SceCameraInfo*)SDL_calloc(1, sizeof(SceCameraInfo));
SceCameraInfo *info = (SceCameraInfo *)SDL_calloc(1, sizeof(SceCameraInfo));
info->size = sizeof(SceCameraInfo);
info->priority = SCE_CAMERA_PRIORITY_SHARE;
@ -139,12 +139,12 @@ static bool VITACAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec
info->format = SCE_CAMERA_FORMAT_YUV420_PLANE;
info->pitch = 0; // same size surface
info->sizeIBase = spec->width*spec->height;;
info->sizeIBase = spec->width * spec->height;;
info->sizeUBase = ((spec->width+1)/2) * ((spec->height+1) / 2);
info->sizeVBase = ((spec->width+1)/2) * ((spec->height+1) / 2);
// PHYCONT memory size *must* be a multiple of 1MB, we can just always spend 2MB, since we don't use PHYCONT anywhere else
imbUid = sceKernelAllocMemBlock("CameraI", SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW, 2*1024*1024 , NULL);
imbUid = sceKernelAllocMemBlock("CameraI", SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW, 2 * 1024 * 1024 , NULL);
if (imbUid < 0)
{
return SDL_SetError("sceKernelAllocMemBlock error: 0x%08X", imbUid);
@ -179,7 +179,7 @@ static void VITACAMERA_CloseDevice(SDL_Camera *device)
if (device->hidden) {
sceCameraStop((int)device->handle);
sceCameraClose((int)device->handle);
freeBuffers((SceCameraInfo*)device->hidden);
freeBuffers((SceCameraInfo *)device->hidden);
SDL_free(device->hidden);
}
}
@ -205,7 +205,7 @@ static SDL_CameraFrameResult VITACAMERA_AcquireFrame(SDL_Camera *device, SDL_Sur
*timestampNS = read.timestamp;
SceCameraInfo* info = (SceCameraInfo*)(device->hidden);
SceCameraInfo *info = (SceCameraInfo *)(device->hidden);
frame->pitch = info->width;
frame->pixels = SDL_aligned_alloc(SDL_GetSIMDAlignment(), info->sizeIBase + info->sizeUBase + info->sizeVBase);

View File

@ -119,7 +119,7 @@ void *SDL_GetAndroidActivity(void)
}
SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidCachePath(void);
const char* SDL_GetAndroidCachePath(void)
const char *SDL_GetAndroidCachePath(void)
{
SDL_Unsupported();
return NULL;
@ -127,7 +127,7 @@ const char* SDL_GetAndroidCachePath(void)
SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void);
const char* SDL_GetAndroidExternalStoragePath(void)
const char *SDL_GetAndroidExternalStoragePath(void)
{
SDL_Unsupported();
return NULL;
@ -172,7 +172,7 @@ bool SDL_SendAndroidMessage(Uint32 command, int param)
}
SDL_DECLSPEC bool SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset);
bool SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset)
bool SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset)
{
(void)message;
(void)duration;

View File

@ -2691,7 +2691,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeFileDialog)(
// Convert fileList to string
size_t count = (*env)->GetArrayLength(env, fileList);
char **charFileList = SDL_calloc(count + 1, sizeof(char*));
char **charFileList = SDL_calloc(count + 1, sizeof(char *));
if (charFileList == NULL) {
mAndroidFileDialogData.callback(mAndroidFileDialogData.userdata, NULL, -1);
@ -2747,7 +2747,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeFileDialog)(
}
bool Android_JNI_OpenFileDialog(
SDL_DialogFileCallback callback, void* userdata,
SDL_DialogFileCallback callback, void *userdata,
const SDL_DialogFileFilter *filters, int nfilters, bool forwrite,
bool multiple)
{

View File

@ -151,7 +151,7 @@ bool SDL_IsAndroidTablet(void);
bool SDL_IsAndroidTV(void);
// File Dialogs
bool Android_JNI_OpenFileDialog(SDL_DialogFileCallback callback, void* userdata,
bool Android_JNI_OpenFileDialog(SDL_DialogFileCallback callback, void *userdata,
const SDL_DialogFileFilter *filters, int nfilters, bool forwrite,
bool multiple);

View File

@ -324,7 +324,7 @@ void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, bool muted)
{
}
void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data)
void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void *), void *release_callback_data, void (*acquire_callback)(void *), void *acquire_callback_data)
{
}

View File

@ -82,7 +82,7 @@ extern "C" SDL_BLooper *SDL_Looper;
class SDL_BLooper : public BLooper
{
public:
SDL_BLooper(const char* name) : BLooper(name)
SDL_BLooper(const char *name) : BLooper(name)
{
#ifdef SDL_VIDEO_OPENGL
_current_context = NULL;

View File

@ -56,7 +56,7 @@ const char *SDL_signature = "application/x-SDL-executable";
// Create a descendant of BApplication
class SDL_BApp : public BApplication {
public:
SDL_BApp(const char* signature) :
SDL_BApp(const char *signature) :
BApplication(signature) {
}
@ -65,7 +65,7 @@ public:
}
virtual void RefsReceived(BMessage* message) {
virtual void RefsReceived(BMessage *message) {
entry_ref entryRef;
for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) {
BPath referencePath = BPath(&entryRef);

View File

@ -287,8 +287,8 @@ static void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_event, int udev_cl
}
#endif // SDL_USE_LIBUDEV
void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data,
void (*acquire_callback)(void*), void *acquire_callback_data)
void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void *), void *release_callback_data,
void (*acquire_callback)(void *), void *acquire_callback_data)
{
SDL_EVDEV_kbd_set_vt_switch_callbacks(_this->kbd,
release_callback, release_callback_data,

View File

@ -30,8 +30,8 @@ struct input_event;
extern bool SDL_EVDEV_Init(void);
extern void SDL_EVDEV_Quit(void);
extern void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data,
void (*acquire_callback)(void*), void *acquire_callback_data);
extern void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void *), void *release_callback_data,
void (*acquire_callback)(void *), void *acquire_callback_data);
extern int SDL_EVDEV_GetDeviceCount(int device_class);
extern void SDL_EVDEV_Poll(void);
extern Uint64 SDL_EVDEV_GetEventTimestamp(struct input_event *event);

View File

@ -495,7 +495,7 @@ void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, bool muted)
state->muted = muted;
}
void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data)
void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void *), void *release_callback_data, void (*acquire_callback)(void *), void *acquire_callback_data)
{
if (state == NULL) {
return;
@ -978,7 +978,7 @@ void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, bool muted)
{
}
void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data)
void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void *), void *release_callback_data, void (*acquire_callback)(void *), void *acquire_callback_data)
{
}

View File

@ -27,7 +27,7 @@ typedef struct SDL_EVDEV_keyboard_state SDL_EVDEV_keyboard_state;
extern SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void);
extern void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, bool muted);
extern void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data);
extern void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void *), void *release_callback_data, void (*acquire_callback)(void *), void *acquire_callback_data);
extern void SDL_EVDEV_kbd_update(SDL_EVDEV_keyboard_state *state);
extern void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode, int down);
extern void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state);

View File

@ -224,7 +224,7 @@ bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *pr
struct stat statbuf;
char type;
struct udev_device *dev;
const char* val;
const char *val;
int class_temp;
if (!_this) {

View File

@ -58,13 +58,13 @@ static void ReactivateAfterDialog(void)
void SDL_SYS_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_DialogFileCallback callback, void *userdata, SDL_PropertiesID props)
{
SDL_Window* window = SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, NULL);
SDL_Window *window = SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, NULL);
SDL_DialogFileFilter *filters = SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_FILTERS_POINTER, NULL);
int nfilters = (int) SDL_GetNumberProperty(props, SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER, 0);
bool allow_many = SDL_GetBooleanProperty(props, SDL_PROP_FILE_DIALOG_MANY_BOOLEAN, false);
const char* default_location = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_LOCATION_STRING, NULL);
const char* title = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_TITLE_STRING, NULL);
const char* accept = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_ACCEPT_STRING, NULL);
const char *default_location = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_LOCATION_STRING, NULL);
const char *title = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_TITLE_STRING, NULL);
const char *accept = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_ACCEPT_STRING, NULL);
if (filters) {
const char *msg = validate_filters(filters, nfilters);
@ -170,7 +170,7 @@ void SDL_SYS_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_DialogFil
[dialog beginSheetModalForWindow:w completionHandler:^(NSInteger result) {
if (result == NSModalResponseOK) {
if (dialog_as_open) {
NSArray* urls = [dialog_as_open URLs];
NSArray *urls = [dialog_as_open URLs];
const char *files[[urls count] + 1];
for (int i = 0; i < [urls count]; i++) {
files[i] = [[[urls objectAtIndex:i] path] UTF8String];
@ -191,7 +191,7 @@ void SDL_SYS_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_DialogFil
} else {
if ([dialog runModal] == NSModalResponseOK) {
if (dialog_as_open) {
NSArray* urls = [dialog_as_open URLs];
NSArray *urls = [dialog_as_open URLs];
const char *files[[urls count] + 1];
for (int i = 0; i < [urls count]; i++) {
files[i] = [[[urls objectAtIndex:i] path] UTF8String];

View File

@ -163,7 +163,7 @@ public:
case B_CANCEL: // Whenever the dialog is closed (Cancel but also after Open and Save)
{
nFiles = m_files.size();
const char* files[nFiles + 1];
const char *files[nFiles + 1];
for (int i = 0; i < nFiles; i++) {
files[i] = m_files[i].c_str();
}
@ -194,14 +194,14 @@ private:
void SDL_SYS_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_DialogFileCallback callback, void *userdata, SDL_PropertiesID props)
{
SDL_Window* window = (SDL_Window*) SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, NULL);
SDL_DialogFileFilter* filters = (SDL_DialogFileFilter*) SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_FILTERS_POINTER, NULL);
SDL_Window *window = (SDL_Window *)SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, NULL);
SDL_DialogFileFilter *filters = (SDL_DialogFileFilter *)SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_FILTERS_POINTER, NULL);
int nfilters = (int) SDL_GetNumberProperty(props, SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER, 0);
bool many = SDL_GetBooleanProperty(props, SDL_PROP_FILE_DIALOG_MANY_BOOLEAN, false);
const char* location = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_LOCATION_STRING, NULL);
const char* title = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_TITLE_STRING, NULL);
const char* accept = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_ACCEPT_STRING, NULL);
const char* cancel = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_CANCEL_STRING, NULL);
const char *location = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_LOCATION_STRING, NULL);
const char *title = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_TITLE_STRING, NULL);
const char *accept = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_ACCEPT_STRING, NULL);
const char *cancel = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_CANCEL_STRING, NULL);
bool modal = !!window;
@ -222,7 +222,7 @@ void SDL_SYS_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_DialogFil
};
if (!SDL_InitBeApp()) {
char* err = SDL_strdup(SDL_GetError());
char *err = SDL_strdup(SDL_GetError());
SDL_SetError("Couldn't init Be app: %s", err);
SDL_free(err);
callback(userdata, NULL, -1);

View File

@ -288,12 +288,12 @@ void SDL_Portal_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_Dialog
const char *method;
const char *method_title;
SDL_Window* window = SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, NULL);
SDL_Window *window = SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, NULL);
SDL_DialogFileFilter *filters = SDL_GetPointerProperty(props, SDL_PROP_FILE_DIALOG_FILTERS_POINTER, NULL);
int nfilters = (int) SDL_GetNumberProperty(props, SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER, 0);
bool allow_many = SDL_GetBooleanProperty(props, SDL_PROP_FILE_DIALOG_MANY_BOOLEAN, false);
const char* default_location = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_LOCATION_STRING, NULL);
const char* accept = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_ACCEPT_STRING, NULL);
const char *default_location = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_LOCATION_STRING, NULL);
const char *accept = SDL_GetStringProperty(props, SDL_PROP_FILE_DIALOG_ACCEPT_STRING, NULL);
bool open_folders = false;
switch (type) {

View File

@ -277,7 +277,7 @@ void windows_ShowFileDialog(void *ptr)
while (*file_ptr) {
nfiles++;
char **new_cfl = (char **) SDL_realloc(chosen_files_list, sizeof(char*) * (nfiles + 1));
char **new_cfl = (char **) SDL_realloc(chosen_files_list, sizeof(char *) * (nfiles + 1));
if (!new_cfl) {
for (size_t i = 0; i < nfiles - 1; i++) {
@ -327,7 +327,7 @@ void windows_ShowFileDialog(void *ptr)
// If the user chose only one file, it's all just one string
if (nfiles == 0) {
nfiles++;
char **new_cfl = (char **) SDL_realloc(chosen_files_list, sizeof(char*) * (nfiles + 1));
char **new_cfl = (char **) SDL_realloc(chosen_files_list, sizeof(char *) * (nfiles + 1));
if (!new_cfl) {
SDL_free(chosen_files_list);
@ -348,7 +348,7 @@ void windows_ShowFileDialog(void *ptr)
}
}
callback(userdata, (const char * const*) chosen_files_list, getFilterIndex(dialog.nFilterIndex));
callback(userdata, (const char * const *) chosen_files_list, getFilterIndex(dialog.nFilterIndex));
for (size_t i = 0; i < nfiles; i++) {
SDL_free(chosen_files_list[i]);
@ -443,11 +443,11 @@ void windows_ShowFolderDialog(void *ptr)
SHGetPathFromIDListW(lpItem, buffer);
char *chosen_file = WIN_StringToUTF8W(buffer);
const char *files[2] = { chosen_file, NULL };
callback(userdata, (const char * const*) files, -1);
callback(userdata, (const char * const *) files, -1);
SDL_free(chosen_file);
} else {
const char *files[1] = { NULL };
callback(userdata, (const char * const*) files, -1);
callback(userdata, (const char * const *) files, -1);
}
}

View File

@ -136,7 +136,7 @@ char *SDL_SYS_GetUserFolder(SDL_Folder folder)
return NULL;
#else
char *result = NULL;
const char* base;
const char *base;
NSArray *array;
NSSearchPathDirectory dir;
NSString *str;

View File

@ -111,7 +111,7 @@ char *SDL_SYS_GetPrefPath(const char *org, const char *app)
return NULL;
}
folderPath = (char*) SDL_malloc(MAX_PATH);
folderPath = (char *)SDL_malloc(MAX_PATH);
do {
result = XGameSaveFilesGetFolderWithUiResult(&block, MAX_PATH, folderPath);
} while (result == E_PENDING);

View File

@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
extern void NGAGE_GetAppPath(char* path);
extern void NGAGE_GetAppPath(char *path);
char *SDL_SYS_GetBasePath(void)
{

View File

@ -37,7 +37,7 @@ extern "C" {
extern "C" {
#endif
void NGAGE_GetAppPath(char* path)
void NGAGE_GetAppPath(char *path)
{
TBuf<512> aPath;
@ -50,7 +50,7 @@ void NGAGE_GetAppPath(char* path)
CnvUtfConverter::ConvertFromUnicodeToUtf8(utf8Path, aPath);
// Copy UTF-8 data to the provided char* buffer.
strncpy(path, (const char*)utf8Path.Ptr(), utf8Path.Length());
strncpy(path, (const char *)utf8Path.Ptr(), utf8Path.Length());
path[utf8Path.Length()] = '\0';
// Replace backslashes with forward slashes.

View File

@ -377,7 +377,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
if (!config_home || config_home[0] == 0)
{
l = SDL_strlen (home_dir) + SDL_strlen ("/.config/user-dirs.dirs") + 1;
config_file = (char*) SDL_malloc (l);
config_file = (char *)SDL_malloc (l);
if (!config_file)
goto error;
@ -387,7 +387,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
else
{
l = SDL_strlen (config_home) + SDL_strlen ("/user-dirs.dirs") + 1;
config_file = (char*) SDL_malloc (l);
config_file = (char *)SDL_malloc (l);
if (!config_file)
goto error;
@ -449,7 +449,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
if (relative)
{
l = SDL_strlen (home_dir) + 1 + SDL_strlen (p) + 1;
user_dir = (char*) SDL_malloc (l);
user_dir = (char *)SDL_malloc (l);
if (!user_dir)
goto error2;
@ -458,7 +458,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
}
else
{
user_dir = (char*) SDL_malloc (SDL_strlen (p) + 1);
user_dir = (char *)SDL_malloc (SDL_strlen (p) + 1);
if (!user_dir)
goto error2;
@ -503,7 +503,7 @@ static char *xdg_user_dir_lookup (const char *type)
// Special case desktop for historical compatibility
if (SDL_strcmp(type, "DESKTOP") == 0) {
size_t length = SDL_strlen(home_dir) + SDL_strlen("/Desktop") + 1;
user_dir = (char*) SDL_malloc(length);
user_dir = (char *)SDL_malloc(length);
if (!user_dir)
return NULL;

View File

@ -1954,7 +1954,7 @@ void SDL_BindGPUVertexSamplers(
if (RENDERPASS_DEVICE->debug_mode) {
CHECK_RENDERPASS
if (!((CommandBufferCommonHeader*)RENDERPASS_COMMAND_BUFFER)->ignore_render_pass_texture_validation)
if (!((CommandBufferCommonHeader *)RENDERPASS_COMMAND_BUFFER)->ignore_render_pass_texture_validation)
{
CHECK_SAMPLER_TEXTURES
}
@ -2050,7 +2050,7 @@ void SDL_BindGPUFragmentSamplers(
if (RENDERPASS_DEVICE->debug_mode) {
CHECK_RENDERPASS
if (!((CommandBufferCommonHeader*)RENDERPASS_COMMAND_BUFFER)->ignore_render_pass_texture_validation) {
if (!((CommandBufferCommonHeader *)RENDERPASS_COMMAND_BUFFER)->ignore_render_pass_texture_validation) {
CHECK_SAMPLER_TEXTURES
}

View File

@ -1210,7 +1210,7 @@ static ID3D12CommandQueue *s_CommandQueue;
#if defined(SDL_PLATFORM_XBOXONE)
// These are not defined in d3d12_x.h.
typedef HRESULT (D3DAPI* PFN_D3D12_XBOX_CREATE_DEVICE)(_In_opt_ IGraphicsUnknown*, _In_ const D3D12XBOX_CREATE_DEVICE_PARAMETERS*, _In_ REFIID, _Outptr_opt_ void**);
typedef HRESULT (D3DAPI* PFN_D3D12_XBOX_CREATE_DEVICE)(_In_opt_ IGraphicsUnknown *, _In_ const D3D12XBOX_CREATE_DEVICE_PARAMETERS*, _In_ REFIID, _Outptr_opt_ void **);
#define D3D12_STANDARD_MULTISAMPLE_PATTERN DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN
#endif
@ -2212,15 +2212,15 @@ static D3D12StagingDescriptorPool *D3D12_INTERNAL_CreateStagingDescriptorPool(
return NULL;
}
D3D12StagingDescriptorPool *pool = (D3D12StagingDescriptorPool*) SDL_calloc(1, sizeof(D3D12StagingDescriptorPool));
D3D12StagingDescriptorPool *pool = (D3D12StagingDescriptorPool *)SDL_calloc(1, sizeof(D3D12StagingDescriptorPool));
pool->heapCount = 1;
pool->heaps = (D3D12DescriptorHeap**) SDL_malloc(sizeof(D3D12DescriptorHeap*));
pool->heaps = (D3D12DescriptorHeap **)SDL_malloc(sizeof(D3D12DescriptorHeap *));
pool->heaps[0] = heap;
pool->freeDescriptorCapacity = STAGING_HEAP_DESCRIPTOR_COUNT;
pool->freeDescriptorCount = STAGING_HEAP_DESCRIPTOR_COUNT;
pool->freeDescriptors = (D3D12StagingDescriptor*) SDL_malloc(STAGING_HEAP_DESCRIPTOR_COUNT * sizeof(D3D12StagingDescriptor));
pool->freeDescriptors = (D3D12StagingDescriptor *)SDL_malloc(STAGING_HEAP_DESCRIPTOR_COUNT * sizeof(D3D12StagingDescriptor));
for (Uint32 i = 0; i < STAGING_HEAP_DESCRIPTOR_COUNT; i += 1) {
pool->freeDescriptors[i].pool = pool;
@ -2250,12 +2250,12 @@ static bool D3D12_INTERNAL_ExpandStagingDescriptorPool(
}
pool->heapCount += 1;
pool->heaps = (D3D12DescriptorHeap**) SDL_realloc(pool->heaps, pool->heapCount * sizeof(D3D12DescriptorHeap*));
pool->heaps = (D3D12DescriptorHeap **)SDL_realloc(pool->heaps, pool->heapCount * sizeof(D3D12DescriptorHeap *));
pool->heaps[pool->heapCount - 1] = heap;
pool->freeDescriptorCapacity += STAGING_HEAP_DESCRIPTOR_COUNT;
pool->freeDescriptorCount += STAGING_HEAP_DESCRIPTOR_COUNT;
pool->freeDescriptors = (D3D12StagingDescriptor*) SDL_realloc(pool->freeDescriptors, pool->freeDescriptorCapacity * sizeof(D3D12StagingDescriptor));
pool->freeDescriptors = (D3D12StagingDescriptor *)SDL_realloc(pool->freeDescriptors, pool->freeDescriptorCapacity * sizeof(D3D12StagingDescriptor));
for (Uint32 i = 0; i < STAGING_HEAP_DESCRIPTOR_COUNT; i += 1) {
pool->freeDescriptors[i].pool = pool;
@ -7521,7 +7521,7 @@ static bool D3D12_INTERNAL_AcquireSwapchainTexture(
1,
&barrierDesc);
*swapchainTexture = (SDL_GPUTexture*)&windowData->textureContainers[swapchainIndex];
*swapchainTexture = (SDL_GPUTexture *)&windowData->textureContainers[swapchainIndex];
return true;
}
@ -7933,7 +7933,7 @@ static bool D3D12_Submit(
ID3D12Resource_Release(windowData->textureContainers[presentData->swapchainImageIndex].activeTexture->resource);
#endif
windowData->inFlightFences[windowData->frameCounter] = (SDL_GPUFence*)d3d12CommandBuffer->inFlightFence;
windowData->inFlightFences[windowData->frameCounter] = (SDL_GPUFence *)d3d12CommandBuffer->inFlightFence;
(void)SDL_AtomicIncRef(&d3d12CommandBuffer->inFlightFence->referenceCount);
windowData->frameCounter = (windowData->frameCounter + 1) % renderer->allowedFramesInFlight;
}

View File

@ -3297,7 +3297,7 @@ static void SDLCALL VULKAN_INTERNAL_GraphicsPipelineResourceLayoutHashDestroy(vo
VulkanRenderer *renderer = (VulkanRenderer *)userdata;
VulkanGraphicsPipelineResourceLayout *resourceLayout = (VulkanGraphicsPipelineResourceLayout *)value;
VULKAN_INTERNAL_DestroyGraphicsPipelineResourceLayout(renderer, resourceLayout);
SDL_free((void*)key);
SDL_free((void *)key);
}
static Uint32 SDLCALL VULKAN_INTERNAL_ComputePipelineResourceLayoutHashFunction(void *userdata, const void *key)
@ -3328,7 +3328,7 @@ static void SDLCALL VULKAN_INTERNAL_ComputePipelineResourceLayoutHashDestroy(voi
VulkanRenderer *renderer = (VulkanRenderer *)userdata;
VulkanComputePipelineResourceLayout *resourceLayout = (VulkanComputePipelineResourceLayout *)value;
VULKAN_INTERNAL_DestroyComputePipelineResourceLayout(renderer, resourceLayout);
SDL_free((void*)key);
SDL_free((void *)key);
}
static Uint32 SDLCALL VULKAN_INTERNAL_DescriptorSetLayoutHashFunction(void *userdata, const void *key)
@ -3361,7 +3361,7 @@ static void SDLCALL VULKAN_INTERNAL_DescriptorSetLayoutHashDestroy(void *userdat
VulkanRenderer *renderer = (VulkanRenderer *)userdata;
DescriptorSetLayout *layout = (DescriptorSetLayout *)value;
VULKAN_INTERNAL_DestroyDescriptorSetLayout(renderer, layout);
SDL_free((void*)key);
SDL_free((void *)key);
}
static Uint32 SDLCALL VULKAN_INTERNAL_CommandPoolHashFunction(void *userdata, const void *key)
@ -10111,7 +10111,7 @@ static SDL_GPUTextureFormat VULKAN_GetSwapchainTextureFormat(
SDL_GPURenderer *driverData,
SDL_Window *window)
{
VulkanRenderer *renderer = (VulkanRenderer*)driverData;
VulkanRenderer *renderer = (VulkanRenderer *)driverData;
WindowData *windowData = VULKAN_INTERNAL_FetchWindowData(window);
if (windowData == NULL) {
@ -10622,7 +10622,7 @@ static bool VULKAN_Submit(
if (presentResult == VK_SUCCESS || presentResult == VK_SUBOPTIMAL_KHR || presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
// If presenting, the swapchain is using the in-flight fence
presentData->windowData->inFlightFences[presentData->windowData->frameCounter] = (SDL_GPUFence*)vulkanCommandBuffer->inFlightFence;
presentData->windowData->inFlightFences[presentData->windowData->frameCounter] = (SDL_GPUFence *)vulkanCommandBuffer->inFlightFence;
(void)SDL_AtomicIncRef(&vulkanCommandBuffer->inFlightFence->referenceCount);
if (presentResult == VK_SUBOPTIMAL_KHR || presentResult == VK_ERROR_OUT_OF_DATE_KHR) {

View File

@ -319,7 +319,7 @@ private:
hid_buffer_entry *m_pFree;
};
static jbyteArray NewByteArray( JNIEnv* env, const uint8_t *pData, size_t nDataLen )
static jbyteArray NewByteArray( JNIEnv *env, const uint8_t *pData, size_t nDataLen )
{
jbyteArray array = env->NewByteArray( (jsize)nDataLen );
jbyte *pBuf = env->GetByteArrayElements( array, NULL );
@ -333,7 +333,7 @@ static char *CreateStringFromJString( JNIEnv *env, const jstring &sString )
{
size_t nLength = env->GetStringUTFLength( sString );
const char *pjChars = env->GetStringUTFChars( sString, NULL );
char *psString = (char*)malloc( nLength + 1 );
char *psString = (char *)malloc( nLength + 1 );
SDL_memcpy( psString, pjChars, nLength );
psString[ nLength ] = '\0';
env->ReleaseStringUTFChars( sString, pjChars );
@ -344,7 +344,7 @@ static wchar_t *CreateWStringFromJString( JNIEnv *env, const jstring &sString )
{
size_t nLength = env->GetStringLength( sString );
const jchar *pjChars = env->GetStringChars( sString, NULL );
wchar_t *pwString = (wchar_t*)malloc( ( nLength + 1 ) * sizeof( wchar_t ) );
wchar_t *pwString = (wchar_t *)malloc( ( nLength + 1 ) * sizeof( wchar_t ) );
wchar_t *pwChars = pwString;
for ( size_t iIndex = 0; iIndex < nLength; ++iIndex )
{
@ -358,7 +358,7 @@ static wchar_t *CreateWStringFromJString( JNIEnv *env, const jstring &sString )
static wchar_t *CreateWStringFromWString( const wchar_t *pwSrc )
{
size_t nLength = SDL_wcslen( pwSrc );
wchar_t *pwString = (wchar_t*)malloc( ( nLength + 1 ) * sizeof( wchar_t ) );
wchar_t *pwString = (wchar_t *)malloc( ( nLength + 1 ) * sizeof( wchar_t ) );
SDL_memcpy( pwString, pwSrc, nLength * sizeof( wchar_t ) );
pwString[ nLength ] = '\0';
return pwString;
@ -997,7 +997,7 @@ JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceInputReport)(J
hid_device_ref<CHIDDevice> pDevice = FindDevice( nDeviceID );
if ( pDevice )
{
pDevice->ProcessInput( reinterpret_cast< const uint8_t* >( pBuf ), nBufSize );
pDevice->ProcessInput( reinterpret_cast< const uint8_t * >( pBuf ), nBufSize );
}
env->ReleaseByteArrayElements(value, pBuf, 0);
@ -1013,7 +1013,7 @@ JNIEXPORT void JNICALL HID_DEVICE_MANAGER_JAVA_INTERFACE(HIDDeviceReportResponse
hid_device_ref<CHIDDevice> pDevice = FindDevice( nDeviceID );
if ( pDevice )
{
pDevice->ProcessReportResponse( reinterpret_cast< const uint8_t* >( pBuf ), nBufSize );
pDevice->ProcessReportResponse( reinterpret_cast< const uint8_t * >( pBuf ), nBufSize );
}
env->ReleaseByteArrayElements(value, pBuf, 0);
@ -1375,7 +1375,7 @@ int hid_get_report_descriptor(hid_device *device, unsigned char *buf, size_t buf
return -1;
}
HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *device)
HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *device)
{
return NULL;
}

View File

@ -50,7 +50,7 @@ static void *ioring_handle = NULL;
SDL_IORING_FUNC(BOOL, IsIoRingOpSupported, (HIORING ioRing, IORING_OP_CODE op)) \
SDL_IORING_FUNC(HRESULT, CreateIoRing, (IORING_VERSION ioringVersion, IORING_CREATE_FLAGS flags, UINT32 submissionQueueSize, UINT32 completionQueueSize, HIORING* h)) \
SDL_IORING_FUNC(HRESULT, GetIoRingInfo, (HIORING ioRing, IORING_INFO* info)) \
SDL_IORING_FUNC(HRESULT, SubmitIoRing, (HIORING ioRing, UINT32 waitOperations, UINT32 milliseconds, UINT32* submittedEntries)) \
SDL_IORING_FUNC(HRESULT, SubmitIoRing, (HIORING ioRing, UINT32 waitOperations, UINT32 milliseconds, UINT32 * submittedEntries)) \
SDL_IORING_FUNC(HRESULT, CloseIoRing, (HIORING ioRing)) \
SDL_IORING_FUNC(HRESULT, PopIoRingCompletion, (HIORING ioRing, IORING_CQE* cqe)) \
SDL_IORING_FUNC(HRESULT, SetIoRingCompletionEvent, (HIORING ioRing, HANDLE hEvent)) \

View File

@ -209,8 +209,8 @@ static GAMEINPUT_InternalDevice *GAMEINPUT_InternalFindByIndex(int idx)
static void CALLBACK GAMEINPUT_InternalJoystickDeviceCallback(
_In_ GameInputCallbackToken callbackToken,
_In_ void* context,
_In_ IGameInputDevice* device,
_In_ void *context,
_In_ IGameInputDevice *device,
_In_ uint64_t timestamp,
_In_ GameInputDeviceStatus currentStatus,
_In_ GameInputDeviceStatus previousStatus)
@ -697,7 +697,7 @@ static void GAMEINPUT_JoystickUpdate(SDL_Joystick *joystick)
GAMEINPUT_UpdatePowerInfo(joystick, device);
}
static void GAMEINPUT_JoystickClose(SDL_Joystick* joystick)
static void GAMEINPUT_JoystickClose(SDL_Joystick *joystick)
{
GAMEINPUT_InternalJoystickHwdata *hwdata = joystick->hwdata;

View File

@ -901,7 +901,7 @@ static bool GIP_ParseDeviceMetadata(GIP_Metadata *metadata, const Uint8 *bytes,
}
if (buffer_offset > 0) {
device->num_preferred_types = bytes[buffer_offset];
device->preferred_types = SDL_calloc(device->num_preferred_types, sizeof(char*));
device->preferred_types = SDL_calloc(device->num_preferred_types, sizeof(char *));
buffer_offset++;
for (i = 0; i < device->num_preferred_types; i++) {
if (buffer_offset + 2 >= length) {
@ -1013,7 +1013,7 @@ static bool GIP_ParseMessageMetadata(GIP_MessageMetadata *metadata, const Uint8
return true;
}
static bool GIP_ParseMetadata(GIP_Metadata *metadata, const Uint8* bytes, int num_bytes)
static bool GIP_ParseMetadata(GIP_Metadata *metadata, const Uint8 *bytes, int num_bytes)
{
int header_size;
int metadata_size;
@ -2427,7 +2427,7 @@ static void GIP_ReceivePacket(GIP_Device *device, const Uint8 *bytes, int num_by
Uint16 bytes_remaining = 0;
bool is_fragment;
Uint8 attachment_index;
GIP_Attachment* attachment;
GIP_Attachment *attachment;
if (num_bytes < 5) {
return;

View File

@ -94,7 +94,7 @@ bool SDL_HasMainCallbacks(void)
return false;
}
SDL_AppResult SDL_InitMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
SDL_AppResult SDL_InitMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
SDL_main_iteration_callback = appiter;
SDL_main_event_callback = appevent;

View File

@ -24,7 +24,7 @@
* If not, you can special case it here by appending || defined(__YOUR_PLATFORM__) */
#if ( !defined(SDL_MAIN_NEEDED) && !defined(SDL_MAIN_AVAILABLE) ) || defined(SDL_PLATFORM_ANDROID)
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
(void)reserved;
@ -32,7 +32,7 @@ int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserv
{
// make sure argv isn't NULL, in case some user code doesn't like that
static char dummyargv0[] = { 'S', 'D', 'L', '_', 'a', 'p', 'p', '\0' };
static char* argvdummy[2] = { dummyargv0, NULL };
static char *argvdummy[2] = { dummyargv0, NULL };
argc = 1;
argv = argvdummy;
}

View File

@ -34,7 +34,7 @@ static void EmscriptenInternalMainloop(void)
}
}
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
const SDL_AppResult rc = SDL_InitMainCallbacks(argc, argv, appinit, appiter, appevent, appquit);
if (rc == SDL_APP_CONTINUE) {

View File

@ -26,7 +26,7 @@
EM_JS_DEPS(sdlrunapp, "$dynCall,$stringToNewUTF8");
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
(void)reserved;

View File

@ -40,7 +40,7 @@ static BOOL OutOfMemory(void)
/* Gets the arguments with GetCommandLine, converts them to argc and argv
and calls SDL_main */
extern "C"
int SDL_RunApp(int, char**, SDL_main_func mainFunction, void *reserved)
int SDL_RunApp(int, char **, SDL_main_func mainFunction, void *reserved)
{
LPWSTR *argvw;
char **argv;

View File

@ -51,7 +51,7 @@ static SDL_AppResult GenericIterateMainCallbacks(void)
return SDL_IterateMainCallbacks(!iterate_after_waitevent);
}
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
SDL_AppResult rc = SDL_InitMainCallbacks(argc, argv, appinit, appiter, appevent, appquit);
if (rc == 0) {

View File

@ -64,7 +64,7 @@ static SDLIosMainCallbacksDisplayLink *globalDisplayLink;
// SDL_RunApp will land in UIApplicationMain, which calls SDL_main from postFinishLaunch, which calls this.
// When we return from here, we're living in the RunLoop, and a CADisplayLink is firing regularly for us.
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
SDL_AppResult rc = SDL_InitMainCallbacks(argc, argv, appinit, appiter, appevent, appquit);
if (rc == SDL_APP_CONTINUE) {

View File

@ -25,7 +25,7 @@
#include <3ds.h>
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
int result;
// init

View File

@ -22,7 +22,7 @@
#ifdef SDL_PLATFORM_NGAGE
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
// Intentionally does nothing; Callbacks are called using the RunL() method.
return 0;

View File

@ -24,10 +24,10 @@ extern "C" {
#include "SDL_internal.h"
extern SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]);
extern SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event);
extern SDL_AppResult SDL_AppIterate(void* appstate);
extern void SDL_AppQuit(void* appstate, SDL_AppResult result);
extern SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]);
extern SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event);
extern SDL_AppResult SDL_AppIterate(void *appstate);
extern void SDL_AppQuit(void *appstate, SDL_AppResult result);
#ifdef __cplusplus
}
@ -48,14 +48,14 @@ GLDEF_C TInt E32Main()
{
// Get args and environment.
int argc = 1;
char* argv[] = { "game", NULL };
char** envp = NULL;
char *argv[] = { "game", NULL };
char **envp = NULL;
// Create lvalue variables for __crt0 arguments.
char** argv_lvalue = argv;
char** envp_lvalue = envp;
char **argv_lvalue = argv;
char **envp_lvalue = envp;
CTrapCleanup* cleanup = CTrapCleanup::New();
CTrapCleanup *cleanup = CTrapCleanup::New();
if (!cleanup)
{
return KErrNoMemory;
@ -63,7 +63,7 @@ GLDEF_C TInt E32Main()
TRAPD(err,
{
CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
CActiveScheduler *scheduler = new (ELeave) CActiveScheduler();
CleanupStack::PushL(scheduler);
CActiveScheduler::Install(scheduler);
@ -77,7 +77,7 @@ GLDEF_C TInt E32Main()
__crt0(argc, argv_lvalue, envp_lvalue);
// Increase heap size.
RHeap* newHeap = User::ChunkHeap(NULL, 7500000, 7500000, KMinHeapGrowBy);
RHeap *newHeap = User::ChunkHeap(NULL, 7500000, 7500000, KMinHeapGrowBy);
if (!newHeap)
{
SDL_Log("Error: Failed to create new heap");
@ -85,7 +85,7 @@ GLDEF_C TInt E32Main()
}
CleanupStack::PushL(newHeap);
RHeap* oldHeap = User::SwitchHeap(newHeap);
RHeap *oldHeap = User::SwitchHeap(newHeap);
TInt targetLatency = 225;
InitAudio(&targetLatency);
@ -101,7 +101,7 @@ GLDEF_C TInt E32Main()
CleanupStack::PushL(gRenderer);
// Create and start the SDL main runner.
CSDLmain* mainApp = CSDLmain::NewL();
CSDLmain *mainApp = CSDLmain::NewL();
CleanupStack::PushL(mainApp);
mainApp->Start();
@ -125,9 +125,9 @@ GLDEF_C TInt E32Main()
return err;
}
CSDLmain* CSDLmain::NewL()
CSDLmain *CSDLmain::NewL()
{
CSDLmain* self = new (ELeave) CSDLmain();
CSDLmain *self = new (ELeave) CSDLmain();
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
@ -149,7 +149,7 @@ CSDLmain::~CSDLmain()
void CSDLmain::Start()
{
SetActive();
TRequestStatus* status = &iStatus;
TRequestStatus *status = &iStatus;
User::RequestComplete(status, KErrNone);
}

View File

@ -28,7 +28,7 @@
class CSDLmain : public CActive
{
public:
static CSDLmain* NewL();
static CSDLmain *NewL();
~CSDLmain();
void Start();

View File

@ -64,7 +64,7 @@ static void deinit_drivers(void)
deinit_ps2_filesystem_driver();
}
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
int res;
(void)reserved;

View File

@ -69,7 +69,7 @@ int sdl_psp_setup_callbacks(void)
return thid;
}
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
(void)reserved;
sdl_psp_setup_callbacks();

View File

@ -36,7 +36,7 @@ static int OutOfMemory(void)
return -1;
}
int MINGW32_FORCEALIGN SDL_RunApp(int _argc, char* _argv[], SDL_main_func mainFunction, void * reserved)
int MINGW32_FORCEALIGN SDL_RunApp(int _argc, char *_argv[], SDL_main_func mainFunction, void * reserved)
{
/* Gets the arguments with GetCommandLine, converts them to argc and argv
and calls SDL_main */

View File

@ -1512,7 +1512,7 @@ static void D3D12_FreeSRVIndex(SDL_Renderer *renderer, SIZE_T index)
static bool GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D12Resource **texture)
{
IUnknown *unknown = (IUnknown*)SDL_GetPointerProperty(props, name, NULL);
IUnknown *unknown = (IUnknown *)SDL_GetPointerProperty(props, name, NULL);
if (unknown) {
#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
HRESULT result = unknown->QueryInterface(D3D_GUID(SDL_IID_ID3D12Resource), (void **)texture);

View File

@ -48,10 +48,10 @@ void ApplyColorMod(void *dest, void *source, int pitch, int width, int height, S
}
}
void ApplyFlip(void* dest, void* source, int pitch, int width, int height, SDL_FlipMode flip)
void ApplyFlip(void *dest, void *source, int pitch, int width, int height, SDL_FlipMode flip)
{
TUint16* src_pixels = static_cast<TUint16*>(source);
TUint16* dst_pixels = static_cast<TUint16*>(dest);
TUint16 *src_pixels = static_cast<TUint16 *>(source);
TUint16 *dst_pixels = static_cast<TUint16 *>(dest);
for (int y = 0; y < height; ++y)
{
@ -75,10 +75,10 @@ void ApplyFlip(void* dest, void* source, int pitch, int width, int height, SDL_F
}
}
void ApplyRotation(void* dest, void* source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed angle)
void ApplyRotation(void *dest, void *source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed angle)
{
TUint16* src_pixels = static_cast<TUint16*>(source);
TUint16* dst_pixels = static_cast<TUint16*>(dest);
TUint16 *src_pixels = static_cast<TUint16 *>(source);
TUint16 *dst_pixels = static_cast<TUint16 *>(dest);
TFixed cos_angle = 0;
TFixed sin_angle = 0;
@ -117,10 +117,10 @@ void ApplyRotation(void* dest, void* source, int pitch, int width, int height, T
}
}
void ApplyScale(void* dest, void* source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed scale_x, TFixed scale_y)
void ApplyScale(void *dest, void *source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed scale_x, TFixed scale_y)
{
TUint16* src_pixels = static_cast<TUint16*>(source);
TUint16* dst_pixels = static_cast<TUint16*>(dest);
TUint16 *src_pixels = static_cast<TUint16 *>(source);
TUint16 *dst_pixels = static_cast<TUint16 *>(dest);
for (int y = 0; y < height; ++y)
{

View File

@ -24,9 +24,9 @@
#include <3dtypes.h>
void ApplyColorMod(void* dest, void* source, int pitch, int width, int height, SDL_FColor color);
void ApplyFlip(void* dest, void* source, int pitch, int width, int height, SDL_FlipMode flip);
void ApplyRotation(void* dest, void* source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed angle);
void ApplyScale(void* dest, void* source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed scale_x, TFixed scale_y);
void ApplyColorMod(void *dest, void *source, int pitch, int width, int height, SDL_FColor color);
void ApplyFlip(void *dest, void *source, int pitch, int width, int height, SDL_FlipMode flip);
void ApplyRotation(void *dest, void *source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed angle);
void ApplyScale(void *dest, void *source, int pitch, int width, int height, TFixed center_x, TFixed center_y, TFixed scale_x, TFixed scale_y);
#endif // ngage_video_render_ops_hpp

View File

@ -1607,7 +1607,7 @@ static VkSemaphore VULKAN_CreateSemaphore(VULKAN_RenderData *rendererData)
return semaphore;
}
static bool VULKAN_DeviceExtensionsFound(VULKAN_RenderData *rendererData, int extensionsToCheck, const char* const* extNames)
static bool VULKAN_DeviceExtensionsFound(VULKAN_RenderData *rendererData, int extensionsToCheck, const char * const *extNames)
{
uint32_t extensionCount;
bool foundExtensions = true;
@ -2364,7 +2364,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
}
// Create descriptor pools - start by allocating one per swapchain image, let it grow if more are needed
rendererData->descriptorPools = (VkDescriptorPool **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VkDescriptorPool*));
rendererData->descriptorPools = (VkDescriptorPool **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VkDescriptorPool *));
rendererData->numDescriptorPools = (uint32_t *)SDL_calloc(rendererData->swapchainImageCount, sizeof(uint32_t));
for (uint32_t i = 0; i < rendererData->swapchainImageCount; i++) {
// Start by just allocating one pool, it will grow if needed
@ -2394,7 +2394,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
}
// Upload buffers
rendererData->uploadBuffers = (VULKAN_Buffer **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VULKAN_Buffer*));
rendererData->uploadBuffers = (VULKAN_Buffer **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VULKAN_Buffer *));
for (uint32_t i = 0; i < rendererData->swapchainImageCount; i++) {
rendererData->uploadBuffers[i] = (VULKAN_Buffer *)SDL_calloc(SDL_VULKAN_NUM_UPLOAD_BUFFERS, sizeof(VULKAN_Buffer));
}
@ -2402,7 +2402,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
rendererData->currentUploadBuffer = (int *)SDL_calloc(rendererData->swapchainImageCount, sizeof(int));
// Constant buffers
rendererData->constantBuffers = (VULKAN_Buffer **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VULKAN_Buffer*));
rendererData->constantBuffers = (VULKAN_Buffer **)SDL_calloc(rendererData->swapchainImageCount, sizeof(VULKAN_Buffer *));
rendererData->numConstantBuffers = (uint32_t *)SDL_calloc(rendererData->swapchainImageCount, sizeof(uint32_t));
for (uint32_t i = 0; i < rendererData->swapchainImageCount; i++) {
// Start with just allocating one, will grow if needed
@ -3939,7 +3939,7 @@ static bool VULKAN_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cm
return true;
}
static SDL_Surface* VULKAN_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect)
static SDL_Surface *VULKAN_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect)
{
VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal;
VkImage backBuffer;

View File

@ -535,8 +535,8 @@ void *SDL_aligned_alloc(size_t alignment, size_t size)
Uint8 *result = NULL;
size_t requested_size = size;
if (alignment < sizeof(void*)) {
alignment = sizeof(void*);
if (alignment < sizeof(void *)) {
alignment = sizeof(void *);
}
padding = (alignment - (size % alignment));

View File

@ -28,14 +28,14 @@ typedef struct TitleStorageBootStrap
{
const char *name;
const char *desc;
SDL_Storage *(*create)(const char*, SDL_PropertiesID);
SDL_Storage *(*create)(const char *, SDL_PropertiesID);
} TitleStorageBootStrap;
typedef struct UserStorageBootStrap
{
const char *name;
const char *desc;
SDL_Storage *(*create)(const char*, const char*, SDL_PropertiesID);
SDL_Storage *(*create)(const char *, const char *, SDL_PropertiesID);
} UserStorageBootStrap;
// Not all of these are available in a given build. Use #ifdefs, etc.

View File

@ -41,7 +41,7 @@ typedef struct STEAM_RemoteStorage
static bool STEAM_CloseStorage(void *userdata)
{
bool result = true;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage *)userdata;
void *steamremotestorage = steam->SteamAPI_SteamRemoteStorage_v016();
if (steamremotestorage == NULL) {
result = SDL_SetError("SteamRemoteStorage unavailable");
@ -60,7 +60,7 @@ static bool STEAM_StorageReady(void *userdata)
static bool STEAM_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info)
{
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage *)userdata;
void *steamremotestorage = steam->SteamAPI_SteamRemoteStorage_v016();
if (steamremotestorage == NULL) {
return SDL_SetError("SteamRemoteStorage unavailable");
@ -77,7 +77,7 @@ static bool STEAM_GetStoragePathInfo(void *userdata, const char *path, SDL_PathI
static bool STEAM_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length)
{
bool result = false;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage *)userdata;
void *steamremotestorage = steam->SteamAPI_SteamRemoteStorage_v016();
if (steamremotestorage == NULL) {
return SDL_SetError("SteamRemoteStorage unavailable");
@ -96,7 +96,7 @@ static bool STEAM_ReadStorageFile(void *userdata, const char *path, void *destin
static bool STEAM_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length)
{
bool result = false;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage *)userdata;
void *steamremotestorage = steam->SteamAPI_SteamRemoteStorage_v016();
if (steamremotestorage == NULL) {
return SDL_SetError("SteamRemoteStorage unavailable");
@ -115,7 +115,7 @@ static bool STEAM_WriteStorageFile(void *userdata, const char *path, const void
static Uint64 STEAM_GetStorageSpaceRemaining(void *userdata)
{
Uint64 total, remaining;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage *)userdata;
void *steamremotestorage = steam->SteamAPI_SteamRemoteStorage_v016();
if (steamremotestorage == NULL) {
SDL_SetError("SteamRemoteStorage unavailable");
@ -149,7 +149,7 @@ static SDL_Storage *STEAM_User_Create(const char *org, const char *app, SDL_Prop
STEAM_RemoteStorage *steam;
void *steamremotestorage;
steam = (STEAM_RemoteStorage*) SDL_malloc(sizeof(STEAM_RemoteStorage));
steam = (STEAM_RemoteStorage *)SDL_malloc(sizeof(STEAM_RemoteStorage));
if (steam == NULL) {
return NULL;
}

View File

@ -95,7 +95,7 @@ static unsigned int get_allocation_bucket(void *mem)
return index;
}
static SDL_tracked_allocation* SDL_GetTrackedAllocation(void *mem)
static SDL_tracked_allocation *SDL_GetTrackedAllocation(void *mem)
{
SDL_tracked_allocation *entry;
LOCK_ALLOCATOR();
@ -216,9 +216,9 @@ static void SDL_UntrackAllocation(void *mem)
UNLOCK_ALLOCATOR();
}
static void rand_fill_memory(void* ptr, size_t start, size_t end)
static void rand_fill_memory(void *ptr, size_t start, size_t end)
{
Uint8* mem = (Uint8*) ptr;
Uint8 *mem = (Uint8 *)ptr;
size_t i;
if (!s_randfill_allocations)

View File

@ -40,7 +40,7 @@
/* Glib 2.0 */
typedef unsigned long gulong;
typedef void* gpointer;
typedef void *gpointer;
typedef char gchar;
typedef int gint;
typedef unsigned int guint;
@ -88,11 +88,11 @@ typedef struct _GtkCheckMenuItem GtkCheckMenuItem;
static gboolean (*gtk_init_check)(int *argc, char ***argv);
static gboolean (*gtk_main_iteration_do)(gboolean blocking);
static GtkWidget* (*gtk_menu_new)(void);
static GtkWidget* (*gtk_separator_menu_item_new)(void);
static GtkWidget* (*gtk_menu_item_new_with_label)(const gchar *label);
static GtkWidget *(*gtk_menu_new)(void);
static GtkWidget *(*gtk_separator_menu_item_new)(void);
static GtkWidget *(*gtk_menu_item_new_with_label)(const gchar *label);
static void (*gtk_menu_item_set_submenu)(GtkMenuItem *menu_item, GtkWidget *submenu);
static GtkWidget* (*gtk_check_menu_item_new_with_label)(const gchar *label);
static GtkWidget *(*gtk_check_menu_item_new_with_label)(const gchar *label);
static void (*gtk_check_menu_item_set_active)(GtkCheckMenuItem *check_menu_item, gboolean is_active);
static void (*gtk_widget_set_sensitive)(GtkWidget *widget, gboolean sensitive);
static void (*gtk_widget_show)(GtkWidget *widget);

View File

@ -486,8 +486,8 @@ static void SDL_TARGETING("mmx") Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
d &= 0x07e0f81f;
*dstp++ = (Uint16)(d | d >> 16);
},{
src1 = *(__m64*)srcp; // 4 src pixels -> src1
dst1 = *(__m64*)dstp; // 4 dst pixels -> dst1
src1 = *(__m64 *)srcp; // 4 src pixels -> src1
dst1 = *(__m64 *)dstp; // 4 dst pixels -> dst1
// red
src2 = src1;
@ -536,7 +536,7 @@ static void SDL_TARGETING("mmx") Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
mm_res = _mm_or_si64(mm_res, dst2); // RED | GREEN | BLUE -> mm_res
*(__m64*)dstp = mm_res; // mm_res -> 4 dst pixels
*(__m64 *)dstp = mm_res; // mm_res -> 4 dst pixels
srcp += 4;
dstp += 4;
@ -624,8 +624,8 @@ static void SDL_TARGETING("mmx") Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info)
d &= 0x03e07c1f;
*dstp++ = (Uint16)(d | d >> 16);
},{
src1 = *(__m64*)srcp; // 4 src pixels -> src1
dst1 = *(__m64*)dstp; // 4 dst pixels -> dst1
src1 = *(__m64 *)srcp; // 4 src pixels -> src1
dst1 = *(__m64 *)dstp; // 4 dst pixels -> dst1
// red -- process the bits in place
src2 = src1;
@ -674,7 +674,7 @@ static void SDL_TARGETING("mmx") Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info)
mm_res = _mm_or_si64(mm_res, dst2); // RED | GREEN | BLUE -> mm_res
*(__m64*)dstp = mm_res; // mm_res -> 4 dst pixels
*(__m64 *)dstp = mm_res; // mm_res -> 4 dst pixels
srcp += 4;
dstp += 4;
@ -1061,8 +1061,8 @@ static void SDL_TARGETING("sse4.1") Blit8888to8888PixelAlphaSwizzleSSE41(SDL_Bli
__m128i dst_hi = _mm_maddubs_epi16(srca_hi, _mm_unpackhi_epi8(src128, dst128));
// dst += 0x1U (use 0x80 to round instead of floor) + 128*255 (to fix maddubs result)
dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1 + 128*255));
dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1 + 128*255));
dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1 + 128 * 255));
dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1 + 128 * 255));
// dst = (dst + (dst >> 8)) >> 8 = (dst * 257) >> 16
dst_lo = _mm_mulhi_epu16(dst_lo, _mm_set1_epi16(257));
@ -1165,8 +1165,8 @@ static void SDL_TARGETING("avx2") Blit8888to8888PixelAlphaSwizzleAVX2(SDL_BlitIn
__m256i dst_hi = _mm256_maddubs_epi16(alpha_hi, _mm256_unpackhi_epi8(src256, dst256));
// dst += 0x1U (use 0x80 to round instead of floor) + 128*255 (to fix maddubs result)
dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1 + 128*255));
dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1 + 128*255));
dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1 + 128 * 255));
dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1 + 128 * 255));
// dst = (dst + (dst >> 8)) >> 8 = (dst * 257) >> 16
dst_lo = _mm256_mulhi_epu16(dst_lo, _mm256_set1_epi16(257));
@ -1290,8 +1290,8 @@ static void Blit8888to8888PixelAlphaSwizzleNEON(SDL_BlitInfo *info)
// Process 1 pixel per iteration, max 3 iterations, same calculations as above
for (; i < width; ++i) {
// Top 32-bits will be not used in src32 & dst32
uint8x8_t src32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32*)src));
uint8x8_t dst32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32*)dst));
uint8x8_t src32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32 *)src));
uint8x8_t dst32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32 *)dst));
uint8x8_t srcA = vtbl1_u8(src32, vget_low_u8(alpha_splat_mask));
src32 = vtbl1_u8(src32, vget_low_u8(convert_mask));
@ -1309,7 +1309,7 @@ static void Blit8888to8888PixelAlphaSwizzleNEON(SDL_BlitInfo *info)
}
// Save the result, only low 32-bits
vst1_lane_u32((Uint32*)dst, vreinterpret_u32_u8(dst32), 0);
vst1_lane_u32((Uint32 *)dst, vreinterpret_u32_u8(dst32), 0);
src += 4;
dst += 4;

View File

@ -2258,7 +2258,7 @@ static void BlitNtoNKey(SDL_BlitInfo *info)
/* *INDENT-OFF* */ // clang-format off
DUFFS_LOOP(
{
Uint32 *src32 = (Uint32*)src;
Uint32 *src32 = (Uint32 *)src;
if ((*src32 & rgbmask) != ckey) {
dst[0] = src[p0];
@ -2366,7 +2366,7 @@ static void BlitNtoNKey(SDL_BlitInfo *info)
/* *INDENT-OFF* */ // clang-format off
DUFFS_LOOP(
{
Uint32 *src32 = (Uint32*)src;
Uint32 *src32 = (Uint32 *)src;
if ((*src32 & rgbmask) != ckey) {
dst[0] = src[p0];
dst[1] = src[p1];
@ -2516,7 +2516,7 @@ static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
/* *INDENT-OFF* */ // clang-format off
DUFFS_LOOP(
{
Uint32 *src32 = (Uint32*)src;
Uint32 *src32 = (Uint32 *)src;
if ((*src32 & rgbmask) != ckey) {
dst[0] = src[p0];
dst[1] = src[p1];
@ -2777,7 +2777,7 @@ static void Blit8888to8888PixelSwizzleNEON(SDL_BlitInfo *info)
// Process 1 pixel per iteration, max 3 iterations, same calculations as above
for (; i < width; ++i) {
// Top 32-bits will be not used in src32
uint8x8_t src32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32*)src));
uint8x8_t src32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32 *)src));
// Convert to dst format
src32 = vtbl1_u8(src32, vget_low_u8(convert_mask));
@ -2788,7 +2788,7 @@ static void Blit8888to8888PixelSwizzleNEON(SDL_BlitInfo *info)
}
// Save the result, only low 32-bits
vst1_lane_u32((Uint32*)dst, vreinterpret_u32_u8(src32), 0);
vst1_lane_u32((Uint32 *)dst, vreinterpret_u32_u8(src32), 0);
src += 4;
dst += 4;
@ -2829,7 +2829,7 @@ static void Blit_3or4_to_3or4__same_rgb(SDL_BlitInfo *info)
/* *INDENT-OFF* */ // clang-format off
DUFFS_LOOP(
{
Uint32 *dst32 = (Uint32*)dst;
Uint32 *dst32 = (Uint32 *)dst;
Uint8 s0 = src[i0];
Uint8 s1 = src[i1];
Uint8 s2 = src[i2];
@ -2901,7 +2901,7 @@ static void Blit_3or4_to_3or4__inversed_rgb(SDL_BlitInfo *info)
/* *INDENT-OFF* */ // clang-format off
DUFFS_LOOP(
{
Uint32 *dst32 = (Uint32*)dst;
Uint32 *dst32 = (Uint32 *)dst;
Uint8 s0 = src[i0];
Uint8 s1 = src[i1];
Uint8 s2 = src[i2];
@ -2929,7 +2929,7 @@ static void Blit_3or4_to_3or4__inversed_rgb(SDL_BlitInfo *info)
/* *INDENT-OFF* */ // clang-format off
DUFFS_LOOP(
{
Uint32 *dst32 = (Uint32*)dst;
Uint32 *dst32 = (Uint32 *)dst;
Uint8 s0 = src[i0];
Uint8 s1 = src[i1];
Uint8 s2 = src[i2];

View File

@ -288,7 +288,7 @@ typedef struct color_t
#if 0
static void printf_64(const char *str, void *var)
{
uint8_t *val = (uint8_t*) var;
uint8_t *val = (uint8_t *)var;
printf(" * %s: %02x %02x %02x %02x _ %02x %02x %02x %02x\n",
str, val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]);
}
@ -394,7 +394,7 @@ static bool scale_mat(const Uint32 *src, int src_w, int src_h, int src_pitch, Ui
#if 0
static void SDL_TARGETING("sse2") printf_128(const char *str, __m128i var)
{
uint16_t *val = (uint16_t*) &var;
uint16_t *val = (uint16_t *)&var;
printf(" * %s: %04x %04x %04x %04x _ %04x %04x %04x %04x\n",
str, val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]);
}

View File

@ -336,7 +336,7 @@ struct SDL_VideoDevice
*/
bool (*Vulkan_LoadLibrary)(SDL_VideoDevice *_this, const char *path);
void (*Vulkan_UnloadLibrary)(SDL_VideoDevice *_this);
char const* const* (*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, Uint32 *count);
char const * const *(*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, Uint32 *count);
bool (*Vulkan_CreateSurface)(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface);
void (*Vulkan_DestroySurface)(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator);
bool (*Vulkan_GetPresentationSupport)(SDL_VideoDevice *_this, VkInstance instance, VkPhysicalDevice physicalDevice, Uint32 queueFamilyIndex);

View File

@ -6024,7 +6024,7 @@ void SDL_Vulkan_UnloadLibrary(void)
}
}
char const* const* SDL_Vulkan_GetInstanceExtensions(Uint32 *count)
char const * const *SDL_Vulkan_GetInstanceExtensions(Uint32 *count)
{
return _this->Vulkan_GetInstanceExtensions(_this, count);
}

View File

@ -110,8 +110,7 @@ void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
}
}
char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
Uint32 *count)
char const * const *Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
{
static const char *const extensionsForAndroid[] = {
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_ANDROID_SURFACE_EXTENSION_NAME

View File

@ -36,7 +36,7 @@
extern bool Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
extern char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern char const * const *Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,

View File

@ -244,7 +244,7 @@ void Cocoa_VideoQuit(SDL_VideoDevice *_this)
SDL_SystemTheme Cocoa_GetSystemTheme(void)
{
if (@available(macOS 10.14, *)) {
NSAppearance* appearance = [[NSApplication sharedApplication] effectiveAppearance];
NSAppearance *appearance = [[NSApplication sharedApplication] effectiveAppearance];
if ([appearance.name containsString: @"Dark"]) {
return SDL_SYSTEM_THEME_DARK;

View File

@ -36,7 +36,7 @@
extern bool Cocoa_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
extern char const* const* Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern char const * const *Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,

View File

@ -161,8 +161,7 @@ void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
}
}
char const* const* Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
Uint32 *count)
char const * const *Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
{
static const char *const extensionsForCocoa[] = {
VK_KHR_SURFACE_EXTENSION_NAME, VK_EXT_METAL_SURFACE_EXTENSION_NAME, VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME

View File

@ -110,7 +110,7 @@ bool Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *wind
data32.set(HEAP32.subarray(src, src + num));
var data8 = SDL3.data8;
var i = 3;
var j = i + 4*num;
var j = i + 4 * num;
if (num % 8 == 0) {
// unrolling gives big speedups
while (i < j) {

View File

@ -59,7 +59,7 @@ char *HAIKU_GetClipboardText(SDL_VideoDevice *_this) {
if (be_clipboard->Lock()) {
if ((clip = be_clipboard->Data())) {
// Presumably the string of characters is ascii-format
clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text,
clip->FindData("text/plain", B_MIME_TYPE, (const void **)&text,
&length);
}
be_clipboard->Unlock();

View File

@ -324,7 +324,7 @@ protected:
}
virtual void
SetTitle(const char* aTitle)
SetTitle(const char *aTitle)
{
fTitle = aTitle;
BAlert::SetTitle(aTitle);

View File

@ -178,7 +178,7 @@ static void _BDisplayModeToSdlDisplayMode(display_mode *bmode, SDL_DisplayMode *
get_refresh_rate(*bmode, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator);
#if WRAP_BMODE
SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1, sizeof(SDL_DisplayModeData));
SDL_DisplayModeData *data = (SDL_DisplayModeData *)SDL_calloc(1, sizeof(SDL_DisplayModeData));
data->bmode = bmode;
mode->internal = data;

View File

@ -94,7 +94,7 @@ bool HAIKU_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window * window)
bool HAIKU_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window * window, SDL_GLContext context)
{
BGLView* glView = (BGLView*)context;
BGLView *glView = (BGLView *)context;
// printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL));
if (glView) {
if ((glView->Window() == NULL) || (!window) || (_ToBeWin(window)->GetGLView() != glView)) {
@ -150,8 +150,8 @@ SDL_GLContext HAIKU_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window * window
bool HAIKU_GL_DestroyContext(SDL_VideoDevice *_this, SDL_GLContext context)
{
// printf("HAIKU_GL_DestroyContext(%llx), thread = %d\n", (uint64)context, find_thread(NULL));
BGLView* glView = (BGLView*)context;
SDL_BWin *bwin = (SDL_BWin*)glView->Window();
BGLView *glView = (BGLView *)context;
SDL_BWin *bwin = (SDL_BWin *)glView->Window();
if (!bwin) {
delete glView;
} else {

View File

@ -140,8 +140,7 @@ void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
// members of the VkInstanceCreateInfo struct passed to
// vkCreateInstance().
/*********************************************************************/
char const* const* KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
Uint32 *count)
char const * const *KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
{
static const char *const extensionsForKMSDRM[] = {
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_DISPLAY_EXTENSION_NAME

View File

@ -35,7 +35,7 @@
extern bool KMSDRM_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
extern char const* const* KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern char const * const *KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,

View File

@ -108,7 +108,7 @@ static BOOL (*ov_wglMakeCurrent)(HDC, HGLRC);
#define OPENVR_DEFAULT_WIDTH 1920
#define OPENVR_DEFAULT_HEIGHT 1080
#define OPENVR_SetupProc(proc) { proc = (void*)SDL_GL_GetProcAddress((#proc)+3); if (!proc) { failed_extension = (#proc)+3; } }
#define OPENVR_SetupProc(proc) { proc = (void *)SDL_GL_GetProcAddress((#proc)+3); if (!proc) { failed_extension = (#proc)+3; } }
static bool OPENVR_InitExtensions(SDL_VideoDevice *_this)
{
@ -211,7 +211,7 @@ static bool OPENVR_VideoInit(SDL_VideoDevice *_this)
}
display.internal = (SDL_DisplayData *)data;
display.name = (char*)"OpenVRDisplay";
display.name = (char *)"OpenVRDisplay";
SDL_AddVideoDisplay(&display, false);
return true;
@ -250,7 +250,7 @@ static uint32_t *ImageSDLToOpenVRGL(SDL_Surface * surf, bool bFlipY)
int x, y;
uint32_t * pxd = SDL_malloc(4 * surf->w * surf->h);
for(y = 0; y < h; y++) {
uint32_t * iline = (uint32_t*)&(((uint8_t*)surf->pixels)[y*pitch]);
uint32_t * iline = (uint32_t *)&(((uint8_t *)surf->pixels)[y * pitch]);
uint32_t * oline = &pxd[(bFlipY?(h-y-1):y)*w];
for(x = 0; x < w; x++)
{
@ -430,7 +430,7 @@ static void OPENVR_VirtualControllerUpdate(void *userdata)
xval *= -1.0f;
if (a == SDL_GAMEPAD_AXIS_LEFT_TRIGGER || a == SDL_GAMEPAD_AXIS_RIGHT_TRIGGER)
xval = xval * 2.0f - 1.0f;
//SDL_SetJoystickVirtualAxis(joystick, a, analog_input_action.x*32767);
//SDL_SetJoystickVirtualAxis(joystick, a, analog_input_action.x * 32767);
xval *= SDL_JOYSTICK_AXIS_MAX;
SDL_SetJoystickVirtualAxis(joystick, a, xval);
#ifdef DEBUG_OPENVR
@ -1039,7 +1039,7 @@ static SDL_GLContext OVR_EGL_CreateContext(SDL_VideoDevice *_this, SDL_Window *
ov_glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
for(int i = 0; i < numExtensions; i++) {
const char * ccc = (const char*)ov_glGetStringi(GL_EXTENSIONS, i);
const char * ccc = (const char *)ov_glGetStringi(GL_EXTENSIONS, i);
if (SDL_strcmp(ccc, "GL_KHR_debug") == 0) {
#ifdef DEBUG_OPENVR
SDL_Log("Found renderdoc debug extension.");
@ -1327,7 +1327,7 @@ static bool OPENVR_ShowCursor(SDL_Cursor * cursor)
hotspot.v[0] = (float)ovrc->hot_x / (float)ovrc->w;
hotspot.v[1] = (float)ovrc->hot_y / (float)ovrc->h;
texture.handle = (void*)(intptr_t)(ovrc->texture_id_handle);
texture.handle = (void *)(intptr_t)(ovrc->texture_id_handle);
texture.eType = ETextureType_TextureType_OpenGL;
texture.eColorSpace = EColorSpace_ColorSpace_Auto;
@ -1395,7 +1395,7 @@ static bool OPENVR_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window * window, SD
SDL_free(pixels);
ov_glBindTexture(GL_TEXTURE_2D, 0);
texture.handle = (void*)(intptr_t)(texture_id_handle);
texture.handle = (void *)(intptr_t)(texture_id_handle);
texture.eType = ETextureType_TextureType_OpenGL;
texture.eColorSpace = EColorSpace_ColorSpace_Auto;

View File

@ -39,7 +39,7 @@ static int forward_argc;
static char **forward_argv;
static int exit_status;
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void *reserved)
{
int i;

View File

@ -36,7 +36,7 @@
extern bool UIKit_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern void UIKit_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
extern char const* const* UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern char const * const *UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,

View File

@ -167,8 +167,7 @@ void UIKit_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
}
}
char const* const* UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
Uint32 *count)
char const * const *UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
{
static const char *const extensionsForUIKit[] = {
VK_KHR_SURFACE_EXTENSION_NAME, VK_EXT_METAL_SURFACE_EXTENSION_NAME

View File

@ -117,8 +117,7 @@ void VIVANTE_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
}
}
char const* const* VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
Uint32 *count)
char const * const *VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
{
static const char *const extensionsForVivante[] = {
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_DISPLAY_EXTENSION_NAME

View File

@ -35,7 +35,7 @@
extern bool VIVANTE_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern void VIVANTE_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
extern char const* const* VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern char const * const *VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern bool VIVANTE_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,

View File

@ -84,13 +84,13 @@ SDL_WAYLAND_SYM(const char * const *, wl_proxy_get_tag, (struct wl_proxy *))
* non-optional when we are compiling against Wayland 1.20. We don't
* explicitly call them ourselves, though, so if we are only compiling
* against Wayland 1.18, they're unnecessary. */
SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interfac, uint32_t version, uint32_t flags, ...))
SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_array_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, uint32_t flags, union wl_argument *args))
SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interfac, uint32_t version, uint32_t flags, ...))
SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_array_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, uint32_t flags, union wl_argument *args))
#endif
#if 0 // TODO RECONNECT: See waylandvideo.c for more information!
#if SDL_WAYLAND_CHECK_VERSION(broken, on, purpose)
SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display*))
SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display *))
#endif
#endif // 0
@ -149,7 +149,7 @@ SDL_WAYLAND_SYM(void, xkb_compose_state_unref, (struct xkb_compose_state *) )
SDL_WAYLAND_SYM(enum xkb_compose_feed_result, xkb_compose_state_feed, (struct xkb_compose_state *, xkb_keysym_t) )
SDL_WAYLAND_SYM(enum xkb_compose_status, xkb_compose_state_get_status, (struct xkb_compose_state *) )
SDL_WAYLAND_SYM(xkb_keysym_t, xkb_compose_state_get_one_sym, (struct xkb_compose_state *) )
SDL_WAYLAND_SYM(void, xkb_keymap_key_for_each, (struct xkb_keymap *, xkb_keymap_key_iter_t, void*) )
SDL_WAYLAND_SYM(void, xkb_keymap_key_for_each, (struct xkb_keymap *, xkb_keymap_key_iter_t, void *) )
SDL_WAYLAND_SYM(int, xkb_keymap_key_get_syms_by_level, (struct xkb_keymap *,
xkb_keycode_t,
xkb_layout_index_t,
@ -158,9 +158,9 @@ SDL_WAYLAND_SYM(int, xkb_keymap_key_get_syms_by_level, (struct xkb_keymap *,
SDL_WAYLAND_SYM(uint32_t, xkb_keysym_to_utf32, (xkb_keysym_t) )
SDL_WAYLAND_SYM(uint32_t, xkb_keymap_mod_get_index, (struct xkb_keymap *,
const char *) )
SDL_WAYLAND_SYM(const char *, xkb_keymap_layout_get_name, (struct xkb_keymap*, xkb_layout_index_t))
SDL_WAYLAND_SYM(const char *, xkb_keymap_layout_get_name, (struct xkb_keymap *, xkb_layout_index_t))
#if SDL_XKBCOMMON_CHECK_VERSION(1, 10, 0)
SDL_WAYLAND_SYM(xkb_mod_mask_t, xkb_keymap_mod_get_mask, (struct xkb_keymap*, const char*))
SDL_WAYLAND_SYM(xkb_mod_mask_t, xkb_keymap_mod_get_mask, (struct xkb_keymap *, const char *))
#endif
#ifdef HAVE_LIBDECOR_H

View File

@ -115,7 +115,7 @@ void Wayland_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
}
}
char const* const* Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
char const * const *Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
{
static const char *const extensionsForWayland[] = {
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME

View File

@ -35,7 +35,7 @@
extern bool Wayland_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern void Wayland_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
extern char const* const* Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern char const * const *Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern bool Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,

View File

@ -1794,7 +1794,7 @@ static struct wl_callback_listener show_hide_sync_listener = {
static void exported_handle_handler(void *data, struct zxdg_exported_v2 *zxdg_exported_v2, const char *handle)
{
SDL_WindowData *wind = (SDL_WindowData*)data;
SDL_WindowData *wind = (SDL_WindowData *)data;
SDL_PropertiesID props = SDL_GetWindowProperties(wind->sdlwindow);
SDL_SetStringProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_EXPORT_HANDLE_STRING, handle);
@ -2065,7 +2065,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
data->show_hide_sync_required = true;
struct wl_callback *cb = wl_display_sync(_this->internal->display);
wl_callback_add_listener(cb, &show_hide_sync_listener, (void*)((uintptr_t)window->id));
wl_callback_add_listener(cb, &show_hide_sync_listener, (void *)((uintptr_t)window->id));
data->showing_window = true;
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_SHOWN, 0, 0);
@ -2181,7 +2181,7 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
wind->show_hide_sync_required = true;
struct wl_callback *cb = wl_display_sync(_this->internal->display);
wl_callback_add_listener(cb, &show_hide_sync_listener, (void*)((uintptr_t)window->id));
wl_callback_add_listener(cb, &show_hide_sync_listener, (void *)((uintptr_t)window->id));
}
static void handle_xdg_activation_done(void *data,

View File

@ -46,7 +46,7 @@ HICON CreateIconFromSurface(SDL_Surface *surface)
bmpInfo.bmiHeader.biCompression = BI_RGB;
HDC hdc = GetDC(NULL);
void* pBits = NULL;
void *pBits = NULL;
HBITMAP hBitmap = CreateDIBSection(hdc, &bmpInfo, DIB_RGB_COLORS, &pBits, NULL, 0);
if (!hBitmap) {
ReleaseDC(NULL, hdc);

View File

@ -185,7 +185,7 @@ done:
static void CALLBACK GAMEINPUT_InternalDeviceCallback(
_In_ GameInputCallbackToken callbackToken,
_In_ void* context,
_In_ void *context,
_In_ IGameInputDevice *pDevice,
_In_ uint64_t timestamp,
_In_ GameInputDeviceStatus currentStatus,
@ -594,7 +594,7 @@ void WIN_QuitGameInput(SDL_VideoDevice *_this)
#else // !HAVE_GAMEINPUT_H
bool WIN_InitGameInput(SDL_VideoDevice* _this)
bool WIN_InitGameInput(SDL_VideoDevice *_this)
{
return SDL_Unsupported();
}
@ -604,12 +604,12 @@ bool WIN_UpdateGameInputEnabled(SDL_VideoDevice *_this)
return SDL_Unsupported();
}
void WIN_UpdateGameInput(SDL_VideoDevice* _this)
void WIN_UpdateGameInput(SDL_VideoDevice *_this)
{
return;
}
void WIN_QuitGameInput(SDL_VideoDevice* _this)
void WIN_QuitGameInput(SDL_VideoDevice *_this)
{
return;
}

View File

@ -696,8 +696,8 @@ static void ReadMouseCurve(int v, Uint64 xs[5], Uint64 ys[5])
ys[0] = 0; // first node must always be origin
int i;
for (i = 1; i < 5; i++) {
xs[i] = (7 * (Uint64)xbuff[i*2]);
ys[i] = (v * (Uint64)ybuff[i*2]) << 17;
xs[i] = (7 * (Uint64)xbuff[i * 2]);
ys[i] = (v * (Uint64)ybuff[i * 2]) << 17;
}
}

View File

@ -168,8 +168,8 @@ static SDL_VideoDevice *WIN_CreateDevice(void)
data->GetDpiForWindow = (UINT (WINAPI *)(HWND))SDL_LoadFunction(data->userDLL, "GetDpiForWindow");
data->AreDpiAwarenessContextsEqual = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "AreDpiAwarenessContextsEqual");
data->IsValidDpiAwarenessContext = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "IsValidDpiAwarenessContext");
data->GetDisplayConfigBufferSizes = (LONG (WINAPI *)(UINT32,UINT32*,UINT32* ))SDL_LoadFunction(data->userDLL, "GetDisplayConfigBufferSizes");
data->QueryDisplayConfig = (LONG (WINAPI *)(UINT32,UINT32*,DISPLAYCONFIG_PATH_INFO*,UINT32*,DISPLAYCONFIG_MODE_INFO*,DISPLAYCONFIG_TOPOLOGY_ID*))SDL_LoadFunction(data->userDLL, "QueryDisplayConfig");
data->GetDisplayConfigBufferSizes = (LONG (WINAPI *)(UINT32,UINT32 *,UINT32 *))SDL_LoadFunction(data->userDLL, "GetDisplayConfigBufferSizes");
data->QueryDisplayConfig = (LONG (WINAPI *)(UINT32,UINT32 *,DISPLAYCONFIG_PATH_INFO*,UINT32 *,DISPLAYCONFIG_MODE_INFO*,DISPLAYCONFIG_TOPOLOGY_ID*))SDL_LoadFunction(data->userDLL, "QueryDisplayConfig");
data->DisplayConfigGetDeviceInfo = (LONG (WINAPI *)(DISPLAYCONFIG_DEVICE_INFO_HEADER*))SDL_LoadFunction(data->userDLL, "DisplayConfigGetDeviceInfo");
data->GetPointerType = (BOOL (WINAPI *)(UINT32, POINTER_INPUT_TYPE *))SDL_LoadFunction(data->userDLL, "GetPointerType");
data->GetPointerPenInfo = (BOOL (WINAPI *)(UINT32, POINTER_PEN_INFO *))SDL_LoadFunction(data->userDLL, "GetPointerPenInfo");
@ -624,7 +624,7 @@ bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface)
if (*pD3DDLL) {
/* *INDENT-OFF* */ // clang-format off
typedef IDirect3D9 *(WINAPI *Direct3DCreate9_t)(UINT SDKVersion);
typedef HRESULT (WINAPI* Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex** ppD3D);
typedef HRESULT (WINAPI* Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex **ppD3D);
/* *INDENT-ON* */ // clang-format on
Direct3DCreate9_t Direct3DCreate9Func;

View File

@ -448,8 +448,8 @@ struct SDL_VideoData
BOOL (WINAPI *AreDpiAwarenessContextsEqual)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT);
BOOL (WINAPI *IsValidDpiAwarenessContext)(DPI_AWARENESS_CONTEXT);
// DisplayConfig functions
LONG (WINAPI *GetDisplayConfigBufferSizes)( UINT32, UINT32*, UINT32* );
LONG (WINAPI *QueryDisplayConfig)( UINT32, UINT32*, DISPLAYCONFIG_PATH_INFO*, UINT32*, DISPLAYCONFIG_MODE_INFO*, DISPLAYCONFIG_TOPOLOGY_ID*);
LONG (WINAPI *GetDisplayConfigBufferSizes)( UINT32, UINT32 *, UINT32 *);
LONG (WINAPI *QueryDisplayConfig)( UINT32, UINT32 *, DISPLAYCONFIG_PATH_INFO*, UINT32 *, DISPLAYCONFIG_MODE_INFO*, DISPLAYCONFIG_TOPOLOGY_ID*);
LONG (WINAPI *DisplayConfigGetDeviceInfo)( DISPLAYCONFIG_DEVICE_INFO_HEADER*);
/* *INDENT-ON* */ // clang-format on

View File

@ -110,8 +110,7 @@ void WIN_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
}
}
char const* const* WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
Uint32 *count)
char const * const *WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
{
static const char *const extensionsForWin32[] = {
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_WIN32_SURFACE_EXTENSION_NAME

View File

@ -35,7 +35,7 @@
extern bool WIN_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern void WIN_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
extern char const* const* WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern char const * const *WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
extern bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,

View File

@ -186,7 +186,7 @@ static DWORD GetWindowStyleEx(SDL_Window *window)
}
#ifdef HAVE_SHOBJIDL_CORE_H
static ITaskbarList3 *GetTaskbarList(SDL_Window* window)
static ITaskbarList3 *GetTaskbarList(SDL_Window *window)
{
const SDL_WindowData *data = window->internal;
SDL_assert(data->taskbar_button_created);
@ -2264,7 +2264,7 @@ bool WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperat
return true;
}
bool WIN_ApplyWindowProgress(SDL_VideoDevice *_this, SDL_Window* window)
bool WIN_ApplyWindowProgress(SDL_VideoDevice *_this, SDL_Window *window)
{
#ifdef HAVE_SHOBJIDL_CORE_H
SDL_WindowData *data = window->internal;

View File

@ -771,7 +771,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
/* the new mime formats are the SDL_FORMATS property as an array of Atoms */
Atom atom = None;
Atom *patom;
unsigned char* data = NULL;
unsigned char *data = NULL;
int format_property = 0;
unsigned long length = 0;
unsigned long bytes_left = 0;
@ -780,8 +780,8 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
X11_XGetWindowProperty(display, GetWindow(_this), videodata->atoms.SDL_FORMATS, 0, 200,
0, XA_ATOM, &atom, &format_property, &length, &bytes_left, &data);
int allocationsize = (length + 1) * sizeof(char*);
for (j = 0, patom = (Atom*)data; j < length; j++, patom++) {
int allocationsize = (length + 1) * sizeof(char *);
for (j = 0, patom = (Atom *)data; j < length; j++, patom++) {
char *atomStr = X11_XGetAtomName(display, *patom);
allocationsize += SDL_strlen(atomStr) + 1;
X11_XFree(atomStr);
@ -791,7 +791,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
if (new_mime_types) {
char *strPtr = (char *)(new_mime_types + length + 1);
for (j = 0, patom = (Atom*)data; j < length; j++, patom++) {
for (j = 0, patom = (Atom *)data; j < length; j++, patom++) {
char *atomStr = X11_XGetAtomName(display, *patom);
new_mime_types[j] = strPtr;
strPtr = stpcpy(strPtr, atomStr) + 1;

Some files were not shown because too many files have changed in this diff Show More