1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

A few android warning fixes.

This commit is contained in:
jules 2013-07-31 22:14:11 +01:00
parent 7a47c12a76
commit 3cd00c8730
7 changed files with 14 additions and 11 deletions

View file

@ -77,8 +77,8 @@ public:
numClientInputChannels (0), numDeviceInputChannels (0), numDeviceInputChannelsAvailable (2),
numClientOutputChannels (0), numDeviceOutputChannels (0),
actualBufferSize (0), isRunning (false),
outputChannelBuffer (1, 1),
inputChannelBuffer (1, 1)
inputChannelBuffer (1, 1),
outputChannelBuffer (1, 1)
{
JNIEnv* env = getEnv();
sampleRate = env->CallStaticIntMethod (AudioTrack, AudioTrack.getNativeOutputSampleRate, MODE_STREAM);

View file

@ -234,6 +234,7 @@ bool Process::openDocument (const String& fileName, const String& parameters)
{
const LocalRef<jstring> t (javaString (fileName));
android.activity.callVoidMethod (JuceAppActivity.launchURL, t.get());
return true;
}
void File::revealToUser() const

View file

@ -28,5 +28,5 @@
void Logger::outputDebugString (const String& text)
{
__android_log_print (ANDROID_LOG_INFO, "JUCE", text.toUTF8());
__android_log_print (ANDROID_LOG_INFO, "JUCE", "%s", text.toUTF8().getAddress());
}

View file

@ -126,7 +126,7 @@ static void findIPAddresses (int sock, Array<IPAddress>& result)
cfg.ifc_buf += IFNAMSIZ + cfg.ifc_req->ifr_addr.sa_len;
}
#else
for (int i = 0; i < cfg.ifc_len / sizeof (struct ifreq); ++i)
for (size_t i = 0; i < cfg.ifc_len / sizeof (struct ifreq); ++i)
{
const ifreq& item = cfg.ifc_req[i];

View file

@ -65,10 +65,15 @@ struct CurrentThreadHolder : public ReferenceCountedObject
static char currentThreadHolderLock [sizeof (SpinLock)]; // (statically initialised to zeros).
static SpinLock* castToSpinLockWithoutAliasingWarning (void* s)
{
return static_cast<SpinLock*> (s);
}
static CurrentThreadHolder::Ptr getCurrentThreadHolder()
{
static CurrentThreadHolder::Ptr currentThreadHolder;
SpinLock::ScopedLockType lock (*reinterpret_cast <SpinLock*> (currentThreadHolderLock));
SpinLock::ScopedLockType lock (*castToSpinLockWithoutAliasingWarning (currentThreadHolderLock));
if (currentThreadHolder == nullptr)
currentThreadHolder = new CurrentThreadHolder();

View file

@ -697,7 +697,6 @@ JUCE_JNI_CALLBACK (JUCE_ANDROID_ACTIVITY_CLASSNAME, setScreenSize, void, (JNIEnv
jint screenWidth, jint screenHeight,
jint dpi))
{
const bool isSystemInitialised = android.screenWidth != 0;
android.screenWidth = screenWidth;
android.screenHeight = screenHeight;
android.dpi = dpi;

View file

@ -193,8 +193,8 @@ private:
class ColourSelector::HueSelectorComp : public Component
{
public:
HueSelectorComp (ColourSelector& cs, float& hue, float& sat, float& val, const int edgeSize)
: owner (cs), h (hue), s (sat), v (val), edge (edgeSize)
HueSelectorComp (ColourSelector& cs, float& hue, const int edgeSize)
: owner (cs), h (hue), edge (edgeSize)
{
addAndMakeVisible (&marker);
}
@ -236,8 +236,6 @@ public:
private:
ColourSelector& owner;
float& h;
float& s;
float& v;
HueSelectorMarker marker;
const int edge;
@ -332,7 +330,7 @@ ColourSelector::ColourSelector (const int sectionsToShow, const int edge, const
if ((flags & showColourspace) != 0)
{
addAndMakeVisible (colourSpace = new ColourSpaceView (*this, h, s, v, gapAroundColourSpaceComponent));
addAndMakeVisible (hueSelector = new HueSelectorComp (*this, h, s, v, gapAroundColourSpaceComponent));
addAndMakeVisible (hueSelector = new HueSelectorComp (*this, h, gapAroundColourSpaceComponent));
}
update();