Skip to content

Commit

Permalink
Fix built-in plugin clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
medengineer committed Jul 4, 2024
1 parent 0c4b41f commit 5a3721c
Show file tree
Hide file tree
Showing 29 changed files with 105 additions and 70 deletions.
2 changes: 2 additions & 0 deletions Plugins/ArduinoOutput/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ add_sources(${PLUGIN_NAME}
)
if(MSVC)
target_link_libraries(${PLUGIN_NAME} Winmm.lib)
elseif(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.ArduinoOutput")
endif()

if(BUILD_TESTS)
Expand Down
6 changes: 3 additions & 3 deletions Plugins/ArduinoOutput/serial/ofArduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,10 @@ bool ofArduino::isInitialized()

// ------------------------------ private functions

void ofArduino::processData (unsigned char inputData)
void ofArduino::processData(unsigned char inputData)
{
char msg[100];
sprintf (msg, "Received Byte: %i", inputData);
snprintf(msg, sizeof(msg), "Received Byte: %i", inputData);
//Logger::get("Application").information(msg);

// we have command data
Expand Down Expand Up @@ -959,4 +959,4 @@ unsigned long ofArduino::ofGetSystemTimeMicros()
return timeGetTime() * 1000;
#endif
#endif
}
}
5 changes: 5 additions & 0 deletions Plugins/BandpassFilter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ add_sources(${PLUGIN_NAME}
BandpassFilterEditor.cpp
BandpassFilterEditor.h
)

