Skip to content

Commit

Permalink
src/pmview: reduce the number of compilation warnings
Browse files Browse the repository at this point in the history
Down to a handful that I don't know how to fix.

Sadly, the pmview application still does not work worth a crumpet.
  • Loading branch information
kmcdonell committed Aug 25, 2023
1 parent 5cfc67d commit d05d248
Show file tree
Hide file tree
Showing 23 changed files with 141 additions and 143 deletions.
28 changes: 14 additions & 14 deletions src/pmview/barmod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ BarMod::BarMod(MetricList *metrics,
SoNode *obj,
BarMod::Direction dir,
BarMod::Grouping group,
float xScale, float yScale, float zScale,
float xScale, float __yScale, float zScale,
float xSpace, float zSpace)
: Modulate(metrics),
_blocks(),
Expand All @@ -49,7 +49,7 @@ BarMod::BarMod(MetricList *metrics,
_infoMetric(0),
_infoInst(0),
_xScale(xScale),
_yScale(yScale),
_yScale(__yScale),
_zScale(zScale)
{
generate(obj, xSpace, zSpace);
Expand All @@ -61,7 +61,7 @@ BarMod::BarMod(MetricList *metrics,
BarMod::Direction dir,
BarMod::Modulation mod,
BarMod::Grouping group,
float xScale, float yScale, float zScale,
float xScale, float __yScale, float zScale,
float xSpace, float zSpace)
: Modulate(metrics),
_blocks(),
Expand All @@ -74,7 +74,7 @@ BarMod::BarMod(MetricList *metrics,
_infoMetric(0),
_infoInst(0),
_xScale(xScale),
_yScale(yScale),
_yScale(__yScale),
_zScale(zScale)
{
generate(obj, xSpace, zSpace);
Expand Down Expand Up @@ -136,7 +136,7 @@ BarMod::generate(SoNode *obj, float xSpace, float zSpace)
add();
if (pmDebugOptions.appl2)
cerr << "BarMod::generate: Added " << numValues << " in " << _cols
<< " cols and " << _rows << " rows." << endl;
<< " cols and " << _rows << " rows." << Qt::endl;

}

Expand Down Expand Up @@ -224,7 +224,7 @@ BarMod::selectAll()
theModList->selectAllId(_root, _blocks.size());

if (pmDebugOptions.appl2)
cerr << "BarMod::selectAll" << endl;
cerr << "BarMod::selectAll" << Qt::endl;

for (i = 0; i < _blocks.size(); i++) {
if (_blocks[i]._selected == false) {
Expand All @@ -247,7 +247,7 @@ BarMod::select(SoPath *path)

if (pmDebugOptions.appl2)
cerr << "BarMod::select: value = " << value
<< ", count = " << _selectCount << endl;
<< ", count = " << _selectCount << Qt::endl;
}
return _selectCount;
}
Expand All @@ -264,12 +264,12 @@ BarMod::remove(SoPath *path)

if (pmDebugOptions.appl2)
cerr << "BarMod::remove: value = " << value
<< ", count = " << _selectCount << endl;
<< ", count = " << _selectCount << Qt::endl;
}

else if (pmDebugOptions.appl2)
cerr << "BarMod::remove: did not remove " << value
<< ", count = " << _selectCount << endl;
<< ", count = " << _selectCount << Qt::endl;

return _selectCount;
}
Expand Down Expand Up @@ -297,7 +297,7 @@ void BarMod::infoText(QString &str, bool selected) const
if (v >= _blocks.size()) {
if (pmDebugOptions.appl2)
cerr << "BarMod::infoText: infoText requested but nothing selected"
<< endl;
<< Qt::endl;
str = "";
}
else {
Expand Down Expand Up @@ -436,9 +436,9 @@ BarMod::dump(QTextStream &os) const
os << ", Color & Y-Scale: ";

if (status() < 0)
os << "Invalid metrics: " << pmErrStr(status()) << endl;
os << "Invalid metrics: " << pmErrStr(status()) << Qt::endl;
else {
os << endl;
os << Qt::endl;
for (m = 0, v = 0; m < _metrics->numMetrics(); m++) {
QmcMetric &metric = _metrics->metric(m);
for (i = 0; i < metric.numValues(); i++, v++) {
Expand Down Expand Up @@ -474,7 +474,7 @@ BarMod::findBlock(SoPath *path, int &metric, int &inst,
if (i >= 0) {

if (pmDebugOptions.appl2)
cerr << "BarMod::findBlock: Bar id = " << str << endl;
cerr << "BarMod::findBlock: Bar id = " << str << Qt::endl;

sscanf(str, "%c%d", &c, &value);

Expand Down Expand Up @@ -506,7 +506,7 @@ BarMod::findBlock(SoPath *path, int &metric, int &inst,

if (pmDebugOptions.appl2)
cerr << "BarMod::findBlock: metric = " << metric
<< ", inst = " << inst << ", value = " << value << endl;
<< ", inst = " << inst << ", value = " << value << Qt::endl;

return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/pmview/barmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class BarMod : public Modulate
SoNode *obj,
BarMod::Direction dir,
BarMod::Grouping group,
float xScale, float yScale, float zScale,
float xScale, float __yScale, float zScale,
float xSpace, float zSpace);

BarMod(MetricList *list,
Expand All @@ -82,7 +82,7 @@ class BarMod : public Modulate
BarMod::Direction dir,
BarMod::Modulation mod,
BarMod::Grouping group,
float xScale, float yScale, float zScale,
float xScale, float __yScale, float zScale,
float xSpace, float zSpace);

Direction dir() const
Expand Down
20 changes: 10 additions & 10 deletions src/pmview/barobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ BarObj::finishedAdd()
int numInstLabels = 0;

if (pmDebugOptions.appl0)
cerr << "BarObj::finishedAdd:" << endl;
cerr << "BarObj::finishedAdd:" << Qt::endl;

if (_metrics.numMetrics() == 0) {
BaseObj::addBase(_root);
Expand Down Expand Up @@ -266,8 +266,8 @@ BarObj::finishedAdd()
0.0);

if (pmDebugOptions.appl0)
cerr << "BarObj::finishedAdd: metric list = " << endl
<< _metrics << endl;
cerr << "BarObj::finishedAdd: metric list = " << Qt::endl
<< _metrics << Qt::endl;

if (_metrics.numMetrics())
ViewObj::theNumModObjects++;
Expand Down Expand Up @@ -303,7 +303,7 @@ BarObj::display(QTextStream& os) const
BaseObj::display(os);

if (_bars == NULL) {
os << "No valid metrics" << endl;
os << "No valid metrics" << Qt::endl;
return;
}

Expand Down Expand Up @@ -366,7 +366,7 @@ BarObj::calcLabels(const QStringList &labels, LabelSide side, int numLabels)
default:
break;
}
cerr << " side" << endl;
cerr << " side" << Qt::endl;
}

// Create the text objects so that we know how big they are
Expand All @@ -385,7 +385,7 @@ BarObj::calcLabels(const QStringList &labels, LabelSide side, int numLabels)

if (pmDebugOptions.appl0)
cerr << "BarObj::calcLabels: maxWidth = " << maxWidth
<< ", maxDepth = " << maxDepth << endl;
<< ", maxDepth = " << maxDepth << Qt::endl;

// Determine if the size of the bars will need to be increased

Expand All @@ -396,7 +396,7 @@ BarObj::calcLabels(const QStringList &labels, LabelSide side, int numLabels)

if (pmDebugOptions.appl0)
cerr << "BarObj::calcLabels: length (width) increased to "
<< _length << endl;
<< _length << Qt::endl;

}
}
Expand All @@ -407,7 +407,7 @@ BarObj::calcLabels(const QStringList &labels, LabelSide side, int numLabels)

if (pmDebugOptions.appl0)
cerr << "BarObj::calcLabels: length (depth) increased to "
<< _length << endl;
<< _length << Qt::endl;
}
}
return text;
Expand Down Expand Up @@ -440,7 +440,7 @@ BarObj::doLabels(Text **text, LabelSide side, int numLabels)
default:
break;
}
cerr << " side" << endl;
cerr << " side" << Qt::endl;
}

