From d05d2481c25ffecea44b91e136cb537a2d82a4b4 Mon Sep 17 00:00:00 2001 From: Ken McDonell Date: Fri, 25 Aug 2023 13:45:20 +1000 Subject: [PATCH] src/pmview: reduce the number of compilation warnings Down to a handful that I don't know how to fix. Sadly, the pmview application still does not work worth a crumpet. --- src/pmview/barmod.cpp | 28 ++++++++++++------------ src/pmview/barmod.h | 4 ++-- src/pmview/barobj.cpp | 20 ++++++++--------- src/pmview/colorlist.cpp | 2 +- src/pmview/colormod.cpp | 8 +++---- src/pmview/colorscalemod.cpp | 8 +++---- src/pmview/defaultobj.cpp | 8 +++---- src/pmview/gridobj.cpp | 26 +++++++++++----------- src/pmview/launch.cpp | 28 ++++++++++++------------ src/pmview/launch.h | 2 +- src/pmview/lex.l | 6 +++--- src/pmview/main.cpp | 12 +++++------ src/pmview/metriclist.cpp | 2 +- src/pmview/modlist.cpp | 42 ++++++++++++++++++------------------ src/pmview/modlist.h | 2 +- src/pmview/modulate.cpp | 2 +- src/pmview/pmview.cpp | 8 +++---- src/pmview/scalemod.cpp | 6 +++--- src/pmview/stackmod.cpp | 32 +++++++++++++-------------- src/pmview/stackobj.cpp | 12 +++++------ src/pmview/text.cpp | 8 +++---- src/pmview/togglemod.cpp | 12 +++++------ src/pmview/viewobj.cpp | 6 +++--- 23 files changed, 141 insertions(+), 143 deletions(-) diff --git a/src/pmview/barmod.cpp b/src/pmview/barmod.cpp index 41870010f9..f5e51f5c7a 100644 --- a/src/pmview/barmod.cpp +++ b/src/pmview/barmod.cpp @@ -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(), @@ -49,7 +49,7 @@ BarMod::BarMod(MetricList *metrics, _infoMetric(0), _infoInst(0), _xScale(xScale), - _yScale(yScale), + _yScale(__yScale), _zScale(zScale) { generate(obj, xSpace, zSpace); @@ -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(), @@ -74,7 +74,7 @@ BarMod::BarMod(MetricList *metrics, _infoMetric(0), _infoInst(0), _xScale(xScale), - _yScale(yScale), + _yScale(__yScale), _zScale(zScale) { generate(obj, xSpace, zSpace); @@ -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; } @@ -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) { @@ -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; } @@ -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; } @@ -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 { @@ -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++) { @@ -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); @@ -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; } diff --git a/src/pmview/barmod.h b/src/pmview/barmod.h index 30806fa528..0d4386fa9e 100644 --- a/src/pmview/barmod.h +++ b/src/pmview/barmod.h @@ -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, @@ -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 diff --git a/src/pmview/barobj.cpp b/src/pmview/barobj.cpp index 6cdc7bbe5a..393bbb56db 100644 --- a/src/pmview/barobj.cpp +++ b/src/pmview/barobj.cpp @@ -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); @@ -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++; @@ -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; } @@ -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 @@ -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 @@ -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; } } @@ -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; @@ -440,7 +440,7 @@ BarObj::doLabels(Text **text, LabelSide side, int numLabels) default: break; } - cerr << " side" << endl; + cerr << " side" << Qt::endl; } sep->addChild(tran); @@ -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 diff --git a/src/pmview/colorlist.cpp b/src/pmview/colorlist.cpp index 38847fc35b..5488343a30 100644 --- a/src/pmview/colorlist.cpp +++ b/src/pmview/colorlist.cpp @@ -177,7 +177,7 @@ operator<<(QTextStream& os, ColorList const& rhs) os << ' '; } } - os << endl; + os << Qt::endl; } return os; } diff --git a/src/pmview/colormod.cpp b/src/pmview/colormod.cpp index c5d4c2dd2b..0163140f26 100644 --- a/src/pmview/colormod.cpp +++ b/src/pmview/colormod.cpp @@ -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_, @@ -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); @@ -138,7 +138,7 @@ int ColorMod::select(SoPath *) { if (pmDebugOptions.appl2) - cerr << "ColorMod::select: " << _metrics->metric(0) << endl; + cerr << "ColorMod::select: " << _metrics->metric(0) << Qt::endl; return 1; } @@ -146,6 +146,6 @@ int ColorMod::remove(SoPath *) { if (pmDebugOptions.appl2) - cerr << "ColorMod::remove: " << _metrics->metric(0) << endl; + cerr << "ColorMod::remove: " << _metrics->metric(0) << Qt::endl; return 0; } diff --git a/src/pmview/colorscalemod.cpp b/src/pmview/colorscalemod.cpp index 45c23a08ad..36e7370439 100644 --- a/src/pmview/colorscalemod.cpp +++ b/src/pmview/colorscalemod.cpp @@ -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_, @@ -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); @@ -168,7 +168,7 @@ int ColorScaleMod::select(SoPath *) { if (pmDebugOptions.appl2) - cerr << "ColorScaleMod::select: " << _metrics->metric(0) << endl; + cerr << "ColorScaleMod::select: " << _metrics->metric(0) << Qt::endl; return 1; } @@ -176,6 +176,6 @@ int ColorScaleMod::remove(SoPath *) { if (pmDebugOptions.appl2) - cerr << "ColorScaleMod::remove: " << _metrics->metric(0) << endl; + cerr << "ColorScaleMod::remove: " << _metrics->metric(0) << Qt::endl; return 0; } diff --git a/src/pmview/defaultobj.cpp b/src/pmview/defaultobj.cpp index 1ffcc4b26b..e725ce9d15 100644 --- a/src/pmview/defaultobj.cpp +++ b/src/pmview/defaultobj.cpp @@ -111,7 +111,7 @@ 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; @@ -119,7 +119,7 @@ operator<<(QTextStream &os, const DefaultObj &rhs) 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; @@ -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\", " @@ -166,5 +166,5 @@ DefaultObj::getResources() resources.endGroup(); if (pmDebugOptions.appl0) - cerr << "DefaultObj::getResources: " << *this << endl; + cerr << "DefaultObj::getResources: " << *this << Qt::endl; } diff --git a/src/pmview/gridobj.cpp b/src/pmview/gridobj.cpp index 2fa458cfd7..7276b7aef3 100644 --- a/src/pmview/gridobj.cpp +++ b/src/pmview/gridobj.cpp @@ -59,7 +59,7 @@ GridObj::setTran(float xTran, float zTran, int setWidth, int setDepth) << col() << "," << row() << "::setTran (" << xTran << ", " << zTran << ", " - << setWidth << ", " << setDepth << ")" << endl; + << setWidth << ", " << setDepth << ")" << Qt::endl; BaseObj::setBaseSize(width(), depth()); BaseObj::setTran(xTran + xShift, zTran + zShift, setWidth, setDepth); @@ -126,7 +126,7 @@ GridObj::addObj(ViewObj *obj, int col, int row) if (pmDebugOptions.appl0) cerr << "GridObj::addObj: Adding item " << _list.length() << ": " << obj->name() << ", size = " << obj->width() << 'x' - << obj->depth() << endl; + << obj->depth() << Qt::endl; newItem._item = obj; newItem._row = row; @@ -142,7 +142,7 @@ GridObj::addObj(ViewObj *obj, int col, int row) if (obj->cols() == 1 && _colWidth[col] < obj->width()) { if (pmDebugOptions.appl0) cerr << "GridObj::addObj: increasing col[" << col << "] from " - << _colWidth[col] << " to " << obj->width() << endl; + << _colWidth[col] << " to " << obj->width() << Qt::endl; _width += obj->width() - _colWidth[col]; _colWidth[col] = obj->width(); } @@ -150,7 +150,7 @@ GridObj::addObj(ViewObj *obj, int col, int row) if (obj->rows() == 1 && _rowDepth[row] < obj->depth()) { if (pmDebugOptions.appl0) cerr << "GridObj::addObj: increasing row[" << row << "] from " - << _rowDepth[row] << " to " << obj->depth() << endl; + << _rowDepth[row] << " to " << obj->depth() << Qt::endl; _depth += obj->depth() - _rowDepth[row]; _rowDepth[row] = obj->depth(); } @@ -190,7 +190,7 @@ GridObj::finishedAdd() if (pmDebugOptions.appl0) cerr << "GridObj::finishedAdd: increasing col[" << j << "] from " << _colWidth[j] << " to " - << _colWidth[j] + size << endl; + << _colWidth[j] + size << Qt::endl; _colWidth[j] += size; _width+= size; adjust = 0; @@ -199,7 +199,7 @@ GridObj::finishedAdd() if (pmDebugOptions.appl0) cerr << "GridObj::finishedAdd: increasing col[" << j << "] from " << _colWidth[j] << " to " - << _colWidth[j] + adjust << endl; + << _colWidth[j] + adjust << Qt::endl; _colWidth[j] += adjust; _width += adjust; size -= adjust; @@ -225,7 +225,7 @@ GridObj::finishedAdd() if (pmDebugOptions.appl0) cerr << "GridObj::finishedAdd: increasing row[" << j << "] from " << _rowDepth[j] << " to " - << _rowDepth[j] + size << endl; + << _rowDepth[j] + size << Qt::endl; _rowDepth[j] += size; _depth+= size; adjust = 0; @@ -234,7 +234,7 @@ GridObj::finishedAdd() if (pmDebugOptions.appl0) cerr << "GridObj::finishedAdd: increasing row[" << j << "] from " << _rowDepth[j] << " to " - << _rowDepth[j] + adjust << endl; + << _rowDepth[j] + adjust << Qt::endl; _rowDepth[j] += adjust; _depth += adjust; size -= adjust; @@ -247,7 +247,7 @@ GridObj::finishedAdd() _finished = true; if (pmDebugOptions.appl0) - cerr << "GridObj::finishedAdd: " << *this << endl; + cerr << "GridObj::finishedAdd: " << *this << Qt::endl; } QTextStream& @@ -267,14 +267,14 @@ GridObj::display(QTextStream& os) const os << ", minRowDepth = " << _minDepth << ", minColWidth = " << _minWidth << ", rows = " << rows() << ", cols = " << cols() << ", finishedAdd = " << (_finished == true ? "true" : "false") - << endl; + << Qt::endl; os << "Column widths: "; for (i = 0, sum = 0; i < _colWidth.size(); i++) { os << _colWidth[i] << ' '; sum += _colWidth[i]; } - os << endl; + os << Qt::endl; assert(_width == sum + baseWidth()); os << "Row depths: "; @@ -282,10 +282,10 @@ GridObj::display(QTextStream& os) const os << _rowDepth[i] << ' '; sum += _rowDepth[i]; } - os << endl; + os << Qt::endl; assert(_depth == sum + baseDepth()); for (i = 0; i < _list.size(); i++) os << '[' << i << "] at " << _list[i]._col << ',' << _list[i]._row - << ": " << *(_list[i]._item) << endl; + << ": " << *(_list[i]._item) << Qt::endl; } diff --git a/src/pmview/launch.cpp b/src/pmview/launch.cpp index 8bd6b1ca35..4e59491374 100644 --- a/src/pmview/launch.cpp +++ b/src/pmview/launch.cpp @@ -70,7 +70,7 @@ Launch::setDefaultOptions(int interval, const char *starttime, const char *endtime, const char *offset, - const char *timezone, + const char *_timezone, const char *defsourcetype, const char *defsourcename, bool selected) @@ -86,7 +86,7 @@ Launch::setDefaultOptions(int interval, addOption("endtime", endtime); if (offset != NULL) addOption("offset", offset); - if (timezone != NULL) + if (_timezone != NULL) addOption("timezone", timezone); if (defsourcetype != NULL) addOption("defsourcetype", defsourcetype); @@ -141,7 +141,7 @@ Launch::addMetric(const QmcMetric &metric, if (pmDebugOptions.appl1) { cerr << "Launch::addMetric(1): Adding "; metric.dump(cerr, true, instance); - cerr << " (" << _metricCount << ')' << endl; + cerr << " (" << _metricCount << ')' << Qt::endl; } QmcSource source = metric.context()->source(); @@ -162,7 +162,7 @@ Launch::addMetric(const QmcMetric &metric, if (pmDebugOptions.appl1) { cerr << "Launch::addMetric(2): Adding "; metric.dump(cerr, true, instance); - cerr << " (" << _metricCount << ')' << endl; + cerr << " (" << _metricCount << ')' << Qt::endl; } QmcSource source = metric.context()->source(); @@ -191,7 +191,7 @@ Launch::addMetric(int context, if (_groupMetric == -1) { if (pmDebugOptions.appl1) cerr << "Launch::addMetric: Called before startGroup." - << " Adding a group." << endl; + << " Adding a group." << Qt::endl; startGroup(); } @@ -222,7 +222,7 @@ Launch::addMetric(int context, if (_groupMetric == -1) { if (pmDebugOptions.appl1) cerr << "Launch::addMetric: Called before startGroup." - << " Adding a group." << endl; + << " Adding a group." << Qt::endl; startGroup(); } @@ -306,11 +306,11 @@ Launch::startGroup(const char *hint) { if (_groupMetric != -1) - cerr << "Launch::startGroup: Two groups started at once!" << endl; + cerr << "Launch::startGroup: Two groups started at once!" << Qt::endl; else { if (pmDebugOptions.appl1) cerr << "Launch::startGroup: Starting group " << _groupCount - << endl; + << Qt::endl; _groupMetric = _metricCount; _groupHint = hint; @@ -321,15 +321,15 @@ void Launch::endGroup() { if (_groupMetric == -1) - cerr << "Launch::endGroup: No group to end!" << endl; + cerr << "Launch::endGroup: No group to end!" << Qt::endl; else if (_groupMetric == _metricCount) { cerr << "Launch::endGroup: No metrics added to group " - << _groupCount << endl; + << _groupCount << Qt::endl; _groupMetric = -1; } else { if (pmDebugOptions.appl1) cerr << "Launch::endGroup: ending group " << _groupCount - << endl; + << Qt::endl; _groupMetric = -1; _groupCount++; @@ -342,7 +342,7 @@ Launch::append(Launch const &rhs) if (rhs._groupMetric != -1) { if (pmDebugOptions.appl1) cerr << "Launch::append: Group not finished in appended object." - << " Completing group" << endl; + << " Completing group" << Qt::endl; // Cast away const, yuk. ((Launch *)(&rhs))->endGroup(); @@ -387,7 +387,7 @@ Launch::output(int fd) const str = ba.data(); if ((sts = write(fd, str, strlen(str))) != (int)strlen(str)) { cerr << "Launch::output: version write->" << sts - << " not " << strlen(str) << endl; + << " not " << strlen(str) << Qt::endl; } for (int i = 0; i < _strings.length(); i++) { @@ -396,7 +396,7 @@ Launch::output(int fd) const if ((sts = write(fd, str, strlen(str))) != (int)strlen(str)) { cerr << "Launch::output: string write->" << sts << " not " << strlen(str) - << " for " << str << endl; + << " for " << str << Qt::endl; } } } diff --git a/src/pmview/launch.h b/src/pmview/launch.h index c9ec11e56b..b1c71342c8 100644 --- a/src/pmview/launch.h +++ b/src/pmview/launch.h @@ -51,7 +51,7 @@ class Launch const char *starttime = NULL, const char *endtime = NULL, const char *offset = NULL, - const char *timezone = NULL, + const char *_timezone = NULL, const char *defsourcetype = NULL, const char *defsourcename = NULL, bool selected = false); diff --git a/src/pmview/lex.l b/src/pmview/lex.l index 146afab4ed..c7c9aacb06 100644 --- a/src/pmview/lex.l +++ b/src/pmview/lex.l @@ -67,7 +67,7 @@ extern FILE *theAltConfig; #define RETURN(c) if (theAltConfig) fprintf(theAltConfig, "%s", yytext); return c #endif -static void lexerror (const char * msg, const char * yytext); +static void lexerror (const char * msg, const char * _yytext); %} @@ -427,11 +427,11 @@ locateError(void) * in lexer, i.e those, where we've got no reasonable chance to do any * recovery. */ static void -lexerror(const char * msg, const char * yytext) +lexerror(const char * msg, const char * _yytext) { char *pos; - if ((pos = strstr(line, yytext)) != NULL) { + if ((pos = strstr(line, _yytext)) != NULL) { int i; for (i = 0; (line[i] != '\n') && (line[i] != '\0'); i++) diff --git a/src/pmview/main.cpp b/src/pmview/main.cpp index 10ddd820dd..f8e3da772d 100644 --- a/src/pmview/main.cpp +++ b/src/pmview/main.cpp @@ -84,8 +84,7 @@ int warningMsg(const char *file, int line, const char *msg, ...) pmsprintf(theBuffer + pos, theBufferLen - pos, "\n"); if (somedebug) { - QTextStream cerr(stderr); - cerr << file << ":" << line << ": " << theBuffer << endl; + cerr << file << ":" << line << ": " << theBuffer << Qt::endl; } sts = QMessageBox::warning(pmview, "Warning", theBuffer, sts, sts); @@ -202,7 +201,6 @@ genInventor(void) { int sts = 0; char *configfile; - QTextStream cerr(stderr); if (theConfigName.length()) { configfile = strdup((const char *)theConfigName.toLatin1()); @@ -236,12 +234,12 @@ genInventor(void) if (fd < 0) goto fail; if (!(theAltConfig = fdopen(fd, "a"))) fail: - pmprintf("%s: Warning: Unable to save configuration for " - "recording to \"%s\": %s\n", + pmprintf("%s: Warning: Unable to save configuration for" + "recording to \"%s\": %s\n", pmGetProgname(), configfile, strerror(errno)); else if (pmDebugOptions.appl0) cerr << "genInventor: Copy of configuration saved to " - << configfile << endl; + << configfile << Qt::endl; theAltConfigName = configfile; } @@ -253,7 +251,7 @@ genInventor(void) if (pmDebugOptions.appl0) { cerr << pmGetProgname() << ": " << errorCount << " errors detected in " - << theConfigName << endl; + << theConfigName << Qt::endl; } sts = -errorCount; diff --git a/src/pmview/metriclist.cpp b/src/pmview/metriclist.cpp index 00f591961d..8455018450 100644 --- a/src/pmview/metriclist.cpp +++ b/src/pmview/metriclist.cpp @@ -165,7 +165,7 @@ operator<<(QTextStream &os, MetricList const &list) list._colors[i]->getValue(r, g, b); os << r << ',' << g << ',' << b << ": "; } - os << *(list._metrics[i]) << endl; + os << *(list._metrics[i]) << Qt::endl; } return os; } diff --git a/src/pmview/modlist.cpp b/src/pmview/modlist.cpp index 4707b58952..2c7452c65c 100644 --- a/src/pmview/modlist.cpp +++ b/src/pmview/modlist.cpp @@ -35,11 +35,11 @@ ModList::~ModList() } ModList::ModList(SoQtViewer *viewer, - SelCallBack selCB, + SelCallBack __selCB, SelInvCallBack selInvCB, SelInvCallBack deselInvCB) : _viewer(viewer), - _selCB(selCB), + _selCB(__selCB), _selInvCB(selInvCB), _deselInvCB(deselInvCB), _root(0), @@ -126,14 +126,14 @@ ModList::dumpSelections(QTextStream &os) const os << _numSel << " selections (SoSelections.numSelections = " << _selection->getNumSelected() << "), allFlag = " - << (_allFlag == true ? "true" : "false") << endl; + << (_allFlag == true ? "true" : "false") << Qt::endl; for (i = 0; i < _selList.size(); i++) if (_selList[i] > 0) { count += _selList[i]; os << '[' << i << "]: "; if (_numSel == 1 && _oneSel == i) os << '*'; - os << *(_list[i]) << endl; + os << *(_list[i]) << Qt::endl; } assert(count == _numSel); @@ -145,7 +145,7 @@ operator<<(QTextStream &os, const ModList &rhs) int i; for (i = 0; i < rhs._list.size(); i++) - os << '[' << i << "]: " << rhs[i] << endl; + os << '[' << i << "]: " << rhs[i] << Qt::endl; return os; } @@ -186,7 +186,7 @@ ModList::selCB(void *ptrToThis, SoPath *path) if (id < 0) { if (pmDebugOptions.appl1) - cerr << "ModList::selCB: Nothing selected" << endl; + cerr << "ModList::selCB: Nothing selected" << Qt::endl; return; /*NOTREACHED*/ @@ -198,9 +198,9 @@ ModList::selCB(void *ptrToThis, SoPath *path) if (pmDebugOptions.appl1) cerr << "ModList::selCB: Before Selected [" << id << "] = " - << *obj << endl + << *obj << Qt::endl << "oldCount = " << oldCount << ", _numSel = " - << me->_numSel << ", _allFlag = false" << endl; + << me->_numSel << ", _allFlag = false" << Qt::endl; me->_selList[id] = obj->select(path); @@ -216,12 +216,12 @@ ModList::selCB(void *ptrToThis, SoPath *path) (*(me->_selInvCB))(me, path); if (pmDebugOptions.appl1) { - cerr << "ModList::selCB: After Selected [" << id << "] " << endl + cerr << "ModList::selCB: After Selected [" << id << "] " << Qt::endl << "oldCount = " << oldCount << ", _numSel = " << me->_numSel << ", _allFlag = " << (me->_allFlag == true ? "true" : "false") << ", _allId = " - << me->_allId << endl; - cerr << "ModList::selCB: selection state:" << endl; + << me->_allId << Qt::endl; + cerr << "ModList::selCB: selection state:" << Qt::endl; me->dumpSelections(cerr); } } @@ -240,7 +240,7 @@ ModList::deselectCB(void *ptrToThis, SoPath *path) if (id < 0) { if (pmDebugOptions.appl1) - cerr << "ModList::deselectCB: Nothing deselected" << endl; + cerr << "ModList::deselectCB: Nothing deselected" << Qt::endl; return; /*NOTREACHED*/ @@ -250,7 +250,7 @@ ModList::deselectCB(void *ptrToThis, SoPath *path) if (pmDebugOptions.appl1) cerr << "ModList::deselectCB: Deselected [" << id << "] = " - << *obj << endl; + << *obj << Qt::endl; oldCount = me->_selList[id]; me->_selList[id] = obj->remove(path); @@ -271,7 +271,7 @@ ModList::deselectCB(void *ptrToThis, SoPath *path) (*(me->_deselInvCB))(me, path); if (pmDebugOptions.appl1) { - cerr << "ModList::deselectCB: selection state:" << endl; + cerr << "ModList::deselectCB: selection state:" << Qt::endl; me->dumpSelections(cerr); } } @@ -303,7 +303,7 @@ ModList::motionCB(void *ptrToThis, SoEventCallback *theEvent) me->_current = me->size(); if (pmDebugOptions.appl1) - cerr << "ModList::motionCB: remove object " << id << endl; + cerr << "ModList::motionCB: remove object " << id << Qt::endl; } } else if (me->_current != id) { @@ -313,13 +313,13 @@ ModList::motionCB(void *ptrToThis, SoEventCallback *theEvent) (*me)[me->_current].selectInfo(path); if (pmDebugOptions.appl1) - cerr << "ModList::motionCB: new object " << id << endl; + cerr << "ModList::motionCB: new object " << id << Qt::endl; } else { (*me)[me->_current].selectInfo(path); if (pmDebugOptions.appl1) - cerr << "ModList::motionCB: same object " << id << endl; + cerr << "ModList::motionCB: same object " << id << Qt::endl; } // Note: the call to _selCB below used to only be done if the guard @@ -357,7 +357,7 @@ ModList::launch(Launch &launch, bool all) const if (pmDebugOptions.appl1) cerr << "ModList::launch: launching for " << _numSel - << " objects" << endl; + << " objects" << Qt::endl; for (i = 0; i < _selList.size(); i++) { if (_selList[i] > 0) @@ -367,7 +367,7 @@ ModList::launch(Launch &launch, bool all) const else { if (pmDebugOptions.appl1) - cerr << "ModList::launch: launching for all objects" << endl; + cerr << "ModList::launch: launching for all objects" << Qt::endl; for (i = 0; i < _list.size(); i++) _list[i]->launch(launch, true); @@ -402,7 +402,7 @@ void ModList::deselectPath(SoPath *path) { if (pmDebugOptions.appl1) - cerr << "ModList::deselectPath:" << endl; + cerr << "ModList::deselectPath:" << Qt::endl; _selection->deselect(path); deselectCB(this, path); @@ -416,7 +416,7 @@ ModList::selectAllId(SoNode *node, int count) _allId = findToken(path); if (pmDebugOptions.appl1) - cerr << "ModList::selectAllId: Select All on " << _allId << endl; + cerr << "ModList::selectAllId: Select All on " << _allId << Qt::endl; if (_allId > 0) { _numSel += count - _selList[_allId]; diff --git a/src/pmview/modlist.h b/src/pmview/modlist.h index 72d231982a..f641e7faa1 100644 --- a/src/pmview/modlist.h +++ b/src/pmview/modlist.h @@ -64,7 +64,7 @@ class ModList ~ModList(); - ModList(SoQtViewer *viewer, SelCallBack selCB, + ModList(SoQtViewer *viewer, SelCallBack __selCB, SelInvCallBack selInvCB = NULL, SelInvCallBack deselInvCB = NULL); int size() const diff --git a/src/pmview/modulate.cpp b/src/pmview/modulate.cpp index 175c341253..ee86a8b961 100644 --- a/src/pmview/modulate.cpp +++ b/src/pmview/modulate.cpp @@ -123,7 +123,7 @@ void Modulate::selectAll() { if (pmDebugOptions.appl2) - cerr << "Modulate::selectAll: selectAll for " << *this << endl; + cerr << "Modulate::selectAll: selectAll for " << *this << Qt::endl; theModList->selectAllId(_root, 1); theModList->selectSingle(_root); diff --git a/src/pmview/pmview.cpp b/src/pmview/pmview.cpp index 6f0fd10868..3255c2eaca 100644 --- a/src/pmview/pmview.cpp +++ b/src/pmview/pmview.cpp @@ -173,12 +173,12 @@ bool PmView::view(bool showAxis, if (pmDebugOptions.appl1) cerr << "PmView::view: antialiasing set to smooth = " << (smooth == TRUE ? "true" : "false") - << ", passes = " << passes << endl; + << ", passes = " << passes << Qt::endl; if (passes > 1) viewer()->setAntialiasing(smooth, atoi(sval)); if (pmDebugOptions.appl1) - cerr << "PmView::view: displaying window" << endl; + cerr << "PmView::view: displaying window" << Qt::endl; viewer()->viewAll(); @@ -218,13 +218,13 @@ void PmView::render(RenderOptions options, time_t theTime) // TODO: set label string to my.text if (pmDebugOptions.appl1) cerr << "PmView::render: metricLabel text \"" << - my.text << "\"" << endl; + my.text << "\"" << Qt::endl; } } } if (options & PmView::timeLabel) - setDateLabel(theTime, QString::null); // TODO + setDateLabel(theTime, QString()); // TODO viewer()->setAutoRedraw(true); } diff --git a/src/pmview/scalemod.cpp b/src/pmview/scalemod.cpp index 2b6cf646ae..fca86aae24 100644 --- a/src/pmview/scalemod.cpp +++ b/src/pmview/scalemod.cpp @@ -56,7 +56,7 @@ ScaleMod::ScaleMod(const char *str, if (pmDebugOptions.appl2) cerr << "ScaleMod: Added " << str << " (Id = " - << _root->getName().getString() << ")" << endl; + << _root->getName().getString() << ")" << Qt::endl; } // Invalid metric @@ -161,7 +161,7 @@ int ScaleMod::select(SoPath *) { if (pmDebugOptions.appl2) - cerr << "ScaleMod::select: " << _metrics->metric(0) << endl; + cerr << "ScaleMod::select: " << _metrics->metric(0) << Qt::endl; return 1; } @@ -169,6 +169,6 @@ int ScaleMod::remove(SoPath *) { if (pmDebugOptions.appl2) - cerr << "ScaleMod::remove: " << _metrics->metric(0) << endl; + cerr << "ScaleMod::remove: " << _metrics->metric(0) << Qt::endl; return 0; } diff --git a/src/pmview/stackmod.cpp b/src/pmview/stackmod.cpp index 369a4b8680..3f6f78612c 100644 --- a/src/pmview/stackmod.cpp +++ b/src/pmview/stackmod.cpp @@ -67,7 +67,7 @@ StackMod::StackMod(MetricList *metrics, SoNode *obj, StackMod::Height height) if (pmDebugOptions.appl2) cerr << "StackMod::StackMod: numValues = " - << numValues << ", num of blocks = " << m << endl + << numValues << ", num of blocks = " << m << Qt::endl << *_metrics; for (m = 0, v = 0; m < numMetrics; m++) { @@ -158,7 +158,7 @@ StackMod::refresh(bool fetchFlag) static QVector values; if (pmDebugOptions.libpmda) - cerr << endl << "StackMod::refresh" << endl; + cerr << Qt::endl << "StackMod::refresh" << Qt::endl; if (status() < 0) return; @@ -187,7 +187,7 @@ StackMod::refresh(bool fetchFlag) sum += value; if (pmDebugOptions.libpmda) - cerr << "Error, value set to " << value << endl; + cerr << "Error, value set to " << value << Qt::endl; } else if (block._state == Modulate::error || block._state == Modulate::start) { @@ -201,7 +201,7 @@ StackMod::refresh(bool fetchFlag) value = theMinScale; sum += value; if (pmDebugOptions.libpmda) - cerr << "Error->Normal, value = " << value << endl; + cerr << "Error->Normal, value = " << value << Qt::endl; } else { value = metric.value(i) * theScale; @@ -209,13 +209,13 @@ StackMod::refresh(bool fetchFlag) value = theMinScale; sum += value; if (pmDebugOptions.libpmda) - cerr << "Normal, value = " << value << endl; + cerr << "Normal, value = " << value << Qt::endl; } } } if (pmDebugOptions.libpmda) - cerr << "sum = " << sum << endl; + cerr << "sum = " << sum << Qt::endl; if (sum > theNormError && _height != util) { if (_blocks[0]._state != Modulate::saturated) { @@ -272,7 +272,7 @@ StackMod::refresh(bool fetchFlag) double &value = values[v]; if (pmDebugOptions.libpmda) - cerr << '[' << v << "] scale = " << value << endl; + cerr << '[' << v << "] scale = " << value << Qt::endl; block._scale->scaleFactor.setValue(1.0, value, 1.0); @@ -301,9 +301,9 @@ StackMod::dump(QTextStream &os) const os << "StackMod: "; 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++) { @@ -344,7 +344,7 @@ StackMod::infoText(QString &str, bool selected) const if (v >= _blocks.size()) { if (pmDebugOptions.appl2) cerr << "StackMod::infoText: infoText requested but nothing selected" - << endl; + << Qt::endl; str = ""; } else if (_height == fixed && v == _blocks.size() - 1) { @@ -419,7 +419,7 @@ StackMod::selectAll() theModList->selectAllId(_root, _blocks.size()); if (pmDebugOptions.appl2) - cerr << "StackMod::selectAll" << endl; + cerr << "StackMod::selectAll" << Qt::endl; for (i = 0; i < _blocks.size(); i++) { if (_blocks[i]._selected == false) { @@ -442,7 +442,7 @@ StackMod::select(SoPath *path) if (pmDebugOptions.appl2) cerr << "StackMod::select: value = " << value - << ", count = " << _selectCount << endl; + << ", count = " << _selectCount << Qt::endl; } return _selectCount; } @@ -459,11 +459,11 @@ StackMod::remove(SoPath *path) if (pmDebugOptions.appl2) cerr << "StackMod::remove: value = " << value - << ", count = " << _selectCount << endl; + << ", count = " << _selectCount << Qt::endl; } else if (pmDebugOptions.appl2) cerr << "StackMod::remove: did not remove " << value - << ", count = " << _selectCount << endl; + << ", count = " << _selectCount << Qt::endl; return _selectCount; } @@ -500,7 +500,7 @@ StackMod::findBlock(SoPath *path, int &metric, int &inst, if (i >= 0) { if (pmDebugOptions.appl2) - cerr << "StackMod::findBlock: stack id = " << str << endl; + cerr << "StackMod::findBlock: stack id = " << str << Qt::endl; sscanf(str, "%c%d", &c, &value); @@ -532,7 +532,7 @@ StackMod::findBlock(SoPath *path, int &metric, int &inst, if (pmDebugOptions.appl2) cerr << "StackMod::findBlock: metric = " << metric - << ", inst = " << inst << ", value = " << value << endl; + << ", inst = " << inst << ", value = " << value << Qt::endl; } void diff --git a/src/pmview/stackobj.cpp b/src/pmview/stackobj.cpp index 23d29fc0ca..78205b4224 100644 --- a/src/pmview/stackobj.cpp +++ b/src/pmview/stackobj.cpp @@ -73,7 +73,7 @@ StackObj::finishedAdd() cerr << "StackObj::finishedAdd: Adding " << colSpec->_list.length() << " colors for " << _metrics.numMetrics() - << " metrics" << endl; + << " metrics" << Qt::endl; for (i = 0; i < colSpec->_list.size(); i++) _metrics.add(*(colSpec->_list)[i]); @@ -86,8 +86,8 @@ StackObj::finishedAdd() _metrics.resolveColors(MetricList::perValue); if (pmDebugOptions.appl0) - cerr << "StackObj::finishedAdd: metrics: " << endl - << _metrics << endl; + cerr << "StackObj::finishedAdd: metrics: " << Qt::endl + << _metrics << Qt::endl; _stack = new StackMod(&_metrics, ViewObj::object(_shape), _height); _root->addChild(_stack->root()); @@ -103,7 +103,7 @@ StackObj::finishedAdd() } if (pmDebugOptions.appl0) - cerr << name() << "has length " << _length << endl; + cerr << name() << "has length " << _length << Qt::endl; _width = baseWidth() + _length; _depth = baseDepth() + _length; @@ -131,7 +131,7 @@ StackObj::display(QTextStream& os) const BaseObj::display(os); os << ", length = " << _length << ": "; if (_stack) - os << *_stack << endl; + os << *_stack << Qt::endl; else - os << "stack undefined!" << endl; + os << "stack undefined!" << Qt::endl; } diff --git a/src/pmview/text.cpp b/src/pmview/text.cpp index c96cde436d..a5bcfc032d 100644 --- a/src/pmview/text.cpp +++ b/src/pmview/text.cpp @@ -106,7 +106,7 @@ Text::Text(const QString &theString, break; default: if (pmDebugOptions.appl1) - cerr << "Text::Text: Illegal size specified" << endl; + cerr << "Text::Text: Illegal size specified" << Qt::endl; _fontSize = medium; _root->addChild(theMediumFont->copy()); } @@ -171,7 +171,7 @@ Text::Text(const QString &theString, if (pmDebugOptions.appl2) cerr << "Text::Text: Bogus bounding box returned for \"" << theString << "\": x = " << x << ", y = " << y - << ", z = " << z << endl; + << ", z = " << z << Qt::endl; x = 0.0; y = 0.0; z = 0.0; @@ -185,7 +185,7 @@ Text::Text(const QString &theString, if (pmDebugOptions.appl1) cerr << "Text::Text: " << theString << ": width = " << _width << " height = " << _depth << " low = " - << ((hasLow != (char *)0) ? 1 : 0) << endl; + << ((hasLow != (char *)0) ? 1 : 0) << Qt::endl; switch(_dir) { case left: @@ -227,7 +227,7 @@ Text::Text(const QString &theString, default: if (pmDebugOptions.appl1) cerr << "Text::Text: Illegal direction specified (" - << (int)_dir << ")" << endl; + << (int)_dir << ")" << Qt::endl; break; } } diff --git a/src/pmview/togglemod.cpp b/src/pmview/togglemod.cpp index b34152136a..f3394f571d 100644 --- a/src/pmview/togglemod.cpp +++ b/src/pmview/togglemod.cpp @@ -39,7 +39,7 @@ void ToggleMod::dump(QTextStream &os) const { os << "ToggleMod: \"" << _label << "\" has " << _list.size() - << " objects" << endl; + << " objects" << Qt::endl; } void @@ -48,12 +48,12 @@ ToggleMod::selectAll() int i; if (pmDebugOptions.appl2) - cerr << "ToggleMod::selectAll: \"" << _label << '"' << endl; + cerr << "ToggleMod::selectAll: \"" << _label << '"' << Qt::endl; for (i = 0; i < _list.size(); i++) { if (pmDebugOptions.appl2) cerr << "ToggleMod::selectAll: Selecting [" << i << ']' - << endl; + << Qt::endl; _list[i]->selectAll(); } @@ -65,13 +65,13 @@ ToggleMod::select(SoPath *path) int i; if (pmDebugOptions.appl2) - cerr << "ToggleMod::select: \"" << _label << '"' << endl; + cerr << "ToggleMod::select: \"" << _label << '"' << Qt::endl; theModList->selectAllOn(); for (i = 0; i < _list.size(); i++) { if (pmDebugOptions.appl2) - cerr << "ToggleMod::select: Selecting [" << i << ']' << endl; + cerr << "ToggleMod::select: Selecting [" << i << ']' << Qt::endl; _list[i]->selectAll(); } @@ -87,7 +87,7 @@ int ToggleMod::remove(SoPath *) { if (pmDebugOptions.appl2) - cerr << "ToggleMod::remove: " << _label << endl; + cerr << "ToggleMod::remove: " << _label << Qt::endl; return 0; } diff --git a/src/pmview/viewobj.cpp b/src/pmview/viewobj.cpp index 7003db6392..943717c28c 100644 --- a/src/pmview/viewobj.cpp +++ b/src/pmview/viewobj.cpp @@ -126,13 +126,13 @@ ViewObj::setTran(float xTran, float zTran, int setWidth, int setDepth) float z = zTran + ((setDepth - (float)depth()) * _zAlign); if (pmDebugOptions.appl0) { - cerr << "ViewObj::setTran: " << name() << ":" << endl; + cerr << "ViewObj::setTran: " << name() << ":" << Qt::endl; cerr << "x=" << x << ", xTran =" << xTran << ", setWidth=" << setWidth << ", width=" << width() << ", xAlign=" << _xAlign - << endl; + << Qt::endl; cerr << "z=" << z << ", zTran =" << zTran << ", setDepth=" << setDepth << ", depth=" << depth() << ", zAlign=" << _zAlign - << endl << endl; + << Qt::endl << Qt::endl; } _tran->translation.setValue(x, 0.0, z);