1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
From: Justin Pryzby <justinpryzby@users.sf.net>
Date: Fri, 16 Dec 2016 09:23:38 +0100
Subject: [tksao] Avoid compile time warnings and errors
---
tksao/colorbar/cbgrid.C | 12 ++++++------
tksao/frame/grid25d.C | 10 +++++-----
tksao/frame/grid2d.C | 14 +++++++-------
tksao/frame/grid3d.C | 24 ++++++++++++------------
tksao/frame/wcsast.C | 2 +-
5 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/tksao/colorbar/cbgrid.C b/tksao/colorbar/cbgrid.C
index c84afd4..4edbcb5 100644
--- a/tksao/colorbar/cbgrid.C
+++ b/tksao/colorbar/cbgrid.C
@@ -123,19 +123,19 @@ int CBGrid::doit(RenderMode rm)
if (!(frameSet = astFrameSet(astFrame(2,"Domain=WIDGET"),"")))
goto error;
- if (!(bb = astUnitMap(1,"")))
+ if (!(bb = astUnitMap(1,"%s", "")))
goto error;
if (!opts->orientation) {
- if (!(aa = astLutMap(cnt_, lut_, 0, double(opts->width)/(cnt_-1), "")))
+ if (!(aa = astLutMap(cnt_, lut_, 0, double(opts->width)/(cnt_-1), "%s", "")))
goto error;
- if (!(cmp = astCmpMap(aa, bb, 0, "")))
+ if (!(cmp = astCmpMap(aa, bb, 0, "%s", "")))
goto error;
}
else {
- if (!(aa = astLutMap(cnt_, lut_, 0, double(opts->height)/(cnt_-1), "")))
+ if (!(aa = astLutMap(cnt_, lut_, 0, double(opts->height)/(cnt_-1), "%s", "")))
goto error;
- if (!(cmp = astCmpMap(bb, aa, 0, "")))
+ if (!(cmp = astCmpMap(bb, aa, 0, "%s", "")))
goto error;
}
@@ -197,7 +197,7 @@ int CBGrid::doit(RenderMode rm)
pbox[3] = 0;
}
- plot = astPlot(frameSet, gbox, pbox, option_, "");
+ plot = astPlot(frameSet, gbox, pbox, "%s", option_);
// and now create astGrid
astGrid2dPtr = this;
diff --git a/tksao/frame/grid25d.C b/tksao/frame/grid25d.C
index ed0107a..05a38b9 100644
--- a/tksao/frame/grid25d.C
+++ b/tksao/frame/grid25d.C
@@ -142,7 +142,7 @@ void Grid25d::doit(RenderMode rm)
// and now create astGrid
astGrid25dPtr = this;
- AstPlot* plot = astPlot(frameSet, gbox, pbox, option_, "");
+ AstPlot* plot = astPlot(frameSet, gbox, pbox, "%s", option_);
astGrid(plot);
astEnd; // now, clean up memory
@@ -155,9 +155,9 @@ void Grid25d::matrixMap(void* frameSet, Matrix& mx, const char* str)
mx.matrix(0,1),mx.matrix(1,1)};
double tt[] = {mx.matrix(2,0),mx.matrix(2,1)};
- AstMatrixMap* mm = astMatrixMap(2, 2, 0, ss, "");
- AstShiftMap* sm = astShiftMap(2, tt, "");
- AstCmpMap* cmp = astCmpMap(mm, sm, 1, "");
+ AstMatrixMap* mm = astMatrixMap(2, 2, 0, ss, "%s", "");
+ AstShiftMap* sm = astShiftMap(2, tt, "%s", "");
+ AstCmpMap* cmp = astCmpMap(mm, sm, 1, "%s", "");
- astAddFrame((AstFrameSet*)frameSet, AST__CURRENT, cmp, astFrame(2, str, ""));
+ astAddFrame((AstFrameSet*)frameSet, AST__CURRENT, cmp, astFrame(2, "%s", str));
}
diff --git a/tksao/frame/grid2d.C b/tksao/frame/grid2d.C
index f577a22..af2f9e4 100644
--- a/tksao/frame/grid2d.C
+++ b/tksao/frame/grid2d.C
@@ -38,7 +38,7 @@ void Grid2d::doit(RenderMode rm)
astBegin; // start memory management
// map from Widget to Image
- AstFrameSet* frameSet = astFrameSet(astFrame(2,"Domain=WIDGET"),"");
+ AstFrameSet* frameSet = astFrameSet(astFrame(2,"Domain=WIDGET"),"%s","");
matrixMap(frameSet,fits->widgetToImage,"Domain=IMAGE");
switch (system_) {
@@ -117,7 +117,7 @@ void Grid2d::doit(RenderMode rm)
int id = astGetI(ast,"Current");
int nf = astGetI(frameSet,"NFrame");
astInvert(ast);
- astAddFrame(frameSet, AST__CURRENT, astUnitMap(2,""), ast);
+ astAddFrame(frameSet, AST__CURRENT, astUnitMap(2,"%s",""), ast);
astSetI(frameSet,"Current",id+nf);
}
break;
@@ -164,7 +164,7 @@ void Grid2d::doit(RenderMode rm)
// and now create astGrid
astGrid2dPtr = this;
- AstPlot* plot = astPlot(frameSet, gbox, pbox, option_, "");
+ AstPlot* plot = astPlot(frameSet, gbox, pbox, "%s", option_);
astGrid(plot);
astEnd; // now, clean up memory
@@ -177,9 +177,9 @@ void Grid2d::matrixMap(void* frameSet, Matrix& mx, const char* str)
mx.matrix(0,1),mx.matrix(1,1)};
double tt[] = {mx.matrix(2,0),mx.matrix(2,1)};
- AstMatrixMap* mm = astMatrixMap(2, 2, 0, ss, "");
- AstShiftMap* sm = astShiftMap(2, tt, "");
- AstCmpMap* cmp = astCmpMap(mm, sm, 1, "");
+ AstMatrixMap* mm = astMatrixMap(2, 2, 0, ss, "%s", "");
+ AstShiftMap* sm = astShiftMap(2, tt, "%s", "");
+ AstCmpMap* cmp = astCmpMap(mm, sm, 1, "%s", "");
- astAddFrame((AstFrameSet*)frameSet, AST__CURRENT, cmp, astFrame(2, str, ""));
+ astAddFrame((AstFrameSet*)frameSet, AST__CURRENT, cmp, astFrame(2, "%s", str));
}
diff --git a/tksao/frame/grid3d.C b/tksao/frame/grid3d.C
index cd54ad8..3ce8940 100644
--- a/tksao/frame/grid3d.C
+++ b/tksao/frame/grid3d.C
@@ -95,19 +95,19 @@ void Grid3d::doit(RenderMode rm)
break;
case 2:
{
- AstFrame* zbase = astFrame(1,"");
- AstFrame* zcurr = astFrame(1,"");
- AstMapping* zmap = (AstMapping*)astUnitMap(1,"");
+ AstFrame* zbase = astFrame(1,"%s","");
+ AstFrame* zcurr = astFrame(1,"%s","");
+ AstMapping* zmap = (AstMapping*)astUnitMap(1,"%s","");
AstFrame* wcsbase = (AstFrame*)astGetFrame(ast,AST__BASE);
AstFrame* wcscurr = (AstFrame*)astGetFrame(ast,AST__CURRENT);
AstMapping* wcsmap = (AstMapping*)astGetMapping(ast,AST__BASE,AST__CURRENT);
- AstCmpFrame* cmpwcsbase = astCmpFrame(wcsbase,zbase,"");
- AstCmpFrame* cmpwcscurr = astCmpFrame(wcscurr,zcurr,"");
- AstCmpMap* cmpwcsmap = astCmpMap(wcsmap,zmap,0,"");
+ AstCmpFrame* cmpwcsbase = astCmpFrame(wcsbase,zbase,"%s","");
+ AstCmpFrame* cmpwcscurr = astCmpFrame(wcscurr,zcurr,"%s","");
+ AstCmpMap* cmpwcsmap = astCmpMap(wcsmap,zmap,0,"%s","");
- ast = astFrameSet(cmpwcsbase,"");
+ ast = astFrameSet(cmpwcsbase,"%s","");
astAddFrame(ast, AST__CURRENT, cmpwcsmap, cmpwcscurr);
}
break;
@@ -135,7 +135,7 @@ void Grid3d::doit(RenderMode rm)
int id = astGetI(ast,"Current");
int nf = astGetI(frameSet,"NFrame");
astInvert(ast);
- astAddFrame(frameSet, AST__CURRENT, astUnitMap(3,""), ast);
+ astAddFrame(frameSet, AST__CURRENT, astUnitMap(3,"%s",""), ast);
astSetI(frameSet,"Current",id+nf);
}
}
@@ -177,9 +177,9 @@ void Grid3d::matrixMap(void* frameSet, Matrix3d& mx, const char* str)
mx.matrix(0,2),mx.matrix(1,2),mx.matrix(2,2)};
double tt[] = {mx.matrix(3,0),mx.matrix(3,1),mx.matrix(3,2)};
- AstMatrixMap* mm = astMatrixMap(3,3,0,ss,"");
- AstShiftMap* sm = astShiftMap(3,tt,"");
- AstCmpMap* cmp = astCmpMap(mm,sm,1,"");
+ AstMatrixMap* mm = astMatrixMap(3,3,0,ss,"%s","");
+ AstShiftMap* sm = astShiftMap(3,tt,"%s","");
+ AstCmpMap* cmp = astCmpMap(mm,sm,1,"%s","");
- astAddFrame((AstFrameSet*)frameSet, AST__CURRENT, cmp, astFrame(3, str, ""));
+ astAddFrame((AstFrameSet*)frameSet, AST__CURRENT, cmp, astFrame(3, "%s", str));
}
diff --git a/tksao/frame/wcsast.C b/tksao/frame/wcsast.C
index a518544..c19b30f 100644
--- a/tksao/frame/wcsast.C
+++ b/tksao/frame/wcsast.C
@@ -63,7 +63,7 @@ void wcsFormat(AstFrameSet* ast, int id, const char* format)
}
ostringstream str;
str << "Format(" << id << ")=" << format << ends;
- astSet(ast, str.str().c_str(), "");
+ astSet(ast, "%s", str.str().c_str());
}
Vector wcsTran(Context* context, AstFrameSet* ast,
|