Browse Source

A few android warning fixes.

tags/2021-05-28
jules 12 years ago
parent
commit
3cd00c8730
7 changed files with 14 additions and 11 deletions
  1. +2
    -2
      modules/juce_audio_devices/native/juce_android_Audio.cpp
  2. +1
    -0
      modules/juce_core/native/juce_android_Files.cpp
  3. +1
    -1
      modules/juce_core/native/juce_android_Misc.cpp
  4. +1
    -1
      modules/juce_core/network/juce_IPAddress.cpp
  5. +6
    -1
      modules/juce_core/threads/juce_Thread.cpp
  6. +0
    -1
      modules/juce_gui_basics/native/juce_android_Windowing.cpp
  7. +3
    -5
      modules/juce_gui_extra/misc/juce_ColourSelector.cpp

+ 2
- 2
modules/juce_audio_devices/native/juce_android_Audio.cpp View File

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


+ 1
- 0
modules/juce_core/native/juce_android_Files.cpp View File

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


+ 1
- 1
modules/juce_core/native/juce_android_Misc.cpp View File

@@ -28,5 +28,5 @@
void Logger::outputDebugString (const String& text) 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());
} }

+ 1
- 1
modules/juce_core/network/juce_IPAddress.cpp 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; cfg.ifc_buf += IFNAMSIZ + cfg.ifc_req->ifr_addr.sa_len;
} }
#else #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]; const ifreq& item = cfg.ifc_req[i];


+ 6
- 1
modules/juce_core/threads/juce_Thread.cpp View File

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


+ 0
- 1
modules/juce_gui_basics/native/juce_android_Windowing.cpp View File

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


+ 3
- 5
modules/juce_gui_extra/misc/juce_ColourSelector.cpp View File

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


Loading…
Cancel
Save