Browse Source

Fixed some stray zeros that were still being passed as null pointers

tags/2021-05-28
jules 7 years ago
parent
commit
6fda0bffca
54 changed files with 237 additions and 221 deletions
  1. +2
    -1
      extras/AudioPluginHost/JuceLibraryCode/BinaryData.cpp
  2. +2
    -1
      extras/NetworkGraphicsDemo/JuceLibraryCode/BinaryData.cpp
  3. +2
    -2
      extras/Projucer/Builds/MacOSX/Projucer.xcodeproj/project.pbxproj
  4. +2
    -1
      extras/Projucer/JuceLibraryCode/BinaryData.cpp
  5. +1
    -1
      extras/Projucer/Projucer.jucer
  6. +1
    -1
      extras/Projucer/Source/ComponentEditor/Components/jucer_ComponentTypeHandler.cpp
  7. +6
    -6
      extras/Projucer/Source/ComponentEditor/Components/jucer_JucerComponentHandler.h
  8. +2
    -2
      extras/Projucer/Source/ComponentEditor/Components/jucer_SliderHandler.h
  9. +12
    -12
      extras/Projucer/Source/ComponentEditor/Components/jucer_TabbedComponentHandler.h
  10. +2
    -2
      extras/Projucer/Source/ComponentEditor/Components/jucer_TextEditorHandler.h
  11. +1
    -1
      extras/Projucer/Source/ComponentEditor/Components/jucer_ViewportHandler.h
  12. +1
    -1
      extras/Projucer/Source/ComponentEditor/Documents/jucer_ButtonDocument.h
  13. +1
    -1
      extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.cpp
  14. +22
    -21
      extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementUndoableAction.h
  15. +2
    -2
      extras/Projucer/Source/ComponentEditor/Properties/jucer_PositionPropertyBase.h
  16. +5
    -5
      extras/Projucer/Source/ComponentEditor/UI/jucer_ComponentLayoutEditor.cpp
  17. +14
    -14
      extras/Projucer/Source/ComponentEditor/UI/jucer_JucerDocumentEditor.cpp
  18. +12
    -12
      extras/Projucer/Source/ComponentEditor/UI/jucer_RelativePositionedRectangle.h
  19. +5
    -5
      extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.cpp
  20. +1
    -1
      extras/Projucer/Source/Project/jucer_Project.cpp
  21. +1
    -1
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp
  22. +19
    -14
      extras/Projucer/Source/Utility/Helpers/jucer_CodeHelpers.cpp
  23. +1
    -1
      modules/juce_core/maths/juce_Expression.cpp
  24. +1
    -1
      modules/juce_core/memory/juce_Atomic.h
  25. +4
    -4
      modules/juce_core/native/juce_mac_Files.mm
  26. +3
    -3
      modules/juce_core/native/juce_mac_Strings.mm
  27. +2
    -2
      modules/juce_core/native/juce_mac_SystemStats.mm
  28. +1
    -1
      modules/juce_core/native/juce_mac_Threads.mm
  29. +1
    -1
      modules/juce_core/native/juce_posix_NamedPipe.cpp
  30. +21
    -21
      modules/juce_core/native/juce_posix_SharedCode.h
  31. +3
    -2
      modules/juce_core/network/juce_Socket.cpp
  32. +1
    -4
      modules/juce_core/threads/juce_ReadWriteLock.cpp
  33. +2
    -2
      modules/juce_core/threads/juce_ReadWriteLock.h
  34. +3
    -3
      modules/juce_core/threads/juce_Thread.cpp
  35. +3
    -0
      modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp
  36. +1
    -1
      modules/juce_cryptography/encryption/juce_Primes.h
  37. +1
    -1
      modules/juce_cryptography/encryption/juce_RSAKey.cpp
  38. +1
    -1
      modules/juce_events/messages/juce_ApplicationBase.cpp
  39. +1
    -1
      modules/juce_events/messages/juce_MessageManager.cpp
  40. +3
    -3
      modules/juce_graphics/geometry/juce_PathStrokeType.cpp
  41. +3
    -0
      modules/juce_graphics/image_formats/juce_JPEGLoader.cpp
  42. +9
    -6
      modules/juce_graphics/image_formats/juce_PNGLoader.cpp
  43. +1
    -1
      modules/juce_graphics/image_formats/pnglib/png.c
  44. +10
    -10
      modules/juce_graphics/native/juce_RenderingHelpers.h
  45. +25
    -25
      modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
  46. +2
    -2
      modules/juce_graphics/native/juce_mac_Fonts.mm
  47. +2
    -2
      modules/juce_gui_basics/native/juce_mac_Windowing.mm
  48. +1
    -1
      modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp
  49. +4
    -4
      modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  50. +1
    -1
      modules/juce_gui_basics/windows/juce_DocumentWindow.cpp
  51. +1
    -1
      modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h
  52. +1
    -1
      modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.cpp
  53. +7
    -7
      modules/juce_gui_extra/native/juce_mac_AppleRemote.mm
  54. +1
    -1
      modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm

+ 2
- 1
extras/AudioPluginHost/JuceLibraryCode/BinaryData.cpp View File

