diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h index 04e05228f6..256fd7d156 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h @@ -794,254 +794,6 @@ protected: JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC2005); }; - -//============================================================================== -class MSVCProjectExporterVC6 : public MSVCProjectExporterBase -{ -public: - //============================================================================== - MSVCProjectExporterVC6 (Project& project_, const ValueTree& settings_) - : MSVCProjectExporterBase (project_, settings_, "MSVC6") - { - name = getName(); - } - - static const char* getName() { return "Visual C++ 6.0"; } - static const char* getValueTreeTypeName() { return "MSVC6"; } - - int getLaunchPreferenceOrderForCurrentOS() - { - #if JUCE_WINDOWS - return 1; - #else - return 0; - #endif - } - - void launchProject() { getDSWFile().startAsProcess(); } - - static MSVCProjectExporterVC6* createForSettings (Project& project, const ValueTree& settings) - { - if (settings.hasType (getValueTreeTypeName())) - return new MSVCProjectExporterVC6 (project, settings); - - return nullptr; - } - - //============================================================================== - void create() - { - { - MemoryOutputStream mo; - writeProject (mo); - overwriteFileIfDifferentOrThrow (getDSPFile(), mo); - } - - { - MemoryOutputStream mo; - writeDSWFile (mo); - overwriteFileIfDifferentOrThrow (getDSWFile(), mo); - } - } - -private: - File getDSPFile() const { return getProjectFile (".dsp"); } - File getDSWFile() const { return getProjectFile (".dsw"); } - - //============================================================================== - String createConfigName (const BuildConfiguration& config) const - { - return projectName + " - Win32 " + config.getName().toString(); - } - - void writeProject (OutputStream& out) - { - const String defaultConfigName (createConfigName (*getConfiguration(0))); - - String targetType, targetCode; - - if (isLibraryDLL()) { targetType = "\"Win32 (x86) Dynamic-Link Library\""; targetCode = "0x0102"; } - else if (projectType.isLibrary()) { targetType = "\"Win32 (x86) Static Library\""; targetCode = "0x0104"; } - else if (projectType.isCommandLineApp()) { targetType = "\"Win32 (x86) Console Application\""; targetCode = "0x0103"; } - else { targetType = "\"Win32 (x86) Application\""; targetCode = "0x0101"; } - - out << "# Microsoft Developer Studio Project File - Name=\"" << projectName - << "\" - Package Owner=<4>" << newLine - << "# Microsoft Developer Studio Generated Build File, Format Version 6.00" << newLine - << "# ** DO NOT EDIT **" << newLine - << "# TARGTYPE " << targetType << " " << targetCode << newLine - << "CFG=" << defaultConfigName << newLine - << "!MESSAGE This is not a valid makefile. To build this project using NMAKE," << newLine - << "!MESSAGE use the Export Makefile command and run" << newLine - << "!MESSAGE " << newLine - << "!MESSAGE NMAKE /f \"" << projectName << ".mak.\"" << newLine - << "!MESSAGE " << newLine - << "!MESSAGE You can specify a configuration when running NMAKE" << newLine - << "!MESSAGE by defining the macro CFG on the command line. For example:" << newLine - << "!MESSAGE " << newLine - << "!MESSAGE NMAKE /f \"" << projectName << ".mak\" CFG=\"" << defaultConfigName << '"' << newLine - << "!MESSAGE " << newLine - << "!MESSAGE Possible choices for configuration are:" << newLine - << "!MESSAGE " << newLine; - - for (ConfigIterator i (*this); i.next();) - out << "!MESSAGE \"" << createConfigName (*i) << "\" (based on " << targetType << ")" << newLine; - - out << "!MESSAGE " << newLine - << "# Begin Project" << newLine - << "# PROP AllowPerConfigDependencies 0" << newLine - << "# PROP Scc_ProjName \"\"" << newLine - << "# PROP Scc_LocalPath \"\"" << newLine - << "CPP=cl.exe" << newLine - << "MTL=midl.exe" << newLine - << "RSC=rc.exe" << newLine; - - String targetList; - - for (ConfigIterator config (*this); config.next();) - { - const String configName (createConfigName (*config)); - targetList << "# Name \"" << configName << '"' << newLine; - - const String binariesPath (getConfigTargetPath (*config)); - const String targetBinary (FileHelpers::windowsStylePath (binariesPath + "/" + getBinaryFileForConfig (*config))); - const String optimisationFlag (((int) config->getOptimisationLevel().getValue() <= 1) ? "Od" : (config->getOptimisationLevel() == 2 ? "O2" : "O3")); - const String defines (getPreprocessorDefs (*config, " /D ")); - const bool isDebug = (bool) config->isDebug().getValue(); - const String extraDebugFlags (isDebug ? "/Gm /ZI /GZ" : ""); - - out << (config.index == 0 ? "!IF" : "!ELSEIF") << " \"$(CFG)\" == \"" << configName << '"' << newLine - << "# PROP BASE Use_MFC 0" << newLine - << "# PROP BASE Use_Debug_Libraries " << (isDebug ? "1" : "0") << newLine - << "# PROP BASE Output_Dir \"" << binariesPath << '"' << newLine - << "# PROP BASE Intermediate_Dir \"" << getIntermediatesPath (*config) << '"' << newLine - << "# PROP BASE Target_Dir \"\"" << newLine - << "# PROP Use_MFC 0" << newLine - << "# PROP Use_Debug_Libraries " << (isDebug ? "1" : "0") << newLine - << "# PROP Output_Dir \"" << binariesPath << '"' << newLine - << "# PROP Intermediate_Dir \"" << getIntermediatesPath (*config) << '"' << newLine - << "# PROP Ignore_Export_Lib 0" << newLine - << "# PROP Target_Dir \"\"" << newLine - << "# ADD BASE CPP /nologo /W3 /GX /" << optimisationFlag << " /D " << defines - << " /YX /FD /c " << extraDebugFlags << " /Zm1024" << newLine - << "# ADD CPP /nologo " << (isDebug ? "/MTd" : "/MT") << " /W3 /GR /GX /" << optimisationFlag - << " /I " << replacePreprocessorTokens (*config, getHeaderSearchPaths (*config).joinIntoString (" /I ")) - << " /D " << defines << " /D \"_UNICODE\" /D \"UNICODE\" /FD /c /Zm1024 " << extraDebugFlags - << " " << replacePreprocessorTokens (*config, getExtraCompilerFlags().toString()).trim() << newLine; - - if (! isDebug) - out << "# SUBTRACT CPP /YX" << newLine; - - if (! projectType.isLibrary()) - out << "# ADD BASE MTL /nologo /D " << defines << " /mktyplib203 /win32" << newLine - << "# ADD MTL /nologo /D " << defines << " /mktyplib203 /win32" << newLine; - - out << "# ADD BASE RSC /l 0x40c /d " << defines << newLine - << "# ADD RSC /l 0x40c /d " << defines << newLine - << "BSC32=bscmake.exe" << newLine - << "# ADD BASE BSC32 /nologo" << newLine - << "# ADD BSC32 /nologo" << newLine; - - if (projectType.isLibrary()) - { - out << "LIB32=link.exe -lib" << newLine - << "# ADD BASE LIB32 /nologo" << newLine - << "# ADD LIB32 /nologo /out:\"" << targetBinary << '"' << newLine; - } - else - { - out << "LINK32=link.exe" << newLine - << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386" << newLine - << "# ADD LINK32 \"C:\\Program Files\\Microsoft Visual Studio\\VC98\\LIB\\shell32.lib\" " // This is avoid debug information corruption when mixing Platform SDK - << "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib " - << (isDebug ? " /debug" : "") - << " /nologo /machine:I386 /out:\"" << targetBinary << "\" " - << (isLibraryDLL() ? "/dll" : (msvcIsWindowsSubsystem ? "/subsystem:windows " - : "/subsystem:console ")) - << replacePreprocessorTokens (*config, getExtraLinkerFlags().toString()).trim() << newLine; - } - } - - out << "!ENDIF" << newLine - << "# Begin Target" << newLine - << targetList; - - for (int i = 0; i < groups.size(); ++i) - if (groups.getReference(i).getNumChildren() > 0) - writeFiles (out, groups.getReference(i)); - - out << "# End Target" << newLine - << "# End Project" << newLine; - } - - void writeFile (OutputStream& out, const RelativePath& file, const bool excludeFromBuild) - { - jassert (file.getRoot() == RelativePath::buildTargetFolder); - - out << "# Begin Source File" << newLine - << "SOURCE=" << file.toWindowsStyle().quoted() << newLine; - - if (excludeFromBuild) - out << "# PROP Exclude_From_Build 1" << newLine; - - out << "# End Source File" << newLine; - } - - void writeFiles (OutputStream& out, const Project::Item& projectItem) - { - if (projectItem.isGroup()) - { - out << "# Begin Group \"" << projectItem.getName() << '"' << newLine - << "# PROP Default_Filter \"cpp;c;cc;cxx;rc;def;r;odl;idl;hpj;bat\"" << newLine; - - for (int i = 0; i < projectItem.getNumChildren(); ++i) - writeFiles (out, projectItem.getChild (i)); - - out << "# End Group" << newLine; - } - else if (projectItem.shouldBeAddedToTargetProject()) - { - const RelativePath path (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder); - writeFile (out, path, projectItem.shouldBeAddedToBinaryResources() || (shouldFileBeCompiledByDefault (path) && ! projectItem.shouldBeCompiled())); - } - } - - void writeGroup (OutputStream& out, const String& groupName, const Array& files) - { - if (files.size() > 0) - { - out << "# Begin Group \"" << groupName << '"' << newLine; - for (int i = 0; i < files.size(); ++i) - if (files.getReference(i).hasFileExtension ("cpp;cc;c;cxx;h;hpp;hxx")) - writeFile (out, files.getReference(i), false); - - out << "# End Group" << newLine; - } - } - - void writeDSWFile (OutputStream& out) - { - out << "Microsoft Developer Studio Workspace File, Format Version 6.00 " << newLine - << "Project: \"" << projectName << "\" = .\\" << getDSPFile().getFileName() << " - Package Owner=<4>" << newLine - << "Package=<5>" << newLine - << "{{{" << newLine - << "}}}" << newLine - << "Package=<4>" << newLine - << "{{{" << newLine - << "}}}" << newLine - << "Global:" << newLine - << "Package=<5>" << newLine - << "{{{" << newLine - << "}}}" << newLine - << "Package=<3>" << newLine - << "{{{" << newLine - << "}}}" << newLine; - } - - JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC6); -}; - - //============================================================================== class MSVCProjectExporterVC2010 : public MSVCProjectExporterBase { diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp b/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp index bbddcffbe8..c73ebe0abf 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp @@ -41,7 +41,6 @@ StringArray ProjectExporter::getExporterNames() StringArray s; s.add (XCodeProjectExporter::getNameMac()); s.add (XCodeProjectExporter::getNameiOS()); - s.add (MSVCProjectExporterVC6::getName()); s.add (MSVCProjectExporterVC2005::getName()); s.add (MSVCProjectExporterVC2008::getName()); s.add (MSVCProjectExporterVC2010::getName()); @@ -68,7 +67,6 @@ ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int { case 0: exp = new XCodeProjectExporter (project, ValueTree (XCodeProjectExporter ::getValueTreeTypeName (false)), false); break; case 1: exp = new XCodeProjectExporter (project, ValueTree (XCodeProjectExporter ::getValueTreeTypeName (true)), true); break; - case 2: exp = new MSVCProjectExporterVC6 (project, ValueTree (MSVCProjectExporterVC6 ::getValueTreeTypeName())); break; case 3: exp = new MSVCProjectExporterVC2005 (project, ValueTree (MSVCProjectExporterVC2005::getValueTreeTypeName())); break; case 4: exp = new MSVCProjectExporterVC2008 (project, ValueTree (MSVCProjectExporterVC2008::getValueTreeTypeName())); break; case 5: exp = new MSVCProjectExporterVC2010 (project, ValueTree (MSVCProjectExporterVC2010::getValueTreeTypeName())); break; @@ -97,7 +95,8 @@ ProjectExporter* ProjectExporter::createNewExporter (Project& project, const Str ProjectExporter* ProjectExporter::createExporter (Project& project, const ValueTree& settings) { - ProjectExporter* exp = MSVCProjectExporterVC6 ::createForSettings (project, settings); + ProjectExporter* exp = nullptr; + if (exp == nullptr) exp = MSVCProjectExporterVC2005::createForSettings (project, settings); if (exp == nullptr) exp = MSVCProjectExporterVC2008::createForSettings (project, settings); if (exp == nullptr) exp = MSVCProjectExporterVC2010::createForSettings (project, settings); diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp index ee8e899b8e..0af24de5cb 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.cpp +++ b/extras/Introjucer/Source/Project/jucer_Project.cpp @@ -120,6 +120,8 @@ void Project::setMissingDefaultValues() if (! projectRoot.getChildWithName (Tags::exporters).isValid()) createDefaultExporters(); + else + removeDefunctExporters(); getProjectType().setMissingProjectProperties (*this); @@ -173,6 +175,21 @@ void Project::moveOldPropertyFromProjectToAllExporters (Identifier name) } } +void Project::removeDefunctExporters() +{ + ValueTree exporters (projectRoot.getChildWithName (Tags::exporters)); + + for (;;) + { + ValueTree oldVC6Exporter (exporters.getChildWithName ("MSVC6")); + + if (oldVC6Exporter.isValid()) + exporters.removeChild (oldVC6Exporter, nullptr); + else + break; + } +} + void Project::addDefaultModules (bool shouldCopyFilesLocally) { addModule ("juce_core", shouldCopyFilesLocally); diff --git a/extras/Introjucer/Source/Project/jucer_Project.h b/extras/Introjucer/Source/Project/jucer_Project.h index 3cb988ea0d..04329339b5 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.h +++ b/extras/Introjucer/Source/Project/jucer_Project.h @@ -264,6 +264,7 @@ private: void updateOldStyleConfigList(); void moveOldPropertyFromProjectToAllExporters (Identifier name); + void removeDefunctExporters(); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Project); }; diff --git a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h index 97e3f04ebc..e70551462d 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h +++ b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h @@ -332,7 +332,7 @@ public: typename Endianness, typename InterleavingType, typename Constness> - class Pointer + class Pointer : private InterleavingType // (inherited for EBCO) { public: //============================================================================== @@ -352,22 +352,20 @@ public: For non-interleaved data, use the other constructor. */ Pointer (typename Constness::VoidType* sourceData, int numInterleavedChannels) noexcept - : data (Constness::toVoidPtr (sourceData)), - interleaving (numInterleavedChannels) + : InterleavingType (numInterleavedChannels), data (Constness::toVoidPtr (sourceData)) { } /** Creates a copy of another pointer. */ Pointer (const Pointer& other) noexcept - : data (other.data), - interleaving (other.interleaving) + : InterleavingType (other), data (other.data) { } Pointer& operator= (const Pointer& other) noexcept { + InterleavingType::operator= (other); data = other.data; - interleaving.copyFrom (other.interleaving); return *this; } @@ -412,10 +410,10 @@ public: inline Pointer& operator++() noexcept { advance(); return *this; } /** Moves the pointer back to the previous sample. */ - inline Pointer& operator--() noexcept { interleaving.advanceDataBy (data, -1); return *this; } + inline Pointer& operator--() noexcept { this->advanceDataBy (data, -1); return *this; } /** Adds a number of samples to the pointer's position. */ - Pointer& operator+= (int samplesToJump) noexcept { interleaving.advanceDataBy (data, samplesToJump); return *this; } + Pointer& operator+= (int samplesToJump) noexcept { this->advanceDataBy (data, samplesToJump); return *this; } /** Writes a stream of samples into this pointer from another pointer. This will copy the specified number of samples, converting between formats appropriately. @@ -466,7 +464,7 @@ public: void clearSamples (int numSamples) const noexcept { Pointer dest (*this); - dest.interleaving.clear (dest.data, numSamples); + dest.clear (dest.data, numSamples); } /** Returns true if the pointer is using a floating-point format. */ @@ -482,7 +480,7 @@ public: int getNumInterleavedChannels() const noexcept { return (int) this->numInterleavedChannels; } /** Returns the number of bytes between the start address of each sample. */ - int getNumBytesBetweenSamples() const noexcept { return interleaving.getNumBytesBetweenSamples (data); } + int getNumBytesBetweenSamples() const noexcept { return InterleavingType::getNumBytesBetweenSamples (data); } /** Returns the accuracy of this format when represented as a 32-bit integer. This is the smallest number above 0 that can be represented in the sample format, converted to @@ -497,10 +495,8 @@ public: private: //============================================================================== SampleFormat data; - InterleavingType interleaving; // annoyingly, making the interleaving type a superclass to take - // advantage of EBCO causes an internal compiler error in VC6.. - inline void advance() noexcept { interleaving.advanceData (data); } + inline void advance() noexcept { this->advanceData (data); } Pointer operator++ (int); // private to force you to use the more efficient pre-increment! Pointer operator-- (int); diff --git a/modules/juce_audio_formats/format/juce_AudioFormatWriter.h b/modules/juce_audio_formats/format/juce_AudioFormatWriter.h index 7683877f49..9f1ce1a6c7 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatWriter.h +++ b/modules/juce_audio_formats/format/juce_AudioFormatWriter.h @@ -199,11 +199,8 @@ public: */ void setDataReceiver (IncomingDataReceiver* receiver); - #ifndef DOXYGEN - class Buffer; // (only public for VC6 compatibility) - #endif - private: + class Buffer; friend class ScopedPointer; ScopedPointer buffer; }; diff --git a/modules/juce_audio_utils/gui/juce_AudioThumbnail.h b/modules/juce_audio_utils/gui/juce_AudioThumbnail.h index 73f9477ee3..488a082734 100644 --- a/modules/juce_audio_utils/gui/juce_AudioThumbnail.h +++ b/modules/juce_audio_utils/gui/juce_AudioThumbnail.h @@ -189,15 +189,12 @@ public: /** Returns the hash code that was set by setSource() or setReader(). */ int64 getHashCode() const; - #ifndef DOXYGEN - class LevelDataSource; // (this is only public to avoid a VC6 bug) - #endif - private: //============================================================================== AudioFormatManager& formatManagerToUse; AudioThumbnailCache& cache; + class LevelDataSource; struct MinMaxValue; class ThumbData; class CachedWindow; diff --git a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp index e40c06af4e..9f1665de12 100644 --- a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp @@ -459,7 +459,7 @@ void MidiKeyboardComponent::drawWhiteNote (int midiNoteNumber, if (! text.isEmpty()) { g.setColour (textColour); - g.setFont (Font (12.0f, keyWidth * 0.9f).withHorizontalScale (0.8f)); + g.setFont (Font (jmin (12.0f, keyWidth * 0.9f)).withHorizontalScale (0.8f)); Justification justification (Justification::centredBottom); diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp index d270928255..7f8ca996da 100644 --- a/modules/juce_core/juce_core.cpp +++ b/modules/juce_core/juce_core.cpp @@ -150,10 +150,6 @@ namespace juce //============================================================================== #elif JUCE_WINDOWS - #if JUCE_VC6 - #pragma warning (disable: 4309 4305) - #endif - #include "native/juce_win32_ComSmartPtr.h" #include "native/juce_win32_Files.cpp" #include "native/juce_win32_Network.cpp" diff --git a/modules/juce_core/juce_core.h b/modules/juce_core/juce_core.h index ef3cf963fd..228f4dc134 100644 --- a/modules/juce_core/juce_core.h +++ b/modules/juce_core/juce_core.h @@ -105,7 +105,7 @@ #pragma pack (push, 8) // this is set explicitly in case the app is using a different packing size. #pragma warning (push) - #pragma warning (disable: 4786) // (old vc6 warning about long class names) + #pragma warning (disable: 4786) // (long class name warning) #ifdef __INTEL_COMPILER #pragma warning (disable: 1125) #endif diff --git a/modules/juce_core/maths/juce_Expression.cpp b/modules/juce_core/maths/juce_Expression.cpp index a4c7aff957..142379d4c0 100644 --- a/modules/juce_core/maths/juce_Expression.cpp +++ b/modules/juce_core/maths/juce_Expression.cpp @@ -83,9 +83,6 @@ struct Expression::Helpers { typedef ReferenceCountedObjectPtr TermPtr; - // This helper function is needed to work around VC6 scoping bugs - static inline const TermPtr& getTermFor (const Expression& exp) noexcept { return exp.term; } - static void checkRecursionDepth (const int depth) { if (depth > 256) @@ -208,7 +205,7 @@ struct Expression::Helpers TermPtr resolve (const Scope& scope, int recursionDepth) { checkRecursionDepth (recursionDepth); - return getTermFor (scope.getSymbolValue (symbol))->resolve (scope, recursionDepth + 1); + return scope.getSymbolValue (symbol).term->resolve (scope, recursionDepth + 1); } Type getType() const noexcept { return symbolType; } @@ -220,7 +217,7 @@ struct Expression::Helpers { checkRecursionDepth (recursionDepth); visitor.useSymbol (Symbol (scope.getScopeUID(), symbol)); - getTermFor (scope.getSymbolValue (symbol))->visitAllSymbols (visitor, scope, recursionDepth + 1); + scope.getSymbolValue (symbol).term->visitAllSymbols (visitor, scope, recursionDepth + 1); } void renameSymbol (const Symbol& oldSymbol, const String& newName, const Scope& scope, int /*recursionDepth*/) @@ -245,7 +242,7 @@ struct Expression::Helpers Type getType() const noexcept { return functionType; } Term* clone() const { return new Function (functionName, parameters); } int getNumInputs() const { return parameters.size(); } - Term* getInput (int i) const { return getTermFor (parameters [i]); } + Term* getInput (int i) const { return parameters.getReference(i).term; } String getName() const { return functionName; } TermPtr resolve (const Scope& scope, int recursionDepth) @@ -257,7 +254,7 @@ struct Expression::Helpers { HeapBlock params ((size_t) numParams); for (int i = 0; i < numParams; ++i) - params[i] = getTermFor (parameters.getReference(i))->resolve (scope, recursionDepth + 1)->toDouble(); + params[i] = parameters.getReference(i).term->resolve (scope, recursionDepth + 1)->toDouble(); result = scope.evaluateFunction (functionName, params, numParams); } @@ -272,7 +269,7 @@ struct Expression::Helpers int getInputIndexFor (const Term* possibleInput) const { for (int i = 0; i < parameters.size(); ++i) - if (getTermFor (parameters.getReference(i)) == possibleInput) + if (parameters.getReference(i).term == possibleInput) return i; return -1; @@ -287,7 +284,7 @@ struct Expression::Helpers for (int i = 0; i < parameters.size(); ++i) { - s << getTermFor (parameters.getReference(i))->toString(); + s << parameters.getReference(i).term->toString(); if (i < parameters.size() - 1) s << ", "; diff --git a/modules/juce_core/maths/juce_MathsFunctions.h b/modules/juce_core/maths/juce_MathsFunctions.h index bd84e25314..c3beb57c5c 100644 --- a/modules/juce_core/maths/juce_MathsFunctions.h +++ b/modules/juce_core/maths/juce_MathsFunctions.h @@ -79,7 +79,7 @@ typedef unsigned int uint32; typedef int64 pointer_sized_int; /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ typedef uint64 pointer_sized_uint; -#elif JUCE_MSVC && ! JUCE_VC6 +#elif JUCE_MSVC /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ typedef _W64 int pointer_sized_int; /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ @@ -227,14 +227,12 @@ inline bool isPositiveAndBelow (Type valueToTest, Type upperLimit) noexcept return Type() <= valueToTest && valueToTest < upperLimit; } -#if ! JUCE_VC6 template <> inline bool isPositiveAndBelow (const int valueToTest, const int upperLimit) noexcept { jassert (upperLimit >= 0); // makes no sense to call this if the upper limit is itself below zero.. return static_cast (valueToTest) < static_cast (upperLimit); } -#endif /** Returns true if a value is at least zero, and also less than or equal to a specified upper limit. This is basically a quicker way to write: @@ -248,14 +246,12 @@ inline bool isPositiveAndNotGreaterThan (Type valueToTest, Type upperLimit) noex return Type() <= valueToTest && valueToTest <= upperLimit; } -#if ! JUCE_VC6 template <> inline bool isPositiveAndNotGreaterThan (const int valueToTest, const int upperLimit) noexcept { jassert (upperLimit >= 0); // makes no sense to call this if the upper limit is itself below zero.. return static_cast (valueToTest) <= static_cast (upperLimit); } -#endif //============================================================================== /** Handy function to swap two values. */ @@ -265,25 +261,21 @@ inline void swapVariables (Type& variable1, Type& variable2) std::swap (variable1, variable2); } -#if JUCE_VC6 - #define numElementsInArray(X) (sizeof((X)) / sizeof(0[X])) -#else - /** Handy function for getting the number of elements in a simple const C array. - E.g. - @code - static int myArray[] = { 1, 2, 3 }; +/** Handy function for getting the number of elements in a simple const C array. + E.g. + @code + static int myArray[] = { 1, 2, 3 }; - int numElements = numElementsInArray (myArray) // returns 3 - @endcode - */ - template - inline int numElementsInArray (Type (&array)[N]) - { - (void) array; // (required to avoid a spurious warning in MS compilers) - (void) sizeof (0[array]); // This line should cause an error if you pass an object with a user-defined subscript operator - return N; - } -#endif + int numElements = numElementsInArray (myArray) // returns 3 + @endcode +*/ +template +inline int numElementsInArray (Type (&array)[N]) +{ + (void) array; // (required to avoid a spurious warning in MS compilers) + (void) sizeof (0[array]); // This line should cause an error if you pass an object with a user-defined subscript operator + return N; +} //============================================================================== // Some useful maths functions that aren't always present with all compilers and build settings. diff --git a/modules/juce_core/system/juce_StandardHeader.h b/modules/juce_core/system/juce_StandardHeader.h index 6fbba76db6..6ba3851240 100644 --- a/modules/juce_core/system/juce_StandardHeader.h +++ b/modules/juce_core/system/juce_StandardHeader.h @@ -62,23 +62,6 @@ // Now we'll include any OS headers we need.. (at this point we are outside the Juce namespace). #if JUCE_MSVC - #if JUCE_VC6 - #pragma warning (disable: 4284 4786) // (spurious VC6 warnings) - - namespace std // VC6 doesn't have sqrt/sin/cos/tan/abs in std, so declare them here: - { - template Type abs (Type a) { if (a < 0) return -a; return a; } - template Type tan (Type a) { return static_cast (::tan (static_cast (a))); } - template Type sin (Type a) { return static_cast (::sin (static_cast (a))); } - template Type asin (Type a) { return static_cast (::asin (static_cast (a))); } - template Type cos (Type a) { return static_cast (::cos (static_cast (a))); } - template Type sqrt (Type a) { return static_cast (::sqrt (static_cast (a))); } - template Type floor (Type a) { return static_cast (::floor (static_cast (a))); } - template Type ceil (Type a) { return static_cast (::ceil (static_cast (a))); } - template Type atan2 (Type a, Type b) { return static_cast (::atan2 (static_cast (a), static_cast (b))); } - } - #endif - #pragma warning (push) #pragma warning (disable: 4514 4245 4100) #endif diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index 38c86b1a4d..ef7db39a84 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -182,7 +182,7 @@ namespace JuceDummyNamespace {} #define JUCE_VC7_OR_EARLIER 1 #if _MSC_VER < 1300 - #define JUCE_VC6 1 + #warning "MSVC 6.0 is no longer supported!" #endif #endif #endif diff --git a/modules/juce_data_structures/values/juce_ValueTree.h b/modules/juce_data_structures/values/juce_ValueTree.h index a5dbf839df..184952a32a 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.h +++ b/modules/juce_data_structures/values/juce_ValueTree.h @@ -504,9 +504,6 @@ private: void createListOfChildren (OwnedArray&) const; void reorderChildren (const OwnedArray&, UndoManager*); -#if JUCE_MSVC && ! DOXYGEN - public: // (workaround for VC6) -#endif explicit ValueTree (SharedObject*); }; diff --git a/modules/juce_events/broadcasters/juce_ListenerList.h b/modules/juce_events/broadcasters/juce_ListenerList.h index 26482a7395..a290d83454 100644 --- a/modules/juce_events/broadcasters/juce_ListenerList.h +++ b/modules/juce_events/broadcasters/juce_ListenerList.h @@ -69,7 +69,7 @@ template > class ListenerList { - // Horrible macros required to support VC6/7.. + // Horrible macros required to support VC7.. #ifndef DOXYGEN #if JUCE_VC8_OR_EARLIER #define LL_TEMPLATE(a) typename P##a, typename Q##a diff --git a/modules/juce_graphics/fonts/juce_Font.cpp b/modules/juce_graphics/fonts/juce_Font.cpp index b2cc697477..84fb800150 100644 --- a/modules/juce_graphics/fonts/juce_Font.cpp +++ b/modules/juce_graphics/fonts/juce_Font.cpp @@ -81,7 +81,7 @@ public: } int replaceIndex = 0; - int bestLastUsageCount = std::numeric_limits::max(); + size_t bestLastUsageCount = std::numeric_limits::max(); for (i = faces.size(); --i >= 0;) { diff --git a/modules/juce_gui_basics/buttons/juce_Button.h b/modules/juce_gui_basics/buttons/juce_Button.h index 593b5e4fbc..07160edb0a 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.h +++ b/modules/juce_gui_basics/buttons/juce_Button.h @@ -32,9 +32,6 @@ #include "../windows/juce_TooltipWindow.h" #include "../layout/juce_ComponentBuilder.h" -#if JUCE_VC6 - #define Listener ButtonListener -#endif //============================================================================== /** @@ -518,8 +515,4 @@ private: typedef Button::Listener ButtonListener; #endif -#if JUCE_VC6 - #undef Listener -#endif - #endif // __JUCE_BUTTON_JUCEHEADER__ diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index f8c7f625b1..4e10664b58 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -462,9 +462,7 @@ Component::Component (const String& name) Component::~Component() { - #if ! JUCE_VC6 // (access to private union not allowed in VC6) static_jassert (sizeof (flags) <= sizeof (componentFlags)); - #endif componentListeners.call (&ComponentListener::componentBeingDeleted, *this); diff --git a/modules/juce_gui_basics/widgets/juce_ComboBox.h b/modules/juce_gui_basics/widgets/juce_ComboBox.h index 7db39cb0c1..324083d17b 100644 --- a/modules/juce_gui_basics/widgets/juce_ComboBox.h +++ b/modules/juce_gui_basics/widgets/juce_ComboBox.h @@ -28,9 +28,6 @@ #include "juce_Label.h" -#if JUCE_VC6 - #define Listener SliderListener -#endif //============================================================================== /** @@ -415,8 +412,4 @@ private: /** This typedef is just for compatibility with old code - newer code should use the ComboBox::Listener class directly. */ typedef ComboBox::Listener ComboBoxListener; -#if JUCE_VC6 - #undef Listener -#endif - #endif // __JUCE_COMBOBOX_JUCEHEADER__ diff --git a/modules/juce_gui_basics/widgets/juce_Label.h b/modules/juce_gui_basics/widgets/juce_Label.h index 80a31b7bda..85939f18ba 100644 --- a/modules/juce_gui_basics/widgets/juce_Label.h +++ b/modules/juce_gui_basics/widgets/juce_Label.h @@ -28,9 +28,6 @@ #include "juce_TextEditor.h" -#if JUCE_VC6 - #define Listener ButtonListener -#endif //============================================================================== /** @@ -344,8 +341,4 @@ private: /** This typedef is just for compatibility with old code - newer code should use the Label::Listener class directly. */ typedef Label::Listener LabelListener; -#if JUCE_VC6 - #undef Listener -#endif - #endif // __JUCE_LABEL_JUCEHEADER__ diff --git a/modules/juce_gui_basics/widgets/juce_Slider.h b/modules/juce_gui_basics/widgets/juce_Slider.h index 14c35bda18..b12fedc25f 100644 --- a/modules/juce_gui_basics/widgets/juce_Slider.h +++ b/modules/juce_gui_basics/widgets/juce_Slider.h @@ -29,10 +29,6 @@ #include "juce_Label.h" #include "../buttons/juce_Button.h" -#if JUCE_VC6 - #define Listener LabelListener -#endif - //============================================================================== /** A slider control for changing a value. @@ -887,8 +883,4 @@ private: /** This typedef is just for compatibility with old code - newer code should use the Slider::Listener class directly. */ typedef Slider::Listener SliderListener; -#if JUCE_VC6 - #undef Listener -#endif - #endif // __JUCE_SLIDER_JUCEHEADER__