Browse Source

Fixed some VS2013 compiler errors

tags/2021-05-28
tpoole 8 years ago
parent
commit
51b3eaebb2
12 changed files with 137 additions and 48 deletions
  1. +1
    -3
      modules/juce_audio_basics/midi/juce_MidiBuffer.cpp
  2. +4
    -1
      modules/juce_audio_basics/midi/juce_MidiBuffer.h
  3. +29
    -6
      modules/juce_core/maths/juce_NormalisableRange.h
  4. +23
    -7
      modules/juce_core/network/juce_URL.cpp
  5. +4
    -2
      modules/juce_core/network/juce_URL.h
  6. +7
    -9
      modules/juce_core/text/juce_String.cpp
  7. +31
    -1
      modules/juce_graphics/fonts/juce_GlyphArrangement.cpp
  8. +10
    -5
      modules/juce_graphics/fonts/juce_GlyphArrangement.h
  9. +15
    -5
      modules/juce_gui_basics/native/juce_MultiTouchMapper.h
  10. +9
    -1
      modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  11. +2
    -6
      modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp
  12. +2
    -2
      modules/juce_gui_extra/code_editor/juce_CodeDocument.h

+ 1
- 3
modules/juce_audio_basics/midi/juce_MidiBuffer.cpp View File

@@ -189,9 +189,7 @@ MidiBuffer::Iterator::Iterator (const MidiBuffer& b) noexcept
{
}
MidiBuffer::Iterator::~Iterator() noexcept
{
}
MidiBuffer::Iterator::~Iterator() noexcept{}
void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) noexcept
{


+ 4
- 1
modules/juce_audio_basics/midi/juce_MidiBuffer.h View File

@@ -173,7 +173,10 @@ public:
Iterator (const MidiBuffer&) noexcept;
/** Creates a copy of an iterator. */
Iterator (const Iterator&) noexcept = default;
Iterator (const Iterator&) = default;
// VS2013 requires this, even if it's unused.
Iterator& operator= (const Iterator&) = delete;
/** Destructor. */
~Iterator() noexcept;


+ 29
- 6
modules/juce_core/maths/juce_NormalisableRange.h View File

@@ -38,12 +38,34 @@ class NormalisableRange
{
public:
/** Creates a continuous range that performs a dummy mapping. */
NormalisableRange() noexcept = default;
NormalisableRange() noexcept {}
NormalisableRange (const NormalisableRange&) = default;
NormalisableRange (NormalisableRange&&) = default;
NormalisableRange& operator= (const NormalisableRange&) = default;
NormalisableRange& operator= (NormalisableRange&&) = default;
// VS2013 can't default move constructors
NormalisableRange (NormalisableRange&& other)
: start (other.start), end (other.end),
interval (other.interval), skew (other.skew),
symmetricSkew (other.symmetricSkew),
convertFrom0To1Function (static_cast<ConverstionFunction&&> (other.convertFrom0To1Function)),
convertTo0To1Function (static_cast<ConverstionFunction&&> (other.convertTo0To1Function)),
snapToLegalValueFunction (static_cast<ConverstionFunction&&> (other.snapToLegalValueFunction))
{
}
// VS2013 can't default move assignments
NormalisableRange& operator= (NormalisableRange&& other)
{
start = other.start;
end = other.end;
interval = other.interval;
skew = other.skew;
symmetricSkew = other.symmetricSkew;
convertFrom0To1Function = static_cast<ConverstionFunction&&> (other.convertFrom0To1Function);
convertTo0To1Function = static_cast<ConverstionFunction&&> (other.convertTo0To1Function);
snapToLegalValueFunction = static_cast<ConverstionFunction&&> (other.snapToLegalValueFunction);
}
/** Creates a NormalisableRange with a given range, interval and skew factor. */
NormalisableRange (ValueType rangeStart,
@@ -235,9 +257,10 @@ private:
jassert (skew > ValueType());
}
std::function<ValueType (ValueType, ValueType, ValueType)> convertFrom0To1Function = {},
convertTo0To1Function = {},
snapToLegalValueFunction = {};
typedef std::function<ValueType(ValueType, ValueType, ValueType)> ConverstionFunction;
ConverstionFunction convertFrom0To1Function = {},
convertTo0To1Function = {},
snapToLegalValueFunction = {};
};
} // namespace juce

+ 23
- 7
modules/juce_core/network/juce_URL.cpp View File

