diff --git a/Software/PC_Application/Calibration/amplitudecaldialog.cpp b/Software/PC_Application/Calibration/amplitudecaldialog.cpp index 856f6ad..1cb732c 100644 --- a/Software/PC_Application/Calibration/amplitudecaldialog.cpp +++ b/Software/PC_Application/Calibration/amplitudecaldialog.cpp @@ -479,19 +479,19 @@ AmplitudeModel::AmplitudeModel(AmplitudeCalDialog *c) : { } -int AmplitudeModel::rowCount(const QModelIndex &parent) const +int AmplitudeModel::rowCount(const QModelIndex &) const { return c->getPoints().size(); } -int AmplitudeModel::columnCount(const QModelIndex &parent) const +int AmplitudeModel::columnCount(const QModelIndex &) const { return ColIndexLast; } QVariant AmplitudeModel::data(const QModelIndex &index, int role) const { - if(role == Qt::DisplayRole && index.row() < c->getPoints().size()) { + if(role == Qt::DisplayRole && static_cast(index.row()) < c->getPoints().size()) { auto p = c->getPoints()[index.row()]; switch(index.column()) { case ColIndexFreq: @@ -519,7 +519,7 @@ QVariant AmplitudeModel::data(const QModelIndex &index, int role) const return QVariant(); } -bool AmplitudeModel::setData(const QModelIndex &index, const QVariant &value, int role) +bool AmplitudeModel::setData(const QModelIndex &index, const QVariant &value, int) { if((unsigned int) index.row() >= c->getPoints().size()) { return false; diff --git a/Software/PC_Application/Tools/eseries.cpp b/Software/PC_Application/Tools/eseries.cpp index fe5aefe..2f31118 100644 --- a/Software/PC_Application/Tools/eseries.cpp +++ b/Software/PC_Application/Tools/eseries.cpp @@ -20,7 +20,7 @@ static const std::vector E96 = { double ESeries::ToESeries(double value, ESeries::Series s, ESeries::Type t) { - if(s == Series::Ideal) { + if(s == Series::Ideal || value <= 0) { // nothing to do return value; } @@ -45,7 +45,7 @@ double ESeries::ToESeries(double value, ESeries::Series s, ESeries::Type t) if(index < series.size()) { higher = series[index]; } - double approximation; + double approximation = 0; switch(t) { case Type::Lower: approximation = lower; break; case Type::Higher: approximation = higher; break; diff --git a/Software/PC_Application/Tools/impedancematchdialog.cpp b/Software/PC_Application/Tools/impedancematchdialog.cpp index 35d6d0c..dd45a79 100644 --- a/Software/PC_Application/Tools/impedancematchdialog.cpp +++ b/Software/PC_Application/Tools/impedancematchdialog.cpp @@ -111,7 +111,7 @@ void ImpedanceMatchDialog::calculateMatch() // convert X and B to inductor and capacitor bool twoCs = false; bool twoLs = false; - double L, C, C2, L2; + double L = 0, C = 0, C2 = 0, L2 = 0; if(X >= 0) { L = X/(2*M_PI*freq); if(B > 0) { diff --git a/Software/PC_Application/Traces/traceeditdialog.cpp b/Software/PC_Application/Traces/traceeditdialog.cpp index 31e9405..79c1c88 100644 --- a/Software/PC_Application/Traces/traceeditdialog.cpp +++ b/Software/PC_Application/Traces/traceeditdialog.cpp @@ -110,8 +110,8 @@ void TraceEditDialog::on_buttonBox_accepted() auto t = ui->touchstoneImport->getTouchstone(); trace.fillFromTouchstone(t, ui->CParameter->currentIndex(), ui->touchstoneImport->getFilename()); } else { - Trace::LivedataType type; - Trace::LiveParameter param; + Trace::LivedataType type = Trace::LivedataType::Overwrite; + Trace::LiveParameter param = Trace::LiveParameter::S11; switch(ui->CLiveType->currentIndex()) { case 0: type = Trace::LivedataType::Overwrite; break; case 1: type = Trace::LivedataType::MaxHold; break; diff --git a/Software/PC_Application/Traces/traceexportdialog.cpp b/Software/PC_Application/Traces/traceexportdialog.cpp index 873c926..5816d22 100644 --- a/Software/PC_Application/Traces/traceexportdialog.cpp +++ b/Software/PC_Application/Traces/traceexportdialog.cpp @@ -80,14 +80,14 @@ void TraceExportDialog::on_buttonBox_accepted() } t.AddDatapoint(tData); } - Touchstone::Unit unit; + Touchstone::Unit unit = Touchstone::Unit::GHz; switch(ui->cUnit->currentIndex()) { case 0: unit = Touchstone::Unit::Hz; break; case 1: unit = Touchstone::Unit::kHz; break; case 2: unit = Touchstone::Unit::MHz; break; case 3: unit = Touchstone::Unit::GHz; break; } - Touchstone::Format format; + Touchstone::Format format = Touchstone::Format::RealImaginary; switch(ui->cFormat->currentIndex()) { case 0: format = Touchstone::Format::DBAngle; break; case 1: format = Touchstone::Format::MagnitudeAngle; break; diff --git a/Software/PC_Application/Traces/tracemarkermodel.cpp b/Software/PC_Application/Traces/tracemarkermodel.cpp index 9a8842d..9a45cf0 100644 --- a/Software/PC_Application/Traces/tracemarkermodel.cpp +++ b/Software/PC_Application/Traces/tracemarkermodel.cpp @@ -268,7 +268,7 @@ TraceMarker *TraceMarkerModel::markerFromIndex(const QModelIndex &index) const } } -QSize MarkerTraceDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const +QSize MarkerTraceDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { return QSize(0, rowHeight); } @@ -307,12 +307,12 @@ void MarkerTraceDelegate::setModelData(QWidget *editor, QAbstractItemModel *mode markerModel->setData(index, c->itemData(c->currentIndex())); } -QSize MarkerSettingsDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const +QSize MarkerSettingsDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { return QSize(0, rowHeight); } -QWidget *MarkerSettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const +QWidget *MarkerSettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const { auto marker = static_cast(index.model())->markerFromIndex(index); marker->editingFrequeny = true; @@ -331,17 +331,16 @@ QWidget *MarkerSettingsDelegate::createEditor(QWidget *parent, const QStyleOptio void MarkerSettingsDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { auto markerModel = (TraceMarkerModel*) model; - auto marker = markerModel->markerFromIndex(index); auto si = (SIUnitEdit*) editor; markerModel->setData(index, si->value()); } -QSize MarkerTypeDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const +QSize MarkerTypeDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { return QSize(0, rowHeight); } -QWidget *MarkerTypeDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const +QWidget *MarkerTypeDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const { auto marker = static_cast(index.model())->markerFromIndex(index); auto editor = marker->getTypeEditor(const_cast(this)); @@ -350,7 +349,7 @@ QWidget *MarkerTypeDelegate::createEditor(QWidget *parent, const QStyleOptionVie return editor; } -void MarkerTypeDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const +void MarkerTypeDelegate::setModelData(QWidget *editor, QAbstractItemModel *, const QModelIndex &index) const { auto marker = static_cast(index.model())->markerFromIndex(index); marker->updateTypeFromEditor(editor); diff --git a/Software/PC_Application/Traces/tracesmithchart.h b/Software/PC_Application/Traces/tracesmithchart.h index 125cd9a..3b56748 100644 --- a/Software/PC_Application/Traces/tracesmithchart.h +++ b/Software/PC_Application/Traces/tracesmithchart.h @@ -3,6 +3,7 @@ #include "traceplot.h" #include +#include class TraceSmithChart : public TracePlot { diff --git a/Software/PC_Application/Traces/tracexyplot.cpp b/Software/PC_Application/Traces/tracexyplot.cpp index b6edfb5..e410dba 100644 --- a/Software/PC_Application/Traces/tracexyplot.cpp +++ b/Software/PC_Application/Traces/tracexyplot.cpp @@ -449,7 +449,8 @@ void TraceXYPlot::updateXAxis() auto trace = t.first; if(enabled && trace->isVisible()) { // this trace is currently displayed - double trace_min, trace_max; + double trace_min = std::numeric_limits::max(); + double trace_max = std::numeric_limits::lowest(); switch(XAxis.type) { case XAxisType::Frequency: trace_min = trace->minFreq(); diff --git a/Software/PC_Application/main.cpp b/Software/PC_Application/main.cpp index 373d46a..53e8549 100644 --- a/Software/PC_Application/main.cpp +++ b/Software/PC_Application/main.cpp @@ -14,4 +14,5 @@ int main(int argc, char *argv[]) { vna.resize(1280, 800); vna.show(); a.exec(); + return 0; } diff --git a/Software/VNA_embedded/Application/Communication/Protocol.cpp b/Software/VNA_embedded/Application/Communication/Protocol.cpp index 4e64a66..d46e98c 100644 --- a/Software/VNA_embedded/Application/Communication/Protocol.cpp +++ b/Software/VNA_embedded/Application/Communication/Protocol.cpp @@ -152,7 +152,8 @@ static Protocol::Datapoint DecodeDatapoint(uint8_t *buf) { } static int16_t EncodeDatapoint(Protocol::Datapoint d, uint8_t *buf, uint16_t bufSize) { - // Special case, bypassing the encoder for speed optimizations. + (void) bufSize; + // Special case, bypassing the encoder for speed optimizations. // The datapoint is only ever encoded on the device and the // Protocol::Datapoint struct is setup without any padding between // the variables. In this case it is allowed to simply copy its