Skip to content

Commit

Permalink
Fixed warnings on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ffAudio committed Mar 30, 2021
1 parent d0eeec7 commit e9b4e2b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions Editor/foleys_StyleColourPropertyComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ juce::Colour StyleColourPropertyComponent::ColourPanel::ColourSelectorWithSwatch
return swatchColours [size_t (index)];
}

void StyleColourPropertyComponent::ColourPanel::ColourSelectorWithSwatches::setSwatchColour (int index, const juce::Colour& colour)
void StyleColourPropertyComponent::ColourPanel::ColourSelectorWithSwatches::setSwatchColour (int index, const juce::Colour& newColour)
{
swatchColours [size_t (index)] = colour;
swatchColours [size_t (index)] = newColour;
}

void StyleColourPropertyComponent::ColourPanel::ColourSelectorWithSwatches::loadSwatches()
Expand All @@ -281,8 +281,8 @@ void StyleColourPropertyComponent::ColourPanel::ColourSelectorWithSwatches::save
coloursNode->deleteAllChildElements();
for (int i = 0; i < int (swatchColours.size()); ++i)
{
auto* node = coloursNode->createNewChildElement (IDs::colour);
node->addTextElement (swatchColours [size_t (i)].toDisplayString (true));
auto* colourNode = coloursNode->createNewChildElement (IDs::colour);
colourNode->addTextElement (swatchColours [size_t (i)].toDisplayString (true));
}

p->setValue (IDs::swatches, coloursNode.get());
Expand Down
8 changes: 4 additions & 4 deletions Editor/foleys_StyleGradientPropertyComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ juce::Colour StyleGradientPropertyComponent::GradientPanel::ColourSelectorWithSw
return swatchColours [size_t (index)];
}

void StyleGradientPropertyComponent::GradientPanel::ColourSelectorWithSwatches::setSwatchColour (int index, const juce::Colour& colour)
void StyleGradientPropertyComponent::GradientPanel::ColourSelectorWithSwatches::setSwatchColour (int index, const juce::Colour& newColour)
{
swatchColours [size_t (index)] = colour;
swatchColours [size_t (index)] = newColour;
}

void StyleGradientPropertyComponent::GradientPanel::ColourSelectorWithSwatches::loadSwatches()
Expand All @@ -267,8 +267,8 @@ void StyleGradientPropertyComponent::GradientPanel::ColourSelectorWithSwatches::
coloursNode->deleteAllChildElements();
for (int i = 0; i < int (swatchColours.size()); ++i)
{
auto* node = coloursNode->createNewChildElement (IDs::colour);
node->addTextElement (swatchColours [size_t (i)].toDisplayString (true));
auto* colourNode = coloursNode->createNewChildElement (IDs::colour);
colourNode->addTextElement (swatchColours [size_t (i)].toDisplayString (true));
}

p->setValue (IDs::swatches, coloursNode.get());
Expand Down
12 changes: 6 additions & 6 deletions Editor/foleys_ToolBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ juce::File ToolBox::getLastLocation() const
{
juce::File lastLocation;

juce::ApplicationProperties properties;
properties.setStorageParameters (ToolBox::getApplicationPropertyStorage());
if (auto* p = properties.getUserSettings())
juce::ApplicationProperties appProperties;
appProperties.setStorageParameters (ToolBox::getApplicationPropertyStorage());
if (auto* p = appProperties.getUserSettings())
lastLocation = juce::File (p->getValue (IDs::lastLocation));

if (lastLocation.exists())
Expand All @@ -390,9 +390,9 @@ juce::File ToolBox::getLastLocation() const

void ToolBox::setLastLocation(juce::File file)
{
juce::ApplicationProperties properties;
properties.setStorageParameters (ToolBox::getApplicationPropertyStorage());
if (auto* p = properties.getUserSettings())
juce::ApplicationProperties appProperties;
appProperties.setStorageParameters (ToolBox::getApplicationPropertyStorage());
if (auto* p = appProperties.getUserSettings())
p->setValue (IDs::lastLocation, file.getFullPathName());
}

Expand Down
2 changes: 1 addition & 1 deletion General/foleys_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

namespace BinaryDataFallbacks {
const int namedResourceListSize = 0;
const char* namedResourceList[]{};
const char** namedResourceList = nullptr;
const char* getNamedResource(const char*, int&) { return nullptr; }
} // namespace BinaryDataFallbacks

Expand Down
2 changes: 1 addition & 1 deletion Layout/foleys_Decorator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Decorator::ClientBounds Decorator::getClientBounds (juce::Rectangle<int> overall
else
{
juce::Font f (captionSize * 0.8f);
auto w = f.getStringWidth (caption);
auto w = float (f.getStringWidth (caption));

if (justification.getOnlyHorizontalFlags() & juce::Justification::left)
captionBox = box.removeFromLeft (w).toNearestInt();
Expand Down
4 changes: 2 additions & 2 deletions Layout/foleys_GuiItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ void GuiItem::updateInternal()
{
auto& stylesheet = magicBuilder.getStylesheet();

if (auto* lookAndFeel = stylesheet.getLookAndFeel (configNode))
setLookAndFeel (lookAndFeel);
if (auto* newLookAndFeel = stylesheet.getLookAndFeel (configNode))
setLookAndFeel (newLookAndFeel);

decorator.configure (magicBuilder, configNode);
configureComponent();
Expand Down
14 changes: 7 additions & 7 deletions State/foleys_MagicProcessorState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ bool MagicProcessorState::getLastEditorSize (int& width, int& height)

void MagicProcessorState::getStateInformation (juce::MemoryBlock& destData)
{
auto state = getValueTree();
parameters.saveParameterValues (state);
auto newState = getValueTree();
parameters.saveParameterValues (newState);

juce::MemoryOutputStream stream (destData, false);
state.writeToStream (stream);
newState.writeToStream (stream);
}

void MagicProcessorState::setStateInformation (const void* data, int sizeInBytes, juce::AudioProcessorEditor* editor)
Expand All @@ -155,13 +155,13 @@ void MagicProcessorState::setStateInformation (const void* data, int sizeInBytes
if (tree.isValid() == false)
return;

auto state = getValueTree();
if (state.getType() != tree.getType())
auto newState = getValueTree();
if (newState.getType() != tree.getType())
return;

state.copyPropertiesAndChildrenFrom (tree, nullptr);
newState.copyPropertiesAndChildrenFrom (tree, nullptr);

parameters.loadParameterValues (state);
parameters.loadParameterValues (newState);

if (editor)
{
Expand Down

0 comments on commit e9b4e2b

Please sign in to comment.