Browse Source

Fixed some Android compiler warnings

tags/2021-05-28
Tom Poole 6 years ago
parent
commit
670f77f80c
37 changed files with 170 additions and 169 deletions
  1. +1
    -1
      examples/GUI/VideoDemo.h
  2. +8
    -8
      modules/juce_audio_devices/native/juce_android_Audio.cpp
  3. +5
    -5
      modules/juce_audio_devices/native/juce_android_OpenSL.cpp
  4. +2
    -2
      modules/juce_audio_devices/native/juce_ios_Audio.cpp
  5. +1
    -1
      modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp
  6. +2
    -2
      modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm
  7. +1
    -1
      modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h
  8. +1
    -1
      modules/juce_core/misc/juce_ConsoleApplication.cpp
  9. +7
    -7
      modules/juce_core/native/juce_android_Files.cpp
  10. +14
    -14
      modules/juce_core/native/juce_android_JNIHelpers.cpp
  11. +15
    -15
      modules/juce_core/native/juce_android_JNIHelpers.h
  12. +9
    -9
      modules/juce_core/native/juce_android_Network.cpp
  13. +2
    -2
      modules/juce_core/native/juce_android_RuntimePermissions.cpp
  14. +1
    -1
      modules/juce_core/native/juce_android_Threads.cpp
  15. +2
    -1
      modules/juce_core/native/juce_mac_Network.mm
  16. +4
    -4
      modules/juce_events/native/juce_android_Messaging.cpp
  17. +1
    -0
      modules/juce_graphics/image_formats/juce_JPEGLoader.cpp
  18. +2
    -2
      modules/juce_graphics/native/juce_android_Fonts.cpp
  19. +2
    -2
      modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp
  20. +4
    -4
      modules/juce_gui_basics/native/juce_MultiTouchMapper.h
  21. +6
    -6
      modules/juce_gui_basics/native/juce_android_ContentSharer.cpp
  22. +1
    -1
      modules/juce_gui_basics/native/juce_android_FileChooser.cpp
  23. +8
    -8
      modules/juce_gui_basics/native/juce_android_Windowing.cpp
  24. +1
    -1
      modules/juce_gui_basics/native/juce_ios_ContentSharer.cpp
  25. +1
    -1
      modules/juce_gui_basics/native/juce_ios_FileChooser.mm
  26. +1
    -1
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
  27. +1
    -1
      modules/juce_gui_extra/embedding/juce_AndroidViewComponent.h
  28. +1
    -1
      modules/juce_gui_extra/embedding/juce_UIViewComponent.h
  29. +2
    -2
      modules/juce_gui_extra/native/juce_AndroidViewComponent.cpp
  30. +26
    -27
      modules/juce_gui_extra/native/juce_android_PushNotifications.cpp
  31. +5
    -5
      modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp
  32. +1
    -1
      modules/juce_gui_extra/native/juce_ios_UIViewComponent.mm
  33. +3
    -3
      modules/juce_opengl/native/juce_OpenGL_android.h
  34. +2
    -2
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp
  35. +20
    -20
      modules/juce_video/native/juce_android_CameraDevice.h
  36. +4
    -4
      modules/juce_video/native/juce_android_Video.h
  37. +3
    -3
      modules/juce_video/native/juce_ios_CameraDevice.h

+ 1
- 1
examples/GUI/VideoDemo.h View File

@@ -363,7 +363,7 @@ public:
setPortraitOrientationEnabled (true);
}
~VideoDemo()
~VideoDemo() override
{
curVideoComp->onPlaybackStarted = nullptr;
curVideoComp->onPlaybackStopped = nullptr;


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

@@ -73,7 +73,7 @@ public:
AndroidAudioIODevice (const String& deviceName)
: AudioIODevice (deviceName, javaAudioTypeName),
Thread ("audio"),
minBufferSizeOut (0), minBufferSizeIn (0), callback (0), sampleRate (0),
minBufferSizeOut (0), minBufferSizeIn (0), callback (nullptr), sampleRate (0),
numClientInputChannels (0), numDeviceInputChannels (0), numDeviceInputChannelsAvailable (2),
numClientOutputChannels (0), numDeviceOutputChannels (0),
actualBufferSize (0), isRunning (false),
@@ -100,7 +100,7 @@ public:
<< sampleRate << " Hz; input chans: " << numDeviceInputChannelsAvailable);
}
~AndroidAudioIODevice()
~AndroidAudioIODevice() override
{
close();
}
@@ -196,7 +196,7 @@ public:
(jint) (minBufferSizeOut * numDeviceOutputChannels * static_cast<int> (sizeof (int16))), MODE_STREAM)));
const bool supportsUnderrunCount = (getAndroidSDKVersion() >= 24);
getUnderrunCount = supportsUnderrunCount ? env->GetMethodID (AudioTrack, "getUnderrunCount", "()I") : 0;
getUnderrunCount = supportsUnderrunCount ? env->GetMethodID (AudioTrack, "getUnderrunCount", "()I") : nullptr;
int outputDeviceState = env->CallIntMethod (outputDevice, AudioTrack.getState);
if (outputDeviceState > 0)
@@ -282,11 +282,11 @@ public:
BigInteger getActiveOutputChannels() const override { return activeOutputChans; }
BigInteger getActiveInputChannels() const override { return activeInputChans; }
String getLastError() override { return lastError; }
bool isPlaying() override { return isRunning && callback != 0; }
bool isPlaying() override { return isRunning && callback != nullptr; }
int getXRunCount() const noexcept override
{
if (outputDevice != nullptr && getUnderrunCount != 0)
if (outputDevice != nullptr && getUnderrunCount != nullptr)
return getEnv()->CallIntMethod (outputDevice, getUnderrunCount);
return -1;
@@ -337,7 +337,7 @@ public:
DBG ("Audio read under-run! " << numRead);
}
jshort* const src = env->GetShortArrayElements (audioBuffer, 0);
jshort* const src = env->GetShortArrayElements (audioBuffer, nullptr);
for (int chan = 0; chan < inputChannelBuffer.getNumChannels(); ++chan)
{
@@ -380,7 +380,7 @@ public:
if (threadShouldExit())
break;
jshort* const dest = env->GetShortArrayElements (audioBuffer, 0);
jshort* const dest = env->GetShortArrayElements (audioBuffer, nullptr);
for (int chan = 0; chan < numDeviceOutputChannels; ++chan)
{
@@ -417,7 +417,7 @@ private:
BigInteger activeOutputChans, activeInputChans;
GlobalRef outputDevice, inputDevice;
AudioBuffer<float> inputChannelBuffer, outputChannelBuffer;
jmethodID getUnderrunCount = 0;
jmethodID getUnderrunCount = nullptr;
void closeDevices()
{


+ 5
- 5
modules/juce_audio_devices/native/juce_android_OpenSL.cpp View File

@@ -340,7 +340,7 @@ public:
auto status = (*config)->AcquireJavaProxy (config, /*SL_ANDROID_JAVA_PROXY_ROUTING*/1,
&audioRoutingJni);
if (status == SL_RESULT_SUCCESS && audioRoutingJni != 0)
if (status == SL_RESULT_SUCCESS && audioRoutingJni != nullptr)
javaProxy = GlobalRef (LocalRef<jobject>(getEnv()->NewLocalRef (audioRoutingJni)));
}
}
@@ -662,7 +662,7 @@ public:
}
const bool supportsUnderrunCount = (getAndroidSDKVersion() >= 24);
getUnderrunCount = supportsUnderrunCount ? getEnv()->GetMethodID (AudioTrack, "getUnderrunCount", "()I") : 0;
getUnderrunCount = supportsUnderrunCount ? getEnv()->GetMethodID (AudioTrack, "getUnderrunCount", "()I") : nullptr;
}
}
}
@@ -727,7 +727,7 @@ public:
int getXRunCount() const noexcept override
{
if (player != nullptr && player->javaProxy != nullptr && getUnderrunCount != 0)
if (player != nullptr && player->javaProxy != nullptr && getUnderrunCount != nullptr)
return getEnv()->CallIntMethod (player->javaProxy, getUnderrunCount);
return -1;
@@ -783,7 +783,7 @@ public:
std::unique_ptr<OpenSLQueueRunnerPlayer<T>> player;
std::unique_ptr<OpenSLQueueRunnerRecorder<T>> recorder;
Atomic<int> guard;
jmethodID getUnderrunCount = 0;
jmethodID getUnderrunCount = nullptr;
};
//==============================================================================
@@ -810,7 +810,7 @@ public:
ignoreUnused (success);
}
~OpenSLAudioIODevice()
~OpenSLAudioIODevice() override
{
close();
}


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

