mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed some g++ compiler warnings
This commit is contained in:
parent
35facc3656
commit
9b687968db
19 changed files with 198 additions and 280 deletions
|
|
@ -309,7 +309,7 @@ void AudioDataConverters::convertInt24BEToFloat (const void* const source, float
|
|||
|
||||
void AudioDataConverters::convertInt32LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const float scale = 1.0f / 0x7fffffff;
|
||||
const auto scale = 1.0f / (float) 0x7fffffff;
|
||||
const char* intData = static_cast<const char*> (source);
|
||||
|
||||
if (source != (void*) dest || srcBytesPerSample >= 4)
|
||||
|
|
@ -334,7 +334,7 @@ void AudioDataConverters::convertInt32LEToFloat (const void* const source, float
|
|||
|
||||
void AudioDataConverters::convertInt32BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const float scale = 1.0f / 0x7fffffff;
|
||||
const auto scale = 1.0f / (float) 0x7fffffff;
|
||||
const char* intData = static_cast<const char*> (source);
|
||||
|
||||
if (source != (void*) dest || srcBytesPerSample >= 4)
|
||||
|
|
|
|||
|
|
@ -629,7 +629,7 @@ public:
|
|||
jassert (isPositiveAndBelow (channel, numChannels));
|
||||
jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size);
|
||||
|
||||
const auto increment = (endGain - startGain) / numSamples;
|
||||
const auto increment = (endGain - startGain) / (float) numSamples;
|
||||
auto* d = channels[channel] + startSample;
|
||||
|
||||
while (--numSamples >= 0)
|
||||
|
|
|
|||
|
|
@ -874,7 +874,7 @@ void JUCE_CALLTYPE FloatVectorOperations::convertFixedToFloat (float* dest, cons
|
|||
vmulq_n_f32 (vcvtq_f32_s32 (vld1q_s32 (src)), multiplier),
|
||||
JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, )
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier,
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = (float) src[i] * multiplier,
|
||||
Mode::mul (mult, _mm_cvtepi32_ps (_mm_loadu_si128 ((const __m128i*) src))),
|
||||
JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST,
|
||||
const Mode::ParallelType mult = Mode::load1 (multiplier);)
|
||||
|
|
@ -1158,7 +1158,7 @@ public:
|
|||
static void convertFixed (float* d, const int* s, ValueType multiplier, int num)
|
||||
{
|
||||
while (--num >= 0)
|
||||
*d++ = *s++ * multiplier;
|
||||
*d++ = (float) *s++ * multiplier;
|
||||
}
|
||||
|
||||
static bool areAllValuesEqual (const ValueType* d, int num, ValueType target)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace MidiBufferHelpers
|
|||
|
||||
inline uint16 getEventTotalSize (const void* const d) noexcept
|
||||
{
|
||||
return getEventDataSize (d) + sizeof (int32) + sizeof (uint16);
|
||||
return (uint16) (getEventDataSize (d) + sizeof (int32) + sizeof (uint16));
|
||||
}
|
||||
|
||||
static int findActualEventLength (const uint8* const data, const int maxBytes) noexcept
|
||||
|
|
|
|||
|
|
@ -929,7 +929,7 @@ void AudioDeviceManager::LevelMeter::updateLevel (const float* const* channelDat
|
|||
for (int i = 0; i < numChannels; ++i)
|
||||
s += std::abs (channelData[i][j]);
|
||||
|
||||
s /= numChannels;
|
||||
s /= (float) numChannels;
|
||||
|
||||
const double decayFactor = 0.99992;
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public:
|
|||
numBytes -= numSent;
|
||||
data += numSent;
|
||||
|
||||
snd_seq_ev_set_source (&event, portId);
|
||||
snd_seq_ev_set_source (&event, (unsigned char) portId);
|
||||
snd_seq_ev_set_subs (&event);
|
||||
snd_seq_ev_set_direct (&event);
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ void AudioTransportSource::setPosition (double newPosition)
|
|||
double AudioTransportSource::getCurrentPosition() const
|
||||
{
|
||||
if (sampleRate > 0.0)
|
||||
return getNextReadPosition() / sampleRate;
|
||||
return (double) getNextReadPosition() / sampleRate;
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ double AudioTransportSource::getCurrentPosition() const
|
|||
double AudioTransportSource::getLengthInSeconds() const
|
||||
{
|
||||
if (sampleRate > 0.0)
|
||||
return getTotalLength() / sampleRate;
|
||||
return (double) getTotalLength() / sampleRate;
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
|
@ -177,7 +177,7 @@ void AudioTransportSource::setNextReadPosition (int64 newPosition)
|
|||
if (positionableSource != nullptr)
|
||||
{
|
||||
if (sampleRate > 0 && sourceSampleRate > 0)
|
||||
newPosition = (int64) (newPosition * sourceSampleRate / sampleRate);
|
||||
newPosition = (int64) ((double) newPosition * sourceSampleRate / sampleRate);
|
||||
|
||||
positionableSource->setNextReadPosition (newPosition);
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ int64 AudioTransportSource::getNextReadPosition() const
|
|||
if (positionableSource != nullptr)
|
||||
{
|
||||
const double ratio = (sampleRate > 0 && sourceSampleRate > 0) ? sampleRate / sourceSampleRate : 1.0;
|
||||
return (int64) (positionableSource->getNextReadPosition() * ratio);
|
||||
return (int64) ((double) positionableSource->getNextReadPosition() * ratio);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -206,7 +206,7 @@ int64 AudioTransportSource::getTotalLength() const
|
|||
if (positionableSource != nullptr)
|
||||
{
|
||||
const double ratio = (sampleRate > 0 && sourceSampleRate > 0) ? sampleRate / sourceSampleRate : 1.0;
|
||||
return (int64) (positionableSource->getTotalLength() * ratio);
|
||||
return (int64) ((double) positionableSource->getTotalLength() * ratio);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1,167 +1,167 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2012-2014 Xiph.org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* This is the prefered location of all CPP hackery to make $random_compiler
|
||||
* work like something approaching a C99 (or maybe more accurately GNU99)
|
||||
* compiler.
|
||||
*
|
||||
* It is assumed that this header will be included after "config.h".
|
||||
*/
|
||||
|
||||
#ifndef FLAC__SHARE__COMPAT_H
|
||||
#define FLAC__SHARE__COMPAT_H
|
||||
|
||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||
#define FLAC__off_t __int64 /* use this instead of off_t to fix the 2 GB limit */
|
||||
#if !defined __MINGW32__
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
#else /* MinGW */
|
||||
#if !defined(HAVE_FSEEKO)
|
||||
#define fseeko fseeko64
|
||||
#define ftello ftello64
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define FLAC__off_t off_t
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define strtoll _strtoi64
|
||||
#define strtoull _strtoui64
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define inline __inline
|
||||
#endif
|
||||
|
||||
#if defined __INTEL_COMPILER || (defined _MSC_VER && defined _WIN64)
|
||||
/* MSVS generates VERY slow 32-bit code with __restrict */
|
||||
#define flac_restrict __restrict
|
||||
#elif defined __GNUC__
|
||||
#define flac_restrict __restrict__
|
||||
#else
|
||||
#define flac_restrict
|
||||
#endif
|
||||
|
||||
#define FLAC__U64L(x) x##ULL
|
||||
|
||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||
#define FLAC__STRCASECMP stricmp
|
||||
#define FLAC__STRNCASECMP strnicmp
|
||||
#else
|
||||
#define FLAC__STRCASECMP strcasecmp
|
||||
#define FLAC__STRNCASECMP strncasecmp
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER
|
||||
# if _MSC_VER >= 1600
|
||||
/* Visual Studio 2010 has decent C99 support */
|
||||
# define PRIu64 "llu"
|
||||
# define PRId64 "lld"
|
||||
# define PRIx64 "llx"
|
||||
# else
|
||||
# ifndef UINT32_MAX
|
||||
# define UINT32_MAX _UI32_MAX
|
||||
# endif
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int8 int8_t;
|
||||
# define PRIu64 "I64u"
|
||||
# define PRId64 "I64d"
|
||||
# define PRIx64 "I64x"
|
||||
# endif
|
||||
#endif /* defined _MSC_VER */
|
||||
|
||||
#ifdef _WIN32
|
||||
/* All char* strings are in UTF-8 format. Added to support Unicode files on Windows */
|
||||
#include "win_utf8_io.h"
|
||||
|
||||
#define flac_printf printf_utf8
|
||||
#define flac_fprintf fprintf_utf8
|
||||
#define flac_vfprintf vfprintf_utf8
|
||||
#define flac_fopen fopen_utf8
|
||||
#define flac_chmod chmod_utf8
|
||||
#define flac_utime utime_utf8
|
||||
#define flac_unlink unlink_utf8
|
||||
#define flac_rename rename_utf8
|
||||
#define flac_stat _stat64_utf8
|
||||
|
||||
#else
|
||||
|
||||
#define flac_printf printf
|
||||
#define flac_fprintf fprintf
|
||||
#define flac_vfprintf vfprintf
|
||||
#define flac_fopen fopen
|
||||
#define flac_chmod chmod
|
||||
#define flac_utime utime
|
||||
#define flac_unlink unlink
|
||||
#define flac_rename rename
|
||||
#define flac_stat stat
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define flac_stat_s __stat64 /* stat struct */
|
||||
#define flac_fstat _fstat64
|
||||
#else
|
||||
#define flac_stat_s stat /* stat struct */
|
||||
#define flac_fstat fstat
|
||||
#endif
|
||||
|
||||
#ifndef M_LN2
|
||||
#define M_LN2 0.69314718055994530942
|
||||
#endif
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/* FLAC needs to compile and work correctly on systems with a normal ISO C99
|
||||
* snprintf as well as Microsoft Visual Studio which has an non-standards
|
||||
* conformant snprint_s function.
|
||||
*
|
||||
* This function wraps the MS version to behave more like the the ISO version.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int flac_snprintf(char *str, size_t size, const char *fmt, ...);
|
||||
int flac_vsnprintf(char *str, size_t size, const char *fmt, va_list va);
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* FLAC__SHARE__COMPAT_H */
|
||||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2012-2014 Xiph.org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* This is the prefered location of all CPP hackery to make $random_compiler
|
||||
* work like something approaching a C99 (or maybe more accurately GNU99)
|
||||
* compiler.
|
||||
*
|
||||
* It is assumed that this header will be included after "config.h".
|
||||
*/
|
||||
|
||||
#ifndef FLAC__SHARE__COMPAT_H
|
||||
#define FLAC__SHARE__COMPAT_H
|
||||
|
||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||
#define FLAC__off_t __int64 /* use this instead of off_t to fix the 2 GB limit */
|
||||
#if !defined __MINGW32__
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
#else /* MinGW */
|
||||
#if !defined(HAVE_FSEEKO)
|
||||
#define fseeko fseeko64
|
||||
#define ftello ftello64
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define FLAC__off_t off_t
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define strtoll _strtoi64
|
||||
#define strtoull _strtoui64
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define inline __inline
|
||||
#endif
|
||||
|
||||
#if defined __INTEL_COMPILER || (defined _MSC_VER && defined _WIN64)
|
||||
/* MSVS generates VERY slow 32-bit code with __restrict */
|
||||
#define flac_restrict __restrict
|
||||
#elif defined __GNUC__
|
||||
#define flac_restrict __restrict__
|
||||
#else
|
||||
#define flac_restrict
|
||||
#endif
|
||||
|
||||
#define FLAC__U64L(x) x##ULL
|
||||
|
||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||
#define FLAC__STRCASECMP stricmp
|
||||
#define FLAC__STRNCASECMP strnicmp
|
||||
#else
|
||||
#define FLAC__STRCASECMP strcasecmp
|
||||
#define FLAC__STRNCASECMP strncasecmp
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER
|
||||
# if _MSC_VER >= 1600
|
||||
/* Visual Studio 2010 has decent C99 support */
|
||||
# define PRIu64 "llu"
|
||||
# define PRId64 "lld"
|
||||
# define PRIx64 "llx"
|
||||
# else
|
||||
# ifndef UINT32_MAX
|
||||
# define UINT32_MAX _UI32_MAX
|
||||
# endif
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int8 int8_t;
|
||||
# define PRIu64 "I64u"
|
||||
# define PRId64 "I64d"
|
||||
# define PRIx64 "I64x"
|
||||
# endif
|
||||
#endif /* defined _MSC_VER */
|
||||
|
||||
#ifdef _WIN32
|
||||
/* All char* strings are in UTF-8 format. Added to support Unicode files on Windows */
|
||||
#include "win_utf8_io.h"
|
||||
|
||||
#define flac_printf printf_utf8
|
||||
#define flac_fprintf fprintf_utf8
|
||||
#define flac_vfprintf vfprintf_utf8
|
||||
#define flac_fopen fopen_utf8
|
||||
#define flac_chmod chmod_utf8
|
||||
#define flac_utime utime_utf8
|
||||
#define flac_unlink unlink_utf8
|
||||
#define flac_rename rename_utf8
|
||||
#define flac_stat _stat64_utf8
|
||||
|
||||
#else
|
||||
|
||||
#define flac_printf printf
|
||||
#define flac_fprintf fprintf
|
||||
#define flac_vfprintf vfprintf
|
||||
#define flac_fopen fopen
|
||||
#define flac_chmod chmod
|
||||
#define flac_utime utime
|
||||
#define flac_unlink unlink
|
||||
#define flac_rename rename
|
||||
#define flac_stat stat
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define flac_stat_s __stat64 /* stat struct */
|
||||
#define flac_fstat _fstat64
|
||||
#else
|
||||
#define flac_stat_s stat /* stat struct */
|
||||
#define flac_fstat fstat
|
||||
#endif
|
||||
|
||||
#ifndef M_LN2
|
||||
#define M_LN2 0.69314718055994530942
|
||||
#endif
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/* FLAC needs to compile and work correctly on systems with a normal ISO C99
|
||||
* snprintf as well as Microsoft Visual Studio which has an non-standards
|
||||
* conformant snprint_s function.
|
||||
*
|
||||
* This function wraps the MS version to behave more like the the ISO version.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int flac_snprintf(char *str, size_t size, const char *fmt, ...);
|
||||
int flac_vsnprintf(char *str, size_t size, const char *fmt, va_list va);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FLAC__SHARE__COMPAT_H */
|
||||
|
|
|
|||
|
|
@ -892,7 +892,7 @@ namespace WavFileHelpers
|
|||
|
||||
return xml.getMemoryBlock();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
struct ExtensibleWavSubFormat
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
#endif
|
||||
|
||||
#else
|
||||
JUCE_CREATE_APPLICATION_DEFINE(StandaloneFilterApp);
|
||||
JUCE_CREATE_APPLICATION_DEFINE(StandaloneFilterApp)
|
||||
#endif
|
||||
|
||||
JUCE_MAIN_FUNCTION_DEFINITION
|
||||
|
|
|
|||
|
|
@ -228,38 +228,8 @@ static pointer_sized_int VSTINTERFACECALL audioMaster (VstEffectInterface*, int3
|
|||
|
||||
namespace
|
||||
{
|
||||
static bool xErrorTriggered = false;
|
||||
|
||||
static int temporaryErrorHandler (::Display*, XErrorEvent*)
|
||||
{
|
||||
xErrorTriggered = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef void (*EventProcPtr) (XEvent* ev);
|
||||
|
||||
static EventProcPtr getPropertyFromXWindow (Window handle, Atom atom)
|
||||
{
|
||||
XErrorHandler oldErrorHandler = XSetErrorHandler (temporaryErrorHandler);
|
||||
xErrorTriggered = false;
|
||||
|
||||
int userSize;
|
||||
unsigned long bytes, userCount;
|
||||
unsigned char* data;
|
||||
Atom userType;
|
||||
|
||||
{
|
||||
ScopedXDisplay xDisplay;
|
||||
|
||||
XGetWindowProperty (xDisplay.display, handle, atom, 0, 1, false, AnyPropertyType,
|
||||
&userType, &userSize, &userCount, &bytes, &data);
|
||||
}
|
||||
|
||||
XSetErrorHandler (oldErrorHandler);
|
||||
|
||||
return (userCount == 1 && ! xErrorTriggered) ? *reinterpret_cast<EventProcPtr*> (data) : nullptr;
|
||||
}
|
||||
|
||||
Window getChildWindow (Window windowToCheck)
|
||||
{
|
||||
Window rootWindow, parentWindow;
|
||||
|
|
@ -276,55 +246,6 @@ namespace
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void translateJuceToXButtonModifiers (const MouseEvent& e, XEvent& ev) noexcept
|
||||
{
|
||||
if (e.mods.isLeftButtonDown())
|
||||
{
|
||||
ev.xbutton.button = Button1;
|
||||
ev.xbutton.state |= Button1Mask;
|
||||
}
|
||||
else if (e.mods.isRightButtonDown())
|
||||
{
|
||||
ev.xbutton.button = Button3;
|
||||
ev.xbutton.state |= Button3Mask;
|
||||
}
|
||||
else if (e.mods.isMiddleButtonDown())
|
||||
{
|
||||
ev.xbutton.button = Button2;
|
||||
ev.xbutton.state |= Button2Mask;
|
||||
}
|
||||
}
|
||||
|
||||
static void translateJuceToXMotionModifiers (const MouseEvent& e, XEvent& ev) noexcept
|
||||
{
|
||||
if (e.mods.isLeftButtonDown()) ev.xmotion.state |= Button1Mask;
|
||||
else if (e.mods.isRightButtonDown()) ev.xmotion.state |= Button3Mask;
|
||||
else if (e.mods.isMiddleButtonDown()) ev.xmotion.state |= Button2Mask;
|
||||
}
|
||||
|
||||
static void translateJuceToXCrossingModifiers (const MouseEvent& e, XEvent& ev) noexcept
|
||||
{
|
||||
if (e.mods.isLeftButtonDown()) ev.xcrossing.state |= Button1Mask;
|
||||
else if (e.mods.isRightButtonDown()) ev.xcrossing.state |= Button3Mask;
|
||||
else if (e.mods.isMiddleButtonDown()) ev.xcrossing.state |= Button2Mask;
|
||||
}
|
||||
|
||||
static void translateJuceToXMouseWheelModifiers (const MouseEvent& e, const float increment, XEvent& ev) noexcept
|
||||
{
|
||||
ignoreUnused (e);
|
||||
|
||||
if (increment < 0)
|
||||
{
|
||||
ev.xbutton.button = Button5;
|
||||
ev.xbutton.state |= Button5Mask;
|
||||
}
|
||||
else if (increment > 0)
|
||||
{
|
||||
ev.xbutton.button = Button4;
|
||||
ev.xbutton.state |= Button4Mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@
|
|||
|
||||
namespace FunctionTestsHelpers
|
||||
{
|
||||
void incrementArgument (int& x) { x++; };
|
||||
double multiply (double x, double a) noexcept { return a * x; };
|
||||
void incrementArgument (int& x) { x++; }
|
||||
double multiply (double x, double a) noexcept { return a * x; }
|
||||
|
||||
struct BigData
|
||||
{
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace internal
|
|||
template <> struct make_unsigned<int> { typedef unsigned int type; };
|
||||
template <> struct make_unsigned<long> { typedef unsigned long type; };
|
||||
template <> struct make_unsigned<long long> { typedef unsigned long long type; };
|
||||
};
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
|
|
@ -181,7 +181,7 @@ public:
|
|||
|| ((numSigFigs == 0 && (! decimalPointFound)) && digit == 0))
|
||||
continue;
|
||||
|
||||
*currentCharacter++ = '0' + (char) digit;
|
||||
*currentCharacter++ = (char) ('0' + (char) digit);
|
||||
numSigFigs++;
|
||||
}
|
||||
else if ((! decimalPointFound) && *text == '.')
|
||||
|
|
@ -219,7 +219,7 @@ public:
|
|||
|
||||
if (digit != 0 || exponentMagnitude != 0)
|
||||
{
|
||||
*currentCharacter++ = '0' + (char) digit;
|
||||
*currentCharacter++ = (char) ('0' + (char) digit);
|
||||
exponentMagnitude = (exponentMagnitude * 10) + digit;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ struct SIMDNativeOps<int8_t>
|
|||
const int8_t* lo_ptr = reinterpret_cast<const int8_t*> (&lo);
|
||||
const int8_t* hi_ptr = reinterpret_cast<const int8_t*> (&hi);
|
||||
|
||||
return lo_ptr[0] + hi_ptr[0] + lo_ptr[16] + hi_ptr[16];
|
||||
return (int8_t) (lo_ptr[0] + hi_ptr[0] + lo_ptr[16] + hi_ptr[16]);
|
||||
}
|
||||
|
||||
static forcedinline __m256i JUCE_VECTOR_CALLTYPE mul (__m256i a, __m256i b)
|
||||
|
|
@ -257,7 +257,7 @@ struct SIMDNativeOps<uint8_t>
|
|||
const uint8_t* lo_ptr = reinterpret_cast<const uint8_t*> (&lo);
|
||||
const uint8_t* hi_ptr = reinterpret_cast<const uint8_t*> (&hi);
|
||||
|
||||
return lo_ptr[0] + hi_ptr[0] + lo_ptr[16] + hi_ptr[16];
|
||||
return (uint8_t) (lo_ptr[0] + hi_ptr[0] + lo_ptr[16] + hi_ptr[16]);
|
||||
}
|
||||
|
||||
static forcedinline __m256i JUCE_VECTOR_CALLTYPE mul (__m256i a, __m256i b)
|
||||
|
|
@ -308,7 +308,7 @@ struct SIMDNativeOps<int16_t>
|
|||
tmp = _mm256_hadd_epi16 (tmp, tmp);
|
||||
tmp = _mm256_hadd_epi16 (tmp, tmp);
|
||||
int16_t* ptr = reinterpret_cast<int16_t*> (&tmp);
|
||||
return ptr[0] + ptr[8];
|
||||
return (int16_t) (ptr[0] + ptr[8]);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ struct SIMDNativeOps<uint16_t>
|
|||
tmp = _mm256_hadd_epi16 (tmp, tmp);
|
||||
tmp = _mm256_hadd_epi16 (tmp, tmp);
|
||||
uint16_t* ptr = reinterpret_cast<uint16_t*> (&tmp);
|
||||
return ptr[0] + ptr[8];
|
||||
return (uint16_t) (ptr[0] + ptr[8]);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -844,8 +844,8 @@ FlexItem FlexItem::withWidth (float newWidth) const noexcept { auto fi =
|
|||
FlexItem FlexItem::withMinWidth (float newMinWidth) const noexcept { auto fi = *this; fi.minWidth = newMinWidth; return fi; }
|
||||
FlexItem FlexItem::withMaxWidth (float newMaxWidth) const noexcept { auto fi = *this; fi.maxWidth = newMaxWidth; return fi; }
|
||||
|
||||
FlexItem FlexItem::withMinHeight (float newMinHeight) const noexcept { auto fi = *this; fi.minHeight = newMinHeight; return fi; };
|
||||
FlexItem FlexItem::withMaxHeight (float newMaxHeight) const noexcept { auto fi = *this; fi.maxHeight = newMaxHeight; return fi; };
|
||||
FlexItem FlexItem::withMinHeight (float newMinHeight) const noexcept { auto fi = *this; fi.minHeight = newMinHeight; return fi; }
|
||||
FlexItem FlexItem::withMaxHeight (float newMaxHeight) const noexcept { auto fi = *this; fi.maxHeight = newMaxHeight; return fi; }
|
||||
FlexItem FlexItem::withHeight (float newHeight) const noexcept { auto fi = *this; fi.height = newHeight; return fi; }
|
||||
|
||||
FlexItem FlexItem::withMargin (Margin m) const noexcept { auto fi = *this; fi.margin = m; return fi; }
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ struct ReportingThreadContainer : public ChangeListener,
|
|||
juce_DeclareSingleton_SingleThreaded_Minimal (ReportingThreadContainer)
|
||||
};
|
||||
|
||||
juce_ImplementSingleton_SingleThreaded (ReportingThreadContainer);
|
||||
juce_ImplementSingleton_SingleThreaded (ReportingThreadContainer)
|
||||
|
||||
//==============================================================================
|
||||
struct ReportingThread : public Thread,
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ private:
|
|||
// calling any of the mouse input methods!
|
||||
jassert (scale > 0);
|
||||
|
||||
return Point<float> ((mousePos.x - area.getCentreX()) / scale,
|
||||
(area.getCentreY() - mousePos.y) / scale);
|
||||
return Point<float> ((mousePos.x - (float) area.getCentreX()) / (float) scale,
|
||||
((float) area.getCentreY() - mousePos.y) / (float) scale);
|
||||
}
|
||||
|
||||
VectorType projectOnSphere (const Point<float> pos) const noexcept
|
||||
|
|
|
|||
|
|
@ -42,9 +42,6 @@ OSCTimeTag::OSCTimeTag (Time time) noexcept
|
|||
{
|
||||
const uint64 milliseconds = (uint64) time.toMilliseconds() + millisecondsBetweenOscAndJuceEpochs;
|
||||
|
||||
// something went seriously wrong if the line above didn't render the time nonnegative!
|
||||
jassert (milliseconds >= 0);
|
||||
|
||||
uint64 seconds = milliseconds / 1000;
|
||||
uint32 fractionalPart = uint32 (4294967.296 * (milliseconds % 1000));
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ void InAppPurchases::getProductsInformation (const StringArray& productIdentifie
|
|||
#else
|
||||
Array<Product> products;
|
||||
for (auto productId : productIdentifiers)
|
||||
products.add (Product {productId});
|
||||
products.add (Product { productId, {}, {}, {}, {} });
|
||||
|
||||
listeners.call (&Listener::productsInfoReturned, products);
|
||||
#endif
|
||||
|
|
@ -63,7 +63,7 @@ void InAppPurchases::purchaseProduct (const String& productIdentifier,
|
|||
pimpl->purchaseProduct (productIdentifier, isSubscription,
|
||||
upgradeProductIdentifiers, creditForUnusedSubscription);
|
||||
#else
|
||||
Listener::PurchaseInfo purchaseInfo { Purchase {"", productIdentifier}, {} };
|
||||
Listener::PurchaseInfo purchaseInfo { Purchase { "", productIdentifier, {}, {}, {} }, {} };
|
||||
|
||||
listeners.call (&Listener::productPurchaseFinished, purchaseInfo, false, "In-app purchases unavailable");
|
||||
ignoreUnused (isSubscription, upgradeProductIdentifiers, creditForUnusedSubscription);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue