Skip to content

Commit b6246a7

Browse files
authored
Merge pull request #9 from AMReX-Codes/warnings
Fixing warnings with gcc 7.5, DEBUG=TRUE, DIM=2 and DIM=3.
2 parents a64855f + 8643a37 commit b6246a7

17 files changed

+100
-82
lines changed

AVPApp.H

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ class AVPApp
2626
PltAppState *GetPltAppState() const { return pltAppState; }
2727
virtual XYPlotWin *GetXYPlotWin(int dir) const { return XYplotwin[dir]; }
2828
virtual void DetachXYPlotWin(int dir) { XYplotwin[dir] = NULL; }
29-
virtual amrex::XYPlotDataList *CreateLinePlot(int V, int sdir, int mal, int ixY,
30-
const std::string *derived)
31-
{ amrex::Abort("AVPApp not implemented."); return nullptr; }
29+
virtual amrex::XYPlotDataList *CreateLinePlot(int /*V*/, int /*sdir*/, int /*mal*/,
30+
int /*ixY*/, const std::string * /*derived*/)
31+
{ amrex::Abort("AVPApp not implemented.");
32+
return nullptr; }
3233
virtual Widget GetPalArea() { return wPalArea; }
3334
virtual bool PaletteCBQ() { return paletteCBQ; }
3435
virtual void SetPaletteCBQ(bool tf = true) { paletteCBQ = tf; }

AmrPicture.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ AmrPicture::AmrPicture(int view, GraphicsAttributes *gaptr,
169169
isSubDomain(true)
170170
{
171171
BL_ASSERT(pltappptr != NULL);
172+
173+
amrex::ignore_unused(parentPltAppPtr);
174+
172175
int ilev;
173176

174177
dataServicesPtr = pltAppPtr->GetDataServicesPtr();
@@ -471,6 +474,7 @@ AmrPicture::~AmrPicture() {
471474

472475
// ---------------------------------------------------------------------
473476
void AmrPicture::SetSlice(int view, int here) {
477+
amrex::ignore_unused(here);
474478
int lev;
475479
int minDrawnLevel(pltAppStatePtr->MinDrawnLevel());
476480
int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel());
@@ -649,7 +653,7 @@ void AmrPicture::DrawBoxes(Vector< Vector<GridPicture> > &gp, Drawable &drawable
649653

650654

651655
// ---------------------------------------------------------------------
652-
void AmrPicture::DrawTerrBoxes(int level, bool bIsWindow, bool bIsPixmap) {
656+
void AmrPicture::DrawTerrBoxes(int /*level*/, bool /*bIsWindow*/, bool /*bIsPixmap*/) {
653657
cerr << endl;
654658
cerr << "***** Error: should not be in AmrPicture::DrawTerrBoxes." << endl;
655659
cerr << "Continuing..." << endl;
@@ -658,7 +662,7 @@ void AmrPicture::DrawTerrBoxes(int level, bool bIsWindow, bool bIsPixmap) {
658662

659663

660664
// ---------------------------------------------------------------------
661-
void AmrPicture::APDraw(int fromLevel, int toLevel) {
665+
void AmrPicture::APDraw(int /*fromLevel*/, int toLevel) {
662666
if( ! pixMapCreated) {
663667
pixMap = XCreatePixmap(display, pictureWindow,
664668
imageSizeH, imageSizeV, gaPtr->PDepth());
@@ -1173,12 +1177,12 @@ void AmrPicture::CreateScaledImage(XImage **ximage, int scale,
11731177

11741178
tempSum = 0;
11751179
for(isum=nStartV; isum<=nEndV; ++isum) {
1176-
tempSum += sumV[isum];
1180+
tempSum += int( sumV[isum] );
11771181
}
11781182
avgV = tempSum / ((Real) nV);
11791183
tempSum = 0;
11801184
for(isum=nStartH; isum<=nEndH; ++isum) {
1181-
tempSum += sumH[isum];
1185+
tempSum += int( sumH[isum] );
11821186
}
11831187
avgH = tempSum / ((Real) nH);
11841188

@@ -1862,7 +1866,7 @@ void AmrPicture::Sweep(Amrvis::AnimDirection direction) {
18621866

18631867

18641868
// ---------------------------------------------------------------------
1865-
void AmrPicture::DrawSlice(int iSlice) {
1869+
void AmrPicture::DrawSlice(int /*iSlice*/) {
18661870
XDrawLine(display, pictureWindow, pltAppPtr->GetRbgc(),
18671871
0, 30, imageSizeH, 30);
18681872
}

AmrVisTool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ void SubregionProfApp(Widget swTopLevel, const amrex::Box &trueRegion,
720720

721721

722722
// ---------------------------------------------------------------
723-
void CBQuitPltApp(Widget ofPltApp, XtPointer client_data, XtPointer) {
723+
void CBQuitPltApp(Widget /*ofPltApp*/, XtPointer client_data, XtPointer) {
724724
PltApp *obj = (PltApp *) client_data;
725725
pltAppList.remove(obj);
726726

@@ -736,7 +736,7 @@ void CBQuitPltApp(Widget ofPltApp, XtPointer client_data, XtPointer) {
736736

737737
#ifdef BL_USE_PROFPARSER
738738
// ---------------------------------------------------------------
739-
void CBQuitProfApp(Widget ofProfApp, XtPointer client_data, XtPointer) {
739+
void CBQuitProfApp(Widget /*ofProfApp*/, XtPointer client_data, XtPointer) {
740740
ProfApp *obj = (ProfApp *) client_data;
741741
profAppList.remove(obj);
742742

GridPicture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ GridPicture::GridPicture() {
1515

1616

1717
// -------------------------------------------------------------------
18-
void GridPicture::GridPictureInit(int level,
18+
void GridPicture::GridPictureInit(int /*level*/,
1919
int rratio, int scale, int picSizeH, int picSizeV,
2020
const Box &overlapbox,
2121
const Box &boxWithData, int slicedir)

Output.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ void WriteNewPSFile(const char *filename, XImage *image,
5050
const int minlev, const int maxlev,
5151
Vector< Vector<GridBoxes> > &gridBoxes)
5252
{
53+
amrex::ignore_unused(amrdata);
54+
5355
clock_t time0 = clock();
5456
unsigned char r, g, b;
5557

Palette.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Palette::Palette(Widget &w, int datalistlength, int width,
7575

7676
remapTable = new unsigned char[totalColorSlots]; // this is faster than Vector<uc>
7777
float sizeRatio(((float) colorSlots) / ((float) totalColorSlots));
78-
float mapLow(((float) paletteStart) + 0.5);
78+
float mapLow((float) paletteStart + (float) 0.5);
7979
for(int itab(0); itab < totalColorSlots; ++itab) {
8080
remapTable[itab] = (int) ((((float) itab) * sizeRatio) + mapLow);
8181
}
@@ -120,7 +120,7 @@ Palette::Palette(int datalistlength, int width, int totalwidth,
120120

121121
remapTable = new unsigned char[totalColorSlots]; // this is faster than Vector<uc>
122122
float sizeRatio(((float) colorSlots) / ((float) totalColorSlots));
123-
float mapLow(((float) paletteStart) + 0.5);
123+
float mapLow( (float) paletteStart + (float) 0.5);
124124
for(int itab(0); itab < totalColorSlots; ++itab) {
125125
remapTable[itab] = (int) ((((float) itab) * sizeRatio) + mapLow);
126126
}
@@ -213,7 +213,7 @@ void Palette::DrawPalette(Real palMin, Real palMax, const string &numberFormat)
213213
#endif
214214

215215
if(bTimeline) {
216-
int nPalVals(mpiFuncNames.size()), count(0), cftRange(palMax - palMin);
216+
int nPalVals(mpiFuncNames.size()), count(0), cftRange(int(palMax - palMin));
217217
int nameLocation, palLocation, cftIndex, noffX(18);
218218
Vector<int> palIndex(mpiFuncNames.size(), 0);
219219
XSetForeground(display, gc, AVWhitePixel());
@@ -225,13 +225,13 @@ void Palette::DrawPalette(Real palMin, Real palMax, const string &numberFormat)
225225
string fname(it->second);
226226
nameLocation = (totalColorSlots - 1) -
227227
(count * totalColorSlots / (nPalVals - 1)) + palOffsetY;
228-
palLocation = (totalColorSlots - 1) -
229-
(totalColorSlots * (cftIndex - palMin) / cftRange) + palOffsetY;
228+
palLocation = int( (totalColorSlots - 1) -
229+
(totalColorSlots * (cftIndex - palMin) / cftRange) + palOffsetY );
230230
XDrawString(display, palPixmap, gc, palWidth + noffX,
231231
nameLocation, fname.c_str(), strlen(fname.c_str()));
232232
XDrawLine(display, palPixmap, gc,
233233
palWidth + 2, palLocation, palWidth + noffX - 4, nameLocation - 4);
234-
palIndex[count] = paletteStart + (((cftIndex - palMin) / cftRange) * colorSlots);
234+
palIndex[count] = int( paletteStart + (((cftIndex - palMin) / cftRange) * colorSlots) );
235235
++count;
236236
}
237237

@@ -256,7 +256,7 @@ void Palette::DrawPalette(Real palMin, Real palMax, const string &numberFormat)
256256
}
257257

258258
} else if(bRegions) {
259-
int nPalVals(regionNames.size()), count(0), cftRange(palMax - palMin);
259+
int nPalVals(regionNames.size()), count(0), cftRange(int(palMax - palMin));
260260
int nameLocation, palLocation, cftIndex, noffX(18);
261261
Vector<int> palIndex(regionNames.size(), 0);
262262
XSetForeground(display, gc, AVWhitePixel());
@@ -269,8 +269,8 @@ void Palette::DrawPalette(Real palMin, Real palMax, const string &numberFormat)
269269
string fname(it->second);
270270
nameLocation = (totalColorSlots - 1) -
271271
(count * totalColorSlots / (nPalVals - 1)) + palOffsetY;
272-
palLocation = (totalColorSlots - 1) -
273-
(totalColorSlots * (cftIndex - palMin) / cftRange) + palOffsetY;
272+
palLocation = int( (totalColorSlots - 1) -
273+
(totalColorSlots * (cftIndex - palMin) / cftRange) + palOffsetY );
274274
XDrawString(display, palPixmap, gc, palWidth + noffX,
275275
nameLocation, fname.c_str(), strlen(fname.c_str()));
276276
if(cftIndex == -2) {
@@ -280,7 +280,7 @@ void Palette::DrawPalette(Real palMin, Real palMax, const string &numberFormat)
280280
XDrawLine(display, palPixmap, gc,
281281
palWidth + 2, palLocation, palWidth + noffX - 4, nameLocation - 4);
282282
}
283-
palIndex[count] = paletteStart + (((cftIndex - palMin) / cftRange) * colorSlots);
283+
palIndex[count] = int( paletteStart + (((cftIndex - palMin) / cftRange) * colorSlots) );
284284
++count;
285285
}
286286

@@ -350,7 +350,7 @@ void Palette::SetWindowPalette(const string &palName, Window newPalWindow,
350350

351351

352352
// -------------------------------------------------------------------
353-
void Palette::ChangeWindowPalette(const string &palName, Window newPalWindow)
353+
void Palette::ChangeWindowPalette(const string &palName, Window /*newPalWindow*/)
354354
{
355355
bReadPalette = true;
356356
ReadPalette(palName);
@@ -669,7 +669,7 @@ int Palette::ReadSeqPalette(const string &fileName, bool bRedraw) {
669669
for(int j(0); j < iSeqPalSize; ++j) {
670670
indexArray[j] = j;
671671
int tmp = (unsigned short) abuff[j];
672-
transferArray[j] = (float) tmp / 100.0;
672+
transferArray[j] = (float) tmp / (float) 100.0;
673673
}
674674
}
675675

PltApp.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const int NFRAMES = 19;
6060
const int OXY(0);
6161
const int OYZ(1);
6262
const int OXZ(2);
63-
};
63+
}
6464

6565

6666
class PltApp;

PltApp.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ void PltApp::ChangeDerived(Widget w, XtPointer client_data, XtPointer) {
21692169

21702170

21712171
// -------------------------------------------------------------------
2172-
void PltApp::ChangeContour(Widget w, XtPointer input_data, XtPointer) {
2172+
void PltApp::ChangeContour(Widget /*w*/, XtPointer input_data, XtPointer) {
21732173
Amrvis::ContourType prevCType(pltAppState->GetContourType());
21742174
Amrvis::ContourType newCType = Amrvis::ContourType((unsigned long) input_data);
21752175
if(newCType == prevCType) {
@@ -2232,7 +2232,7 @@ void PltApp::ReadContourString(Widget w, XtPointer, XtPointer) {
22322232

22332233

22342234
// -------------------------------------------------------------------
2235-
void PltApp::ToggleRange(Widget w, XtPointer client_data, XtPointer call_data) {
2235+
void PltApp::ToggleRange(Widget /*w*/, XtPointer client_data, XtPointer call_data) {
22362236
unsigned long r = (unsigned long) client_data;
22372237
XmToggleButtonCallbackStruct *state = (XmToggleButtonCallbackStruct *) call_data;
22382238
if(state->set == true) {
@@ -2527,7 +2527,7 @@ void PltApp::DoCallTraceButton(Widget, XtPointer, XtPointer) {
25272527

25282528

25292529
// -------------------------------------------------------------------
2530-
void PltApp::DestroyCallTraceWindow(Widget, XtPointer xp, XtPointer) {
2530+
void PltApp::DestroyCallTraceWindow(Widget, XtPointer /*xp*/, XtPointer) {
25312531
callTraceShowing = false;
25322532
}
25332533

@@ -2540,7 +2540,7 @@ void PltApp::CloseCallTraceWindow(Widget, XtPointer, XtPointer) {
25402540

25412541

25422542
// -------------------------------------------------------------------
2543-
void PltApp::DestroyInfoWindow(Widget, XtPointer xp, XtPointer) {
2543+
void PltApp::DestroyInfoWindow(Widget, XtPointer /*xp*/, XtPointer) {
25442544
infoShowing = false;
25452545
}
25462546

@@ -2780,8 +2780,8 @@ void PltApp::CloseContoursWindow(Widget, XtPointer, XtPointer) {
27802780

27812781

27822782
// -------------------------------------------------------------------
2783-
void PltApp::DoToggleFileRangeButton(Widget w, XtPointer client_data,
2784-
XtPointer call_data)
2783+
void PltApp::DoToggleFileRangeButton(Widget /*w*/, XtPointer /*client_data*/,
2784+
XtPointer /*call_data*/)
27852785
{
27862786
bFileRangeButtonSet = XmToggleButtonGetState(wFileRangeCheckBox);
27872787
if(bFileRangeButtonSet) {
@@ -3917,7 +3917,7 @@ void PltApp::DoRubberBanding(Widget, XtPointer client_data, XtPointer call_data)
39173917
sprintf(dLocStr, pltAppState->GetFormatString().c_str(), sDLoc);
39183918
buffout << "time = " << dLocStr << '\n';
39193919
idx = Amrvis::YDIR;
3920-
int iLoc = gridOffset[idx] + trueRegionArray[mal].smallEnd()[idx];
3920+
int iLoc = int( gridOffset[idx] + trueRegionArray[mal].smallEnd()[idx] );
39213921
iLoc *= amrex::CRRBetweenLevels(maxDrawnLevel, amrData.FinestLevel(), amrData.RefRatio());
39223922
buffout << "rank = " << iLoc << '\n';
39233923
if(callTraceExists) {
@@ -4421,7 +4421,7 @@ void PltApp::DoExposePalette(Widget, XtPointer, XtPointer) {
44214421

44224422

44234423
// -------------------------------------------------------------------
4424-
void PltApp::PADoExposePicture(Widget w, XtPointer client_data, XtPointer) {
4424+
void PltApp::PADoExposePicture(Widget /*w*/, XtPointer client_data, XtPointer) {
44254425
unsigned long np = (unsigned long) client_data;
44264426
//cout << "==%%%%%%%%%%%%=== _in PADoExposePicture: currentFrame = " << currentFrame << endl;
44274427

PltApp3D.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void PltApp::DoExposeTransDA(Widget, XtPointer, XtPointer) {
5858

5959

6060
// -------------------------------------------------------------------
61-
void PltApp::DoTransInput(Widget w, XtPointer, XtPointer call_data) {
61+
void PltApp::DoTransInput(Widget /*w*/, XtPointer, XtPointer call_data) {
6262
Real temp, scaledLBS(projPicturePtr->LongestBoxSide() * oo64);
6363
AmrQuaternion quatRotation, quatRotation2;
6464
AmrQuaternion newRotation, newRotation2;
@@ -429,7 +429,7 @@ void PltApp::DoDoneLightingWindow(Widget w, XtPointer xp1, XtPointer xp2) {
429429

430430

431431
// -------------------------------------------------------------------
432-
void PltApp::DestroyLightingWindow(Widget w, XtPointer xp, XtPointer) {
432+
void PltApp::DestroyLightingWindow(Widget /*w*/, XtPointer /*xp*/, XtPointer) {
433433
lightingWindowExists = false;
434434
}
435435

@@ -441,7 +441,7 @@ void PltApp::DoCancelLightingWindow(Widget, XtPointer, XtPointer) {
441441

442442

443443
// -------------------------------------------------------------------
444-
void PltApp::DoOpenFileLightingWindow(Widget w, XtPointer oos, XtPointer call_data)
444+
void PltApp::DoOpenFileLightingWindow(Widget /*w*/, XtPointer oos, XtPointer /*call_data*/)
445445
{
446446
static Widget wOpenLWDialog;
447447
wOpenLWDialog = XmCreateFileSelectionDialog(wAmrVisTopLevel,
@@ -784,7 +784,7 @@ void PltApp::DoAutoDraw(Widget, XtPointer, XtPointer) {
784784

785785

786786
// -------------------------------------------------------------------
787-
void PltApp::DoRenderModeMenu(Widget w, XtPointer item_no, XtPointer client_data) {
787+
void PltApp::DoRenderModeMenu(Widget w, XtPointer item_no, XtPointer /*client_data*/) {
788788
if(wCurrentRenderMode == w) {
789789
XtVaSetValues(w, XmNset, true, NULL);
790790
return;
@@ -808,7 +808,7 @@ void PltApp::DoRenderModeMenu(Widget w, XtPointer item_no, XtPointer client_data
808808

809809

810810
// -------------------------------------------------------------------
811-
void PltApp::DoClassifyMenu(Widget w, XtPointer item_no, XtPointer client_data) {
811+
void PltApp::DoClassifyMenu(Widget w, XtPointer item_no, XtPointer /*client_data*/) {
812812
if(wCurrentClassify == w) {
813813
XtVaSetValues(w, XmNset, true, NULL);
814814
return;
@@ -905,7 +905,7 @@ void PltApp::Clear() {
905905

906906

907907
// -------------------------------------------------------------------
908-
void PltApp::DoOrient(Widget w, XtPointer client_data, XtPointer) {
908+
void PltApp::DoOrient(Widget /*w*/, XtPointer client_data, XtPointer) {
909909
Real rW(1.0), rX(0.0), rY(0.0), rZ(0.0);
910910
Real rW2(1.0), rX2(0.0), rY2(0.0), rZ2(0.0);
911911
//int iOrientation((int) client_data);

PltAppOutput.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ using namespace amrex;
2727

2828
// -------------------------------------------------------------------
2929
void PltApp::DoOutput(Widget w, XtPointer data, XtPointer) {
30+
amrex::ignore_unused(w);
3031
int i;
3132
static Widget wGetFileName;
3233
XmString sMessage;

0 commit comments

Comments
 (0)