@@ -216,7 +216,7 @@ class iOSAudioIODeviceType : public AudioIODeviceType,
{
public:
iOSAudioIODeviceType();
~iOSAudioIODeviceType();
~iOSAudioIODeviceType() override;
void scanForDevices() override;
StringArray getDeviceNames (bool) const override;
@@ -262,7 +262,7 @@ struct iOSAudioIODevice::Pimpl : public AudioPlayHead,
sessionHolder->activeDevices.add (this);
}
~Pimpl()
~Pimpl() override
{
sessionHolder->activeDevices.removeFirstMatchingValue (this);


+ 1
- 1
modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp View File

@@ -421,7 +421,7 @@ public:
enterModalState (true, exitCallback.release(), true);
}
~BluetoothMidiSelectorOverlay()
~BluetoothMidiSelectorOverlay() override
{
AndroidBluetoothMidiInterface::startStopScan (false);
}


+ 2
- 2
modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm View File

@@ -61,7 +61,7 @@ public:
enterModalState (true, exitCallback.release(), true);
}
~BluetoothMidiSelectorOverlay()
~BluetoothMidiSelectorOverlay() override
{
nativeSelectorComponent.setView (nullptr);
[controller release];
@@ -126,7 +126,7 @@ bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback*
bool BluetoothMidiDevicePairingDialogue::isAvailable()
{
return NSClassFromString ([NSString stringWithUTF8String: "CABTMIDICentralViewController"]) != nil;
return NSClassFromString (@"CABTMIDICentralViewController") != nil;
}
} // namespace juce


+ 1
- 1
modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h View File