@@ -134,9 +134,7 @@ URL::DownloadTask::DownloadTask() {}
URL::DownloadTask::~DownloadTask() {}
//==============================================================================
URL::URL() noexcept
{
}
URL::URL() noexcept {}
URL::URL (const String& u) : url (u)
{
@@ -170,6 +168,28 @@ URL::URL (const String& u) : url (u)
URL::URL (const String& u, int) : url (u) {}
URL::URL (URL&& other)
: url (static_cast<String&&> (other.url)),
postData (static_cast<MemoryBlock&&> (other.postData)),
parameterNames (static_cast<StringArray&&> (other.parameterNames)),
parameterValues (static_cast<StringArray&&> (other.parameterValues)),
filesToUpload (static_cast<ReferenceCountedArray<Upload>&&> (other.filesToUpload))
{
}
URL& URL::operator= (URL&& other)
{
url = static_cast<String&&> (other.url);
postData = static_cast<MemoryBlock&&> (other.postData);
parameterNames = static_cast<StringArray&&> (other.parameterNames);
parameterValues = static_cast<StringArray&&> (other.parameterValues);
filesToUpload = static_cast<ReferenceCountedArray<Upload>&&> (other.filesToUpload);
return *this;
}
URL::~URL() {}
URL URL::createWithoutParsing (const String& u)
{
return URL (u, 0);
@@ -189,10 +209,6 @@ bool URL::operator!= (const URL& other) const
return ! operator== (other);
}
URL::~URL()
{
}
namespace URLHelpers
{
static String getMangledParameters (const URL& url)


+ 4
- 2
modules/juce_core/network/juce_URL.h View File

@@ -47,9 +47,11 @@ public:
URL (const String& url);
URL (const URL&) = default;
URL (URL&&) = default;
URL& operator= (const URL&) = default;
URL& operator= (URL&&) = default;
// VS2013 can't default move constructors and assignments
URL (URL&&);
URL& operator= (URL&&);
/** Destructor. */
~URL();


+ 7
- 9
modules/juce_core/text/juce_String.cpp View File

@@ -1359,8 +1359,6 @@ struct StringCreationHelper
dest.write (c);
}
String&& get() noexcept { return static_cast<String&&> (result); }
String result;
String::CharPointerType source { nullptr }, dest { nullptr };
size_t allocatedBytes, bytesWritten = 0;
@@ -1386,7 +1384,7 @@ String String::replaceCharacter (const juce_wchar charToReplace, const juce_wcha
break;
}
return builder.get();
return static_cast<String&&> (builder.result);
}
String String::replaceCharacters (StringRef charactersToReplace, StringRef charactersToInsertInstead) const
@@ -1411,7 +1409,7 @@ String String::replaceCharacters (StringRef charactersToReplace, StringRef chara
break;
}
return builder.get();
return static_cast<String&&> (builder.result);
}
//==============================================================================
@@ -1493,7 +1491,7 @@ String String::toUpperCase() const
++(builder.source);
}
return builder.get();
return static_cast<String&&> (builder.result);
}
String String::toLowerCase() const
@@ -1511,7 +1509,7 @@ String String::toLowerCase() const
++(builder.source);
}
return builder.get();
return static_cast<String&&> (builder.result);
}
//==============================================================================
@@ -1776,7 +1774,7 @@ String String::retainCharacters (StringRef charactersToRetain) const
}
builder.write (0);
return builder.get();
return static_cast<String&&> (builder.result);
}
String String::removeCharacters (StringRef charactersToRemove) const
@@ -1797,7 +1795,7 @@ String String::removeCharacters (StringRef charactersToRemove) const
break;
}
return builder.get();
return static_cast<String&&> (builder.result);
}
String String::initialSectionContainingOnly (StringRef permittedCharacters) const
@@ -2013,7 +2011,7 @@ String String::createStringFromData (const void* const unknownData, int size)
}
builder.write (0);
return builder.get();
return static_cast<String&&> (builder.result);
}
auto* start = (const char*) data;


+ 31
- 1
modules/juce_graphics/fonts/juce_GlyphArrangement.cpp View File