@@ -660,7 +660,8 @@ const char* JUCEAppIcon_png = (const char*) temp_binary_data_0;
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) const char* getNamedResource (const char* resourceNameUTF8, int& numBytes)
{ {
unsigned int hash = 0; unsigned int hash = 0;
if (resourceNameUTF8 != 0)
if (resourceNameUTF8 != nullptr)
while (*resourceNameUTF8 != 0) while (*resourceNameUTF8 != 0)
hash = 31 * hash + (unsigned int) *resourceNameUTF8++; hash = 31 * hash + (unsigned int) *resourceNameUTF8++;


+ 2
- 1
extras/NetworkGraphicsDemo/JuceLibraryCode/BinaryData.cpp View File

@@ -660,7 +660,8 @@ const char* juce_icon_png = (const char*) temp_binary_data_0;
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) const char* getNamedResource (const char* resourceNameUTF8, int& numBytes)
{ {
unsigned int hash = 0; unsigned int hash = 0;
if (resourceNameUTF8 != 0)
if (resourceNameUTF8 != nullptr)
while (*resourceNameUTF8 != 0) while (*resourceNameUTF8 != 0)
hash = 31 * hash + (unsigned int) *resourceNameUTF8++; hash = 31 * hash + (unsigned int) *resourceNameUTF8++;


+ 2
- 2
extras/Projucer/Builds/MacOSX/Projucer.xcodeproj/project.pbxproj View File

@@ -3233,7 +3233,7 @@
INSTALL_PATH = "$(HOME)/Applications"; INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.11; MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET_ppc = 10.4; MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
OTHER_CPLUSPLUSFLAGS = "-Wall -Wno-missing-field-initializers -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code";
OTHER_CPLUSPLUSFLAGS = "-Wall -Wno-missing-field-initializers -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code -Wzero-as-null-pointer-constant";
PRODUCT_BUNDLE_IDENTIFIER = com.juce.theprojucer; PRODUCT_BUNDLE_IDENTIFIER = com.juce.theprojucer;
PRODUCT_NAME = "Projucer"; PRODUCT_NAME = "Projucer";
SDKROOT_ppc = macosx10.5; SDKROOT_ppc = macosx10.5;
@@ -3280,7 +3280,7 @@
LLVM_LTO = YES; LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11; MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET_ppc = 10.4; MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
OTHER_CPLUSPLUSFLAGS = "-Wall -Wno-missing-field-initializers -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code";
OTHER_CPLUSPLUSFLAGS = "-Wall -Wno-missing-field-initializers -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code -Wzero-as-null-pointer-constant";
PRODUCT_BUNDLE_IDENTIFIER = com.juce.theprojucer; PRODUCT_BUNDLE_IDENTIFIER = com.juce.theprojucer;
PRODUCT_NAME = "Projucer"; PRODUCT_NAME = "Projucer";
SDKROOT_ppc = macosx10.5; SDKROOT_ppc = macosx10.5;


+ 2
- 1
extras/Projucer/JuceLibraryCode/BinaryData.cpp View File

@@ -7773,7 +7773,8 @@ const char* RecentFilesMenuTemplate_nib = (const char*) temp_binary_data_61;
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) const char* getNamedResource (const char* resourceNameUTF8, int& numBytes)
{ {
unsigned int hash = 0; unsigned int hash = 0;
if (resourceNameUTF8 != 0)
if (resourceNameUTF8 != nullptr)
while (*resourceNameUTF8 != 0) while (*resourceNameUTF8 != 0)
hash = 31 * hash + (unsigned int) *resourceNameUTF8++; hash = 31 * hash + (unsigned int) *resourceNameUTF8++;


+ 1
- 1
extras/Projucer/Projucer.jucer View File

@@ -8,7 +8,7 @@
<EXPORTFORMATS> <EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK" <XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
documentExtensions=".jucer" objCExtraSuffix="zkVtji" bigIcon="rv1F4h" documentExtensions=".jucer" objCExtraSuffix="zkVtji" bigIcon="rv1F4h"
extraLinkerFlags="" extraCompilerFlags="-Wall -Wno-missing-field-initializers -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code"
extraLinkerFlags="" extraCompilerFlags="-Wall -Wno-missing-field-initializers -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code -Wzero-as-null-pointer-constant"
customPList="&lt;plist&gt;&#10;&lt;dict&gt;&#10;&#9;&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;&#10;&#9;&lt;dict&gt;&#10;&#9;&#9;&lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;&#10;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&lt;key&gt;NSExceptionDomains&lt;/key&gt;&#10;&#9;&#9;&lt;dict&gt;&#10;&#9;&#9;&#9;&lt;key&gt;amazonaws.com&lt;/key&gt;&#10;&#9;&#9;&#9;&lt;dict&gt;&#10;&#9;&#9;&#9;&#9;&lt;key&gt;NSExceptionAllowsInsecureHTTPLoads&lt;/key&gt;&#10;&#9;&#9;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&#9;&#9;&lt;key&gt;NSIncludesSubdomains&lt;/key&gt;&#10;&#9;&#9;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&#9;&lt;/dict&gt;&#10;&#9;&#9;&lt;/dict&gt;&#10;&#9;&lt;/dict&gt;&#10;&lt;/dict&gt;&#10;&lt;/plist&gt;" customPList="&lt;plist&gt;&#10;&lt;dict&gt;&#10;&#9;&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;&#10;&#9;&lt;dict&gt;&#10;&#9;&#9;&lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;&#10;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&lt;key&gt;NSExceptionDomains&lt;/key&gt;&#10;&#9;&#9;&lt;dict&gt;&#10;&#9;&#9;&#9;&lt;key&gt;amazonaws.com&lt;/key&gt;&#10;&#9;&#9;&#9;&lt;dict&gt;&#10;&#9;&#9;&#9;&#9;&lt;key&gt;NSExceptionAllowsInsecureHTTPLoads&lt;/key&gt;&#10;&#9;&#9;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&#9;&#9;&lt;key&gt;NSIncludesSubdomains&lt;/key&gt;&#10;&#9;&#9;&#9;&#9;&lt;true/&gt;&#10;&#9;&#9;&#9;&lt;/dict&gt;&#10;&#9;&#9;&lt;/dict&gt;&#10;&#9;&lt;/dict&gt;&#10;&lt;/dict&gt;&#10;&lt;/plist&gt;"
extraFrameworks="AudioUnit; Accelerate; AVFoundation; CoreAudio; CoreAudioKit; CoreMIDI; DiscRecording; QuartzCore; AudioToolbox; OpenGL; QTKit; QuickTime"> extraFrameworks="AudioUnit; Accelerate; AVFoundation; CoreAudio; CoreAudioKit; CoreMIDI; DiscRecording; QuartzCore; AudioToolbox; OpenGL; QTKit; QuickTime">
<CONFIGURATIONS> <CONFIGURATIONS>


+ 1
- 1
extras/Projucer/Source/ComponentEditor/Components/jucer_ComponentTypeHandler.cpp View File

@@ -200,7 +200,7 @@ bool ComponentTypeHandler::restoreFromXml (const XmlElement& xml,
RelativePositionedRectangle rpr; RelativePositionedRectangle rpr;
rpr.restoreFromXml (xml, currentPos); rpr.restoreFromXml (xml, currentPos);
jassert (layout != 0);
jassert (layout != nullptr);
setComponentPosition (comp, rpr, layout); setComponentPosition (comp, rpr, layout);
if (SettableTooltipClient* const ttc = dynamic_cast<SettableTooltipClient*> (comp)) if (SettableTooltipClient* const ttc = dynamic_cast<SettableTooltipClient*> (comp))


+ 6
- 6
extras/Projucer/Source/ComponentEditor/Components/jucer_JucerComponentHandler.h View File

@@ -43,7 +43,7 @@ public:
Component* createNewComponent (JucerDocument* doc) override Component* createNewComponent (JucerDocument* doc) override
{ {
return new TestComponent (doc, 0, false);
return new TestComponent (doc, nullptr, false);
} }
String getXmlTagName() const noexcept override { return "JUCERCOMP"; } String getXmlTagName() const noexcept override { return "JUCERCOMP"; }
@@ -61,7 +61,7 @@ public:
bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout) override bool restoreFromXml (const XmlElement& xml, Component* comp, const ComponentLayout* layout) override
{ {
TestComponent* const tc = dynamic_cast<TestComponent*> (comp);
auto tc = dynamic_cast<TestComponent*> (comp);
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout)) if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
return false; return false;
@@ -74,11 +74,11 @@ public:
String getClassName (Component* comp) const override String getClassName (Component* comp) const override
{ {
TestComponent* const tc = dynamic_cast<TestComponent*> (comp);
auto tc = dynamic_cast<TestComponent*> (comp);
String jucerCompClassName; String jucerCompClassName;
if (tc->getDocument() != 0)
if (tc->getDocument() != nullptr)
jucerCompClassName = tc->getDocument()->getClassName(); jucerCompClassName = tc->getDocument()->getClassName();
if (jucerCompClassName.isEmpty()) if (jucerCompClassName.isEmpty())
@@ -95,7 +95,7 @@ public:
if (multipleSelected) if (multipleSelected)
return; return;
if (auto* const tc = dynamic_cast<TestComponent*> (component))
if (auto tc = dynamic_cast<TestComponent*> (component))
{ {
props.add (new JucerCompFileProperty (tc, document)); props.add (new JucerCompFileProperty (tc, document));
props.add (new ConstructorParamsProperty (tc, document)); props.add (new ConstructorParamsProperty (tc, document));
@@ -112,7 +112,7 @@ public:
{ {
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName); ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
if (TestComponent* const tc = dynamic_cast<TestComponent*> (component))
if (auto tc = dynamic_cast<TestComponent*> (component))
code.includeFilesH.add (tc->findFile().withFileExtension (".h")); code.includeFilesH.add (tc->findFile().withFileExtension (".h"));
else else
jassertfalse; jassertfalse;


+ 2
- 2
extras/Projucer/Source/ComponentEditor/Components/jucer_SliderHandler.h View File

@@ -614,8 +614,8 @@ private:
String getText() const override String getText() const override
{ {
Slider* s = dynamic_cast<Slider*> (component);
jassert (s != 0);
auto s = dynamic_cast<Slider*> (component);
jassert (s != nullptr);
return String (s->getSkewFactor()); return String (s->getSkewFactor());
} }


+ 12
- 12
extras/Projucer/Source/ComponentEditor/Components/jucer_TabbedComponentHandler.h View File

@@ -264,15 +264,15 @@ public:
//============================================================================== //==============================================================================
static bool isTabUsingJucerComp (TabbedComponent* tc, int tabIndex) static bool isTabUsingJucerComp (TabbedComponent* tc, int tabIndex)
{ {
TabDemoContentComp* const tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
auto tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
jassert (tdc != nullptr); jassert (tdc != nullptr);
return tdc != 0 && tdc->isUsingJucerComp;
return tdc != nullptr && tdc->isUsingJucerComp;
} }
static void setTabUsingJucerComp (TabbedComponent* tc, int tabIndex, const bool b) static void setTabUsingJucerComp (TabbedComponent* tc, int tabIndex, const bool b)
{ {
TabDemoContentComp* const tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
auto tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
jassert (tdc != nullptr); jassert (tdc != nullptr);
if (tdc != nullptr) if (tdc != nullptr)
@@ -284,10 +284,10 @@ public:
static String getTabClassName (TabbedComponent* tc, int tabIndex) static String getTabClassName (TabbedComponent* tc, int tabIndex)
{ {
TabDemoContentComp* const tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
auto tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
jassert (tdc != nullptr); jassert (tdc != nullptr);
return tdc != 0 ? tdc->contentClassName : String();
return tdc != nullptr ? tdc->contentClassName : String();
} }
static void setTabClassName (TabbedComponent* tc, int tabIndex, const String& newName) static void setTabClassName (TabbedComponent* tc, int tabIndex, const String& newName)
@@ -304,15 +304,15 @@ public:
static String getTabConstructorParams (TabbedComponent* tc, int tabIndex) static String getTabConstructorParams (TabbedComponent* tc, int tabIndex)
{ {
TabDemoContentComp* const tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
auto tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
jassert (tdc != nullptr); jassert (tdc != nullptr);
return tdc != 0 ? tdc->constructorParams : String();
return tdc != nullptr ? tdc->constructorParams : String();
} }
static void setTabConstructorParams (TabbedComponent* tc, int tabIndex, const String& newParams) static void setTabConstructorParams (TabbedComponent* tc, int tabIndex, const String& newParams)
{ {
TabDemoContentComp* const tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
auto tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
jassert (tdc != nullptr); jassert (tdc != nullptr);
if (tdc != nullptr) if (tdc != nullptr)
@@ -324,15 +324,15 @@ public:
static String getTabJucerFile (TabbedComponent* tc, int tabIndex) static String getTabJucerFile (TabbedComponent* tc, int tabIndex)
{ {
TabDemoContentComp* const tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
auto tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
jassert (tdc != nullptr); jassert (tdc != nullptr);
return tdc != 0 ? tdc->jucerComponentFile : String();
return tdc != nullptr ? tdc->jucerComponentFile : String();
} }
static void setTabJucerFile (TabbedComponent* tc, int tabIndex, const String& newFile) static void setTabJucerFile (TabbedComponent* tc, int tabIndex, const String& newFile)
{ {
TabDemoContentComp* const tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
auto tdc = dynamic_cast<TabDemoContentComp*> (tc->getTabContentComponent (tabIndex));
jassert (tdc != nullptr); jassert (tdc != nullptr);
if (tdc != nullptr) if (tdc != nullptr)
@@ -380,7 +380,7 @@ private:
{ {
jucerComp.reset(); jucerComp.reset();
jucerComp.reset (new TestComponent (ComponentTypeHandler::findParentDocument (this), 0, false));
jucerComp.reset (new TestComponent (ComponentTypeHandler::findParentDocument (this), nullptr, false));
jucerComp->setFilename (jucerComponentFile); jucerComp->setFilename (jucerComponentFile);
jucerComp->setToInitialSize(); jucerComp->setToInitialSize();


+ 2
- 2
extras/Projucer/Source/ComponentEditor/Components/jucer_TextEditorHandler.h View File

@@ -115,8 +115,8 @@ public:
{ {
ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName); ComponentTypeHandler::fillInCreationCode (code, component, memberVariableName);
TextEditor* const te = dynamic_cast<TextEditor*> (component);
jassert (te != 0);
auto te = dynamic_cast<TextEditor*> (component);
jassert (te != nullptr);
String s; String s;
s << memberVariableName << "->setMultiLine (" << CodeHelpers::boolLiteral (te->isMultiLine()) << ");\n" s << memberVariableName << "->setMultiLine (" << CodeHelpers::boolLiteral (te->isMultiLine()) << ");\n"


+ 1
- 1
extras/Projucer/Source/ComponentEditor/Components/jucer_ViewportHandler.h View File

@@ -188,7 +188,7 @@ public:
if (getViewportContentType (vp) == 1) if (getViewportContentType (vp) == 1)
{ {
JucerDocument* doc = findParentDocument (vp); JucerDocument* doc = findParentDocument (vp);
TestComponent* tc = new TestComponent (doc, 0, false);
auto tc = new TestComponent (doc, nullptr, false);
tc->setFilename (getViewportJucerComponentFile (vp)); tc->setFilename (getViewportJucerComponentFile (vp));
tc->setToInitialSize(); tc->setToInitialSize();


+ 1
- 1
extras/Projucer/Source/ComponentEditor/Documents/jucer_ButtonDocument.h View File

@@ -50,7 +50,7 @@ public:
int chooseBestEnabledPaintRoutine (int paintRoutineWanted) const; int chooseBestEnabledPaintRoutine (int paintRoutineWanted) const;
ComponentLayout* getComponentLayout() const { return 0; }
ComponentLayout* getComponentLayout() const { return nullptr; }
void addExtraClassProperties (PropertyPanel&); void addExtraClassProperties (PropertyPanel&);


+ 1
- 1
extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.cpp View File

@@ -328,7 +328,7 @@ void PaintElementPath::mouseDrag (const MouseEvent& e)
void PaintElementPath::mouseUp (const MouseEvent& e) void PaintElementPath::mouseUp (const MouseEvent& e)
{ {
if (points [mouseDownOnSegment] == 0)
if (points[mouseDownOnSegment] == nullptr)
ColouredElement::mouseUp (e); ColouredElement::mouseUp (e);
else else
owner->getSelectedPoints().addToSelectionOnMouseUp (points [mouseDownOnSegment], owner->getSelectedPoints().addToSelectionOnMouseUp (points [mouseDownOnSegment],


+ 22
- 21
extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementUndoableAction.h View File

@@ -38,7 +38,7 @@ public:
: routine (*element->getOwner()), : routine (*element->getOwner()),
elementIndex (element->getOwner()->indexOfElement (element)) elementIndex (element->getOwner()->indexOfElement (element))
{ {
jassert (element != 0);
jassert (element != nullptr);
if (elementIndex < 0) if (elementIndex < 0)
findGroupIndices (element->getOwner(), element); findGroupIndices (element->getOwner(), element);
@@ -50,28 +50,27 @@ public:
{ {
if (containerGroups.size() > 0) if (containerGroups.size() > 0)
{ {
PaintElementGroup* group = 0;
group = dynamic_cast<PaintElementGroup*> (routine.getElement (containerGroups.getFirst()));
auto group = dynamic_cast<PaintElementGroup*> (routine.getElement (containerGroups.getFirst()));
if (group == 0)
return 0;
if (group == nullptr)
return nullptr;
for (int i = 1; i < containerGroups.size(); ++i) for (int i = 1; i < containerGroups.size(); ++i)
{ {
group = dynamic_cast<PaintElementGroup*> (group->getElement (containerGroups.getUnchecked(i))); group = dynamic_cast<PaintElementGroup*> (group->getElement (containerGroups.getUnchecked(i)));
if (group == 0)
return 0;
if (group == nullptr)
return nullptr;
} }
ElementType* const e = dynamic_cast<ElementType*> (group->getElement (elementIndex));
jassert (e != 0);
auto e = dynamic_cast<ElementType*> (group->getElement (elementIndex));
jassert (e != nullptr);
return e; return e;
} }
else else
{ {
ElementType* const e = dynamic_cast<ElementType*> (routine.getElement (elementIndex));
jassert (e != 0);
auto e = dynamic_cast<ElementType*> (routine.getElement (elementIndex));
jassert (e != nullptr);
return e; return e;
} }
} }
@@ -104,12 +103,13 @@ private:
{ {
for (int i = pr->getNumElements(); --i >= 0;) for (int i = pr->getNumElements(); --i >= 0;)
{ {
PaintElementGroup* const pg = dynamic_cast<PaintElementGroup*> (pr->getElement (i));
if (pg != 0 && pg->containsElement (element))
if (auto pg = dynamic_cast<PaintElementGroup*> (pr->getElement (i)))
{ {
containerGroups.add (i);
findGroupIndices (pg, element);
if (pg->containsElement (element))
{
containerGroups.add (i);
findGroupIndices (pg, element);
}
} }
} }
} }
@@ -122,12 +122,13 @@ private:
{ {
for (int i = group->getNumElements(); --i >= 0;) for (int i = group->getNumElements(); --i >= 0;)
{ {
PaintElementGroup* pg = dynamic_cast<PaintElementGroup*> (group->getElement (i));
if (pg != 0 && pg->containsElement (element))
if (auto pg = dynamic_cast<PaintElementGroup*> (group->getElement (i)))
{ {
containerGroups.add (i);
findGroupIndices (pg, element);
if (pg->containsElement (element))
{
containerGroups.add (i);
findGroupIndices (pg, element);
}
} }
} }
} }


+ 2
- 2
extras/Projucer/Source/ComponentEditor/Properties/jucer_PositionPropertyBase.h View File

@@ -343,9 +343,9 @@ public:
Rectangle<int> parentArea; Rectangle<int> parentArea;
if (component->findParentComponentOfClass<ComponentLayoutEditor>() != 0)
if (component->findParentComponentOfClass<ComponentLayoutEditor>() != nullptr)
parentArea.setSize (component->getParentWidth(), component->getParentHeight()); parentArea.setSize (component->getParentWidth(), component->getParentHeight());
else if (PaintRoutineEditor* pre = dynamic_cast<PaintRoutineEditor*> (component->getParentComponent()))
else if (auto pre = dynamic_cast<PaintRoutineEditor*> (component->getParentComponent()))
parentArea = pre->getComponentArea(); parentArea = pre->getComponentArea();
else else
jassertfalse; jassertfalse;


+ 5
- 5
extras/Projucer/Source/ComponentEditor/UI/jucer_ComponentLayoutEditor.cpp View File

@@ -220,16 +220,16 @@ void ComponentLayoutEditor::refreshAllComponents()
for (int i = layout.getNumComponents(); --i >= 0;) for (int i = layout.getNumComponents(); --i >= 0;)
{ {
Component* const c = layout.getComponent (i);
auto c = layout.getComponent (i);
jassert (c != nullptr); jassert (c != nullptr);
ComponentOverlayComponent* overlay = getOverlayCompFor (c);
auto overlay = getOverlayCompFor (c);
bool isNewOverlay = false; bool isNewOverlay = false;
if (overlay == 0)
if (overlay == nullptr)
{ {
ComponentTypeHandler* const handler = ComponentTypeHandler::getHandlerFor (*c);
auto handler = ComponentTypeHandler::getHandlerFor (*c);
jassert (handler != nullptr); jassert (handler != nullptr);
overlay = handler->createOverlayComponent (c, layout); overlay = handler->createOverlayComponent (c, layout);
@@ -272,7 +272,7 @@ void ComponentLayoutEditor::mouseDown (const MouseEvent& e)
{ {
if (e.mods.isPopupMenu()) if (e.mods.isPopupMenu())
{ {
ApplicationCommandManager* commandManager = &ProjucerApplication::getCommandManager();
auto commandManager = &ProjucerApplication::getCommandManager();
PopupMenu m; PopupMenu m;


+ 14
- 14
extras/Projucer/Source/ComponentEditor/UI/jucer_JucerDocumentEditor.cpp View File

@@ -197,7 +197,7 @@ private:
{ {
public: public:
ComponentClassNameProperty (JucerDocument& doc) ComponentClassNameProperty (JucerDocument& doc)
: ComponentTextProperty <Component> ("Class name", 128, false, 0, doc)
: ComponentTextProperty<Component> ("Class name", 128, false, nullptr, doc)
{} {}
void setText (const String& newText) override { document.setClassName (newText); } void setText (const String& newText) override { document.setClassName (newText); }
@@ -209,7 +209,7 @@ private:
{ {
public: public:
ComponentCompNameProperty (JucerDocument& doc) ComponentCompNameProperty (JucerDocument& doc)
: ComponentTextProperty <Component> ("Component name", 200, false, 0, doc)
: ComponentTextProperty<Component> ("Component name", 200, false, nullptr, doc)
{} {}
void setText (const String& newText) override { document.setComponentName (newText); } void setText (const String& newText) override { document.setComponentName (newText); }
@@ -221,7 +221,7 @@ private:
{ {
public: public:
ComponentParentClassesProperty (JucerDocument& doc) ComponentParentClassesProperty (JucerDocument& doc)
: ComponentTextProperty <Component> ("Parent classes", 512, false, 0, doc)
: ComponentTextProperty<Component> ("Parent classes", 512, false, nullptr, doc)
{} {}
void setText (const String& newText) override { document.setParentClasses (newText); } void setText (const String& newText) override { document.setParentClasses (newText); }
@@ -233,7 +233,7 @@ private:
{ {
public: public:
ComponentConstructorParamsProperty (JucerDocument& doc) ComponentConstructorParamsProperty (JucerDocument& doc)
: ComponentTextProperty <Component> ("Constructor params", 2048, false, 0, doc)
: ComponentTextProperty<Component> ("Constructor params", 2048, false, nullptr, doc)
{} {}
void setText (const String& newText) override { document.setConstructorParams (newText); } void setText (const String& newText) override { document.setConstructorParams (newText); }
@@ -245,7 +245,7 @@ private:
{ {
public: public:
ComponentInitialisersProperty (JucerDocument& doc) ComponentInitialisersProperty (JucerDocument& doc)
: ComponentTextProperty <Component> ("Member initialisers", 16384, true, 0, doc)
: ComponentTextProperty <Component> ("Member initialisers", 16384, true, nullptr, doc)
{ {
preferredHeight = 24 * 3; preferredHeight = 24 * 3;
} }
@@ -260,9 +260,9 @@ private:
{ {
public: public:
ComponentInitialSizeProperty (JucerDocument& doc, const bool isWidth_) ComponentInitialSizeProperty (JucerDocument& doc, const bool isWidth_)
: ComponentTextProperty <Component> (isWidth_ ? "Initial width"
: "Initial height",
10, false, 0, doc),
: ComponentTextProperty<Component> (isWidth_ ? "Initial width"
: "Initial height",
10, false, nullptr, doc),
isWidth (isWidth_) isWidth (isWidth_)
{} {}
@@ -289,7 +289,7 @@ private:
{ {
public: public:
FixedSizeProperty (JucerDocument& doc) FixedSizeProperty (JucerDocument& doc)
: ComponentChoiceProperty <Component> ("Fixed size", 0, doc)
: ComponentChoiceProperty<Component> ("Fixed size", nullptr, doc)
{ {
choices.add ("Resize component to fit workspace"); choices.add ("Resize component to fit workspace");
choices.add ("Keep component size fixed"); choices.add ("Keep component size fixed");
@@ -304,7 +304,7 @@ private:
{ {
public: public:
TemplateFileProperty (JucerDocument& doc) TemplateFileProperty (JucerDocument& doc)
: ComponentTextProperty <Component> ("Template file", 2048, false, 0, doc)
: ComponentTextProperty<Component> ("Template file", 2048, false, nullptr, doc)
{} {}
void setText (const String& newText) override { document.setTemplateFile (newText); } void setText (const String& newText) override { document.setTemplateFile (newText); }
@@ -394,7 +394,7 @@ void JucerDocumentEditor::updateTabs()
for (int i = tabbedComponent.getNumTabs(); --i >= 0;) for (int i = tabbedComponent.getNumTabs(); --i >= 0;)
{ {
if (dynamic_cast<PaintRoutinePanel*> (tabbedComponent.getTabContentComponent (i)) != 0
if (dynamic_cast<PaintRoutinePanel*> (tabbedComponent.getTabContentComponent (i)) != nullptr
&& ! paintRoutineNames.contains (tabbedComponent.getTabNames() [i])) && ! paintRoutineNames.contains (tabbedComponent.getTabNames() [i]))
{ {
tabbedComponent.removeTab (i); tabbedComponent.removeTab (i);
@@ -485,11 +485,11 @@ void JucerDocumentEditor::showLayout()
void JucerDocumentEditor::showGraphics (PaintRoutine* routine) void JucerDocumentEditor::showGraphics (PaintRoutine* routine)
{ {
if (getCurrentPaintRoutine() != routine || routine == 0)
if (getCurrentPaintRoutine() != routine || routine == nullptr)
{ {
for (int i = 0; i < tabbedComponent.getNumTabs(); ++i) for (int i = 0; i < tabbedComponent.getNumTabs(); ++i)
{ {
if (PaintRoutinePanel* pr = dynamic_cast<PaintRoutinePanel*> (tabbedComponent.getTabContentComponent (i)))
if (auto pr = dynamic_cast<PaintRoutinePanel*> (tabbedComponent.getTabContentComponent (i)))
{ {
if (routine == &(pr->getPaintRoutine()) || routine == nullptr) if (routine == &(pr->getPaintRoutine()) || routine == nullptr)
{ {
@@ -1029,7 +1029,7 @@ bool JucerDocumentEditor::perform (const InvocationInfo& info)
break; break;
case JucerCommandIDs::editCompGraphics: case JucerCommandIDs::editCompGraphics:
showGraphics (0);
showGraphics (nullptr);
break; break;
case JucerCommandIDs::zoomIn: setZoom (snapToIntegerZoom (getZoom() * 2.0)); break; case JucerCommandIDs::zoomIn: setZoom (snapToIntegerZoom (getZoom() * 2.0)); break;


+ 12
- 12
extras/Projucer/Source/ComponentEditor/UI/jucer_RelativePositionedRectangle.h View File

@@ -240,7 +240,7 @@ public:
*/ */
void updateFromComponent (const Component& comp) noexcept void updateFromComponent (const Component& comp) noexcept
{ {
if (comp.getParentComponent() == 0 && ! comp.isOnDesktop())
if (comp.getParentComponent() == nullptr && ! comp.isOnDesktop())
updateFrom (comp.getBounds(), Rectangle<int>()); updateFrom (comp.getBounds(), Rectangle<int>());
else else
updateFrom (comp.getBounds(), Rectangle<int> (comp.getParentWidth(), comp.getParentHeight())); updateFrom (comp.getBounds(), Rectangle<int> (comp.getParentWidth(), comp.getParentHeight()));
@@ -627,12 +627,12 @@ struct RelativePositionedRectangle
int& x, int& xw, int& y, int& yh, int& x, int& xw, int& y, int& yh,
int& w, int& h) const int& w, int& h) const
{ {
Component* rx = 0;
Component* ry = 0;
Component* rw = 0;
Component* rh = 0;
Component* rx = {};
Component* ry = {};
Component* rw = {};
Component* rh = {};
if (layout != 0)
if (layout != nullptr)
{ {
rx = layout->findComponentWithId (relativeToX); rx = layout->findComponentWithId (relativeToX);
ry = layout->findComponentWithId (relativeToY); ry = layout->findComponentWithId (relativeToY);
@@ -640,12 +640,12 @@ struct RelativePositionedRectangle
rh = layout->findComponentWithId (relativeToH); rh = layout->findComponentWithId (relativeToH);
} }
x = parentArea.getX() + (rx != 0 ? rx->getX() : 0);
y = parentArea.getY() + (ry != 0 ? ry->getY() : 0);
w = rw != 0 ? rw->getWidth() : parentArea.getWidth();
h = rh != 0 ? rh->getHeight() : parentArea.getHeight();
xw = rx != 0 ? rx->getWidth() : parentArea.getWidth();
yh = ry != 0 ? ry->getHeight() : parentArea.getHeight();
x = parentArea.getX() + (rx != nullptr ? rx->getX() : 0);
y = parentArea.getY() + (ry != nullptr ? ry->getY() : 0);
w = rw != nullptr ? rw->getWidth() : parentArea.getWidth();
h = rh != nullptr ? rh->getHeight() : parentArea.getHeight();
xw = rx != nullptr ? rx->getWidth() : parentArea.getWidth();
yh = ry != nullptr ? ry->getHeight() : parentArea.getHeight();
} }
Rectangle<int> getRectangle (const Rectangle<int>& parentArea, Rectangle<int> getRectangle (const Rectangle<int>& parentArea,


+ 5
- 5
extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.cpp View File

@@ -502,11 +502,11 @@ void ComponentLayout::setComponentRelativeTarget (Component* comp, int whichDime
jassert (comp != nullptr); jassert (comp != nullptr);
jassert (pe != nullptr || components.contains (comp)); jassert (pe != nullptr || components.contains (comp));
jassert (compToBeRelativeTo == 0 || components.contains (compToBeRelativeTo));
jassert (compToBeRelativeTo == 0 || ! dependsOnComponentForRelativePos (compToBeRelativeTo, comp));
jassert (compToBeRelativeTo == nullptr || components.contains (compToBeRelativeTo));
jassert (compToBeRelativeTo == nullptr || ! dependsOnComponentForRelativePos (compToBeRelativeTo, comp));
if (compToBeRelativeTo != getComponentRelativePosTarget (comp, whichDimension) if (compToBeRelativeTo != getComponentRelativePosTarget (comp, whichDimension)
&& (compToBeRelativeTo == 0 || ! dependsOnComponentForRelativePos (compToBeRelativeTo, comp)))
&& (compToBeRelativeTo == nullptr || ! dependsOnComponentForRelativePos (compToBeRelativeTo, comp)))
{ {
const int64 compId = ComponentTypeHandler::getComponentId (compToBeRelativeTo); const int64 compId = ComponentTypeHandler::getComponentId (compToBeRelativeTo);
@@ -560,9 +560,9 @@ PopupMenu ComponentLayout::getRelativeTargetMenu (Component* comp, int whichDime
{ {
PopupMenu m; PopupMenu m;
Component* const current = getComponentRelativePosTarget (comp, whichDimension);
auto current = getComponentRelativePosTarget (comp, whichDimension);
m.addItem (menuIdBase, "Relative to parent component", true, current == 0);
m.addItem (menuIdBase, "Relative to parent component", true, current == nullptr);
m.addSeparator(); m.addSeparator();
for (int i = 0; i < components.size(); ++i) for (int i = 0; i < components.size(); ++i)


+ 1
- 1
extras/Projucer/Source/Project/jucer_Project.cpp View File

@@ -179,7 +179,7 @@ void Project::initialiseMainGroup()
if (! projectRoot.getChildWithName (Ids::MAINGROUP).isValid()) if (! projectRoot.getChildWithName (Ids::MAINGROUP).isValid())
{ {
Item mainGroup (*this, ValueTree (Ids::MAINGROUP), false); Item mainGroup (*this, ValueTree (Ids::MAINGROUP), false);
projectRoot.addChild (mainGroup.state, 0, 0);
projectRoot.addChild (mainGroup.state, 0, nullptr);
} }
getMainGroup().initialiseMissingProperties(); getMainGroup().initialiseMissingProperties();


+ 1
- 1
extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp View File

@@ -743,7 +743,7 @@ void ProjectExporter::addNewConfigurationFromExisting (const BuildConfiguration&
ValueTree newConfig (Ids::CONFIGURATION); ValueTree newConfig (Ids::CONFIGURATION);
newConfig = configToCopy.config.createCopy(); newConfig = configToCopy.config.createCopy();
newConfig.setProperty (Ids::name, configToCopy.getName(), 0);
newConfig.setProperty (Ids::name, configToCopy.getName(), nullptr);
configs.appendChild (newConfig, project.getUndoManagerFor (configs)); configs.appendChild (newConfig, project.getUndoManagerFor (configs));
} }


+ 19
- 14
extras/Projucer/Source/Utility/Helpers/jucer_CodeHelpers.cpp View File

@@ -99,7 +99,7 @@ namespace CodeHelpers
words.addTokens (s.retainCharacters (allowedChars), false); words.addTokens (s.retainCharacters (allowedChars), false);
words.trim(); words.trim();
String n (words[0]);
auto n = words[0];
if (capitalise) if (capitalise)
n = n.toLowerCase(); n = n.toLowerCase();
@@ -176,7 +176,7 @@ namespace CodeHelpers
{ {
for (int i = 0; i < lines.size(); ++i) for (int i = 0; i < lines.size(); ++i)
{ {
String& line = lines.getReference (i);
auto& line = lines.getReference (i);
if (line.length() > maxLineLength) if (line.length() > maxLineLength)
{ {
@@ -259,7 +259,7 @@ namespace CodeHelpers
#define COL(col) #col, #define COL(col) #col,
#include "jucer_Colours.h" #include "jucer_Colours.h"
#undef COL #undef COL
0
nullptr
}; };
for (int i = 0; i < numElementsInArray (colourNames) - 1; ++i) for (int i = 0; i < numElementsInArray (colourNames) - 1; ++i)
@@ -301,7 +301,7 @@ namespace CodeHelpers
{ {
const int maxCharsOnLine = 250; const int maxCharsOnLine = 250;
const unsigned char* data = (const unsigned char*) mb.getData();
auto data = (const unsigned char*) mb.getData();
int charsOnLine = 0; int charsOnLine = 0;
bool canUseStringLiteral = mb.getSize() < 32768; // MS compilers can't handle big string literals.. bool canUseStringLiteral = mb.getSize() < 32768; // MS compilers can't handle big string literals..
@@ -312,7 +312,8 @@ namespace CodeHelpers
for (size_t i = 0; i < mb.getSize(); ++i) for (size_t i = 0; i < mb.getSize(); ++i)
{ {
const unsigned int num = (unsigned int) data[i];
auto num = (unsigned int) data[i];
if (! ((num >= 32 && num < 127) || num == '\t' || num == '\r' || num == '\n')) if (! ((num >= 32 && num < 127) || num == '\t' || num == '\r' || num == '\n'))
{ {
if (++numEscaped > mb.getSize() / 4) if (++numEscaped > mb.getSize() / 4)
@@ -330,7 +331,7 @@ namespace CodeHelpers
for (size_t i = 0; i < mb.getSize(); ++i) for (size_t i = 0; i < mb.getSize(); ++i)
{ {
const int num = (int) (unsigned int) data[i];
auto num = (int) (unsigned int) data[i];
out << num << ','; out << num << ',';
charsOnLine += 2; charsOnLine += 2;
@@ -364,8 +365,9 @@ namespace CodeHelpers
//============================================================================== //==============================================================================
static unsigned int calculateHash (const String& s, const unsigned int hashMultiplier) static unsigned int calculateHash (const String& s, const unsigned int hashMultiplier)
{ {
const char* t = s.toUTF8();
auto t = s.toUTF8();
unsigned int hash = 0; unsigned int hash = 0;
while (*t != 0) while (*t != 0)
hash = hashMultiplier * hash + (unsigned int) *t++; hash = hashMultiplier * hash + (unsigned int) *t++;
@@ -378,11 +380,13 @@ namespace CodeHelpers
for (;;) for (;;)
{ {
SortedSet <unsigned int> hashes;
SortedSet<unsigned int> hashes;
bool collision = false; bool collision = false;
for (int i = strings.size(); --i >= 0;) for (int i = strings.size(); --i >= 0;)
{ {
const unsigned int hash = calculateHash (strings[i], v);
auto hash = calculateHash (strings[i], v);
if (hashes.contains (hash)) if (hashes.contains (hash))
{ {
collision = true; collision = true;
@@ -405,11 +409,12 @@ namespace CodeHelpers
const StringArray& strings, const StringArray& codeToExecute, const int indentLevel) const StringArray& strings, const StringArray& codeToExecute, const int indentLevel)
{ {
jassert (strings.size() == codeToExecute.size()); jassert (strings.size() == codeToExecute.size());
const String indent (String::repeatedString (" ", indentLevel));
const unsigned int hashMultiplier = findBestHashMultiplier (strings);
auto indent = String::repeatedString (" ", indentLevel);
auto hashMultiplier = findBestHashMultiplier (strings);
out << indent << "unsigned int hash = 0;" << newLine out << indent << "unsigned int hash = 0;" << newLine
<< indent << "if (" << utf8PointerVariable << " != 0)" << newLine
<< newLine
<< indent << "if (" << utf8PointerVariable << " != nullptr)" << newLine
<< indent << " while (*" << utf8PointerVariable << " != 0)" << newLine << indent << " while (*" << utf8PointerVariable << " != 0)" << newLine
<< indent << " hash = " << (int) hashMultiplier << " * hash + (unsigned int) *" << utf8PointerVariable << "++;" << newLine << indent << " hash = " << (int) hashMultiplier << " * hash + (unsigned int) *" << utf8PointerVariable << "++;" << newLine
<< newLine << newLine
@@ -461,8 +466,8 @@ namespace CodeHelpers
{ {
pos = pos.movedByLines (-1); pos = pos.movedByLines (-1);
const String line (pos.getLineText());
const String trimmedLine (line.trimStart());
auto line = pos.getLineText();
auto trimmedLine = line.trimStart();
braceCount += getBraceCount (trimmedLine.getCharPointer()); braceCount += getBraceCount (trimmedLine.getCharPointer());


+ 1
- 1
modules/juce_core/maths/juce_Expression.cpp View File

@@ -145,7 +145,7 @@ struct Expression::Helpers
Type getType() const noexcept { return operatorType; } Type getType() const noexcept { return operatorType; }
int getNumInputs() const { return 2; } int getNumInputs() const { return 2; }
Term* getInput (int index) const { return index == 0 ? left.get() : (index == 1 ? right.get() : 0); }
Term* getInput (int index) const { return index == 0 ? left.get() : (index == 1 ? right.get() : nullptr); }
virtual double performFunction (double left, double right) const = 0; virtual double performFunction (double left, double right) const = 0;
virtual void writeOperator (String& dest) const = 0; virtual void writeOperator (String& dest) const = 0;


+ 1
- 1
modules/juce_core/memory/juce_Atomic.h View File

@@ -43,7 +43,7 @@ struct Atomic final
using DiffType = typename AtomicHelpers::DiffTypeHelper<Type>::Type; using DiffType = typename AtomicHelpers::DiffTypeHelper<Type>::Type;
/** Creates a new value, initialised to zero. */ /** Creates a new value, initialised to zero. */
Atomic() noexcept : value (0) {}
Atomic() noexcept : value (Type()) {}
/** Creates a new value, with a given initial value. */ /** Creates a new value, with a given initial value. */
Atomic (Type initialValue) noexcept : value (initialValue) {} Atomic (Type initialValue) noexcept : value (initialValue) {}


+ 4
- 4
modules/juce_core/native/juce_mac_Files.mm View File

@@ -65,7 +65,7 @@ namespace MacFileHelpers
{ {
const String type (buf.f_fstypename); const String type (buf.f_fstypename);
while (*types != 0)
while (*types != nullptr)
if (type.equalsIgnoreCase (*types++)) if (type.equalsIgnoreCase (*types++))
return true; return true;
} }
@@ -105,14 +105,14 @@ namespace MacFileHelpers
#else #else
static bool launchExecutable (const String& pathAndArguments) static bool launchExecutable (const String& pathAndArguments)
{ {
const int cpid = fork();
auto cpid = fork();
if (cpid == 0) if (cpid == 0)
{ {
const char* const argv[4] = { "/bin/sh", "-c", pathAndArguments.toUTF8(), 0 };
const char* const argv[4] = { "/bin/sh", "-c", pathAndArguments.toUTF8(), nullptr };
// Child process // Child process
if (execve (argv[0], (char**) argv, 0) < 0)
if (execve (argv[0], (char**) argv, nullptr) < 0)
exit (0); exit (0);
} }
else else


+ 3
- 3
modules/juce_core/native/juce_mac_Strings.mm View File

@@ -25,7 +25,7 @@ namespace juce
String String::fromCFString (CFStringRef cfString) String String::fromCFString (CFStringRef cfString)
{ {
if (cfString == 0)
if (cfString == nullptr)
return {}; return {};
CFRange range = { 0, CFStringGetLength (cfString) }; CFRange range = { 0, CFStringGetLength (cfString) };
@@ -72,7 +72,7 @@ String String::convertToPrecomposedUnicode() const
map.mappingVersion = kUnicodeUseLatestMapping; map.mappingVersion = kUnicodeUseLatestMapping;
UnicodeToTextInfo conversionInfo = 0;
UnicodeToTextInfo conversionInfo = {};
String result; String result;
if (CreateUnicodeToTextInfo (&map, &conversionInfo) == noErr) if (CreateUnicodeToTextInfo (&map, &conversionInfo) == noErr)
@@ -88,7 +88,7 @@ String String::convertToPrecomposedUnicode() const
if (ConvertFromUnicodeToText (conversionInfo, if (ConvertFromUnicodeToText (conversionInfo,
bytesNeeded, (ConstUniCharArrayPtr) toUTF16().getAddress(), bytesNeeded, (ConstUniCharArrayPtr) toUTF16().getAddress(),
kUnicodeDefaultDirectionMask, kUnicodeDefaultDirectionMask,
0, 0, 0, 0,
0, {}, {}, {},
bytesNeeded, &bytesRead, bytesNeeded, &bytesRead,
&outputBufferSize, tempOut) == noErr) &outputBufferSize, tempOut) == noErr)
{ {


+ 2
- 2
modules/juce_core/native/juce_mac_SystemStats.mm View File

@@ -190,7 +190,7 @@ int SystemStats::getMemorySizeInMegabytes()
uint64 mem = 0; uint64 mem = 0;
size_t memSize = sizeof (mem); size_t memSize = sizeof (mem);
int mib[] = { CTL_HW, HW_MEMSIZE }; int mib[] = { CTL_HW, HW_MEMSIZE };
sysctl (mib, 2, &mem, &memSize, 0, 0);
sysctl (mib, 2, &mem, &memSize, nullptr, 0);
return (int) (mem / (1024 * 1024)); return (int) (mem / (1024 * 1024));
} }
@@ -224,7 +224,7 @@ int SystemStats::getCpuSpeedInMegahertz()
uint64 speedHz = 0; uint64 speedHz = 0;
size_t speedSize = sizeof (speedHz); size_t speedSize = sizeof (speedHz);
int mib[] = { CTL_HW, HW_CPU_FREQ }; int mib[] = { CTL_HW, HW_CPU_FREQ };
sysctl (mib, 2, &speedHz, &speedSize, 0, 0);
sysctl (mib, 2, &speedHz, &speedSize, nullptr, 0);
#if JUCE_BIG_ENDIAN #if JUCE_BIG_ENDIAN
if (speedSize == 4) if (speedSize == 4)


+ 1
- 1
modules/juce_core/native/juce_mac_Threads.mm View File

@@ -86,7 +86,7 @@ JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept
struct kinfo_proc info; struct kinfo_proc info;
int m[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; int m[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() };
size_t sz = sizeof (info); size_t sz = sizeof (info);
sysctl (m, 4, &info, &sz, 0, 0);
sysctl (m, 4, &info, &sz, nullptr, 0);
return (info.kp_proc.p_flag & P_TRACED) != 0; return (info.kp_proc.p_flag & P_TRACED) != 0;
} }


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

@@ -180,7 +180,7 @@ private:
FD_ZERO (&rset); FD_ZERO (&rset);
FD_SET (handle, &rset); FD_SET (handle, &rset);
select (handle + 1, &rset, nullptr, 0, &timeout);
select (handle + 1, &rset, nullptr, nullptr, &timeout);
} }
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Pimpl)


+ 21
- 21
modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -44,7 +44,7 @@ void CriticalSection::exit() const noexcept { pthread_mutex_unlock (&loc
WaitableEvent::WaitableEvent (bool useManualReset) noexcept WaitableEvent::WaitableEvent (bool useManualReset) noexcept
: triggered (false), manualReset (useManualReset) : triggered (false), manualReset (useManualReset)
{ {
pthread_cond_init (&condition, 0);
pthread_cond_init (&condition, {});
pthread_mutexattr_t atts; pthread_mutexattr_t atts;
pthread_mutexattr_init (&atts); pthread_mutexattr_init (&atts);
@@ -78,7 +78,7 @@ bool WaitableEvent::wait (int timeOutMillisecs) const noexcept
else else
{ {
struct timeval now; struct timeval now;
gettimeofday (&now, 0);
gettimeofday (&now, nullptr);
struct timespec time; struct timespec time;
time.tv_sec = now.tv_sec + (timeOutMillisecs / 1000); time.tv_sec = now.tv_sec + (timeOutMillisecs / 1000);
@@ -469,7 +469,7 @@ Result File::createDirectoryInternal (const String& fileName) const
//============================================================================== //==============================================================================
int64 juce_fileSetPosition (void* handle, int64 pos) int64 juce_fileSetPosition (void* handle, int64 pos)
{ {
if (handle != 0 && lseek (getFD (handle), (off_t) pos, SEEK_SET) == pos)
if (handle != nullptr && lseek (getFD (handle), (off_t) pos, SEEK_SET) == pos)
return pos; return pos;
return -1; return -1;
@@ -487,7 +487,7 @@ void FileInputStream::openHandle()
FileInputStream::~FileInputStream() FileInputStream::~FileInputStream()
{ {
if (fileHandle != 0)
if (fileHandle != nullptr)
close (getFD (fileHandle)); close (getFD (fileHandle));
} }
@@ -495,7 +495,7 @@ size_t FileInputStream::readInternal (void* buffer, size_t numBytes)
{ {
ssize_t result = 0; ssize_t result = 0;
if (fileHandle != 0)
if (fileHandle != nullptr)
{ {
result = ::read (getFD (fileHandle), buffer, numBytes); result = ::read (getFD (fileHandle), buffer, numBytes);
@@ -548,16 +548,16 @@ void FileOutputStream::openHandle()
void FileOutputStream::closeHandle() void FileOutputStream::closeHandle()
{ {
if (fileHandle != 0)
if (fileHandle != nullptr)
{ {
close (getFD (fileHandle)); close (getFD (fileHandle));
fileHandle = 0;
fileHandle = nullptr;
} }
} }
ssize_t FileOutputStream::writeInternal (const void* data, size_t numBytes) ssize_t FileOutputStream::writeInternal (const void* data, size_t numBytes)
{ {
if (fileHandle == 0)
if (fileHandle == nullptr)
return 0; return 0;
auto result = ::write (getFD (fileHandle), data, numBytes); auto result = ::write (getFD (fileHandle), data, numBytes);
@@ -571,14 +571,14 @@ ssize_t FileOutputStream::writeInternal (const void* data, size_t numBytes)
#ifndef JUCE_ANDROID #ifndef JUCE_ANDROID
void FileOutputStream::flushInternal() void FileOutputStream::flushInternal()
{ {
if (fileHandle != 0 && fsync (getFD (fileHandle)) == -1)
if (fileHandle != nullptr && fsync (getFD (fileHandle)) == -1)
status = getResultForErrno(); status = getResultForErrno();
} }
#endif #endif
Result FileOutputStream::truncate() Result FileOutputStream::truncate()
{ {
if (fileHandle == 0)
if (fileHandle == nullptr)
return status; return status;
flush(); flush();
@@ -610,10 +610,10 @@ void MemoryMappedFile::openInternal (const File& file, AccessMode mode, bool exc
if (fileHandle != -1) if (fileHandle != -1)
{ {
void* m = mmap (0, (size_t) range.getLength(),
mode == readWrite ? (PROT_READ | PROT_WRITE) : PROT_READ,
exclusive ? MAP_PRIVATE : MAP_SHARED, fileHandle,
(off_t) range.getStart());
auto m = mmap (nullptr, (size_t) range.getLength(),
mode == readWrite ? (PROT_READ | PROT_WRITE) : PROT_READ,
exclusive ? MAP_PRIVATE : MAP_SHARED, fileHandle,
(off_t) range.getStart());
if (m != MAP_FAILED) if (m != MAP_FAILED)
{ {
@@ -944,8 +944,8 @@ void Thread::launchThread()
} }
#endif #endif
threadHandle = 0;
pthread_t handle = 0;
threadHandle = {};
pthread_t handle = {};
pthread_attr_t attr; pthread_attr_t attr;
pthread_attr_t* attrPtr = nullptr; pthread_attr_t* attrPtr = nullptr;
@@ -968,13 +968,13 @@ void Thread::launchThread()
void Thread::closeThreadHandle() void Thread::closeThreadHandle()
{ {
threadId = 0;
threadHandle = 0;
threadId = {};
threadHandle = {};
} }
void Thread::killThread() void Thread::killThread()
{ {
if (threadHandle.get() != 0)
if (threadHandle.get() != nullptr)
{ {
#if JUCE_ANDROID #if JUCE_ANDROID
jassertfalse; // pthread_cancel not available! jassertfalse; // pthread_cancel not available!
@@ -1304,7 +1304,7 @@ struct HighResolutionTimer::Pimpl
{ {
isRunning = false; isRunning = false;
if (thread == 0)
if (thread == pthread_t())
return; return;
if (thread == pthread_self()) if (thread == pthread_self())
@@ -1321,7 +1321,7 @@ struct HighResolutionTimer::Pimpl
pthread_mutex_unlock (&timerMutex); pthread_mutex_unlock (&timerMutex);
pthread_join (thread, nullptr); pthread_join (thread, nullptr);
thread = 0;
thread = {};
} }
HighResolutionTimer& owner; HighResolutionTimer& owner;


+ 3
- 2
modules/juce_core/network/juce_Socket.cpp View File

@@ -264,7 +264,7 @@ namespace SocketHelpers
} }
else else
{ {
timeoutp = 0;
timeoutp = nullptr;
} }
fd_set rset, wset; fd_set rset, wset;
@@ -282,7 +282,8 @@ namespace SocketHelpers
#else #else
{ {
int result; int result;
while ((result = select (h + 1, prset, pwset, 0, timeoutp)) < 0
while ((result = select (h + 1, prset, pwset, nullptr, timeoutp)) < 0
&& errno == EINTR) && errno == EINTR)
{ {
} }


+ 1
- 4
modules/juce_core/threads/juce_ReadWriteLock.cpp View File

@@ -24,9 +24,6 @@ namespace juce
{ {
ReadWriteLock::ReadWriteLock() noexcept ReadWriteLock::ReadWriteLock() noexcept
: numWaitingWriters (0),
numWriters (0),
writerThreadId (0)
{ {
readerThreads.ensureStorageAllocated (16); readerThreads.ensureStorageAllocated (16);
} }
@@ -141,7 +138,7 @@ void ReadWriteLock::exitWrite() const noexcept
if (--numWriters == 0) if (--numWriters == 0)
{ {
writerThreadId = 0;
writerThreadId = {};
waitEvent.signal(); waitEvent.signal();
} }
} }


+ 2
- 2
modules/juce_core/threads/juce_ReadWriteLock.h View File

@@ -127,8 +127,8 @@ private:
//============================================================================== //==============================================================================
SpinLock accessLock; SpinLock accessLock;
WaitableEvent waitEvent; WaitableEvent waitEvent;
mutable int numWaitingWriters, numWriters;
mutable Thread::ThreadID writerThreadId;
mutable int numWaitingWriters = 0, numWriters = 0;
mutable Thread::ThreadID writerThreadId = {};
struct ThreadRecursionCount struct ThreadRecursionCount
{ {


+ 3
- 3
modules/juce_core/threads/juce_Thread.cpp View File

@@ -195,7 +195,7 @@ bool Thread::currentThreadShouldExit()
bool Thread::waitForThreadToExit (const int timeOutMilliseconds) const bool Thread::waitForThreadToExit (const int timeOutMilliseconds) const
{ {
// Doh! So how exactly do you expect this thread to wait for itself to stop?? // Doh! So how exactly do you expect this thread to wait for itself to stop??
jassert (getThreadId() != getCurrentThreadId() || getCurrentThreadId() == 0);
jassert (getThreadId() != getCurrentThreadId() || getCurrentThreadId() == ThreadID());
auto timeoutEnd = Time::getMillisecondCounter() + (uint32) timeOutMilliseconds; auto timeoutEnd = Time::getMillisecondCounter() + (uint32) timeOutMilliseconds;
@@ -236,7 +236,7 @@ bool Thread::stopThread (const int timeOutMilliseconds)
killThread(); killThread();
threadHandle = nullptr; threadHandle = nullptr;
threadId = 0;
threadId = {};
return false; return false;
} }
} }
@@ -288,7 +288,7 @@ bool Thread::setPriority (int newPriority)
bool Thread::setCurrentThreadPriority (const int newPriority) bool Thread::setCurrentThreadPriority (const int newPriority)
{ {
return setThreadPriority (0, newPriority);
return setThreadPriority ({}, newPriority);
} }
void Thread::setAffinityMask (const uint32 newAffinityMask) void Thread::setAffinityMask (const uint32 newAffinityMask)


+ 3
- 0
modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp View File

@@ -36,6 +36,9 @@ namespace zlibNamespace
#pragma clang diagnostic ignored "-Wconversion" #pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wshadow" #pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wdeprecated-register" #pragma clang diagnostic ignored "-Wdeprecated-register"
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#if __has_warning("-Wcomma") #if __has_warning("-Wcomma")
#pragma clang diagnostic ignored "-Wcomma" #pragma clang diagnostic ignored "-Wcomma"
#endif #endif


+ 1
- 1
modules/juce_cryptography/encryption/juce_Primes.h View File

@@ -52,7 +52,7 @@ public:
*/ */
static BigInteger createProbablePrime (int bitLength, static BigInteger createProbablePrime (int bitLength,
int certainty, int certainty,
const int* randomSeeds = 0,
const int* randomSeeds = nullptr,
int numRandomSeeds = 0); int numRandomSeeds = 0);
/** Tests a number to see if it's prime. /** Tests a number to see if it's prime.


+ 1
- 1
modules/juce_cryptography/encryption/juce_RSAKey.cpp View File

@@ -123,7 +123,7 @@ void RSAKey::createKeyPair (RSAKey& publicKey, RSAKey& privateKey,
jassert (numRandomSeeds == 0 || numRandomSeeds >= 2); // you need to provide plenty of seeds here! jassert (numRandomSeeds == 0 || numRandomSeeds >= 2); // you need to provide plenty of seeds here!
BigInteger p (Primes::createProbablePrime (numBits / 2, 30, randomSeeds, numRandomSeeds / 2)); BigInteger p (Primes::createProbablePrime (numBits / 2, 30, randomSeeds, numRandomSeeds / 2));
BigInteger q (Primes::createProbablePrime (numBits - numBits / 2, 30, randomSeeds == nullptr ? 0 : (randomSeeds + numRandomSeeds / 2), numRandomSeeds - numRandomSeeds / 2));
BigInteger q (Primes::createProbablePrime (numBits - numBits / 2, 30, randomSeeds == nullptr ? nullptr : (randomSeeds + numRandomSeeds / 2), numRandomSeeds - numRandomSeeds / 2));
const BigInteger n (p * q); const BigInteger n (p * q);
const BigInteger m (--p * --q); const BigInteger m (--p * --q);


+ 1
- 1
modules/juce_events/messages/juce_ApplicationBase.cpp View File

@@ -23,7 +23,7 @@
namespace juce namespace juce
{ {
JUCEApplicationBase::CreateInstanceFunction JUCEApplicationBase::createInstance = 0;
JUCEApplicationBase::CreateInstanceFunction JUCEApplicationBase::createInstance = nullptr;
JUCEApplicationBase* JUCEApplicationBase::appInstance = nullptr; JUCEApplicationBase* JUCEApplicationBase::appInstance = nullptr;
#if JUCE_IOS #if JUCE_IOS


+ 1
- 1
modules/juce_events/messages/juce_MessageManager.cpp View File

@@ -349,7 +349,7 @@ void MessageManager::Lock::exit() const noexcept
lockGained.set (0); lockGained.set (0);
if (mm != nullptr) if (mm != nullptr)
mm->threadWithLock = 0;
mm->threadWithLock = {};
if (blockingMessage != nullptr) if (blockingMessage != nullptr)
{ {


+ 3
- 3
modules/juce_graphics/geometry/juce_PathStrokeType.cpp View File

@@ -654,10 +654,10 @@ namespace PathStrokeHelpers
} }
void PathStrokeType::createStrokedPath (Path& destPath, const Path& sourcePath, void PathStrokeType::createStrokedPath (Path& destPath, const Path& sourcePath,
const AffineTransform& transform, const float extraAccuracy) const
const AffineTransform& transform, float extraAccuracy) const
{ {
PathStrokeHelpers::createStroke (thickness, jointStyle, endStyle, destPath, sourcePath, PathStrokeHelpers::createStroke (thickness, jointStyle, endStyle, destPath, sourcePath,
transform, extraAccuracy, 0);
transform, extraAccuracy, nullptr);
} }
void PathStrokeType::createDashedStroke (Path& destPath, void PathStrokeType::createDashedStroke (Path& destPath,
@@ -665,7 +665,7 @@ void PathStrokeType::createDashedStroke (Path& destPath,
const float* dashLengths, const float* dashLengths,
int numDashLengths, int numDashLengths,
const AffineTransform& transform, const AffineTransform& transform,
const float extraAccuracy) const
float extraAccuracy) const
{ {
jassert (extraAccuracy > 0); jassert (extraAccuracy > 0);


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

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


+ 9
- 6
modules/juce_graphics/image_formats/juce_PNGLoader.cpp View File

@@ -66,6 +66,9 @@ namespace pnglibNamespace
#if JUCE_CLANG #if JUCE_CLANG
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wsign-conversion"
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#if __has_warning("-Wcomma") #if __has_warning("-Wcomma")
#pragma clang diagnostic ignored "-Wcomma" #pragma clang diagnostic ignored "-Wcomma"
#endif #endif
@@ -520,23 +523,23 @@ Image PNGImageFormat::decodeImage (InputStream& in)
bool PNGImageFormat::writeImageToStream (const Image& image, OutputStream& out) bool PNGImageFormat::writeImageToStream (const Image& image, OutputStream& out)
{ {
using namespace pnglibNamespace; using namespace pnglibNamespace;
const int width = image.getWidth();
const int height = image.getHeight();
auto width = image.getWidth();
auto height = image.getHeight();
png_structp pngWriteStruct = png_create_write_struct (PNG_LIBPNG_VER_STRING, 0, 0, 0);
auto pngWriteStruct = png_create_write_struct (PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (pngWriteStruct == nullptr) if (pngWriteStruct == nullptr)
return false; return false;
png_infop pngInfoStruct = png_create_info_struct (pngWriteStruct);
auto pngInfoStruct = png_create_info_struct (pngWriteStruct);
if (pngInfoStruct == nullptr) if (pngInfoStruct == nullptr)
{ {
png_destroy_write_struct (&pngWriteStruct, (png_infopp) nullptr);
png_destroy_write_struct (&pngWriteStruct, nullptr);
return false; return false;
} }
png_set_write_fn (pngWriteStruct, &out, PNGHelpers::writeDataCallback, 0);
png_set_write_fn (pngWriteStruct, &out, PNGHelpers::writeDataCallback, nullptr);
png_set_IHDR (pngWriteStruct, pngInfoStruct, (png_uint_32) width, (png_uint_32) height, 8, png_set_IHDR (pngWriteStruct, pngInfoStruct, (png_uint_32) width, (png_uint_32) height, 8,
image.hasAlphaChannel() ? PNG_COLOR_TYPE_RGB_ALPHA image.hasAlphaChannel() ? PNG_COLOR_TYPE_RGB_ALPHA


+ 1
- 1
modules/juce_graphics/image_formats/pnglib/png.c View File

@@ -28,7 +28,7 @@ png_set_sig_bytes(png_structrp png_ptr, int num_bytes)
{ {
png_debug(1, "in png_set_sig_bytes"); png_debug(1, "in png_set_sig_bytes");
if (png_ptr == NULL)
if (png_ptr == NULL)
return; return;
if (num_bytes > 8) if (num_bytes > 8)


+ 10
- 10
modules/juce_graphics/native/juce_RenderingHelpers.h View File

@@ -1725,9 +1725,9 @@ struct ClipRegions
auto imageY = ((ty + 128) >> 8); auto imageY = ((ty + 128) >> 8);
if (image.getFormat() == Image::ARGB) if (image.getFormat() == Image::ARGB)
straightClipImage (srcData, imageX, imageY, (PixelARGB*) 0);
straightClipImage (srcData, imageX, imageY, (PixelARGB*) nullptr);
else else
straightClipImage (srcData, imageX, imageY, (PixelAlpha*) 0);
straightClipImage (srcData, imageX, imageY, (PixelAlpha*) nullptr);
return edgeTable.isEmpty() ? Ptr() : Ptr (*this); return edgeTable.isEmpty() ? Ptr() : Ptr (*this);
} }
@@ -1746,9 +1746,9 @@ struct ClipRegions
if (! edgeTable.isEmpty()) if (! edgeTable.isEmpty())
{ {
if (image.getFormat() == Image::ARGB) if (image.getFormat() == Image::ARGB)
transformedClipImage (srcData, transform, quality, (PixelARGB*) 0);
transformedClipImage (srcData, transform, quality, (PixelARGB*) nullptr);
else else
transformedClipImage (srcData, transform, quality, (PixelAlpha*) 0);
transformedClipImage (srcData, transform, quality, (PixelAlpha*) nullptr);
} }
return edgeTable.isEmpty() ? Ptr() : Ptr (*this); return edgeTable.isEmpty() ? Ptr() : Ptr (*this);
@@ -2640,9 +2640,9 @@ public:
switch (destData.pixelFormat) switch (destData.pixelFormat)
{ {
case Image::ARGB: EdgeTableFillers::renderSolidFill (iter, destData, colour, replaceContents, (PixelARGB*) 0); break;
case Image::RGB: EdgeTableFillers::renderSolidFill (iter, destData, colour, replaceContents, (PixelRGB*) 0); break;
default: EdgeTableFillers::renderSolidFill (iter, destData, colour, replaceContents, (PixelAlpha*) 0); break;
case Image::ARGB: EdgeTableFillers::renderSolidFill (iter, destData, colour, replaceContents, (PixelARGB*) nullptr); break;
case Image::RGB: EdgeTableFillers::renderSolidFill (iter, destData, colour, replaceContents, (PixelRGB*) nullptr); break;
default: EdgeTableFillers::renderSolidFill (iter, destData, colour, replaceContents, (PixelAlpha*) nullptr); break;
} }
} }
@@ -2657,9 +2657,9 @@ public:
switch (destData.pixelFormat) switch (destData.pixelFormat)
{ {
case Image::ARGB: EdgeTableFillers::renderGradient (iter, destData, gradient, trans, lookupTable, numLookupEntries, isIdentity, (PixelARGB*) 0); break;
case Image::RGB: EdgeTableFillers::renderGradient (iter, destData, gradient, trans, lookupTable, numLookupEntries, isIdentity, (PixelRGB*) 0); break;
default: EdgeTableFillers::renderGradient (iter, destData, gradient, trans, lookupTable, numLookupEntries, isIdentity, (PixelAlpha*) 0); break;
case Image::ARGB: EdgeTableFillers::renderGradient (iter, destData, gradient, trans, lookupTable, numLookupEntries, isIdentity, (PixelARGB*) nullptr); break;
case Image::RGB: EdgeTableFillers::renderGradient (iter, destData, gradient, trans, lookupTable, numLookupEntries, isIdentity, (PixelRGB*) nullptr); break;
default: EdgeTableFillers::renderGradient (iter, destData, gradient, trans, lookupTable, numLookupEntries, isIdentity, (PixelAlpha*) nullptr); break;
} }
} }


+ 25
- 25
modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm View File

@@ -86,7 +86,7 @@ class CoreGraphicsImage : public ImagePixelData
{ {
public: public:
CoreGraphicsImage (const Image::PixelFormat format, int w, int h, bool clearImage) CoreGraphicsImage (const Image::PixelFormat format, int w, int h, bool clearImage)
: ImagePixelData (format, w, h), cachedImageRef (0)
: ImagePixelData (format, w, h)
{ {
pixelStride = format == Image::RGB ? 3 : ((format == Image::ARGB) ? 4 : 1); pixelStride = format == Image::RGB ? 3 : ((format == Image::ARGB) ? 4 : 1);
lineStride = (pixelStride * jmax (1, width) + 3) & ~3; lineStride = (pixelStride * jmax (1, width) + 3) & ~3;
@@ -156,7 +156,7 @@ public:
{ {
auto cgim = dynamic_cast<CoreGraphicsImage*> (juceImage.getPixelData()); auto cgim = dynamic_cast<CoreGraphicsImage*> (juceImage.getPixelData());
if (cgim != nullptr && cgim->cachedImageRef != 0)
if (cgim != nullptr && cgim->cachedImageRef != nullptr)
{ {
CGImageRetain (cgim->cachedImageRef); CGImageRetain (cgim->cachedImageRef);
return cgim->cachedImageRef; return cgim->cachedImageRef;
@@ -180,13 +180,13 @@ public:
if (mustOutliveSource) if (mustOutliveSource)
{ {
CFDataRef data = CFDataCreate (0, (const UInt8*) srcData.data, (CFIndex) ((size_t) srcData.lineStride * (size_t) srcData.height));
CFDataRef data = CFDataCreate (nullptr, (const UInt8*) srcData.data, (CFIndex) ((size_t) srcData.lineStride * (size_t) srcData.height));
provider = CGDataProviderCreateWithCFData (data); provider = CGDataProviderCreateWithCFData (data);
CFRelease (data); CFRelease (data);
} }
else else
{ {
provider = CGDataProviderCreateWithData (0, srcData.data, (size_t) srcData.lineStride * (size_t) srcData.height, 0);
provider = CGDataProviderCreateWithData (nullptr, srcData.data, (size_t) srcData.lineStride * (size_t) srcData.height, nullptr);
} }
CGImageRef imageRef = CGImageCreate ((size_t) srcData.width, CGImageRef imageRef = CGImageCreate ((size_t) srcData.width,
@@ -195,7 +195,7 @@ public:
(size_t) srcData.pixelStride * 8, (size_t) srcData.pixelStride * 8,
(size_t) srcData.lineStride, (size_t) srcData.lineStride,
colourSpace, getCGImageFlags (juceImage.getFormat()), provider, colourSpace, getCGImageFlags (juceImage.getFormat()), provider,
0, true, kCGRenderingIntentDefault);
nullptr, true, kCGRenderingIntentDefault);
CGDataProviderRelease (provider); CGDataProviderRelease (provider);
return imageRef; return imageRef;
@@ -203,17 +203,17 @@ public:
//============================================================================== //==============================================================================
CGContextRef context; CGContextRef context;
CGImageRef cachedImageRef;
CGImageRef cachedImageRef = {};
HeapBlock<uint8> imageData; HeapBlock<uint8> imageData;
int pixelStride, lineStride; int pixelStride, lineStride;
private: private:
void freeCachedImageRef() void freeCachedImageRef()
{ {
if (cachedImageRef != 0)
if (cachedImageRef != CGImageRef())
{ {
CGImageRelease (cachedImageRef); CGImageRelease (cachedImageRef);
cachedImageRef = 0;
cachedImageRef = {};
} }
} }
@@ -439,7 +439,7 @@ void CoreGraphicsContext::beginTransparencyLayer (float opacity)
{ {
saveState(); saveState();
CGContextSetAlpha (context, opacity); CGContextSetAlpha (context, opacity);
CGContextBeginTransparencyLayer (context, 0);
CGContextBeginTransparencyLayer (context, nullptr);
} }
void CoreGraphicsContext::endTransparencyLayer() void CoreGraphicsContext::endTransparencyLayer()
@@ -581,7 +581,7 @@ void CoreGraphicsContext::drawImage (const Image& sourceImage, const AffineTrans
#else #else
// There's a bug in CGContextDrawTiledImage that makes it incredibly slow // There's a bug in CGContextDrawTiledImage that makes it incredibly slow
// if it's doing a transformation - it's quicker to just draw lots of images manually // if it's doing a transformation - it's quicker to just draw lots of images manually
if (&CGContextDrawTiledImage != 0 && transform.isOnlyTranslation())
if (&CGContextDrawTiledImage != nullptr && transform.isOnlyTranslation())
{ {
CGContextDrawTiledImage (context, imageRect, image); CGContextDrawTiledImage (context, imageRect, image);
} }
@@ -657,7 +657,7 @@ void CoreGraphicsContext::setFont (const Font& newFont)
{ {
if (state->font != newFont) if (state->font != newFont)
{ {
state->fontRef = 0;
state->fontRef = nullptr;
state->font = newFont; state->font = newFont;
if (auto osxTypeface = dynamic_cast<OSXTypeface*> (state->font.getTypeface())) if (auto osxTypeface = dynamic_cast<OSXTypeface*> (state->font.getTypeface()))
@@ -680,7 +680,7 @@ const Font& CoreGraphicsContext::getFont()
void CoreGraphicsContext::drawGlyph (int glyphNumber, const AffineTransform& transform) void CoreGraphicsContext::drawGlyph (int glyphNumber, const AffineTransform& transform)
{ {
if (state->fontRef != 0 && state->fillType.isColour())
if (state->fontRef != nullptr && state->fillType.isColour())
{ {
#if JUCE_CLANG #if JUCE_CLANG
#pragma clang diagnostic push #pragma clang diagnostic push
@@ -741,13 +741,13 @@ CoreGraphicsContext::SavedState::SavedState (const SavedState& other)
: fillType (other.fillType), font (other.font), fontRef (other.fontRef), : fillType (other.fillType), font (other.font), fontRef (other.fontRef),
fontTransform (other.fontTransform), gradient (other.gradient) fontTransform (other.fontTransform), gradient (other.gradient)
{ {
if (gradient != 0)
if (gradient != nullptr)
CGGradientRetain (gradient); CGGradientRetain (gradient);
} }
CoreGraphicsContext::SavedState::~SavedState() CoreGraphicsContext::SavedState::~SavedState()
{ {
if (gradient != 0)
if (gradient != nullptr)
CGGradientRelease (gradient); CGGradientRelease (gradient);
} }
@@ -755,10 +755,10 @@ void CoreGraphicsContext::SavedState::setFill (const FillType& newFill)
{ {
fillType = newFill; fillType = newFill;
if (gradient != 0)
if (gradient != nullptr)
{ {
CGGradientRelease (gradient); CGGradientRelease (gradient);
gradient = 0;
gradient = nullptr;
} }
} }
@@ -800,7 +800,7 @@ void CoreGraphicsContext::drawGradient()
state->fillType.transform.transformPoints (p1.x, p1.y, p2.x, p2.y); state->fillType.transform.transformPoints (p1.x, p1.y, p2.x, p2.y);
if (state->gradient == 0)
if (state->gradient == nullptr)
state->gradient = createGradient (g, rgbColourSpace); state->gradient = createGradient (g, rgbColourSpace);
if (g.isRadial) if (g.isRadial)
@@ -898,19 +898,19 @@ Image juce_loadWithCoreImage (InputStream& input)
CGImageRef loadedImage = uiImage.CGImage; CGImageRef loadedImage = uiImage.CGImage;
#else #else
CGDataProviderRef provider = CGDataProviderCreateWithData (0, data.getData(), data.getSize(), 0);
CGImageSourceRef imageSource = CGImageSourceCreateWithDataProvider (provider, 0);
auto provider = CGDataProviderCreateWithData (nullptr, data.getData(), data.getSize(), nullptr);
auto imageSource = CGImageSourceCreateWithDataProvider (provider, nullptr);
CGDataProviderRelease (provider); CGDataProviderRelease (provider);
if (imageSource != 0)
if (imageSource != nullptr)
{ {
CGImageRef loadedImage = CGImageSourceCreateImageAtIndex (imageSource, 0, 0);
auto loadedImage = CGImageSourceCreateImageAtIndex (imageSource, 0, nullptr);
CFRelease (imageSource); CFRelease (imageSource);
#endif #endif
if (loadedImage != 0)
if (loadedImage != nullptr)
{ {
CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo (loadedImage);
auto alphaInfo = CGImageGetAlphaInfo (loadedImage);
const bool hasAlphaChan = (alphaInfo != kCGImageAlphaNone const bool hasAlphaChan = (alphaInfo != kCGImageAlphaNone
&& alphaInfo != kCGImageAlphaNoneSkipLast && alphaInfo != kCGImageAlphaNoneSkipLast
&& alphaInfo != kCGImageAlphaNoneSkipFirst); && alphaInfo != kCGImageAlphaNoneSkipFirst);
@@ -992,8 +992,8 @@ CGContextRef juce_getImageContext (const Image& image)
auto requiredSize = NSMakeSize (image.getWidth() / scaleFactor, image.getHeight() / scaleFactor); auto requiredSize = NSMakeSize (image.getWidth() / scaleFactor, image.getHeight() / scaleFactor);
[im setSize: requiredSize]; [im setSize: requiredSize];
CGColorSpaceRef colourSpace = CGColorSpaceCreateDeviceRGB();
CGImageRef imageRef = juce_createCoreGraphicsImage (image, colourSpace, true);
auto colourSpace = CGColorSpaceCreateDeviceRGB();
auto imageRef = juce_createCoreGraphicsImage (image, colourSpace, true);
CGColorSpaceRelease (colourSpace); CGColorSpaceRelease (colourSpace);
NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef];


+ 2
- 2
modules/juce_graphics/native/juce_mac_Fonts.mm View File

@@ -239,7 +239,7 @@ namespace CoreTextTypeLayout
{ {
extraKerning *= attr.font.getHeight(); extraKerning *= attr.font.getHeight();
auto numberRef = CFNumberCreate (0, kCFNumberFloatType, &extraKerning);
auto numberRef = CFNumberCreate (nullptr, kCFNumberFloatType, &extraKerning);
CFAttributedStringSetAttribute (attribString, range, kCTKernAttributeName, numberRef); CFAttributedStringSetAttribute (attribString, range, kCTKernAttributeName, numberRef);
CFRelease (numberRef); CFRelease (numberRef);
} }
@@ -540,7 +540,7 @@ public:
fontHeightToPointsFactor = referenceFontSize / ctTotalHeight; fontHeightToPointsFactor = referenceFontSize / ctTotalHeight;
const short zero = 0; const short zero = 0;
auto numberRef = CFNumberCreate (0, kCFNumberShortType, &zero);
auto numberRef = CFNumberCreate (nullptr, kCFNumberShortType, &zero);
CFStringRef keys[] = { kCTFontAttributeName, kCTLigatureAttributeName }; CFStringRef keys[] = { kCTFontAttributeName, kCTLigatureAttributeName };
CFTypeRef values[] = { ctFontRef, numberRef }; CFTypeRef values[] = { ctFontRef, numberRef };


+ 2
- 2
modules/juce_gui_basics/native/juce_mac_Windowing.mm View File

@@ -465,12 +465,12 @@ struct DisplaySettingsChangeCallback : private DeletedAtShutdown
{ {
DisplaySettingsChangeCallback() DisplaySettingsChangeCallback()
{ {
CGDisplayRegisterReconfigurationCallback (displayReconfigurationCallBack, 0);
CGDisplayRegisterReconfigurationCallback (displayReconfigurationCallBack, nullptr);
} }
~DisplaySettingsChangeCallback() ~DisplaySettingsChangeCallback()
{ {
CGDisplayRemoveReconfigurationCallback (displayReconfigurationCallBack, 0);
CGDisplayRemoveReconfigurationCallback (displayReconfigurationCallBack, nullptr);
clearSingletonInstance(); clearSingletonInstance();
} }


+ 1
- 1
modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp View File

@@ -156,7 +156,7 @@ void TableHeaderComponent::moveColumn (const int columnId, int newIndex)
auto currentIndex = getIndexOfColumnId (columnId, false); auto currentIndex = getIndexOfColumnId (columnId, false);
newIndex = visibleIndexToTotalIndex (newIndex); newIndex = visibleIndexToTotalIndex (newIndex);
if (columns [currentIndex] != 0 && currentIndex != newIndex)
if (columns[currentIndex] != nullptr && currentIndex != newIndex)
{ {
columns.move (currentIndex, newIndex); columns.move (currentIndex, newIndex);
sendColumnsChanged(); sendColumnsChanged();


+ 4
- 4
modules/juce_gui_basics/widgets/juce_TextEditor.cpp View File

@@ -711,13 +711,13 @@ struct TextEditor::InsertAction : public UndoableAction
bool perform() override bool perform() override
{ {
owner.insert (text, insertIndex, font, colour, 0, newCaretPos);
owner.insert (text, insertIndex, font, colour, nullptr, newCaretPos);
return true; return true;
} }
bool undo() override bool undo() override
{ {
owner.remove ({ insertIndex, insertIndex + text.length() }, 0, oldCaretPos);
owner.remove ({ insertIndex, insertIndex + text.length() }, nullptr, oldCaretPos);
return true; return true;
} }
@@ -751,7 +751,7 @@ struct TextEditor::RemoveAction : public UndoableAction
bool perform() override bool perform() override
{ {
owner.remove (range, 0, newCaretPos);
owner.remove (range, nullptr, newCaretPos);
return true; return true;
} }
@@ -1171,7 +1171,7 @@ void TextEditor::setText (const String& newText, bool sendTextChangeMessage)
bool cursorWasAtEnd = oldCursorPos >= getTotalNumChars(); bool cursorWasAtEnd = oldCursorPos >= getTotalNumChars();
clearInternal (nullptr); clearInternal (nullptr);
insert (newText, 0, currentFont, findColour (textColourId), 0, caretPosition);
insert (newText, 0, currentFont, findColour (textColourId), nullptr, caretPosition);
// if you're adding text with line-feeds to a single-line text editor, it // if you're adding text with line-feeds to a single-line text editor, it
// ain't gonna look right! // ain't gonna look right!


+ 1
- 1
modules/juce_gui_basics/windows/juce_DocumentWindow.cpp View File

@@ -212,7 +212,7 @@ void DocumentWindow::paint (Graphics& g)
titleBarArea.getHeight(), titleBarArea.getHeight(),
titleSpaceX1, titleSpaceX1,
jmax (1, titleSpaceX2 - titleSpaceX1), jmax (1, titleSpaceX2 - titleSpaceX1),
titleBarIcon.isValid() ? &titleBarIcon : 0,
titleBarIcon.isValid() ? &titleBarIcon : nullptr,
! drawTitleTextCentred); ! drawTitleTextCentred);
} }


+ 1
- 1
modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniserFunctions.h View File

@@ -101,7 +101,7 @@ struct CppTokeniserFunctions
break; break;
} }
for (int i = 0; k[i] != 0; ++i)
for (int i = 0; k[i] != nullptr; ++i)
if (token.compare (CharPointer_ASCII (k[i])) == 0) if (token.compare (CharPointer_ASCII (k[i])) == 0)
return true; return true;


+ 1
- 1
modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.cpp View File

@@ -68,7 +68,7 @@ struct LuaTokeniserFunctions
break; break;
} }
for (int i = 0; k[i] != 0; ++i)
for (int i = 0; k[i] != nullptr; ++i)
if (token.compare (CharPointer_ASCII (k[i])) == 0) if (token.compare (CharPointer_ASCII (k[i])) == 0)
return true; return true;


+ 7
- 7
modules/juce_gui_extra/native/juce_mac_AppleRemote.mm View File

@@ -142,22 +142,22 @@ bool AppleRemoteDevice::isActive() const
bool AppleRemoteDevice::open (const bool openInExclusiveMode) bool AppleRemoteDevice::open (const bool openInExclusiveMode)
{ {
Array <int> cookies;
Array<int> cookies;
CFArrayRef elements; CFArrayRef elements;
IOHIDDeviceInterface122** const device122 = (IOHIDDeviceInterface122**) device;
auto device122 = (IOHIDDeviceInterface122**) device;
if ((*device122)->copyMatchingElements (device122, 0, &elements) != kIOReturnSuccess)
if ((*device122)->copyMatchingElements (device122, nullptr, &elements) != kIOReturnSuccess)
return false; return false;
for (int i = 0; i < CFArrayGetCount (elements); ++i) for (int i = 0; i < CFArrayGetCount (elements); ++i)
{ {
CFDictionaryRef element = (CFDictionaryRef) CFArrayGetValueAtIndex (elements, i);
auto element = (CFDictionaryRef) CFArrayGetValueAtIndex (elements, i);
// get the cookie // get the cookie
CFTypeRef object = CFDictionaryGetValue (element, CFSTR (kIOHIDElementCookieKey)); CFTypeRef object = CFDictionaryGetValue (element, CFSTR (kIOHIDElementCookieKey));
if (object == 0 || CFGetTypeID (object) != CFNumberGetTypeID())
if (object == nullptr || CFGetTypeID (object) != CFNumberGetTypeID())
continue; continue;
long number; long number;
@@ -176,7 +176,7 @@ bool AppleRemoteDevice::open (const bool openInExclusiveMode)
{ {
queue = (*(IOHIDDeviceInterface**) device)->allocQueue ((IOHIDDeviceInterface**) device); queue = (*(IOHIDDeviceInterface**) device)->allocQueue ((IOHIDDeviceInterface**) device);
if (queue != 0)
if (queue != nullptr)
{ {
(*(IOHIDQueueInterface**) queue)->create ((IOHIDQueueInterface**) queue, 0, 12); (*(IOHIDQueueInterface**) queue)->create ((IOHIDQueueInterface**) queue, 0, 12);
@@ -192,7 +192,7 @@ bool AppleRemoteDevice::open (const bool openInExclusiveMode)
->createAsyncEventSource ((IOHIDQueueInterface**) queue, &eventSource) == KERN_SUCCESS) ->createAsyncEventSource ((IOHIDQueueInterface**) queue, &eventSource) == KERN_SUCCESS)
{ {
if ((*(IOHIDQueueInterface**) queue)->setEventCallout ((IOHIDQueueInterface**) queue, if ((*(IOHIDQueueInterface**) queue)->setEventCallout ((IOHIDQueueInterface**) queue,
appleRemoteQueueCallback, this, 0) == KERN_SUCCESS)
appleRemoteQueueCallback, this, nullptr) == KERN_SUCCESS)
{ {
CFRunLoopAddSource (CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode); CFRunLoopAddSource (CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode);


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

@@ -436,7 +436,7 @@ void WebBrowserComponent::checkWindowAssociation()
// page to avoid this, (and send it back when it's made visible again). // page to avoid this, (and send it back when it's made visible again).
blankPageShown = true; blankPageShown = true;
browser->goToURL ("about:blank", 0, 0);
browser->goToURL ("about:blank", nullptr, nullptr);
} }
} }
} }


Loading…
Cancel
Save