@@ -174,7 +174,7 @@ struct NativeFunction
jassert (slash > 0); // The slash can't be the first character in this string!
jassert (nameAndArgTypes[slash + 1] != 0); // The slash must be followed by a return type character
jassert (String (nameAndArgTypes).substring (0, slash).containsOnly ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
jassert (! String ("0123456789").containsChar (nameAndArgTypes[0]));
jassert (! String ("0123456789").containsChar (String (nameAndArgTypes)[0]));
jassert (String (nameAndArgTypes).substring (slash + 1).containsOnly ("vifb"));
jassert (String (nameAndArgTypes).substring (slash + 2).containsOnly ("ifb")); // arguments must only be of these types


+ 1
- 1
modules/juce_core/misc/juce_ConsoleApplication.cpp View File

@@ -111,7 +111,7 @@ bool ArgumentList::Argument::isShortOption (char option) const
{
jassert (option != '-'); // this is probably not what you intended to pass in
return isShortOption() && text.containsChar (option);
return isShortOption() && text.containsChar (String (option)[0]);
}
bool ArgumentList::Argument::operator== (StringRef wildcard) const


+ 7
- 7
modules/juce_core/native/juce_android_Files.cpp View File

@@ -89,7 +89,7 @@ static File getWellKnownFolder (const char* folderId)
auto* env = getEnv();
auto fieldId = env->GetStaticFieldID (AndroidEnvironment, folderId, "Ljava/lang/String;");
if (fieldId == 0)
if (fieldId == nullptr)
{
// unknown field in environment
jassertfalse;
@@ -194,7 +194,7 @@ public:
auto* env = getEnv();
LocalRef<jobject> contentResolver (env->CallObjectMethod (getAppContext().get(), AndroidContext.getContentResolver));
if (contentResolver == 0)
if (contentResolver == nullptr)
return {};
auto filename = getStringUsingDataColumn ("_display_name", env, uri, contentResolver);
@@ -298,7 +298,7 @@ private:
auto* env = getEnv();
static jmethodID m = (env->GetMethodID (AndroidContext, "getExternalFilesDirs",
"(Ljava/lang/String;)[Ljava/io/File;"));
if (m == 0)
if (m == nullptr)
return {};
auto paths = convertFileArray (LocalRef<jobject> (env->CallObjectMethod (getAppContext().get(), m, nullptr)));
@@ -406,7 +406,7 @@ private:
return {};
}
if (cursor == 0)
if (cursor == nullptr)
return {};
String fileName;
@@ -439,7 +439,7 @@ struct AndroidContentUriOutputStream : public OutputStream
{
}
~AndroidContentUriOutputStream()
~AndroidContentUriOutputStream() override
{
stream.callVoidMethod (AndroidOutputStream.close);
}
@@ -484,7 +484,7 @@ OutputStream* juce_CreateContentURIOutputStream (const URL& url)
{
auto stream = AndroidContentUriResolver::getStreamForContentUri (url, false);
return (stream.get() != 0 ? new AndroidContentUriOutputStream (std::move (stream)) : nullptr);
return (stream.get() != nullptr ? new AndroidContentUriOutputStream (std::move (stream)) : nullptr);
}
//==============================================================================
@@ -676,7 +676,7 @@ private:
void FileOutputStream::flushInternal()
{
if (fileHandle != 0)
if (fileHandle != nullptr)
{
if (fsync (getFD (fileHandle)) == -1)
status = getResultForErrno();


+ 14
- 14
modules/juce_core/native/juce_android_JNIHelpers.cpp View File

@@ -116,7 +116,7 @@ struct SystemJavaClassComparator
//==============================================================================
JNIClassBase::JNIClassBase (const char* cp, int classMinSDK, const void* bc, size_t n)
: classPath (cp), byteCode (bc), byteCodeSize (n), minSDK (classMinSDK), classRef (0)
: classPath (cp), byteCode (bc), byteCodeSize (n), minSDK (classMinSDK), classRef (nullptr)
{
SystemJavaClassComparator comparator;
@@ -162,13 +162,13 @@ void JNIClassBase::initialise (JNIEnv* env)
LocalRef<jobject> defaultClassLoader (env->CallStaticObjectMethod (JavaClassLoader, JavaClassLoader.getSystemClassLoader));
tryLoadingClassWithClassLoader (env, defaultClassLoader.get());
if (classRef == 0)
if (classRef == nullptr)
{
for (auto& byteCodeLoader : byteCodeLoaders)
{
tryLoadingClassWithClassLoader (env, byteCodeLoader.get());
if (classRef != 0)
if (classRef != nullptr)
break;
}
@@ -234,10 +234,10 @@ void JNIClassBase::initialise (JNIEnv* env)
}
}
if (classRef == 0)
if (classRef == nullptr)
classRef = (jclass) env->NewGlobalRef (LocalRef<jobject> (env->FindClass (classPath)));
jassert (classRef != 0);
jassert (classRef != nullptr);
initialiseFields (env);
}
}
@@ -253,7 +253,7 @@ void JNIClassBase::tryLoadingClassWithClassLoader (JNIEnv* env, jobject classLoa
if (jthrowable exception = env->ExceptionOccurred ())
{
env->ExceptionClear();
classObj = 0;
classObj = nullptr;
}
// later versions of Android don't throw at all, so re-check the object
@@ -263,7 +263,7 @@ void JNIClassBase::tryLoadingClassWithClassLoader (JNIEnv* env, jobject classLoa
void JNIClassBase::release (JNIEnv* env)
{
if (classRef != 0)
if (classRef != nullptr)
env->DeleteGlobalRef (classRef);
}
@@ -284,28 +284,28 @@ void JNIClassBase::releaseAllClasses (JNIEnv* env)
jmethodID JNIClassBase::resolveMethod (JNIEnv* env, const char* methodName, const char* params)
{
jmethodID m = env->GetMethodID (classRef, methodName, params);
jassert (m != 0);
jassert (m != nullptr);
return m;
}
jmethodID JNIClassBase::resolveStaticMethod (JNIEnv* env, const char* methodName, const char* params)
{
jmethodID m = env->GetStaticMethodID (classRef, methodName, params);
jassert (m != 0);
jassert (m != nullptr);
return m;
}
jfieldID JNIClassBase::resolveField (JNIEnv* env, const char* fieldName, const char* signature)
{
jfieldID f = env->GetFieldID (classRef, fieldName, signature);
jassert (f != 0);
jassert (f != nullptr);
return f;
}
jfieldID JNIClassBase::resolveStaticField (JNIEnv* env, const char* fieldName, const char* signature)
{
jfieldID f = env->GetStaticFieldID (classRef, fieldName, signature);
jassert (f != 0);
jassert (f != nullptr);
return f;
}
@@ -440,10 +440,10 @@ int getAndroidSDKVersion()
auto* env = getEnv();
auto buildVersion = env->FindClass ("android/os/Build$VERSION");
jassert (buildVersion != 0);
jassert (buildVersion != nullptr);
auto sdkVersionField = env->GetStaticFieldID (buildVersion, "SDK_INT", "I");
jassert (sdkVersionField != 0);
jassert (sdkVersionField != nullptr);
return env->GetStaticIntField (buildVersion, sdkVersionField);
}();
@@ -581,7 +581,7 @@ void FragmentOverlay::onRequestPermissionsResultNative (JNIEnv* env, jobject, jl
if (n > 0)
{
auto* data = env->GetIntArrayElements (jGrantResults, 0);
auto* data = env->GetIntArrayElements (jGrantResults, nullptr);
for (int i = 0; i < n; ++i)
grantResults.add (data[i]);


+ 15
- 15
modules/juce_core/native/juce_android_JNIHelpers.h View File

@@ -31,18 +31,18 @@ template <typename JavaType>
class LocalRef
{
public:
explicit inline LocalRef() noexcept : obj (0) {}
explicit inline LocalRef() noexcept : obj (nullptr) {}
explicit inline LocalRef (JavaType o) noexcept : obj (o) {}
inline LocalRef (const LocalRef& other) noexcept : obj (retain (other.obj)) {}
inline LocalRef (LocalRef&& other) noexcept : obj (0) { std::swap (obj, other.obj); }
inline LocalRef (LocalRef&& other) noexcept : obj (nullptr) { std::swap (obj, other.obj); }
~LocalRef() { clear(); }
void clear()
{
if (obj != 0)
if (obj != nullptr)
{
getEnv()->DeleteLocalRef (obj);
obj = 0;
obj = nullptr;
}
}
@@ -69,7 +69,7 @@ private:
static JavaType retain (JavaType obj)
{
return obj == 0 ? 0 : (JavaType) getEnv()->NewLocalRef (obj);
return obj == nullptr ? nullptr : (JavaType) getEnv()->NewLocalRef (obj);
}
};
@@ -77,21 +77,21 @@ private:
class GlobalRef
{
public:
inline GlobalRef() noexcept : obj (0) {}
inline GlobalRef() noexcept : obj (nullptr) {}
inline explicit GlobalRef (const LocalRef<jobject>& o) : obj (retain (o.get(), getEnv())) {}
inline explicit GlobalRef (const LocalRef<jobject>& o, JNIEnv* env) : obj (retain (o.get(), env)) {}
inline GlobalRef (const GlobalRef& other) : obj (retain (other.obj, getEnv())) {}
inline GlobalRef (GlobalRef && other) noexcept : obj (0) { std::swap (other.obj, obj); }
inline GlobalRef (GlobalRef && other) noexcept : obj (nullptr) { std::swap (other.obj, obj); }
~GlobalRef() { clear(); }
inline void clear() { if (obj != 0) clear (getEnv()); }
inline void clear() { if (obj != nullptr) clear (getEnv()); }
inline void clear (JNIEnv* env)
{
if (obj != 0)
if (obj != nullptr)
{
env->DeleteGlobalRef (obj);
obj = 0;
obj = nullptr;
}
}
@@ -147,11 +147,11 @@ public:
private:
//==============================================================================
jobject obj = 0;
jobject obj = nullptr;
static inline jobject retain (jobject obj, JNIEnv* env)
{
return obj == 0 ? 0 : env->NewGlobalRef (obj);
return obj == nullptr ? nullptr : env->NewGlobalRef (obj);
}
};
@@ -193,7 +193,7 @@ private:
size_t byteCodeSize;
int minSDK;
jclass classRef = 0;
jclass classRef = nullptr;
static Array<JNIClassBase*>& getClasses();
void initialise (JNIEnv*);
@@ -755,7 +755,7 @@ namespace
{
inline String juceString (JNIEnv* env, jstring s)
{
if (s == 0)
if (s == nullptr)
return {};
const char* const utf8 = env->GetStringUTFChars (s, nullptr);
@@ -889,7 +889,7 @@ private:
//==============================================================================
struct SurfaceHolderCallback : AndroidInterfaceImplementer
{
virtual ~SurfaceHolderCallback() {}
virtual ~SurfaceHolderCallback() override = default;
virtual void surfaceChanged (LocalRef<jobject> holder, int format, int width, int height) = 0;
virtual void surfaceCreated (LocalRef<jobject> holder) = 0;


+ 9
- 9
modules/juce_core/native/juce_android_Network.cpp View File

@@ -297,7 +297,7 @@ public:
const ScopedLock lock (createStreamLock);
if (stream != 0)
if (stream != nullptr)
{
stream.callVoidMethod (HTTPStream.release);
stream.clear();
@@ -333,7 +333,7 @@ public:
if (isPost)
WebInputStream::createHeadersAndPostData (url, headers, postData);
jbyteArray postDataArray = 0;
jbyteArray postDataArray = nullptr;
if (postData.getSize() > 0)
{
@@ -348,7 +348,7 @@ public:
jassert (Thread::getCurrentThread() != nullptr);
jintArray statusCodeArray = env->NewIntArray (1);
jassert (statusCodeArray != 0);
jassert (statusCodeArray != nullptr);
{
const ScopedLock lock (createStreamLock);
@@ -367,18 +367,18 @@ public:
javaString (httpRequest).get())));
}
if (stream != 0 && ! stream.callBooleanMethod (HTTPStream.connect))
if (stream != nullptr && ! stream.callBooleanMethod (HTTPStream.connect))
stream.clear();
jint* const statusCodeElements = env->GetIntArrayElements (statusCodeArray, 0);
jint* const statusCodeElements = env->GetIntArrayElements (statusCodeArray, nullptr);
statusCode = statusCodeElements[0];
env->ReleaseIntArrayElements (statusCodeArray, statusCodeElements, 0);
env->DeleteLocalRef (statusCodeArray);
if (postDataArray != 0)
if (postDataArray != nullptr)
env->DeleteLocalRef (postDataArray);
if (stream != 0)
if (stream != nullptr)
{
StringArray headerLines;
@@ -547,12 +547,12 @@ static Array<InterfaceInfo> findIPAddresses (int dummySocket)
if (item.ifr_addr.sa_family == AF_INET)
{
InterfaceInfo info;
info.interfaceAddress = makeAddress ((const sockaddr_in*) &item.ifr_addr);
info.interfaceAddress = makeAddress (reinterpret_cast<const sockaddr_in*> (&item.ifr_addr));
if (! info.interfaceAddress.isNull())
{
if (ioctl (dummySocket, SIOCGIFBRDADDR, &item) == 0)
info.broadcastAddress = makeAddress ((const sockaddr_in*) &item.ifr_broadaddr);
info.broadcastAddress = makeAddress (reinterpret_cast<const sockaddr_in*> (&item.ifr_broadaddr));
result.add (info);
}


+ 2
- 2
modules/juce_core/native/juce_android_RuntimePermissions.cpp View File

@@ -95,7 +95,7 @@ struct PermissionsRequest
struct PermissionsOverlay : FragmentOverlay
{
PermissionsOverlay (CriticalSection& cs) : overlayGuard (cs) {}
~PermissionsOverlay() {}
~PermissionsOverlay() override = default;
struct PermissionResult
{
@@ -175,7 +175,7 @@ struct PermissionsOverlay : FragmentOverlay
// this code should only be reached for SDKs >= 23, so this method should be
// be available
jassert(requestPermissionsMethodID != 0);
jassert(requestPermissionsMethodID != nullptr);
env->CallVoidMethod (getNativeHandle(), requestPermissionsMethodID, jPermissionsArray.get (), 0);
}


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

@@ -113,7 +113,7 @@ public:
checkActivityIsMain (androidApkContext);
}
~JuceActivityWatcher()
~JuceActivityWatcher() override
{
LocalRef<jobject> appContext (getAppContext());


+ 2
- 1
modules/juce_core/native/juce_mac_Network.mm View File

@@ -425,7 +425,8 @@ struct BackgroundDownloadTask : public URL::DownloadTask
DelegateClass::setState (delegate, this);
activeSessions.set (uniqueIdentifier, this);
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:juceStringToNS (urlToUse.toString (true))]];
auto nsUrl = [NSURL URLWithString: juceStringToNS (urlToUse.toString (true))];
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL: nsUrl];
if (shouldUsePostRequest)
[request setHTTPMethod: @"POST"];


+ 4
- 4
modules/juce_events/native/juce_android_Messaging.cpp View File

@@ -76,7 +76,7 @@ struct AndroidMessageQueue : private Android::Runnable
{
}
~AndroidMessageQueue()
~AndroidMessageQueue() override
{
JUCE_ASSERT_MESSAGE_THREAD
clearSingletonInstance();
@@ -156,14 +156,14 @@ void MessageManager::stopDispatchLoop()
{
jmethodID quitMethod = env->GetMethodID (AndroidActivity, "finishAndRemoveTask", "()V");
if (quitMethod != 0)
if (quitMethod != nullptr)
{
env->CallVoidMethod (activity.get(), quitMethod);
return;
}
quitMethod = env->GetMethodID (AndroidActivity, "finish", "()V");
jassert (quitMethod != 0);
jassert (quitMethod != nullptr);
env->CallVoidMethod (activity.get(), quitMethod);
}
else
@@ -195,7 +195,7 @@ public:
}
}
~JuceAppLifecycle()
~JuceAppLifecycle() override
{
LocalRef<jobject> appContext (getAppContext());


+ 1
- 0
modules/juce_graphics/image_formats/juce_JPEGLoader.cpp View File

@@ -43,6 +43,7 @@ namespace jpeglibNamespace
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wdeprecated-register"
#pragma clang diagnostic ignored "-Wcast-align"
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif


+ 2
- 2
modules/juce_graphics/native/juce_android_Fonts.cpp View File

@@ -374,7 +374,7 @@ public:
{
et = new EdgeTable (bounds);
jint* const maskDataElements = env->GetIntArrayElements ((jintArray) cachedRenderArray.get(), 0);
jint* const maskDataElements = env->GetIntArrayElements ((jintArray) cachedRenderArray.get(), nullptr);
const jint* mask = maskDataElements;
for (int y = bounds.getY(); y < bounds.getBottom(); ++y)
@@ -494,7 +494,7 @@ private:
String key;
{
LocalRef<jobject> digest (env->CallStaticObjectMethod (JavaMessageDigest, JavaMessageDigest.getInstance, javaString("MD5").get()));
LocalRef<jbyteArray> bytes(env->NewByteArray(size));
LocalRef<jbyteArray> bytes(env->NewByteArray ((int) size));
jboolean ignore;
auto* jbytes = env->GetByteArrayElements(bytes.get(), &ignore);


+ 2
- 2
modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp View File

@@ -44,7 +44,7 @@ public:
startThread();
}
~PrepareImagesThread()
~PrepareImagesThread() override
{
signalThreadShouldExit();
waitForThreadToExit (10000);
@@ -98,7 +98,7 @@ public:
startThread();
}
~PrepareDataThread()
~PrepareDataThread() override
{
signalThreadShouldExit();
waitForThreadToExit (10000);


+ 4
- 4
modules/juce_gui_basics/native/juce_MultiTouchMapper.h View File

@@ -35,7 +35,7 @@ public:
int getIndexOfTouch (ComponentPeer* peer, IDType touchID)
{
jassert (touchID != 0); // need to rethink this if IDs can be 0!
jassert (touchID != nullptr); // need to rethink this if IDs can be 0!
TouchInfo info {touchID, peer};
int touchIndex = currentTouches.indexOf (info);
@@ -64,7 +64,7 @@ public:
bool areAnyTouchesActive() const noexcept
{
for (auto& t : currentTouches)
if (t.touchId != 0)
if (t.touchId != nullptr)
return true;
return false;
@@ -74,14 +74,14 @@ public:
{
for (auto& t : currentTouches)
if (t.owner == peer)
t.touchId = 0;
t.touchId = nullptr;
}
private:
//==============================================================================
struct TouchInfo
{
TouchInfo() noexcept : touchId (0), owner (nullptr) {}
TouchInfo() noexcept : touchId (nullptr), owner (nullptr) {}
TouchInfo (IDType idToUse, ComponentPeer* peer) noexcept : touchId (idToUse), owner (peer) {}
TouchInfo (const TouchInfo&) = default;


+ 6
- 6
modules/juce_gui_basics/native/juce_android_ContentSharer.cpp View File

@@ -135,7 +135,7 @@ public:
resultColumns.get()))))
{
// the content provider must be created first
jassert (contentProvider.get() != 0);
jassert (contentProvider.get() != nullptr);
}
jobject getNativeCursor() { return cursor.get(); }
@@ -199,7 +199,7 @@ public:
open | access | closeWrite | closeNoWrite))))
{
// the content provider must be created first
jassert (contentProvider.get() != 0);
jassert (contentProvider.get() != nullptr);
env->CallVoidMethod (fileObserver, JuceContentProviderFileObserver.startWatching);
}
@@ -284,7 +284,7 @@ public:
startThread();
}
~AndroidContentSharerPrepareFilesThread()
~AndroidContentSharerPrepareFilesThread() override
{
signalThreadShouldExit();
waitForThreadToExit (10000);
@@ -307,7 +307,7 @@ private:
~StreamCloser()
{
if (stream.get() != 0)
if (stream.get() != nullptr)
getEnv()->CallVoidMethod (stream, JavaCloseable.close);
}
@@ -471,7 +471,7 @@ public:
{
}
~ContentSharerNativeImpl()
~ContentSharerNativeImpl() override
{
masterReference.clear();
}
@@ -586,7 +586,7 @@ public:
return cursor->getNativeCursor();
auto values = LocalRef<jobjectArray> (env->NewObjectArray ((jsize) resultColumns.size(),
JavaObject, 0));
JavaObject, nullptr));
for (int i = 0; i < resultColumns.size(); ++i)
{


+ 1
- 1
modules/juce_gui_basics/native/juce_android_FileChooser.cpp View File

@@ -134,7 +134,7 @@ public:
jassertfalse; // there can only be a single file chooser
}
~Native()
~Native() override
{
masterReference.clear();
currentFileChooser = nullptr;


+ 8
- 8
modules/juce_gui_basics/native/juce_android_Windowing.cpp View File

@@ -318,7 +318,7 @@ public:
handleFocusGain();
}
~AndroidComponentPeer()
~AndroidComponentPeer() override
{
auto* env = getEnv();
@@ -466,7 +466,7 @@ public:
LocalRef<jintArray> position (env->NewIntArray (2));
env->CallVoidMethod (view.get(), AndroidView.getLocationOnScreen, position.get());
jint* const screenPosition = env->GetIntArrayElements (position.get(), 0);
jint* const screenPosition = env->GetIntArrayElements (position.get(), nullptr);
Point<int> pos (screenPosition[0], screenPosition[1]);
env->ReleaseIntArrayElements (position.get(), screenPosition, 0);
@@ -774,7 +774,7 @@ public:
return;
}
if (jint* dest = env->GetIntArrayElements ((jintArray) buffer.get(), 0))
if (jint* dest = env->GetIntArrayElements ((jintArray) buffer.get(), nullptr))
{
{
Image temp (new PreallocatedImage (clip.getWidth(), clip.getHeight(),
@@ -936,7 +936,7 @@ private:
zeromem (data_, static_cast<size_t> (width * height) * sizeof (jint));
}
~PreallocatedImage()
~PreallocatedImage() override
{
if (hasAlpha)
{
@@ -970,7 +970,7 @@ private:
ImagePixelData::Ptr clone() override
{
auto s = new PreallocatedImage (width, height, 0, hasAlpha);
auto s = new PreallocatedImage (width, height, nullptr, hasAlpha);
s->allocatedData.malloc (sizeof (jint) * static_cast<size_t> (width * height));
s->data = s->allocatedData;
memcpy (s->data, data, sizeof (jint) * static_cast<size_t> (width * height));
@@ -1027,11 +1027,11 @@ Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
LocalRef<jobject> windowManager = LocalRef<jobject> (env->CallObjectMethod (getAppContext().get(), AndroidContext.getSystemService, windowServiceString.get()));
if (windowManager.get() != 0)
if (windowManager.get() != nullptr)
{
LocalRef<jobject> display = LocalRef<jobject> (env->CallObjectMethod (windowManager, AndroidWindowManager.getDefaultDisplay));
if (display.get() != 0)
if (display.get() != nullptr)
{
int rotation = env->CallIntMethod (display, AndroidDisplay.getRotation);
@@ -1414,7 +1414,7 @@ void Displays::findDisplays (float masterScale)
jmethodID getRealMetricsMethod = env->GetMethodID (AndroidDisplay, "getRealMetrics", "(Landroid/util/DisplayMetrics;)V");
if (getRealMetricsMethod != 0)
if (getRealMetricsMethod != nullptr)
env->CallVoidMethod (display.get(), getRealMetricsMethod, displayMetrics.get());
else
env->CallVoidMethod (display.get(), AndroidDisplay.getMetrics, displayMetrics.get());


+ 1
- 1
modules/juce_gui_basics/native/juce_ios_ContentSharer.cpp View File

@@ -38,7 +38,7 @@ public:
popoverDelegate.reset ([cls.createInstance() init]);
}
~ContentSharerNativeImpl()
~ContentSharerNativeImpl() override
{
exitModalState (0);
}


+ 1
- 1
modules/juce_gui_basics/native/juce_ios_FileChooser.mm View File

@@ -115,7 +115,7 @@ public:
}
}
~Native()
~Native() override
{
exitModalState (0);
}


+ 1
- 1
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -177,7 +177,7 @@ class UIViewComponentPeer : public ComponentPeer,
{
public:
UIViewComponentPeer (Component&, int windowStyleFlags, UIView* viewToAttachTo);
~UIViewComponentPeer();
~UIViewComponentPeer() override;
//==============================================================================
void* getNativeHandle() const override { return view; }


+ 1
- 1
modules/juce_gui_extra/embedding/juce_AndroidViewComponent.h View File

@@ -50,7 +50,7 @@ public:
AndroidViewComponent();
/** Destructor. */
~AndroidViewComponent();
~AndroidViewComponent() override;
/** Assigns a View to this peer.


+ 1
- 1
modules/juce_gui_extra/embedding/juce_UIViewComponent.h View File

@@ -50,7 +50,7 @@ public:
UIViewComponent();
/** Destructor. */
~UIViewComponent();
~UIViewComponent() override;
/** Assigns an UIView to this peer.


+ 2
- 2
modules/juce_gui_extra/native/juce_AndroidViewComponent.cpp View File

@@ -39,7 +39,7 @@ public:
componentPeerChanged();
}
~Pimpl()
~Pimpl() override
{
removeFromParent();
}
@@ -123,7 +123,7 @@ private:
auto* env = getEnv();
auto parentView = env->CallObjectMethod (view, AndroidView.getParent);
if (parentView != 0)
if (parentView != nullptr)
{
// Assuming a parent is always of ViewGroup type
env->CallVoidMethod (parentView, AndroidViewGroup.removeView, view.get());


+ 26
- 27
modules/juce_gui_extra/native/juce_android_PushNotifications.cpp View File

@@ -280,7 +280,7 @@ struct PushNotifications::Pimpl
auto notificationManager = getNotificationManager();
if (notificationManager.get() != 0)
if (notificationManager.get() != nullptr)
return env->CallBooleanMethod (notificationManager, NotificationManagerApi24.areNotificationsEnabled);
}
@@ -297,7 +297,7 @@ struct PushNotifications::Pimpl
auto notificationManager = getNotificationManager();
if (notificationManager.get() != 0)
if (notificationManager.get() != nullptr)
{
auto notification = juceNotificationToJavaNotification (n);
@@ -317,10 +317,9 @@ struct PushNotifications::Pimpl
Array<PushNotifications::Notification> notifications;
auto notificationManager = getNotificationManager();
jassert (notificationManager != nullptr);
jassert (notificationManager.get() != 0);
if (notificationManager.get() != 0)
if (notificationManager.get() != nullptr)
{
auto statusBarNotifications = LocalRef<jobjectArray> ((jobjectArray)env->CallObjectMethod (notificationManager,
NotificationManagerApi23.getActiveNotifications));
@@ -389,7 +388,7 @@ struct PushNotifications::Pimpl
auto remoteInputResult = LocalRef<jobject> (env->CallStaticObjectMethod (RemoteInput, RemoteInput.getResultsFromIntent, intent.get()));
String responseString;
if (remoteInputResult.get() != 0)
if (remoteInputResult.get() == nullptr)
{
auto charSequence = LocalRef<jobject> (env->CallObjectMethod (remoteInputResult, AndroidBundle.getCharSequence, resultKeyString.get()));
auto responseStringRef = LocalRef<jstring> ((jstring) env->CallObjectMethod (charSequence, JavaCharSequence.toString));
@@ -416,7 +415,7 @@ struct PushNotifications::Pimpl
auto notificationManager = getNotificationManager();
if (notificationManager.get() != 0)
if (notificationManager.get() != nullptr)
env->CallVoidMethod (notificationManager.get(), NotificationManagerBase.cancelAll);
}
@@ -426,7 +425,7 @@ struct PushNotifications::Pimpl
auto notificationManager = getNotificationManager();
if (notificationManager.get() != 0)
if (notificationManager.get() != nullptr)
{
auto tag = javaString (identifier);
const int id = 0;
@@ -635,12 +634,12 @@ struct PushNotifications::Pimpl
LocalRef<jobject> context (getMainActivity());
jclass builderClass = env->FindClass ("android/app/Notification$Builder");
jassert (builderClass != 0);
jassert (builderClass != nullptr);
if (builderClass == 0)
return LocalRef<jobject> (0);
if (builderClass == nullptr)
return LocalRef<jobject> (nullptr);
jmethodID builderConstructor = 0;
jmethodID builderConstructor = nullptr;
const bool apiAtLeast26 = (getAndroidSDKVersion() >= 26);
@@ -649,10 +648,10 @@ struct PushNotifications::Pimpl
else
builderConstructor = env->GetMethodID (builderClass, "<init>", "(Landroid/content/Context;)V");
jassert (builderConstructor != 0);
jassert (builderConstructor != nullptr);
if (builderConstructor == 0)
return LocalRef<jobject> (0);
if (builderConstructor == nullptr)
return LocalRef<jobject> (nullptr);
if (apiAtLeast26)
return LocalRef<jobject> (env->NewObject (builderClass, builderConstructor,
@@ -754,7 +753,7 @@ struct PushNotifications::Pimpl
{
auto array = LocalRef<jlongArray> (env->NewLongArray (size));
jlong* elements = env->GetLongArrayElements (array, 0);
jlong* elements = env->GetLongArrayElements (array, nullptr);
for (int i = 0; i < size; ++i)
elements[i] = (jlong) n.vibrationPattern[i];
@@ -808,7 +807,7 @@ struct PushNotifications::Pimpl
{
auto array = LocalRef<jlongArray> (env->NewLongArray (size));
jlong* elements = env->GetLongArrayElements (array, 0);
jlong* elements = env->GetLongArrayElements (array, nullptr);
for (int i = 0; i < size; ++i)
elements[i] = (jlong) n.vibrationPattern[i];
@@ -993,7 +992,7 @@ struct PushNotifications::Pimpl
const int size = action.allowedResponses.size();
auto array = LocalRef<jobjectArray> (env->NewObjectArray (size, env->FindClass ("java/lang/String"), 0));
auto array = LocalRef<jobjectArray> (env->NewObjectArray (size, env->FindClass ("java/lang/String"), nullptr));
for (int i = 0; i < size; ++i)
{
@@ -1123,7 +1122,7 @@ struct PushNotifications::Pimpl
PushNotifications::Notification n;
if (bundle.get() != 0)
if (bundle.get() != nullptr)
{
n.identifier = getStringFromBundle (env, "identifier", bundle);
n.title = getStringFromBundle (env, "title", bundle);
@@ -1239,7 +1238,7 @@ struct PushNotifications::Pimpl
const int size = env->GetArrayLength (array.get());
jlong* elements = env->GetLongArrayElements (array.get(), 0);
jlong* elements = env->GetLongArrayElements (array.get(), nullptr);
Array<int> resultArray;
@@ -1280,7 +1279,7 @@ struct PushNotifications::Pimpl
static var bundleToVar (const LocalRef<jobject>& bundle)
{
if (bundle.get() != 0)
if (bundle.get() == nullptr)
{
auto* env = getEnv();
@@ -1400,7 +1399,7 @@ struct PushNotifications::Pimpl
propertiesDynamicObject->setProperty ("titleLocalizationKey", juceString (titleLocalizationKey.get()));
propertiesDynamicObject->setProperty ("bodyLocalizationArgs", javaStringArrayToJuce (bodyLocalizationArgs));
propertiesDynamicObject->setProperty ("titleLocalizationArgs", javaStringArrayToJuce (titleLocalizationArgs));
propertiesDynamicObject->setProperty ("link", link.get() != 0 ? juceString ((jstring) env->CallObjectMethod (link, AndroidUri.toString)) : String());
propertiesDynamicObject->setProperty ("link", link.get() == nullptr ? juceString ((jstring) env->CallObjectMethod (link, AndroidUri.toString)) : String());
}
n.properties = var (propertiesDynamicObject.get());
@@ -1418,9 +1417,9 @@ struct PushNotifications::Pimpl
auto notificationManager = getNotificationManager();
jassert (notificationManager.get() != 0);
jassert (notificationManager.get() != nullptr);
if (notificationManager.get() == 0)
if (notificationManager.get() == nullptr)
return;
for (const auto& g : groups)
@@ -1463,7 +1462,7 @@ struct PushNotifications::Pimpl
if (size > 0)
{
auto array = LocalRef<jlongArray> (env->NewLongArray (size));
jlong* elements = env->GetLongArrayElements (array, 0);
jlong* elements = env->GetLongArrayElements (array, nullptr);
for (int i = 0; i < size; ++i)
elements[i] = (jlong) c.vibrationPattern[i];
@@ -1527,7 +1526,7 @@ struct PushNotifications::Pimpl
auto categories = LocalRef<jobject> (env->CallObjectMethod (intent, AndroidIntent.getCategories));
int categoriesNum = categories != 0
int categoriesNum = categories != nullptr
? env->CallIntMethod (categories, JavaSet.size)
: 0;
@@ -1542,7 +1541,7 @@ struct PushNotifications::Pimpl
auto extras = LocalRef<jobject> (env->CallObjectMethod (intent, AndroidIntent.getExtras));
if (extras == 0)
if (extras == nullptr)
return false;
return env->CallBooleanMethod (extras, AndroidBundle.containsKey, javaString ("google.sent_time").get())


+ 5
- 5
modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp View File

@@ -424,7 +424,7 @@ private:
startThread();
}
~ConnectionThread()
~ConnectionThread() override
{
webInputStream->cancel();
signalThreadShouldExit();
@@ -559,11 +559,11 @@ private:
LocalRef<jclass> responseClass (env->FindClass ("android/webkit/WebResourceResponse"));
if (responseClass != 0)
if (responseClass != nullptr)
{
jmethodID method = env->GetMethodID (responseClass, "getReasonPhrase", "()Ljava/lang/String;");
if (method != 0)
if (method != nullptr)
{
auto errorString = LocalRef<jstring> ((jstring) env->CallObjectMethod (errorResponse, method));
@@ -671,7 +671,7 @@ void WebBrowserComponent::checkWindowAssociation()
// page to avoid this, (and send it back when it's made visible again).
blankPageShown = true;
browser->goToURL ("about:blank", 0, 0);
browser->goToURL ("about:blank", nullptr, nullptr);
}
}
}
@@ -711,7 +711,7 @@ void WebBrowserComponent::clearCookies()
auto cookieManager = LocalRef<jobject> (env->CallStaticObjectMethod (AndroidCookieManager,
AndroidCookieManager.getInstance));
jmethodID clearCookiesMethod = 0;
jmethodID clearCookiesMethod = nullptr;
if (getAndroidSDKVersion() >= 21)
{


+ 1
- 1
modules/juce_gui_extra/native/juce_ios_UIViewComponent.mm View File

@@ -41,7 +41,7 @@ public:
componentPeerChanged();
}
~Pimpl()
~Pimpl() override
{
[view removeFromSuperview];
[view release];


+ 3
- 3
modules/juce_opengl/native/juce_OpenGL_android.h View File

@@ -118,7 +118,7 @@ public:
hasInitialised = true;
}
~NativeContext()
~NativeContext() override
{
auto env = getEnv();
@@ -165,7 +165,7 @@ public:
}
// create the surface
surface = eglCreateWindowSurface (display, config, window, 0);
surface = eglCreateWindowSurface (display, config, window, nullptr);
jassert (surface != EGL_NO_SURFACE);
ANativeWindow_release (window);
@@ -317,7 +317,7 @@ private:
return false;
}
if (! eglInitialize (display, 0, 0))
if (! eglInitialize (display, nullptr, nullptr))
{
jassertfalse;
return false;


+ 2
- 2
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -40,8 +40,8 @@ extern Array<AppInactivityCallback*> appBecomingInactiveCallbacks;
// this prevents them from happening (which some messy locking behaviour)
struct iOSBackgroundProcessCheck : public AppInactivityCallback
{
iOSBackgroundProcessCheck() { isBackgroundProcess(); appBecomingInactiveCallbacks.add (this); }
~iOSBackgroundProcessCheck() { appBecomingInactiveCallbacks.removeAllInstancesOf (this); }
iOSBackgroundProcessCheck() { isBackgroundProcess(); appBecomingInactiveCallbacks.add (this); }
~iOSBackgroundProcessCheck() override { appBecomingInactiveCallbacks.removeAllInstancesOf (this); }
bool isBackgroundProcess()
{


+ 20
- 20
modules/juce_video/native/juce_android_CameraDevice.h View File

@@ -508,7 +508,7 @@ struct CameraDevice::Pimpl
startBackgroundThread();
}
~Pimpl()
~Pimpl() override
{
auto* env = getEnv();
@@ -764,18 +764,18 @@ private:
auto* env = getEnv();
#define PRINT_ELEMENTS(elem_type, array_type, fun_name_middle) \
{ \
elem_type* elements = env->Get##fun_name_middle##ArrayElements ((array_type) keyValue.get(), 0); \
int size = env->GetArrayLength ((array_type) keyValue.get()); \
\
for (int i = 0; i < size - 1; ++i) \
result << String (elements[i]) << " "; \
\
if (size > 0) \
result << String (elements[size - 1]); \
\
env->Release##fun_name_middle##ArrayElements ((array_type) keyValue.get(), elements, 0); \
#define PRINT_ELEMENTS(elem_type, array_type, fun_name_middle) \
{ \
elem_type* elements = env->Get##fun_name_middle##ArrayElements ((array_type) keyValue.get(), nullptr); \
int size = env->GetArrayLength ((array_type) keyValue.get()); \
\
for (int i = 0; i < size - 1; ++i) \
result << String (elements[i]) << " "; \
\
if (size > 0) \
result << String (elements[size - 1]); \
\
env->Release##fun_name_middle##ArrayElements ((array_type) keyValue.get(), elements, 0); \
}
if (keyValueString.startsWith ("[I"))
@@ -996,7 +996,7 @@ private:
"android/view/TextureView$SurfaceTextureListener").get());
}
~PreviewDisplay()
~PreviewDisplay() override
{
getEnv()->CallVoidMethod (textureView, AndroidTextureView.setSurfaceTextureListener, nullptr);
}
@@ -1144,7 +1144,7 @@ private:
handlerToUse.get());
}
~ImageReader()
~ImageReader() override
{
getEnv()->CallVoidMethod (imageReader, AndroidImageReader.close);
}
@@ -1405,7 +1405,7 @@ private:
getEnv()->CallVoidMethod (mediaRecorder, AndroidMediaRecorder.prepare);
}
~MediaRecorder()
~MediaRecorder() override
{
getEnv()->CallVoidMethod (mediaRecorder, AndroidMediaRecorder.release);
}
@@ -2494,7 +2494,7 @@ private:
//==============================================================================
struct CaptureSessionModeBase
{
virtual ~CaptureSessionModeBase() { }
virtual ~CaptureSessionModeBase() = default;
virtual bool isVideoRecordSession() const = 0;
@@ -2507,7 +2507,7 @@ private:
private PreviewDisplay::Listener,
private ScopedCameraDevice::CaptureSession::ConfiguredCallback
{
~CaptureSessionMode()
~CaptureSessionMode() override
{
captureSession.reset();
@@ -2789,7 +2789,7 @@ private:
setEnabled (true);
}
~DeviceOrientationChangeListener()
~DeviceOrientationChangeListener() override
{
setEnabled (false);
}
@@ -2985,7 +2985,7 @@ private:
{
auto* env = getEnv();
auto* jArrayElems = env->GetIntArrayElements (jArray, 0);
auto* jArrayElems = env->GetIntArrayElements (jArray, nullptr);
auto numElems = env->GetArrayLength (jArray);
Array<int> juceArray;


+ 4
- 4
modules/juce_video/native/juce_android_Video.h View File

@@ -375,7 +375,7 @@ struct VideoComponent::Pimpl
}
}
~Pimpl()
~Pimpl() override
{
auto* env = getEnv();
@@ -502,7 +502,7 @@ private:
env->CallVoidMethod (nativeMediaSession, AndroidMediaSession.setCallback, mediaSessionCallback.get());
}
~MediaSession()
~MediaSession() override
{
auto* env = getEnv();
@@ -1405,7 +1405,7 @@ private:
auto playPos = player.getPlayPosition();
auto durationMs = player.getVideoDuration();
int playPosPercent = 100 * playPos / static_cast<double> (durationMs);
auto playPosPercent = (int) (100.0 * playPos / static_cast<double> (durationMs));
// NB: assuming the playback will start roughly when there is 5% of content loaded...
return ! bufferedRegions.containsRange (Range<int> (playPosPercent, jmin (101, playPosPercent + 5)));
@@ -1456,7 +1456,7 @@ private:
auto playPos = player.getPlayPosition();
auto durationMs = player.getVideoDuration();
int playPosPercent = 100 * playPos / static_cast<double> (durationMs);
auto playPosPercent = (int) (100.0 * playPos / static_cast<double> (durationMs));
bufferedRegions.addRange (Range<int> (playPosPercent, progress + 1));


+ 3
- 3
modules/juce_video/native/juce_ios_CameraDevice.h View File

@@ -304,7 +304,7 @@ private:
static String cmTimeToString (CMTime time)
{
CFStringRef timeDesc = CMTimeCopyDescription (NULL, time);
CFStringRef timeDesc = CMTimeCopyDescription (nullptr, time);
String result = String::fromCFString (timeDesc);
CFRelease (timeDesc);
@@ -984,7 +984,7 @@ private:
class VideoRecorder
{
public:
VideoRecorder (CaptureSession& captureSession)
VideoRecorder (CaptureSession& session)
: movieFileOutput ([AVCaptureMovieFileOutput new]),
delegate (nullptr)
{
@@ -992,7 +992,7 @@ private:
delegate.reset ([cls.createInstance() init]);
FileOutputRecordingDelegateClass::setOwner (delegate.get(), this);
captureSession.addOutputIfPossible (movieFileOutput);
session.addOutputIfPossible (movieFileOutput);
}
~VideoRecorder()


Loading…
Cancel
Save