sep->addChild(tran);
Expand Down Expand Up @@ -477,7 +477,7 @@ BarObj::doLabels(Text **text, LabelSide side, int numLabels)
float x, y, z;
tran->translation.getValue().getValue(x, y, z);
cerr << "BarObj::doLabels: translation set to " << x << ',' << y
<< ',' << z << endl;
<< ',' << z << Qt::endl;
}

// Add each label to the scene graph
Expand Down
2 changes: 1 addition & 1 deletion src/pmview/colorlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ operator<<(QTextStream& os, ColorList const& rhs)
os << ' ';
}
}
os << endl;
os << Qt::endl;
}
return os;
}
Expand Down
8 changes: 4 additions & 4 deletions src/pmview/colormod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ColorMod::ColorMod(const char *metric, double scale,
add();
if (pmDebugOptions.appl2)
cerr << "ColorMod: Added " << metric << " (Id = "
<< _root->getName().getString() << ")" << endl;
<< _root->getName().getString() << ")" << Qt::endl;
}
else if (_metrics->numValues() > 1) {
warningMsg(_POS_,
Expand Down Expand Up @@ -93,7 +93,7 @@ ColorMod::dump(QTextStream &os) const
{
os << "ColorMod: ";
if (status() < 0)
os << "Invalid Metric: " << pmErrStr(status()) << endl;
os << "Invalid Metric: " << pmErrStr(status()) << Qt::endl;
else {
os << "state = ";
dumpState(os, _state);
Expand Down Expand Up @@ -138,14 +138,14 @@ int
ColorMod::select(SoPath *)
{
if (pmDebugOptions.appl2)
cerr << "ColorMod::select: " << _metrics->metric(0) << endl;
cerr << "ColorMod::select: " << _metrics->metric(0) << Qt::endl;
return 1;
}

int
ColorMod::remove(SoPath *)
{
if (pmDebugOptions.appl2)
cerr << "ColorMod::remove: " << _metrics->metric(0) << endl;
cerr << "ColorMod::remove: " << _metrics->metric(0) << Qt::endl;
return 0;
}
8 changes: 4 additions & 4 deletions src/pmview/colorscalemod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ColorScaleMod::ColorScaleMod(const char *metric, double scale,

if (pmDebugOptions.appl2)
cerr << "ColorScaleMod: Added " << metric << " (Id = "
<< _root->getName().getString() << ")" << endl;
<< _root->getName().getString() << ")" << Qt::endl;
}
else if (_metrics->numValues() > 1) {
warningMsg(_POS_,
Expand Down Expand Up @@ -120,7 +120,7 @@ ColorScaleMod::dump(QTextStream &os) const
{
os << "ColorScaleMod: ";
if (status() < 0)
os << "Invalid Metric: " << pmErrStr(status()) << endl;
os << "Invalid Metric: " << pmErrStr(status()) << Qt::endl;
else {
os << "state = ";
dumpState(os, _state);
Expand Down Expand Up @@ -168,14 +168,14 @@ int
ColorScaleMod::select(SoPath *)
{
if (pmDebugOptions.appl2)
cerr << "ColorScaleMod::select: " << _metrics->metric(0) << endl;
cerr << "ColorScaleMod::select: " << _metrics->metric(0) << Qt::endl;
return 1;
}

int
ColorScaleMod::remove(SoPath *)
{
if (pmDebugOptions.appl2)
cerr << "ColorScaleMod::remove: " << _metrics->metric(0) << endl;
cerr << "ColorScaleMod::remove: " << _metrics->metric(0) << Qt::endl;
return 0;
}
8 changes: 4 additions & 4 deletions src/pmview/defaultobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ operator<<(QTextStream &os, const DefaultObj &rhs)
os << ", baseBorderZ=" << rhs._baseBorderZ;
os << ", baseHeight=" << rhs._baseHeight;
os << ", baseColor=" << rhs._baseColor[0] << ',' << rhs._baseColor[1]
<< ',' << rhs._baseColor[2] << endl;
<< ',' << rhs._baseColor[2] << Qt::endl;
os << ", barSpaceX=" << rhs._barSpaceX;
os << ", barSpaceZ=" << rhs._barSpaceZ;
os << ", barSpaceLabel=" << rhs._barSpaceLabel;
os << ", barLength=" << rhs._barLength;
os << ", barHeight=" << rhs._barHeight;
os << ", labelMargin=" << rhs._labelMargin;
os << ", labelColor=" << rhs._labelColor[0] << ',' << rhs._labelColor[1]
<< ',' << rhs._labelColor[2] << endl;
<< ',' << rhs._labelColor[2] << Qt::endl;
os << ", gridMinWidth=" << rhs._gridMinWidth;
os << ", gridMinDepth=" << rhs._gridMinDepth;
return os;
Expand All @@ -128,7 +128,7 @@ operator<<(QTextStream &os, const DefaultObj &rhs)
static void
getColorResource(const char *name, QString label, float &r, float &g, float &b)
{
if (label != QString::null && label.compare("default") != 0) {
if (label != QString() && label.compare("default") != 0) {
const char *str = (const char *)label.toLatin1();
if (ColorList::findColor(str, r, g, b) == false) {
pmprintf("%s: Unable to map color resource \"%s\" to \"%s\", "
Expand Down Expand Up @@ -166,5 +166,5 @@ DefaultObj::getResources()
resources.endGroup();

if (pmDebugOptions.appl0)
cerr << "DefaultObj::getResources: " << *this << endl;
cerr << "DefaultObj::getResources: " << *this << Qt::endl;
}
Loading

0 comments on commit d05d248

Please sign in to comment.