if(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.BandpassFilter")
endif()

if(BUILD_TESTS)
add_subdirectory(Tests)
endif()
4 changes: 4 additions & 0 deletions Plugins/ChannelMap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ add_sources(
ChannelMapEditor.h
PrbFormat.h)

if(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.ChannelMap")
endif()

if(BUILD_TESTS)
add_subdirectory(Tests)
endif()
14 changes: 7 additions & 7 deletions Plugins/ChannelMap/ChannelMapActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class MapChannelsAction : public ProcessorAction
void restoreOwner (GenericProcessor* processor) override;

/** Perform the action*/
bool perform();
bool perform() override;

/** Undo the action*/
bool undo();
bool undo() override;

XmlElement* settings;

Expand All @@ -71,10 +71,10 @@ class EnableChannelAction : public ProcessorAction
void restoreOwner (GenericProcessor* processor) override;

/** Perform the action*/
bool perform();
bool perform() override;

/** Undo the action*/
bool undo();
bool undo() override;

XmlElement* settings;

Expand All @@ -98,10 +98,10 @@ class ResetStreamAction : public ProcessorAction
void restoreOwner (GenericProcessor* processor) override;

/** Perform the action*/
bool perform();
bool perform() override;

/** Undo the action*/
bool undo();
bool undo() override;

XmlElement* settings;

Expand All @@ -113,4 +113,4 @@ class ResetStreamAction : public ProcessorAction
Array<bool> channelStates;
};

#endif /* ChannelMapActions_h */
#endif /* ChannelMapActions_h */
2 changes: 1 addition & 1 deletion Plugins/ChannelMap/ChannelMapEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void ChannelMapEditor::mouseDrag (const MouseEvent& e)

dragImage.multiplyAllAlphas (0.6f);

startDragging (dragDescription, this, dragImage, false);
startDragging (dragDescription, this, ScaledImage (dragImage), false);
button->setVisible (false);
initialDraggedButton = electrodeButtons.indexOf (button);
lastHoverButton = initialDraggedButton;
Expand Down
4 changes: 4 additions & 0 deletions Plugins/CommonAvgRef/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ add_sources(${PLUGIN_NAME}
CommonAvgRefEditor.h
)

if(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.CommonAvgRef")
endif()

if(BUILD_TESTS)
add_subdirectory(Tests)
endif()
Expand Down
4 changes: 4 additions & 0 deletions Plugins/LfpViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ add_sources(${PLUGIN_NAME}
ColourSchemes/LightBackgroundColourScheme.h
)

if(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.LfpViewer")
endif()

if(BUILD_TESTS)
add_subdirectory(Tests)
endif()
Expand Down
4 changes: 2 additions & 2 deletions Plugins/LfpViewer/EventDisplayInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class EventDisplayInterface : public Component,
~EventDisplayInterface();

/** Renders the background */
void paintOverChildren (Graphics& g);
void paintOverChildren (Graphics& g) override;

/** Responds to button presses */
void buttonClicked (Button* button);
void buttonClicked (Button* button) override;

void resized() override;

Expand Down
2 changes: 1 addition & 1 deletion Plugins/LfpViewer/LfpChannelDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class LfpChannelDisplay : public Component
float depth;
bool isRecorded;

Font channelFont;
FontOptions channelFont;

Colour lineColour;

Expand Down
8 changes: 4 additions & 4 deletions Plugins/LfpViewer/LfpDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ class LfpDisplay : public Component,
Image lfpChannelBitmap;

/** Draws the full channel image */
void paint (Graphics& g);
void paint (Graphics& g) override;

/** Updates the channel image from the screen buffer*/
void refresh();

/** Updates the size and location of individual channels*/
void resized();
void resized() override;

/** Updates the number of displayed channels */
void setNumChannels (int numChannels);
Expand All @@ -84,10 +84,10 @@ class LfpDisplay : public Component,
void reactivateChannels();

/** Selects channels / switches to single channel mode on double click*/
void mouseDown (const MouseEvent& event);
void mouseDown (const MouseEvent& event) override;

/** Scrolls the display*/
void mouseWheelMove (const MouseEvent& event, const MouseWheelDetails& wheel);
void mouseWheelMove (const MouseEvent& event, const MouseWheelDetails& wheel) override;

/** Sets the display range for a particular channel type*/
void setRange (float range, ContinuousChannel::Type type);
Expand Down
2 changes: 1 addition & 1 deletion Plugins/LfpViewer/LfpDisplayCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ void LfpDisplaySplitter::updateScreenBuffer()
// std::cout << "Update screen buffer" << std::endl;

int triggerTime = triggerChannel >= 0
? processor->getLatestTriggerTime (splitID)
? int(processor->getLatestTriggerTime (splitID))
: -1;

int maxSamples = screenBufferWidth;
Expand Down
2 changes: 1 addition & 1 deletion Plugins/LfpViewer/LfpDisplayNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void LfpDisplayNode::handleTTLEvent (TTLEventPtr event)
const int eventChannel = event->getLine();
const uint16 eventStreamId = event->getChannelInfo()->getStreamId();
const int eventSourceNodeId = event->getChannelInfo()->getSourceNodeId();
const int eventTime = event->getSampleNumber() - getFirstSampleNumberForBlock (eventStreamId);
const int eventTime = int(event->getSampleNumber() - getFirstSampleNumberForBlock (eventStreamId));

//LOGD("LFP Viewer received: ", eventSourceNodeId, " ", eventId, " ", event->getSampleNumber(), " ", getFirstSampleNumberForBlock(eventStreamId));

Expand Down
2 changes: 1 addition & 1 deletion Plugins/LfpViewer/LfpTimescale.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class LfpTimescale : public Component,

bool isPaused;

Font font;
FontOptions font;

Array<String> labels;
Array<bool> isMajor;
Expand Down
4 changes: 4 additions & 0 deletions Plugins/PhaseDetector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ add_sources(${PLUGIN_NAME}
PhaseDetectorEditor.h
)

if(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.PhaseDetector")
endif()

if(BUILD_TESTS)
add_subdirectory(Tests)
endif()
4 changes: 4 additions & 0 deletions Plugins/RecordControl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ add_sources(${PLUGIN_NAME}
RecordControlEditor.h
)

if(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.RecordControl")
endif()

if(BUILD_TESTS)
add_subdirectory(Tests)
endif()
4 changes: 4 additions & 0 deletions Plugins/SpikeDetector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ add_sources(${PLUGIN_NAME}
SpikeDetectorActions.h
)

if(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.SpikeDetector")
endif()

if(BUILD_TESTS)
add_subdirectory(Tests)
endif()
6 changes: 3 additions & 3 deletions Plugins/SpikeDetector/PopupConfigurationWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ class PopupThresholdComponent : public PopupComponent,
void createSliders();

/** Responds to slider value changes */
void sliderValueChanged (Slider* slider);
void sliderValueChanged (Slider* slider) override;

/** Responds to button clicks */
void buttonClicked (Button* button);
void buttonClicked (Button* button) override;

/** Updates the view */
void updatePopup() override { repaint(); }
Expand Down Expand Up @@ -466,7 +466,7 @@ class PopupConfigurationWindow : public PopupComponent,
std::unique_ptr<TableListBox> electrodeTable;

/** Listens for viewport scrolling */
void scrollBarMoved (ScrollBar* scrollBar, double newRangeStart);
void scrollBarMoved (ScrollBar* scrollBar, double newRangeStart) override;

private:
SpikeDetectorEditor* editor;
Expand Down
8 changes: 4 additions & 4 deletions Plugins/SpikeDetector/SpikeDetectorActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class AddSpikeChannels : public ProcessorAction
void restoreOwner (GenericProcessor* processor) override;

/** Perform the action*/
bool perform();
bool perform() override;

/** Undo the action*/
bool undo();
bool undo() override;

XmlElement* settings;

Expand Down Expand Up @@ -87,10 +87,10 @@ class RemoveSpikeChannels : public ProcessorAction
void restoreOwner (GenericProcessor* processor) override;

/** Perform the action*/
bool perform();
bool perform() override;

/** Undo the action*/
bool undo();
bool undo() override;

std::unique_ptr<XmlElement> settings;

Expand Down
4 changes: 4 additions & 0 deletions Plugins/SpikeViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ add_sources(${PLUGIN_NAME}
SpikeDisplayNode.h
)

if(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.open-ephys.plugin.SpikeViewer")
endif()

if(BUILD_TESTS)
add_subdirectory(Tests)
endif()
4 changes: 2 additions & 2 deletions Plugins/SpikeViewer/SpikeDisplayCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ class SpikeDisplayCanvas : public Visualizer,
void setPlotScaleFactor (float scale);

/** Saves display parameters */
void saveCustomParametersToXml (XmlElement* xml);
void saveCustomParametersToXml (XmlElement* xml) override;

/** Loads display parameters */
void loadCustomParametersFromXml (XmlElement* xml);
void loadCustomParametersFromXml (XmlElement* xml) override;

/** Loads spike plot settings */
void loadSpikeDisplaySettingsFromXml (XmlElement* xml);
Expand Down
10 changes: 5 additions & 5 deletions Plugins/SpikeViewer/SpikePlots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,19 +502,19 @@ void GenericAxes::makeLabel (int val, int gain, bool convert, char* s)
if (abs (val) > 1e6)
{
//val = val/(1e6);
sprintf (s, "%.2fV", volt);
snprintf (s, sizeof(s), "%.2fV", volt);
}
else if (abs (val) > 1e3)
{
//val = val/(1e3);
sprintf (s, "%.2fmV", volt);
snprintf (s, sizeof(s), "%.2fmV", volt);
}
else
sprintf (s, "%.2fuV", volt);
snprintf (s, sizeof(s), "%.2fuV", volt);
}
else
{
sprintf (s, "%d", (int) val);
snprintf (s, sizeof(s), "%d", (int) val);
}
}

Expand Down Expand Up @@ -615,7 +615,7 @@ void WaveAxes::plotSpike (const Spike* s, Graphics& g)
// sample based upon which channel is getting plotted
int sampIdx = nSamples * channel;

int dataSize = s->getChannelInfo()->getDataSize();
int dataSize = int( s->getChannelInfo()->getDataSize() );

// prevent crashes when acquisition is not active,
// or immediately after acquisition starts
Expand Down
6 changes: 3 additions & 3 deletions Plugins/SpikeViewer/SpikePlots.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class SpikePlot : public Component,
void updateAxesPositions();

String name;
Font font;
FontOptions font;

CriticalSection spikeArrayLock;

Expand Down Expand Up @@ -228,7 +228,7 @@ class GenericAxes : public Component

const SpikePlotType type;

Font font;
FontOptions font;

Array<Colour> colours;

Expand Down Expand Up @@ -310,7 +310,7 @@ class WaveAxes : public GenericAxes

int spikesReceivedSinceLastRedraw;

Font font;
FontOptions font;

OwnedArray<Spike> spikeBuffer;

Expand Down
Loading

0 comments on commit 5a3721c

Please sign in to comment.