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),
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);


+ 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));
android.activity.callVoidMethod (JuceAppActivity.launchURL, t.get());
return true;
}
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)
{
__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;
}
#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];


+ 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 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();


+ 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 dpi))
{
const bool isSystemInitialised = android.screenWidth != 0;
android.screenWidth = screenWidth;
android.screenHeight = screenHeight;
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
{
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();


Loading…
Cancel
Save