| @@ -660,7 +660,8 @@ const char* JUCEAppIcon_png = (const char*) temp_binary_data_0; | |||
| const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) | |||
| { | |||
| unsigned int hash = 0; | |||
| if (resourceNameUTF8 != 0) | |||
| if (resourceNameUTF8 != nullptr) | |||
| while (*resourceNameUTF8 != 0) | |||
| hash = 31 * hash + (unsigned int) *resourceNameUTF8++; | |||
| @@ -660,7 +660,8 @@ const char* juce_icon_png = (const char*) temp_binary_data_0; | |||
| const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) | |||
| { | |||
| unsigned int hash = 0; | |||
| if (resourceNameUTF8 != 0) | |||
| if (resourceNameUTF8 != nullptr) | |||
| while (*resourceNameUTF8 != 0) | |||
| hash = 31 * hash + (unsigned int) *resourceNameUTF8++; | |||
| @@ -3233,7 +3233,7 @@ | |||
| INSTALL_PATH = "$(HOME)/Applications"; | |||
| MACOSX_DEPLOYMENT_TARGET = 10.11; | |||
| 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_NAME = "Projucer"; | |||
| SDKROOT_ppc = macosx10.5; | |||
| @@ -3280,7 +3280,7 @@ | |||
| LLVM_LTO = YES; | |||
| MACOSX_DEPLOYMENT_TARGET = 10.11; | |||
| 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_NAME = "Projucer"; | |||
| SDKROOT_ppc = macosx10.5; | |||
| @@ -7773,7 +7773,8 @@ const char* RecentFilesMenuTemplate_nib = (const char*) temp_binary_data_61; | |||
| const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) | |||
| { | |||
| unsigned int hash = 0; | |||
| if (resourceNameUTF8 != 0) | |||
| if (resourceNameUTF8 != nullptr) | |||
| while (*resourceNameUTF8 != 0) | |||
| hash = 31 * hash + (unsigned int) *resourceNameUTF8++; | |||
| @@ -8,7 +8,7 @@ | |||
| <EXPORTFORMATS> | |||
| <XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK" | |||
| 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="<plist> <dict> 	<key>NSAppTransportSecurity</key> 	<dict> 		<key>NSAllowsArbitraryLoads</key> 		<true/> 		<key>NSExceptionDomains</key> 		<dict> 			<key>amazonaws.com</key> 			<dict> 				<key>NSExceptionAllowsInsecureHTTPLoads</key> 				<true/> 				<key>NSIncludesSubdomains</key> 				<true/> 			</dict> 		</dict> 	</dict> </dict> </plist>" | |||
| extraFrameworks="AudioUnit; Accelerate; AVFoundation; CoreAudio; CoreAudioKit; CoreMIDI; DiscRecording; QuartzCore; AudioToolbox; OpenGL; QTKit; QuickTime"> | |||
| <CONFIGURATIONS> | |||
| @@ -200,7 +200,7 @@ bool ComponentTypeHandler::restoreFromXml (const XmlElement& xml, | |||
| RelativePositionedRectangle rpr; | |||
| rpr.restoreFromXml (xml, currentPos); | |||
| jassert (layout != 0); | |||
| jassert (layout != nullptr); | |||
| setComponentPosition (comp, rpr, layout); | |||
| if (SettableTooltipClient* const ttc = dynamic_cast<SettableTooltipClient*> (comp)) | |||
| @@ -43,7 +43,7 @@ public: | |||
| Component* createNewComponent (JucerDocument* doc) override | |||
| { | |||
| return new TestComponent (doc, 0, false); | |||
| return new TestComponent (doc, nullptr, false); | |||
| } | |||
| String getXmlTagName() const noexcept override { return "JUCERCOMP"; } | |||
| @@ -61,7 +61,7 @@ public: | |||
| 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)) | |||
| return false; | |||
| @@ -74,11 +74,11 @@ public: | |||
| String getClassName (Component* comp) const override | |||
| { | |||
| TestComponent* const tc = dynamic_cast<TestComponent*> (comp); | |||
| auto tc = dynamic_cast<TestComponent*> (comp); | |||
| String jucerCompClassName; | |||
| if (tc->getDocument() != 0) | |||
| if (tc->getDocument() != nullptr) | |||
| jucerCompClassName = tc->getDocument()->getClassName(); | |||
| if (jucerCompClassName.isEmpty()) | |||
| @@ -95,7 +95,7 @@ public: | |||
| if (multipleSelected) | |||
| 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 ConstructorParamsProperty (tc, document)); | |||
| @@ -112,7 +112,7 @@ public: | |||
| { | |||
| 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")); | |||
| else | |||
| jassertfalse; | |||
| @@ -614,8 +614,8 @@ private: | |||
| 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()); | |||
| } | |||
| @@ -264,15 +264,15 @@ public: | |||
| //============================================================================== | |||
| 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); | |||
| return tdc != 0 && tdc->isUsingJucerComp; | |||
| return tdc != nullptr && tdc->isUsingJucerComp; | |||
| } | |||
| 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); | |||
| if (tdc != nullptr) | |||
| @@ -284,10 +284,10 @@ public: | |||
| 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); | |||
| return tdc != 0 ? tdc->contentClassName : String(); | |||
| return tdc != nullptr ? tdc->contentClassName : String(); | |||
| } | |||
| static void setTabClassName (TabbedComponent* tc, int tabIndex, const String& newName) | |||
| @@ -304,15 +304,15 @@ public: | |||
| 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); | |||
| return tdc != 0 ? tdc->constructorParams : String(); | |||
| return tdc != nullptr ? tdc->constructorParams : String(); | |||
| } | |||
| 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); | |||
| if (tdc != nullptr) | |||
| @@ -324,15 +324,15 @@ public: | |||
| 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); | |||
| return tdc != 0 ? tdc->jucerComponentFile : String(); | |||
| return tdc != nullptr ? tdc->jucerComponentFile : String(); | |||
| } | |||
| 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); | |||
| if (tdc != nullptr) | |||
| @@ -380,7 +380,7 @@ private: | |||
| { | |||
| jucerComp.reset(); | |||
| jucerComp.reset (new TestComponent (ComponentTypeHandler::findParentDocument (this), 0, false)); | |||
| jucerComp.reset (new TestComponent (ComponentTypeHandler::findParentDocument (this), nullptr, false)); | |||
| jucerComp->setFilename (jucerComponentFile); | |||
| jucerComp->setToInitialSize(); | |||
| @@ -115,8 +115,8 @@ public: | |||
| { | |||
| 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; | |||
| s << memberVariableName << "->setMultiLine (" << CodeHelpers::boolLiteral (te->isMultiLine()) << ");\n" | |||
| @@ -188,7 +188,7 @@ public: | |||
| if (getViewportContentType (vp) == 1) | |||
| { | |||
| JucerDocument* doc = findParentDocument (vp); | |||
| TestComponent* tc = new TestComponent (doc, 0, false); | |||
| auto tc = new TestComponent (doc, nullptr, false); | |||
| tc->setFilename (getViewportJucerComponentFile (vp)); | |||
| tc->setToInitialSize(); | |||
| @@ -50,7 +50,7 @@ public: | |||
| int chooseBestEnabledPaintRoutine (int paintRoutineWanted) const; | |||
| ComponentLayout* getComponentLayout() const { return 0; } | |||
| ComponentLayout* getComponentLayout() const { return nullptr; } | |||
| void addExtraClassProperties (PropertyPanel&); | |||
| @@ -328,7 +328,7 @@ void PaintElementPath::mouseDrag (const MouseEvent& e) | |||
| void PaintElementPath::mouseUp (const MouseEvent& e) | |||
| { | |||
| if (points [mouseDownOnSegment] == 0) | |||
| if (points[mouseDownOnSegment] == nullptr) | |||
| ColouredElement::mouseUp (e); | |||
| else | |||
| owner->getSelectedPoints().addToSelectionOnMouseUp (points [mouseDownOnSegment], | |||
| @@ -38,7 +38,7 @@ public: | |||
| : routine (*element->getOwner()), | |||
| elementIndex (element->getOwner()->indexOfElement (element)) | |||
| { | |||
| jassert (element != 0); | |||
| jassert (element != nullptr); | |||
| if (elementIndex < 0) | |||
| findGroupIndices (element->getOwner(), element); | |||
| @@ -50,28 +50,27 @@ public: | |||
| { | |||
| 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) | |||
| { | |||
| 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; | |||
| } | |||
| 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; | |||
| } | |||
| } | |||
| @@ -104,12 +103,13 @@ private: | |||
| { | |||
| 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;) | |||
| { | |||
| 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); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -343,9 +343,9 @@ public: | |||
| Rectangle<int> parentArea; | |||
| if (component->findParentComponentOfClass<ComponentLayoutEditor>() != 0) | |||
| if (component->findParentComponentOfClass<ComponentLayoutEditor>() != nullptr) | |||
| 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(); | |||
| else | |||
| jassertfalse; | |||
| @@ -220,16 +220,16 @@ void ComponentLayoutEditor::refreshAllComponents() | |||
| for (int i = layout.getNumComponents(); --i >= 0;) | |||
| { | |||
| Component* const c = layout.getComponent (i); | |||
| auto c = layout.getComponent (i); | |||
| jassert (c != nullptr); | |||
| ComponentOverlayComponent* overlay = getOverlayCompFor (c); | |||
| auto overlay = getOverlayCompFor (c); | |||
| bool isNewOverlay = false; | |||
| if (overlay == 0) | |||
| if (overlay == nullptr) | |||
| { | |||
| ComponentTypeHandler* const handler = ComponentTypeHandler::getHandlerFor (*c); | |||
| auto handler = ComponentTypeHandler::getHandlerFor (*c); | |||
| jassert (handler != nullptr); | |||
| overlay = handler->createOverlayComponent (c, layout); | |||
| @@ -272,7 +272,7 @@ void ComponentLayoutEditor::mouseDown (const MouseEvent& e) | |||
| { | |||
| if (e.mods.isPopupMenu()) | |||
| { | |||
| ApplicationCommandManager* commandManager = &ProjucerApplication::getCommandManager(); | |||
| auto commandManager = &ProjucerApplication::getCommandManager(); | |||
| PopupMenu m; | |||
| @@ -197,7 +197,7 @@ private: | |||
| { | |||
| public: | |||
| 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); } | |||
| @@ -209,7 +209,7 @@ private: | |||
| { | |||
| public: | |||
| 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); } | |||
| @@ -221,7 +221,7 @@ private: | |||
| { | |||
| public: | |||
| 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); } | |||
| @@ -233,7 +233,7 @@ private: | |||
| { | |||
| public: | |||
| 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); } | |||
| @@ -245,7 +245,7 @@ private: | |||
| { | |||
| public: | |||
| ComponentInitialisersProperty (JucerDocument& doc) | |||
| : ComponentTextProperty <Component> ("Member initialisers", 16384, true, 0, doc) | |||
| : ComponentTextProperty <Component> ("Member initialisers", 16384, true, nullptr, doc) | |||
| { | |||
| preferredHeight = 24 * 3; | |||
| } | |||
| @@ -260,9 +260,9 @@ private: | |||
| { | |||
| public: | |||
| 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_) | |||
| {} | |||
| @@ -289,7 +289,7 @@ private: | |||
| { | |||
| public: | |||
| FixedSizeProperty (JucerDocument& doc) | |||
| : ComponentChoiceProperty <Component> ("Fixed size", 0, doc) | |||
| : ComponentChoiceProperty<Component> ("Fixed size", nullptr, doc) | |||
| { | |||
| choices.add ("Resize component to fit workspace"); | |||
| choices.add ("Keep component size fixed"); | |||
| @@ -304,7 +304,7 @@ private: | |||
| { | |||
| public: | |||
| 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); } | |||
| @@ -394,7 +394,7 @@ void JucerDocumentEditor::updateTabs() | |||
| 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])) | |||
| { | |||
| tabbedComponent.removeTab (i); | |||
| @@ -485,11 +485,11 @@ void JucerDocumentEditor::showLayout() | |||
| void JucerDocumentEditor::showGraphics (PaintRoutine* routine) | |||
| { | |||
| if (getCurrentPaintRoutine() != routine || routine == 0) | |||
| if (getCurrentPaintRoutine() != routine || routine == nullptr) | |||
| { | |||
| 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) | |||
| { | |||
| @@ -1029,7 +1029,7 @@ bool JucerDocumentEditor::perform (const InvocationInfo& info) | |||
| break; | |||
| case JucerCommandIDs::editCompGraphics: | |||
| showGraphics (0); | |||
| showGraphics (nullptr); | |||
| break; | |||
| case JucerCommandIDs::zoomIn: setZoom (snapToIntegerZoom (getZoom() * 2.0)); break; | |||
| @@ -240,7 +240,7 @@ public: | |||
| */ | |||
| void updateFromComponent (const Component& comp) noexcept | |||
| { | |||
| if (comp.getParentComponent() == 0 && ! comp.isOnDesktop()) | |||
| if (comp.getParentComponent() == nullptr && ! comp.isOnDesktop()) | |||
| updateFrom (comp.getBounds(), Rectangle<int>()); | |||
| else | |||
| updateFrom (comp.getBounds(), Rectangle<int> (comp.getParentWidth(), comp.getParentHeight())); | |||
| @@ -627,12 +627,12 @@ struct RelativePositionedRectangle | |||
| int& x, int& xw, int& y, int& yh, | |||
| 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); | |||
| ry = layout->findComponentWithId (relativeToY); | |||
| @@ -640,12 +640,12 @@ struct RelativePositionedRectangle | |||
| 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, | |||
| @@ -502,11 +502,11 @@ void ComponentLayout::setComponentRelativeTarget (Component* comp, int whichDime | |||
| jassert (comp != nullptr); | |||
| 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) | |||
| && (compToBeRelativeTo == 0 || ! dependsOnComponentForRelativePos (compToBeRelativeTo, comp))) | |||
| && (compToBeRelativeTo == nullptr || ! dependsOnComponentForRelativePos (compToBeRelativeTo, comp))) | |||
| { | |||
| const int64 compId = ComponentTypeHandler::getComponentId (compToBeRelativeTo); | |||
| @@ -560,9 +560,9 @@ PopupMenu ComponentLayout::getRelativeTargetMenu (Component* comp, int whichDime | |||
| { | |||
| 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(); | |||
| for (int i = 0; i < components.size(); ++i) | |||
| @@ -179,7 +179,7 @@ void Project::initialiseMainGroup() | |||
| if (! projectRoot.getChildWithName (Ids::MAINGROUP).isValid()) | |||
| { | |||
| Item mainGroup (*this, ValueTree (Ids::MAINGROUP), false); | |||
| projectRoot.addChild (mainGroup.state, 0, 0); | |||
| projectRoot.addChild (mainGroup.state, 0, nullptr); | |||
| } | |||
| getMainGroup().initialiseMissingProperties(); | |||
| @@ -743,7 +743,7 @@ void ProjectExporter::addNewConfigurationFromExisting (const BuildConfiguration& | |||
| ValueTree newConfig (Ids::CONFIGURATION); | |||
| newConfig = configToCopy.config.createCopy(); | |||
| newConfig.setProperty (Ids::name, configToCopy.getName(), 0); | |||
| newConfig.setProperty (Ids::name, configToCopy.getName(), nullptr); | |||
| configs.appendChild (newConfig, project.getUndoManagerFor (configs)); | |||
| } | |||
| @@ -99,7 +99,7 @@ namespace CodeHelpers | |||
| words.addTokens (s.retainCharacters (allowedChars), false); | |||
| words.trim(); | |||
| String n (words[0]); | |||
| auto n = words[0]; | |||
| if (capitalise) | |||
| n = n.toLowerCase(); | |||
| @@ -176,7 +176,7 @@ namespace CodeHelpers | |||
| { | |||
| for (int i = 0; i < lines.size(); ++i) | |||
| { | |||
| String& line = lines.getReference (i); | |||
| auto& line = lines.getReference (i); | |||
| if (line.length() > maxLineLength) | |||
| { | |||
| @@ -259,7 +259,7 @@ namespace CodeHelpers | |||
| #define COL(col) #col, | |||
| #include "jucer_Colours.h" | |||
| #undef COL | |||
| 0 | |||
| nullptr | |||
| }; | |||
| for (int i = 0; i < numElementsInArray (colourNames) - 1; ++i) | |||
| @@ -301,7 +301,7 @@ namespace CodeHelpers | |||
| { | |||
| const int maxCharsOnLine = 250; | |||
| const unsigned char* data = (const unsigned char*) mb.getData(); | |||
| auto data = (const unsigned char*) mb.getData(); | |||
| int charsOnLine = 0; | |||
| 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) | |||
| { | |||
| 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 (++numEscaped > mb.getSize() / 4) | |||
| @@ -330,7 +331,7 @@ namespace CodeHelpers | |||
| 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 << ','; | |||
| charsOnLine += 2; | |||
| @@ -364,8 +365,9 @@ namespace CodeHelpers | |||
| //============================================================================== | |||
| static unsigned int calculateHash (const String& s, const unsigned int hashMultiplier) | |||
| { | |||
| const char* t = s.toUTF8(); | |||
| auto t = s.toUTF8(); | |||
| unsigned int hash = 0; | |||
| while (*t != 0) | |||
| hash = hashMultiplier * hash + (unsigned int) *t++; | |||
| @@ -378,11 +380,13 @@ namespace CodeHelpers | |||
| for (;;) | |||
| { | |||
| SortedSet <unsigned int> hashes; | |||
| SortedSet<unsigned int> hashes; | |||
| bool collision = false; | |||
| 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)) | |||
| { | |||
| collision = true; | |||
| @@ -405,11 +409,12 @@ namespace CodeHelpers | |||
| const StringArray& strings, const StringArray& codeToExecute, const int indentLevel) | |||
| { | |||
| 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 | |||
| << indent << "if (" << utf8PointerVariable << " != 0)" << newLine | |||
| << newLine | |||
| << indent << "if (" << utf8PointerVariable << " != nullptr)" << newLine | |||
| << indent << " while (*" << utf8PointerVariable << " != 0)" << newLine | |||
| << indent << " hash = " << (int) hashMultiplier << " * hash + (unsigned int) *" << utf8PointerVariable << "++;" << newLine | |||
| << newLine | |||
| @@ -461,8 +466,8 @@ namespace CodeHelpers | |||
| { | |||
| 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()); | |||
| @@ -145,7 +145,7 @@ struct Expression::Helpers | |||
| Type getType() const noexcept { return operatorType; } | |||
| 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 void writeOperator (String& dest) const = 0; | |||
| @@ -43,7 +43,7 @@ struct Atomic final | |||
| using DiffType = typename AtomicHelpers::DiffTypeHelper<Type>::Type; | |||
| /** Creates a new value, initialised to zero. */ | |||
| Atomic() noexcept : value (0) {} | |||
| Atomic() noexcept : value (Type()) {} | |||
| /** Creates a new value, with a given initial value. */ | |||
| Atomic (Type initialValue) noexcept : value (initialValue) {} | |||
| @@ -65,7 +65,7 @@ namespace MacFileHelpers | |||
| { | |||
| const String type (buf.f_fstypename); | |||
| while (*types != 0) | |||
| while (*types != nullptr) | |||
| if (type.equalsIgnoreCase (*types++)) | |||
| return true; | |||
| } | |||
| @@ -105,14 +105,14 @@ namespace MacFileHelpers | |||
| #else | |||
| static bool launchExecutable (const String& pathAndArguments) | |||
| { | |||
| const int cpid = fork(); | |||
| auto cpid = fork(); | |||
| 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 | |||
| if (execve (argv[0], (char**) argv, 0) < 0) | |||
| if (execve (argv[0], (char**) argv, nullptr) < 0) | |||
| exit (0); | |||
| } | |||
| else | |||
| @@ -25,7 +25,7 @@ namespace juce | |||
| String String::fromCFString (CFStringRef cfString) | |||
| { | |||
| if (cfString == 0) | |||
| if (cfString == nullptr) | |||
| return {}; | |||
| CFRange range = { 0, CFStringGetLength (cfString) }; | |||
| @@ -72,7 +72,7 @@ String String::convertToPrecomposedUnicode() const | |||
| map.mappingVersion = kUnicodeUseLatestMapping; | |||
| UnicodeToTextInfo conversionInfo = 0; | |||
| UnicodeToTextInfo conversionInfo = {}; | |||
| String result; | |||
| if (CreateUnicodeToTextInfo (&map, &conversionInfo) == noErr) | |||
| @@ -88,7 +88,7 @@ String String::convertToPrecomposedUnicode() const | |||
| if (ConvertFromUnicodeToText (conversionInfo, | |||
| bytesNeeded, (ConstUniCharArrayPtr) toUTF16().getAddress(), | |||
| kUnicodeDefaultDirectionMask, | |||
| 0, 0, 0, 0, | |||
| 0, {}, {}, {}, | |||
| bytesNeeded, &bytesRead, | |||
| &outputBufferSize, tempOut) == noErr) | |||
| { | |||
| @@ -190,7 +190,7 @@ int SystemStats::getMemorySizeInMegabytes() | |||
| uint64 mem = 0; | |||
| size_t memSize = sizeof (mem); | |||
| 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)); | |||
| } | |||
| @@ -224,7 +224,7 @@ int SystemStats::getCpuSpeedInMegahertz() | |||
| uint64 speedHz = 0; | |||
| size_t speedSize = sizeof (speedHz); | |||
| 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 (speedSize == 4) | |||
| @@ -86,7 +86,7 @@ JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept | |||
| struct kinfo_proc info; | |||
| int m[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; | |||
| 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; | |||
| } | |||
| @@ -180,7 +180,7 @@ private: | |||
| FD_ZERO (&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) | |||
| @@ -44,7 +44,7 @@ void CriticalSection::exit() const noexcept { pthread_mutex_unlock (&loc | |||
| WaitableEvent::WaitableEvent (bool useManualReset) noexcept | |||
| : triggered (false), manualReset (useManualReset) | |||
| { | |||
| pthread_cond_init (&condition, 0); | |||
| pthread_cond_init (&condition, {}); | |||
| pthread_mutexattr_t atts; | |||
| pthread_mutexattr_init (&atts); | |||
| @@ -78,7 +78,7 @@ bool WaitableEvent::wait (int timeOutMillisecs) const noexcept | |||
| else | |||
| { | |||
| struct timeval now; | |||
| gettimeofday (&now, 0); | |||
| gettimeofday (&now, nullptr); | |||
| struct timespec time; | |||
| 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) | |||
| { | |||
| 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 -1; | |||
| @@ -487,7 +487,7 @@ void FileInputStream::openHandle() | |||
| FileInputStream::~FileInputStream() | |||
| { | |||
| if (fileHandle != 0) | |||
| if (fileHandle != nullptr) | |||
| close (getFD (fileHandle)); | |||
| } | |||
| @@ -495,7 +495,7 @@ size_t FileInputStream::readInternal (void* buffer, size_t numBytes) | |||
| { | |||
| ssize_t result = 0; | |||
| if (fileHandle != 0) | |||
| if (fileHandle != nullptr) | |||
| { | |||
| result = ::read (getFD (fileHandle), buffer, numBytes); | |||
| @@ -548,16 +548,16 @@ void FileOutputStream::openHandle() | |||
| void FileOutputStream::closeHandle() | |||
| { | |||
| if (fileHandle != 0) | |||
| if (fileHandle != nullptr) | |||
| { | |||
| close (getFD (fileHandle)); | |||
| fileHandle = 0; | |||
| fileHandle = nullptr; | |||
| } | |||
| } | |||
| ssize_t FileOutputStream::writeInternal (const void* data, size_t numBytes) | |||
| { | |||
| if (fileHandle == 0) | |||
| if (fileHandle == nullptr) | |||
| return 0; | |||
| auto result = ::write (getFD (fileHandle), data, numBytes); | |||
| @@ -571,14 +571,14 @@ ssize_t FileOutputStream::writeInternal (const void* data, size_t numBytes) | |||
| #ifndef JUCE_ANDROID | |||
| void FileOutputStream::flushInternal() | |||
| { | |||
| if (fileHandle != 0 && fsync (getFD (fileHandle)) == -1) | |||
| if (fileHandle != nullptr && fsync (getFD (fileHandle)) == -1) | |||
| status = getResultForErrno(); | |||
| } | |||
| #endif | |||
| Result FileOutputStream::truncate() | |||
| { | |||
| if (fileHandle == 0) | |||
| if (fileHandle == nullptr) | |||
| return status; | |||
| flush(); | |||
| @@ -610,10 +610,10 @@ void MemoryMappedFile::openInternal (const File& file, AccessMode mode, bool exc | |||
| 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) | |||
| { | |||
| @@ -944,8 +944,8 @@ void Thread::launchThread() | |||
| } | |||
| #endif | |||
| threadHandle = 0; | |||
| pthread_t handle = 0; | |||
| threadHandle = {}; | |||
| pthread_t handle = {}; | |||
| pthread_attr_t attr; | |||
| pthread_attr_t* attrPtr = nullptr; | |||
| @@ -968,13 +968,13 @@ void Thread::launchThread() | |||
| void Thread::closeThreadHandle() | |||
| { | |||
| threadId = 0; | |||
| threadHandle = 0; | |||
| threadId = {}; | |||
| threadHandle = {}; | |||
| } | |||
| void Thread::killThread() | |||
| { | |||
| if (threadHandle.get() != 0) | |||
| if (threadHandle.get() != nullptr) | |||
| { | |||
| #if JUCE_ANDROID | |||
| jassertfalse; // pthread_cancel not available! | |||
| @@ -1304,7 +1304,7 @@ struct HighResolutionTimer::Pimpl | |||
| { | |||
| isRunning = false; | |||
| if (thread == 0) | |||
| if (thread == pthread_t()) | |||
| return; | |||
| if (thread == pthread_self()) | |||
| @@ -1321,7 +1321,7 @@ struct HighResolutionTimer::Pimpl | |||
| pthread_mutex_unlock (&timerMutex); | |||
| pthread_join (thread, nullptr); | |||
| thread = 0; | |||
| thread = {}; | |||
| } | |||
| HighResolutionTimer& owner; | |||
| @@ -264,7 +264,7 @@ namespace SocketHelpers | |||
| } | |||
| else | |||
| { | |||
| timeoutp = 0; | |||
| timeoutp = nullptr; | |||
| } | |||
| fd_set rset, wset; | |||
| @@ -282,7 +282,8 @@ namespace SocketHelpers | |||
| #else | |||
| { | |||
| int result; | |||
| while ((result = select (h + 1, prset, pwset, 0, timeoutp)) < 0 | |||
| while ((result = select (h + 1, prset, pwset, nullptr, timeoutp)) < 0 | |||
| && errno == EINTR) | |||
| { | |||
| } | |||
| @@ -24,9 +24,6 @@ namespace juce | |||
| { | |||
| ReadWriteLock::ReadWriteLock() noexcept | |||
| : numWaitingWriters (0), | |||
| numWriters (0), | |||
| writerThreadId (0) | |||
| { | |||
| readerThreads.ensureStorageAllocated (16); | |||
| } | |||
| @@ -141,7 +138,7 @@ void ReadWriteLock::exitWrite() const noexcept | |||
| if (--numWriters == 0) | |||
| { | |||
| writerThreadId = 0; | |||
| writerThreadId = {}; | |||
| waitEvent.signal(); | |||
| } | |||
| } | |||
| @@ -127,8 +127,8 @@ private: | |||
| //============================================================================== | |||
| SpinLock accessLock; | |||
| WaitableEvent waitEvent; | |||
| mutable int numWaitingWriters, numWriters; | |||
| mutable Thread::ThreadID writerThreadId; | |||
| mutable int numWaitingWriters = 0, numWriters = 0; | |||
| mutable Thread::ThreadID writerThreadId = {}; | |||
| struct ThreadRecursionCount | |||
| { | |||
| @@ -195,7 +195,7 @@ bool Thread::currentThreadShouldExit() | |||
| bool Thread::waitForThreadToExit (const int timeOutMilliseconds) const | |||
| { | |||
| // 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; | |||
| @@ -236,7 +236,7 @@ bool Thread::stopThread (const int timeOutMilliseconds) | |||
| killThread(); | |||
| threadHandle = nullptr; | |||
| threadId = 0; | |||
| threadId = {}; | |||
| return false; | |||
| } | |||
| } | |||
| @@ -288,7 +288,7 @@ bool Thread::setPriority (int newPriority) | |||
| bool Thread::setCurrentThreadPriority (const int newPriority) | |||
| { | |||
| return setThreadPriority (0, newPriority); | |||
| return setThreadPriority ({}, newPriority); | |||
| } | |||
| void Thread::setAffinityMask (const uint32 newAffinityMask) | |||
| @@ -36,6 +36,9 @@ namespace zlibNamespace | |||
| #pragma clang diagnostic ignored "-Wconversion" | |||
| #pragma clang diagnostic ignored "-Wshadow" | |||
| #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") | |||
| #pragma clang diagnostic ignored "-Wcomma" | |||
| #endif | |||
| @@ -52,7 +52,7 @@ public: | |||
| */ | |||
| static BigInteger createProbablePrime (int bitLength, | |||
| int certainty, | |||
| const int* randomSeeds = 0, | |||
| const int* randomSeeds = nullptr, | |||
| int numRandomSeeds = 0); | |||
| /** Tests a number to see if it's prime. | |||
| @@ -123,7 +123,7 @@ void RSAKey::createKeyPair (RSAKey& publicKey, RSAKey& privateKey, | |||
| jassert (numRandomSeeds == 0 || numRandomSeeds >= 2); // you need to provide plenty of seeds here! | |||
| 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 m (--p * --q); | |||
| @@ -23,7 +23,7 @@ | |||
| namespace juce | |||
| { | |||
| JUCEApplicationBase::CreateInstanceFunction JUCEApplicationBase::createInstance = 0; | |||
| JUCEApplicationBase::CreateInstanceFunction JUCEApplicationBase::createInstance = nullptr; | |||
| JUCEApplicationBase* JUCEApplicationBase::appInstance = nullptr; | |||
| #if JUCE_IOS | |||
| @@ -349,7 +349,7 @@ void MessageManager::Lock::exit() const noexcept | |||
| lockGained.set (0); | |||
| if (mm != nullptr) | |||
| mm->threadWithLock = 0; | |||
| mm->threadWithLock = {}; | |||
| if (blockingMessage != nullptr) | |||
| { | |||
| @@ -654,10 +654,10 @@ namespace PathStrokeHelpers | |||
| } | |||
| 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, | |||
| transform, extraAccuracy, 0); | |||
| transform, extraAccuracy, nullptr); | |||
| } | |||
| void PathStrokeType::createDashedStroke (Path& destPath, | |||
| @@ -665,7 +665,7 @@ void PathStrokeType::createDashedStroke (Path& destPath, | |||
| const float* dashLengths, | |||
| int numDashLengths, | |||
| const AffineTransform& transform, | |||
| const float extraAccuracy) const | |||
| float extraAccuracy) const | |||
| { | |||
| jassert (extraAccuracy > 0); | |||
| @@ -43,6 +43,9 @@ namespace jpeglibNamespace | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wconversion" | |||
| #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") | |||
| #pragma clang diagnostic ignored "-Wcomma" | |||
| #endif | |||
| @@ -66,6 +66,9 @@ namespace pnglibNamespace | |||
| #if JUCE_CLANG | |||
| #pragma clang diagnostic push | |||
| #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") | |||
| #pragma clang diagnostic ignored "-Wcomma" | |||
| #endif | |||
| @@ -520,23 +523,23 @@ Image PNGImageFormat::decodeImage (InputStream& in) | |||
| bool PNGImageFormat::writeImageToStream (const Image& image, OutputStream& out) | |||
| { | |||
| 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) | |||
| return false; | |||
| png_infop pngInfoStruct = png_create_info_struct (pngWriteStruct); | |||
| auto pngInfoStruct = png_create_info_struct (pngWriteStruct); | |||
| if (pngInfoStruct == nullptr) | |||
| { | |||
| png_destroy_write_struct (&pngWriteStruct, (png_infopp) nullptr); | |||
| png_destroy_write_struct (&pngWriteStruct, nullptr); | |||
| 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, | |||
| image.hasAlphaChannel() ? PNG_COLOR_TYPE_RGB_ALPHA | |||
| @@ -28,7 +28,7 @@ png_set_sig_bytes(png_structrp png_ptr, int num_bytes) | |||
| { | |||
| png_debug(1, "in png_set_sig_bytes"); | |||
| if (png_ptr == NULL) | |||
| if (png_ptr == NULL) | |||
| return; | |||
| if (num_bytes > 8) | |||
| @@ -1725,9 +1725,9 @@ struct ClipRegions | |||
| auto imageY = ((ty + 128) >> 8); | |||
| if (image.getFormat() == Image::ARGB) | |||
| straightClipImage (srcData, imageX, imageY, (PixelARGB*) 0); | |||
| straightClipImage (srcData, imageX, imageY, (PixelARGB*) nullptr); | |||
| else | |||
| straightClipImage (srcData, imageX, imageY, (PixelAlpha*) 0); | |||
| straightClipImage (srcData, imageX, imageY, (PixelAlpha*) nullptr); | |||
| return edgeTable.isEmpty() ? Ptr() : Ptr (*this); | |||
| } | |||
| @@ -1746,9 +1746,9 @@ struct ClipRegions | |||
| if (! edgeTable.isEmpty()) | |||
| { | |||
| if (image.getFormat() == Image::ARGB) | |||
| transformedClipImage (srcData, transform, quality, (PixelARGB*) 0); | |||
| transformedClipImage (srcData, transform, quality, (PixelARGB*) nullptr); | |||
| else | |||
| transformedClipImage (srcData, transform, quality, (PixelAlpha*) 0); | |||
| transformedClipImage (srcData, transform, quality, (PixelAlpha*) nullptr); | |||
| } | |||
| return edgeTable.isEmpty() ? Ptr() : Ptr (*this); | |||
| @@ -2640,9 +2640,9 @@ public: | |||
| 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) | |||
| { | |||
| 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; | |||
| } | |||
| } | |||
| @@ -86,7 +86,7 @@ class CoreGraphicsImage : public ImagePixelData | |||
| { | |||
| public: | |||
| 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); | |||
| lineStride = (pixelStride * jmax (1, width) + 3) & ~3; | |||
| @@ -156,7 +156,7 @@ public: | |||
| { | |||
| auto cgim = dynamic_cast<CoreGraphicsImage*> (juceImage.getPixelData()); | |||
| if (cgim != nullptr && cgim->cachedImageRef != 0) | |||
| if (cgim != nullptr && cgim->cachedImageRef != nullptr) | |||
| { | |||
| CGImageRetain (cgim->cachedImageRef); | |||
| return cgim->cachedImageRef; | |||
| @@ -180,13 +180,13 @@ public: | |||
| 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); | |||
| CFRelease (data); | |||
| } | |||
| 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, | |||
| @@ -195,7 +195,7 @@ public: | |||
| (size_t) srcData.pixelStride * 8, | |||
| (size_t) srcData.lineStride, | |||
| colourSpace, getCGImageFlags (juceImage.getFormat()), provider, | |||
| 0, true, kCGRenderingIntentDefault); | |||
| nullptr, true, kCGRenderingIntentDefault); | |||
| CGDataProviderRelease (provider); | |||
| return imageRef; | |||
| @@ -203,17 +203,17 @@ public: | |||
| //============================================================================== | |||
| CGContextRef context; | |||
| CGImageRef cachedImageRef; | |||
| CGImageRef cachedImageRef = {}; | |||
| HeapBlock<uint8> imageData; | |||
| int pixelStride, lineStride; | |||
| private: | |||
| void freeCachedImageRef() | |||
| { | |||
| if (cachedImageRef != 0) | |||
| if (cachedImageRef != CGImageRef()) | |||
| { | |||
| CGImageRelease (cachedImageRef); | |||
| cachedImageRef = 0; | |||
| cachedImageRef = {}; | |||
| } | |||
| } | |||
| @@ -439,7 +439,7 @@ void CoreGraphicsContext::beginTransparencyLayer (float opacity) | |||
| { | |||
| saveState(); | |||
| CGContextSetAlpha (context, opacity); | |||
| CGContextBeginTransparencyLayer (context, 0); | |||
| CGContextBeginTransparencyLayer (context, nullptr); | |||
| } | |||
| void CoreGraphicsContext::endTransparencyLayer() | |||
| @@ -581,7 +581,7 @@ void CoreGraphicsContext::drawImage (const Image& sourceImage, const AffineTrans | |||
| #else | |||
| // 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 (&CGContextDrawTiledImage != 0 && transform.isOnlyTranslation()) | |||
| if (&CGContextDrawTiledImage != nullptr && transform.isOnlyTranslation()) | |||
| { | |||
| CGContextDrawTiledImage (context, imageRect, image); | |||
| } | |||
| @@ -657,7 +657,7 @@ void CoreGraphicsContext::setFont (const Font& newFont) | |||
| { | |||
| if (state->font != newFont) | |||
| { | |||
| state->fontRef = 0; | |||
| state->fontRef = nullptr; | |||
| state->font = newFont; | |||
| 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) | |||
| { | |||
| if (state->fontRef != 0 && state->fillType.isColour()) | |||
| if (state->fontRef != nullptr && state->fillType.isColour()) | |||
| { | |||
| #if JUCE_CLANG | |||
| #pragma clang diagnostic push | |||
| @@ -741,13 +741,13 @@ CoreGraphicsContext::SavedState::SavedState (const SavedState& other) | |||
| : fillType (other.fillType), font (other.font), fontRef (other.fontRef), | |||
| fontTransform (other.fontTransform), gradient (other.gradient) | |||
| { | |||
| if (gradient != 0) | |||
| if (gradient != nullptr) | |||
| CGGradientRetain (gradient); | |||
| } | |||
| CoreGraphicsContext::SavedState::~SavedState() | |||
| { | |||
| if (gradient != 0) | |||
| if (gradient != nullptr) | |||
| CGGradientRelease (gradient); | |||
| } | |||
| @@ -755,10 +755,10 @@ void CoreGraphicsContext::SavedState::setFill (const FillType& newFill) | |||
| { | |||
| fillType = newFill; | |||
| if (gradient != 0) | |||
| if (gradient != nullptr) | |||
| { | |||
| 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); | |||
| if (state->gradient == 0) | |||
| if (state->gradient == nullptr) | |||
| state->gradient = createGradient (g, rgbColourSpace); | |||
| if (g.isRadial) | |||
| @@ -898,19 +898,19 @@ Image juce_loadWithCoreImage (InputStream& input) | |||
| CGImageRef loadedImage = uiImage.CGImage; | |||
| #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); | |||
| if (imageSource != 0) | |||
| if (imageSource != nullptr) | |||
| { | |||
| CGImageRef loadedImage = CGImageSourceCreateImageAtIndex (imageSource, 0, 0); | |||
| auto loadedImage = CGImageSourceCreateImageAtIndex (imageSource, 0, nullptr); | |||
| CFRelease (imageSource); | |||
| #endif | |||
| if (loadedImage != 0) | |||
| if (loadedImage != nullptr) | |||
| { | |||
| CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo (loadedImage); | |||
| auto alphaInfo = CGImageGetAlphaInfo (loadedImage); | |||
| const bool hasAlphaChan = (alphaInfo != kCGImageAlphaNone | |||
| && alphaInfo != kCGImageAlphaNoneSkipLast | |||
| && alphaInfo != kCGImageAlphaNoneSkipFirst); | |||
| @@ -992,8 +992,8 @@ CGContextRef juce_getImageContext (const Image& image) | |||
| auto requiredSize = NSMakeSize (image.getWidth() / scaleFactor, image.getHeight() / scaleFactor); | |||
| [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); | |||
| NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; | |||
| @@ -239,7 +239,7 @@ namespace CoreTextTypeLayout | |||
| { | |||
| extraKerning *= attr.font.getHeight(); | |||
| auto numberRef = CFNumberCreate (0, kCFNumberFloatType, &extraKerning); | |||
| auto numberRef = CFNumberCreate (nullptr, kCFNumberFloatType, &extraKerning); | |||
| CFAttributedStringSetAttribute (attribString, range, kCTKernAttributeName, numberRef); | |||
| CFRelease (numberRef); | |||
| } | |||
| @@ -540,7 +540,7 @@ public: | |||
| fontHeightToPointsFactor = referenceFontSize / ctTotalHeight; | |||
| const short zero = 0; | |||
| auto numberRef = CFNumberCreate (0, kCFNumberShortType, &zero); | |||
| auto numberRef = CFNumberCreate (nullptr, kCFNumberShortType, &zero); | |||
| CFStringRef keys[] = { kCTFontAttributeName, kCTLigatureAttributeName }; | |||
| CFTypeRef values[] = { ctFontRef, numberRef }; | |||
| @@ -465,12 +465,12 @@ struct DisplaySettingsChangeCallback : private DeletedAtShutdown | |||
| { | |||
| DisplaySettingsChangeCallback() | |||
| { | |||
| CGDisplayRegisterReconfigurationCallback (displayReconfigurationCallBack, 0); | |||
| CGDisplayRegisterReconfigurationCallback (displayReconfigurationCallBack, nullptr); | |||
| } | |||
| ~DisplaySettingsChangeCallback() | |||
| { | |||
| CGDisplayRemoveReconfigurationCallback (displayReconfigurationCallBack, 0); | |||
| CGDisplayRemoveReconfigurationCallback (displayReconfigurationCallBack, nullptr); | |||
| clearSingletonInstance(); | |||
| } | |||
| @@ -156,7 +156,7 @@ void TableHeaderComponent::moveColumn (const int columnId, int newIndex) | |||
| auto currentIndex = getIndexOfColumnId (columnId, false); | |||
| newIndex = visibleIndexToTotalIndex (newIndex); | |||
| if (columns [currentIndex] != 0 && currentIndex != newIndex) | |||
| if (columns[currentIndex] != nullptr && currentIndex != newIndex) | |||
| { | |||
| columns.move (currentIndex, newIndex); | |||
| sendColumnsChanged(); | |||
| @@ -711,13 +711,13 @@ struct TextEditor::InsertAction : public UndoableAction | |||
| bool perform() override | |||
| { | |||
| owner.insert (text, insertIndex, font, colour, 0, newCaretPos); | |||
| owner.insert (text, insertIndex, font, colour, nullptr, newCaretPos); | |||
| return true; | |||
| } | |||
| bool undo() override | |||
| { | |||
| owner.remove ({ insertIndex, insertIndex + text.length() }, 0, oldCaretPos); | |||
| owner.remove ({ insertIndex, insertIndex + text.length() }, nullptr, oldCaretPos); | |||
| return true; | |||
| } | |||
| @@ -751,7 +751,7 @@ struct TextEditor::RemoveAction : public UndoableAction | |||
| bool perform() override | |||
| { | |||
| owner.remove (range, 0, newCaretPos); | |||
| owner.remove (range, nullptr, newCaretPos); | |||
| return true; | |||
| } | |||
| @@ -1171,7 +1171,7 @@ void TextEditor::setText (const String& newText, bool sendTextChangeMessage) | |||
| bool cursorWasAtEnd = oldCursorPos >= getTotalNumChars(); | |||
| 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 | |||
| // ain't gonna look right! | |||
| @@ -212,7 +212,7 @@ void DocumentWindow::paint (Graphics& g) | |||
| titleBarArea.getHeight(), | |||
| titleSpaceX1, | |||
| jmax (1, titleSpaceX2 - titleSpaceX1), | |||
| titleBarIcon.isValid() ? &titleBarIcon : 0, | |||
| titleBarIcon.isValid() ? &titleBarIcon : nullptr, | |||
| ! drawTitleTextCentred); | |||
| } | |||
| @@ -101,7 +101,7 @@ struct CppTokeniserFunctions | |||
| 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) | |||
| return true; | |||
| @@ -68,7 +68,7 @@ struct LuaTokeniserFunctions | |||
| 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) | |||
| return true; | |||
| @@ -142,22 +142,22 @@ bool AppleRemoteDevice::isActive() const | |||
| bool AppleRemoteDevice::open (const bool openInExclusiveMode) | |||
| { | |||
| Array <int> cookies; | |||
| Array<int> cookies; | |||
| 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; | |||
| for (int i = 0; i < CFArrayGetCount (elements); ++i) | |||
| { | |||
| CFDictionaryRef element = (CFDictionaryRef) CFArrayGetValueAtIndex (elements, i); | |||
| auto element = (CFDictionaryRef) CFArrayGetValueAtIndex (elements, i); | |||
| // get the cookie | |||
| CFTypeRef object = CFDictionaryGetValue (element, CFSTR (kIOHIDElementCookieKey)); | |||
| if (object == 0 || CFGetTypeID (object) != CFNumberGetTypeID()) | |||
| if (object == nullptr || CFGetTypeID (object) != CFNumberGetTypeID()) | |||
| continue; | |||
| long number; | |||
| @@ -176,7 +176,7 @@ bool AppleRemoteDevice::open (const bool openInExclusiveMode) | |||
| { | |||
| queue = (*(IOHIDDeviceInterface**) device)->allocQueue ((IOHIDDeviceInterface**) device); | |||
| if (queue != 0) | |||
| if (queue != nullptr) | |||
| { | |||
| (*(IOHIDQueueInterface**) queue)->create ((IOHIDQueueInterface**) queue, 0, 12); | |||
| @@ -192,7 +192,7 @@ bool AppleRemoteDevice::open (const bool openInExclusiveMode) | |||
| ->createAsyncEventSource ((IOHIDQueueInterface**) queue, &eventSource) == KERN_SUCCESS) | |||
| { | |||
| if ((*(IOHIDQueueInterface**) queue)->setEventCallout ((IOHIDQueueInterface**) queue, | |||
| appleRemoteQueueCallback, this, 0) == KERN_SUCCESS) | |||
| appleRemoteQueueCallback, this, nullptr) == KERN_SUCCESS) | |||
| { | |||
| CFRunLoopAddSource (CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode); | |||
| @@ -436,7 +436,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); | |||
| } | |||
| } | |||
| } | |||