mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-13 12:42:20 +00:00
Remove unused variables and parameter warnings (#4767)
Remove the following types of build warnings: warning C4189: local variable is initialized but not referenced warning C4100: unreferenced parameter warning C4101: unreferenced local variable I have only commented out unused variables and used [[maybe_unused]] for unused parameters.
This commit is contained in:
@@ -1018,8 +1018,7 @@ namespace gte
|
||||
|
||||
for (int i = 1; i <= input.numUniqueKnots - 2; ++i)
|
||||
{
|
||||
int mult = mUniqueKnots[i].multiplicity;
|
||||
LogAssert(mult >= 1 && mult <= mDegree + 1, "Invalid interior multiplicity.");
|
||||
LogAssert(mUniqueKnots[i].multiplicity >= 1 && mUniqueKnots[i].multiplicity <= mDegree + 1, "Invalid interior multiplicity.");
|
||||
}
|
||||
|
||||
mOpen = (mult0 == mult1 && mult0 == mDegree + 1);
|
||||
|
||||
@@ -30,7 +30,7 @@ void Kmeans::free() {
|
||||
|
||||
|
||||
|
||||
void Kmeans::initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, int aNumThreads) {
|
||||
void Kmeans::initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, [[maybe_unused]] int aNumThreads) {
|
||||
free();
|
||||
|
||||
converged = false;
|
||||
@@ -82,7 +82,7 @@ struct ThreadInfo {
|
||||
};
|
||||
#endif
|
||||
|
||||
void *Kmeans::runner(void *args) {
|
||||
void *Kmeans::runner([[maybe_unused]] void *args) {
|
||||
#ifdef USE_THREADS
|
||||
ThreadInfo *ti = (ThreadInfo *)args;
|
||||
ti->numIterations = ti->km->runThread(ti->threadId, ti->maxIterations);
|
||||
@@ -125,7 +125,7 @@ double Kmeans::getSSE() const {
|
||||
return sse;
|
||||
}
|
||||
|
||||
void Kmeans::verifyAssignment(int iteration, int startNdx, int endNdx) const {
|
||||
void Kmeans::verifyAssignment([[maybe_unused]] int iteration, [[maybe_unused]] int startNdx, [[maybe_unused]] int endNdx) const {
|
||||
#ifdef VERIFY_ASSIGNMENTS
|
||||
for (int i = startNdx; i < endNdx; ++i) {
|
||||
// keep track of the squared distance and identity of the closest-seen
|
||||
|
||||
@@ -778,12 +778,12 @@ Voronoi::line(float ax, float ay, float bx, float by)
|
||||
}
|
||||
|
||||
void
|
||||
Voronoi::circle(float ax, float ay, float radius)
|
||||
Voronoi::circle([[maybe_unused]] float ax, [[maybe_unused]] float ay, [[maybe_unused]] float radius)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Voronoi::range(float pxmin, float pxmax, float pymin, float pymax)
|
||||
Voronoi::range([[maybe_unused]] float pxmin, [[maybe_unused]] float pxmax, [[maybe_unused]] float pymin, [[maybe_unused]] float pymax)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1302,7 +1302,7 @@ int ANT::rawWrite(uint8_t *bytes, int size) // unix!!
|
||||
|
||||
}
|
||||
|
||||
int ANT::rawRead(uint8_t bytes[], int size)
|
||||
int ANT::rawRead([[maybe_unused]] uint8_t bytes[], [[maybe_unused]] int size)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef GC_HAVE_LIBUSB
|
||||
|
||||
@@ -375,7 +375,7 @@ ANTMessage::ANTMessage(ANT *parent, const unsigned char *message) {
|
||||
{
|
||||
|
||||
// page no is first 7 bits, page change toggle is bit 8
|
||||
bool page_toggle = data_page&128;
|
||||
// bool page_toggle = data_page&128;
|
||||
data_page &= 127;
|
||||
|
||||
// Heartrate is fairly simple. Although
|
||||
|
||||
@@ -479,7 +479,7 @@ GenericSelectTool::clicked(QPointF pos)
|
||||
}
|
||||
|
||||
bool
|
||||
GenericSelectTool::released(QPointF /* pos */)
|
||||
GenericSelectTool::released([[maybe_unused]] QPointF pos)
|
||||
{
|
||||
if (mode == RECTANGLE || mode == XRANGE) {
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ CloudService::uncompressRide(QByteArray *data, QString name, QStringList &errors
|
||||
}
|
||||
|
||||
void
|
||||
CloudService::sslErrors(QWidget* parent, QNetworkReply* reply ,QList<QSslError> errors)
|
||||
CloudService::sslErrors(QWidget* parent, [[maybe_unused]] QNetworkReply* reply ,QList<QSslError> errors)
|
||||
{
|
||||
QString errorString = "";
|
||||
foreach (const QSslError e, errors ) {
|
||||
|
||||
@@ -432,7 +432,7 @@ CalendarDetailedDayDelegate::paint
|
||||
int iconWidth = 0;
|
||||
if (height >= lineHeight && columnWidth >= lineHeight) {
|
||||
QColor pixmapColor(entry.color);
|
||||
int headlineOffset = 0;
|
||||
// int headlineOffset = 0;
|
||||
if (height >= 2 * lineHeight + priSecSpacing && columnWidth >= 2 * lineHeight + priSecSpacing) {
|
||||
iconWidth = 2 * lineHeight + priSecSpacing;
|
||||
} else {
|
||||
@@ -595,9 +595,9 @@ CalendarHeadlineDelegate::paint
|
||||
const int leftMargin = 4 * dpiXFactor;
|
||||
const int rightMargin = 4 * dpiXFactor;
|
||||
const int topMargin = 2 * dpiYFactor;
|
||||
const int bottomMargin = 4 * dpiYFactor;
|
||||
// const int bottomMargin = 4 * dpiYFactor;
|
||||
const int lineSpacing = 2 * dpiYFactor;
|
||||
const int iconSpacing = 2 * dpiXFactor;
|
||||
// const int iconSpacing = 2 * dpiXFactor;
|
||||
const int radius = 4 * dpiXFactor;
|
||||
|
||||
// Headline: Date, Phases and Events
|
||||
@@ -1289,7 +1289,7 @@ AgendaEntryDelegate::paint
|
||||
QFontMetrics line1FM(line1Font);
|
||||
const int lineSpacing = attributes.lineSpacing * dpiYFactor;
|
||||
const int lineHeight = line1FM.height();
|
||||
const int radius = 4 * dpiXFactor;
|
||||
// const int radius = 4 * dpiXFactor;
|
||||
const int iconInnerSpacing = 4 * dpiXFactor;
|
||||
const int iconTextSpacing = attributes.iconTextSpacing * dpiXFactor;
|
||||
const int iconWidth = 2 * lineHeight + lineSpacing;
|
||||
@@ -1382,7 +1382,7 @@ AgendaEntryDelegate::sizeHint
|
||||
const int iconWidth = 2 * lineHeight + lineSpacing;
|
||||
int tertiaryWidth = width - iconWidth - attributes.iconTextSpacing * dpiXFactor - attributes.padding.left() - attributes.padding.right();
|
||||
int numLines;
|
||||
int tertiary;
|
||||
// int tertiary;
|
||||
layoutTertiaryText(entry.tertiary, option.font, tertiaryWidth, numLines, tertiaryHeight, nullptr, true);
|
||||
tertiaryHeight += 2 * lineSpacing;
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ ListEditDelegate::setDisplayLength
|
||||
|
||||
QWidget*
|
||||
ListEditDelegate::createEditor
|
||||
(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
([[maybe_unused]] QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(index)
|
||||
|
||||
@@ -220,8 +220,8 @@ void PMCData::refresh()
|
||||
//
|
||||
// STEP TWO What are the seedings and ride values
|
||||
//
|
||||
const double lte = (double)exp(-1.0/ltsDays_);
|
||||
const double ste = (double)exp(-1.0/stsDays_);
|
||||
// const double lte = (double)exp(-1.0/ltsDays_);
|
||||
// const double ste = (double)exp(-1.0/stsDays_);
|
||||
|
||||
// clear what's there
|
||||
stress_.fill(0);
|
||||
|
||||
Reference in New Issue
Block a user