@@ -39,6 +39,26 @@ PositionedGlyph::PositionedGlyph (const Font& font_, juce_wchar character_, int
{
}
PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept
: font (static_cast<Font&&> (other.font)),
character (other.character), glyph (other.glyph),
x (other.x), y (other.y), w (other.w), whitespace (other.whitespace)
{
}
PositionedGlyph& PositionedGlyph::operator= (PositionedGlyph&& other) noexcept
{
font = static_cast<Font&&> (other.font);
character = other.character;
glyph = other.glyph;
x = other.x;
y = other.y;
w = other.w;
whitespace = other.whitespace;
return *this;
}
PositionedGlyph::~PositionedGlyph() {}
static inline void drawGlyphWithFont (Graphics& g, int glyph, const Font& font, AffineTransform t)
@@ -108,10 +128,20 @@ GlyphArrangement::GlyphArrangement()
glyphs.ensureStorageAllocated (128);
}
GlyphArrangement::~GlyphArrangement()
GlyphArrangement::GlyphArrangement (GlyphArrangement&& other)
: glyphs (static_cast<Array<PositionedGlyph>&&> (other.glyphs))
{
}
GlyphArrangement& GlyphArrangement::operator= (GlyphArrangement&& other)
{
glyphs = static_cast<Array<PositionedGlyph>&&> (other.glyphs);
return *this;
}
GlyphArrangement::~GlyphArrangement() {}
//==============================================================================
void GlyphArrangement::clear()
{


+ 10
- 5
modules/juce_graphics/fonts/juce_GlyphArrangement.h View File

@@ -42,15 +42,18 @@ class JUCE_API PositionedGlyph final
public:
//==============================================================================
PositionedGlyph() noexcept;
~PositionedGlyph();
PositionedGlyph (const Font& font, juce_wchar character, int glyphNumber,
float anchorX, float baselineY, float width, bool isWhitespace);
PositionedGlyph (const PositionedGlyph&) = default;
PositionedGlyph (PositionedGlyph&&) noexcept = default;
PositionedGlyph& operator= (const PositionedGlyph&) = default;
PositionedGlyph& operator= (PositionedGlyph&&) noexcept = default;
// VS2013 can't default move constructors and assignmants
PositionedGlyph (PositionedGlyph&&) noexcept;
PositionedGlyph& operator= (PositionedGlyph&&) noexcept;
~PositionedGlyph();
/** Returns the character the glyph represents. */
juce_wchar getCharacter() const noexcept { return character; }
@@ -124,9 +127,11 @@ public:
GlyphArrangement();
GlyphArrangement (const GlyphArrangement&) = default;
GlyphArrangement (GlyphArrangement&&) = default;
GlyphArrangement& operator= (const GlyphArrangement&) = default;
GlyphArrangement& operator= (GlyphArrangement&&) = default;
// VS2013 can't default move constructors and assignmants
GlyphArrangement (GlyphArrangement&&);
GlyphArrangement& operator= (GlyphArrangement&&);
/** Destructor. */
~GlyphArrangement();


+ 15
- 5
modules/juce_gui_basics/native/juce_MultiTouchMapper.h View File

@@ -82,12 +82,22 @@ private:
struct TouchInfo
{
TouchInfo() noexcept : touchId (0), owner (nullptr) {}
TouchInfo (IDType idToUse, ComponentPeer* peer) noexcept : touchId (idToUse), owner (peer) {}
TouchInfo (const TouchInfo&) noexcept = default;
TouchInfo (TouchInfo&&) noexcept = default;
TouchInfo (IDType idToUse, ComponentPeer* peer) noexcept : touchId (idToUse), owner (peer) {}
TouchInfo& operator= (const TouchInfo&) noexcept = default;
TouchInfo& operator= (TouchInfo&&) noexcept = default;
TouchInfo (const TouchInfo&) = default;
TouchInfo& operator= (const TouchInfo&) = default;
// VS2013 can't default move constructors
TouchInfo (TouchInfo&& other) noexcept : touchId (other.touchId), owner (other.owner) {}
// VS2013 can't default move assignments
TouchInfo& operator= (TouchInfo&& other) noexcept
{
touchId = other.touchId;
owner = other.owner;
return *this;
}
IDType touchId;
ComponentPeer* owner;


+ 9
- 1
modules/juce_gui_basics/widgets/juce_TextEditor.cpp View File

@@ -74,7 +74,15 @@ public:
}
UniformTextSection (const UniformTextSection&) = default;
UniformTextSection (UniformTextSection&&) = default;
// VS2013 can't default move constructors
UniformTextSection (UniformTextSection&& other)
: font (static_cast<Font&&> (other.font)),
colour (other.colour),
atoms (static_cast<Array<TextAtom>&&> (other.atoms))
{
}
UniformTextSection& operator= (const UniformTextSection&) = delete;
void append (UniformTextSection& other, const juce_wchar passwordChar)


+ 2
- 6
modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp View File

@@ -126,13 +126,9 @@ public:
};
//==============================================================================
CodeDocument::Iterator::Iterator (const CodeDocument& doc) noexcept : document (&doc)
{
}
CodeDocument::Iterator::Iterator (const CodeDocument& doc) noexcept : document (&doc) {}
CodeDocument::Iterator::~Iterator() noexcept
{
}
CodeDocument::Iterator::~Iterator() noexcept {}
juce_wchar CodeDocument::Iterator::nextChar() noexcept
{


+ 2
- 2
modules/juce_gui_extra/code_editor/juce_CodeDocument.h View File

@@ -357,8 +357,8 @@ public:
{
public:
Iterator (const CodeDocument& document) noexcept;
Iterator (const Iterator&) noexcept = default;
Iterator& operator= (const Iterator&) noexcept = default;
Iterator (const Iterator&) = default;
Iterator& operator= (const Iterator&) = default;
~Iterator() noexcept;
/** Reads the next character and returns it.


Loading…
Cancel
Save