Commit 648903ed authored by Sean McBride's avatar Sean McBride

Fixed -Wmissing-variable-declarations warnings in .cxx

Fixed by adding 'static' and/or 'const' to several
variables that had neither.

Removed one obsolete comment too.

Change-Id: I8775c9a1fa8d9cc75b28619216bbe7f901117a0f
parent 7f8ca8e8
......@@ -31,7 +31,7 @@
#include "vtkColorTransferFunction.h"
#include "vtkCompositeTransferFunctionItem.h"
char TestControlPointsHandleItemLog[] =
static char TestControlPointsHandleItemLog[] =
"# StreamVersion 1\n"
"RenderEvent 0 0 0 0 0 0 0\n"
"TimerEvent 0 0 0 0 0 0 0\n"
......
......@@ -27,7 +27,7 @@
#include "vtkRenderWindowInteractor.h"
#include "vtkNew.h"
char TestLinePlotInteractionLog[] =
static char TestLinePlotInteractionLog[] =
"# StreamVersion 1\n"
"RenderEvent 0 0 0 0 0 0 0\n"
"EnterEvent 198 5 0 0 0 0 0\n"
......
......@@ -35,21 +35,21 @@
const int num_months = 12;
int month[] = {1,2,3,4,5,6,7,8,9,10,11,12};
static const int month[] = {1,2,3,4,5,6,7,8,9,10,11,12};
int book_2008[] = {5675, 5902, 6388, 5990, 5575, 7393, 9878, 8082, 6417, 5946, 5526, 5166};
int new_popular_2008[] = {701, 687, 736, 696, 750, 814, 923, 860, 786, 735, 680, 741};
int periodical_2008[] = {184, 176, 166, 131, 171, 191, 231, 166, 197, 162, 152, 143};
int audiobook_2008[] = {903, 1038, 987, 1073, 1144, 1203, 1173, 1196, 1213, 1076, 926, 874};
int video_2008[] = {1524, 1565, 1627, 1445, 1179, 1816, 2293, 1811, 1588, 1561, 1542, 1563};
static const int book_2008[] = {5675, 5902, 6388, 5990, 5575, 7393, 9878, 8082, 6417, 5946, 5526, 5166};
static const int new_popular_2008[] = {701, 687, 736, 696, 750, 814, 923, 860, 786, 735, 680, 741};
static const int periodical_2008[] = {184, 176, 166, 131, 171, 191, 231, 166, 197, 162, 152, 143};
static const int audiobook_2008[] = {903, 1038, 987, 1073, 1144, 1203, 1173, 1196, 1213, 1076, 926, 874};
static const int video_2008[] = {1524, 1565, 1627, 1445, 1179, 1816, 2293, 1811, 1588, 1561, 1542, 1563};
int book_2009[] = {6388, 5990, 5575, 9878, 8082, 5675, 7393, 5902, 5526, 5166, 5946, 6417};
int new_popular_2009[] = {696, 735, 786, 814, 736, 860, 750, 687, 923, 680, 741, 701};
int periodical_2009[] = {197, 166, 176, 231, 171, 152, 166, 131, 184, 191, 143, 162};
int audiobook_2009[] = {1213, 1076, 926, 987, 903, 1196, 1073, 1144, 1203, 1038, 874, 1173};
int video_2009[] = {2293, 1561, 1542, 1627, 1588, 1179, 1563, 1445, 1811, 1565, 1524, 1816};
static const int book_2009[] = {6388, 5990, 5575, 9878, 8082, 5675, 7393, 5902, 5526, 5166, 5946, 6417};
static const int new_popular_2009[] = {696, 735, 786, 814, 736, 860, 750, 687, 923, 680, 741, 701};
static const int periodical_2009[] = {197, 166, 176, 231, 171, 152, 166, 131, 184, 191, 143, 162};
static const int audiobook_2009[] = {1213, 1076, 926, 987, 903, 1196, 1073, 1144, 1203, 1038, 874, 1173};
static const int video_2009[] = {2293, 1561, 1542, 1627, 1588, 1179, 1563, 1445, 1811, 1565, 1524, 1816};
static void build_array(const char *name, vtkIntArray *array, int c_array[])
static void build_array(const char *name, vtkIntArray *array, const int c_array[])
{
array->SetName(name);
for (int i = 0; i < num_months; ++i)
......
......@@ -22,7 +22,7 @@
#include "vtkVersion.h"
#include "vtkPoints.h"
int failed = 0;
static int failed = 0;
class vtkTestPoints : public vtkPoints
{
......
......@@ -24,7 +24,7 @@
// Must NOT be initialized. Default initialization to zero is
// necessary.
unsigned int vtkDebugLeaksManagerCount;
static unsigned int vtkDebugLeaksManagerCount;
vtkDebugLeaksManager::vtkDebugLeaksManager()
{
......
......@@ -18,7 +18,7 @@
// Must NOT be initialized. Default initialization to zero is
// necessary.
unsigned int vtkGarbageCollectorManagerCount;
static unsigned int vtkGarbageCollectorManagerCount;
vtkGarbageCollectorManager::vtkGarbageCollectorManager()
{
......
......@@ -61,7 +61,7 @@ void _OctreeNodeInsertNextPoint( vtkPoints * points, vtkIdType * pntIdx,
typedef void ( * OCTREENODE_INSERTPOINT_FUNCTION )
( vtkPoints * points, vtkIdType * pntIdx, const double * coords );
OCTREENODE_INSERTPOINT_FUNCTION OCTREENODE_INSERTPOINT[3] =
static OCTREENODE_INSERTPOINT_FUNCTION OCTREENODE_INSERTPOINT[3] =
{
_OctreeNodeGetPointId,
_OctreeNodeInsertPoint,
......
......@@ -41,7 +41,7 @@
#include "vtkAMRBox.h"
#include "AMRCommon.h"
struct PulseAttributes {
static struct PulseAttributes {
double origin[3]; // xyz for the center of the pulse
double width[3]; // the width of the pulse
double amplitude; // the amplitude of the pulse
......
......@@ -40,12 +40,12 @@
#include "vtkRenderWindowInteractor.h"
#include "vtkTextProperty.h"
int xLength;
int yLength;
vtkSmartPointer<vtkSelectVisiblePoints> visPts;
vtkSmartPointer<vtkSelectVisiblePoints> visCells;
vtkSmartPointer<vtkPoints> pts;
vtkSmartPointer<vtkRenderWindow> renWin;
static int xLength;
static int yLength;
static vtkSmartPointer<vtkSelectVisiblePoints> visPts;
static vtkSmartPointer<vtkSelectVisiblePoints> visCells;
static vtkSmartPointer<vtkPoints> pts;
static vtkSmartPointer<vtkRenderWindow> renWin;
// Create a procedure to draw the selection window at each location it
// is moved to.
......
......@@ -501,7 +501,7 @@ void vtkTessellatorFilter::Teardown()
// ========================================
// output element topology
double extraLinHexParams[12][3] =
static const double extraLinHexParams[12][3] =
{
{ 0.5, 0.0, 0.0 },
{ 1.0, 0.5, 0.0 },
......@@ -517,7 +517,7 @@ double extraLinHexParams[12][3] =
{ 0.0, 1.0, 0.5 },
};
double extraQuadHexParams[7][3] =
static const double extraQuadHexParams[7][3] =
{
{ 0.5, 0.5, 0.0 },
{ 0.5, 0.5, 1.0 },
......@@ -528,42 +528,42 @@ double extraQuadHexParams[7][3] =
{ 0.5, 0.5, 0.5 }
};
double extraQuadQuadParams[1][3] =
static const double extraQuadQuadParams[1][3] =
{
{ 0.5, 0.5, 0.0 }
};
vtkIdType linEdgeEdges[][2] =
static vtkIdType linEdgeEdges[][2] =
{
{0,1}
};
vtkIdType quadEdgeEdges[][2] =
static vtkIdType quadEdgeEdges[][2] =
{
{0,2},
{2,1}
};
vtkIdType cubicLinEdges[][2] =
static vtkIdType cubicLinEdges[][2] =
{
{0,2},
{2,3},
{3,1}
};
vtkIdType linTriTris[][3] =
static vtkIdType linTriTris[][3] =
{
{0,1,2}
};
vtkIdType linTriEdges[][2] =
static vtkIdType linTriEdges[][2] =
{
{0,1},
{1,2},
{2,0}
};
vtkIdType quadTriTris[][3] =
static vtkIdType quadTriTris[][3] =
{
{0,3,5},
{5,3,1},
......@@ -571,7 +571,7 @@ vtkIdType quadTriTris[][3] =
{4,2,5}
};
vtkIdType biQuadTriTris[][3] =
static vtkIdType biQuadTriTris[][3] =
{
{0,3,6},
{3,1,6},
......@@ -581,7 +581,7 @@ vtkIdType biQuadTriTris[][3] =
{0,6,5}
};
vtkIdType biQuadTriEdges[][2] =
static vtkIdType biQuadTriEdges[][2] =
{
{0,3},
{3,1},
......@@ -591,7 +591,7 @@ vtkIdType biQuadTriEdges[][2] =
{5,0}
};
vtkIdType quadTriEdges[][2] =
static vtkIdType quadTriEdges[][2] =
{
{0,3},
{3,1},
......@@ -601,13 +601,13 @@ vtkIdType quadTriEdges[][2] =
{5,0}
};
vtkIdType linQuadTris[][3] =
static vtkIdType linQuadTris[][3] =
{
{0,1,2},
{0,2,3}
};
vtkIdType linQuadEdges[][2] =
static vtkIdType linQuadEdges[][2] =
{
{0,1},
{1,2},
......@@ -615,7 +615,7 @@ vtkIdType linQuadEdges[][2] =
{3,0}
};
vtkIdType quadQuadTris[][3] =
static vtkIdType quadQuadTris[][3] =
{
{0,4,7},
{7,4,8},
......@@ -627,7 +627,7 @@ vtkIdType quadQuadTris[][3] =
{2,6,8}
};
vtkIdType quadQuadEdges[][2] =
static vtkIdType quadQuadEdges[][2] =
{
{0,4},
{4,1},
......@@ -639,14 +639,14 @@ vtkIdType quadQuadEdges[][2] =
{7,0}
};
vtkIdType linWedgeTetrahedra[][4] =
static vtkIdType linWedgeTetrahedra[][4] =
{
{3,2,1,0},
{1,2,3,4},
{2,3,4,5}
};
vtkIdType linWedgeTris[][3] =
static vtkIdType linWedgeTris[][3] =
{
{0,2,1},
{3,4,5},
......@@ -660,7 +660,7 @@ vtkIdType linWedgeTris[][3] =
{5,0,3}
};
vtkIdType linWedgeEdges[][2] =
static vtkIdType linWedgeEdges[][2] =
{
{0,1},
{1,2},
......@@ -673,13 +673,13 @@ vtkIdType linWedgeEdges[][2] =
{2,5}
};
vtkIdType linPyrTetrahedra[][4] =
static vtkIdType linPyrTetrahedra[][4] =
{
{0,1,2,4},
{0,2,3,4}
};
vtkIdType linPyrTris[][3] =
static vtkIdType linPyrTris[][3] =
{
{0,1,2},
{0,2,3},
......@@ -689,7 +689,7 @@ vtkIdType linPyrTris[][3] =
{3,0,4}
};
vtkIdType linPyrEdges[][2] =
static vtkIdType linPyrEdges[][2] =
{
{0,1},
{1,2},
......@@ -701,12 +701,12 @@ vtkIdType linPyrEdges[][2] =
{3,4}
};
vtkIdType linTetTetrahedra[][4] =
static vtkIdType linTetTetrahedra[][4] =
{
{0,1,2,3}
};
vtkIdType linTetTris[][3] =
static vtkIdType linTetTris[][3] =
{
{0,2,1},
{0,1,3},
......@@ -714,7 +714,7 @@ vtkIdType linTetTris[][3] =
{2,0,3}
};
vtkIdType linTetEdges[][2] =
static vtkIdType linTetEdges[][2] =
{
{0,1},
{1,2},
......@@ -724,7 +724,7 @@ vtkIdType linTetEdges[][2] =
{2,3}
};
vtkIdType quadTetTetrahedra[][4] =
static vtkIdType quadTetTetrahedra[][4] =
{
{4,7,6,0},
{5,6,9,2},
......@@ -736,7 +736,7 @@ vtkIdType quadTetTetrahedra[][4] =
{6,8,9,7}
};
vtkIdType quadTetTris[][3] =
static vtkIdType quadTetTris[][3] =
{
{0,6,4},
{4,6,5},
......@@ -759,7 +759,7 @@ vtkIdType quadTetTris[][3] =
{9,7,3}
};
vtkIdType quadTetEdges[][2] =
static vtkIdType quadTetEdges[][2] =
{
{0,4},
{4,1},
......@@ -785,7 +785,7 @@ vtkIdType quadTetEdges[][2] =
* neighboring hexes to have compatible
* boundaries.
*/
vtkIdType quadHexTetrahedra[][4] =
static vtkIdType quadHexTetrahedra[][4] =
{
{ 0, 8,20,26},
{ 8, 1,20,26},
......@@ -842,7 +842,7 @@ vtkIdType quadHexTetrahedra[][4] =
{ 9, 1,25,26}
};
vtkIdType quadHexTris[][3] =
static vtkIdType quadHexTris[][3] =
{
{ 0, 8,20},
{ 8, 1,20},
......@@ -899,7 +899,7 @@ vtkIdType quadHexTris[][3] =
{ 9, 1,25}
};
vtkIdType quadHexEdges[][2] =
static vtkIdType quadHexEdges[][2] =
{
{ 0, 8},
{ 8, 1},
......@@ -928,7 +928,7 @@ vtkIdType quadHexEdges[][2] =
};
vtkIdType quadVoxTetrahedra[][4] =
static vtkIdType quadVoxTetrahedra[][4] =
{
{ 0, 8,20,26},
{ 8, 1,20,26},
......@@ -985,7 +985,7 @@ vtkIdType quadVoxTetrahedra[][4] =
{ 9, 1,25,26}
};
vtkIdType quadVoxTris[][3] =
static vtkIdType quadVoxTris[][3] =
{
{ 0, 8,20},
{ 8, 1,20},
......@@ -1042,7 +1042,7 @@ vtkIdType quadVoxTris[][3] =
{ 9, 1,25}
};
vtkIdType quadVoxEdges[][2] =
static vtkIdType quadVoxEdges[][2] =
{
{ 0, 8},
{ 8, 1},
......
......@@ -73,7 +73,7 @@ void vtkEarthSource::PrintSelf(ostream& os, vtkIndent indent)
// Special thanks to Tom Johnson at Johnson Scientific International who
// developed and contributed this class based on the data of John B. Allison.
short vtkEarthData[] = {
static const short vtkEarthData[] = {
/* 0 */
3903, 1, 13663, 15523, 21733,
-138, 74, 34, 69, 29, -64, -38, 19, 10, -93, 24, 41,
......
......@@ -382,12 +382,12 @@ void vtkHyperOctreeSurfaceFilter::GenerateQuads(double bounds[4],
// For each face, give the sequence of for point id, counterclockwise.
// [face][ptId]
int Quads[6][4]={{0,4,6,2}, // -x
{3,7,5,1}, // +x
{0,1,5,4}, // -y
{2,6,7,3}, // +y
{0,2,3,1}, // -z
{4,5,7,6}}; // +z
static const int Quads[6][4]={{0,4,6,2}, // -x
{3,7,5,1}, // +x
{0,1,5,4}, // -y
{2,6,7,3}, // +y
{0,2,3,1}, // -z
{4,5,7,6}}; // +z
//-----------------------------------------------------------------------------
void vtkHyperOctreeSurfaceFilter::GenerateFaces(double bounds[6],
......
......@@ -44,7 +44,7 @@ typedef double (*CellQualityType)( vtkCell* );
double TetVolume( vtkCell* cell );
const char* QualityMeasureNames[] =
static const char* QualityMeasureNames[] =
{
"EdgeRatio",
"AspectRatio",
......
......@@ -50,7 +50,7 @@ vtkIVExporter::~vtkIVExporter()
}
static char indent[256];
int indent_now = 0;
static int indent_now = 0;
#define VTK_INDENT_MORE { indent[indent_now] = ' '; \
indent_now += 4; \
indent[indent_now] = 0; }
......
......@@ -43,7 +43,7 @@
#include "vtkPolygonalSurfaceContourLineInterpolator.h"
#include "vtkTestUtilities.h"
char TestDijkstraGraphGeodesicPathLog[] =
static char TestDijkstraGraphGeodesicPathLog[] =
"# StreamVersion 1\n"
"EnterEvent 260 15 0 0 0 0 0 i\n"
"MouseMoveEvent 186 15 0 0 0 0 0 i\n"
......
......@@ -73,7 +73,7 @@ public:
};
// -----------------------------------------------------------------------
char HandleWidgetLog[] =
static char HandleWidgetLog[] =
"# StreamVersion> 1\n"
"RenderEvent 0 0 0 0 0 0 0\n"
"RenderEvent 0 0 0 0 0 0 0\n"
......
......@@ -653,7 +653,7 @@ void vtkMultiProcessController::ProcessRMI(int remoteProcessId,
//============================================================================
// The intent is to give access to a processes controller from a static method.
vtkWeakPointer<vtkMultiProcessController> VTK_GLOBAL_MULTI_PROCESS_CONTROLLER;
static vtkWeakPointer<vtkMultiProcessController> VTK_GLOBAL_MULTI_PROCESS_CONTROLLER;
//----------------------------------------------------------------------------
vtkMultiProcessController *vtkMultiProcessController::GetGlobalController()
{
......
......@@ -694,8 +694,8 @@ vtkAxisActor::BuildLabels(vtkViewport *viewport, bool force)
}
}
int vtkAxisActorMultiplierTable1[4] = { -1, -1, 1, 1};
int vtkAxisActorMultiplierTable2[4] = { -1, 1, 1, -1};
static const int vtkAxisActorMultiplierTable1[4] = { -1, -1, 1, 1};
static const int vtkAxisActorMultiplierTable2[4] = { -1, 1, 1, -1};
// *******************************************************************
// Determine and set scale factor and position for labels.
......
......@@ -46,9 +46,9 @@
#include "vtkDataSetReader.h"
static vtkSmartPointer<vtkRenderer> renderer;
vtkSmartPointer<vtkSphereSource> SS1;
vtkSmartPointer<vtkDataSetMapper> sMap;
vtkSmartPointer<vtkPolyData> emptyPD;
static vtkSmartPointer<vtkSphereSource> SS1;
static vtkSmartPointer<vtkDataSetMapper> sMap;
static vtkSmartPointer<vtkPolyData> emptyPD;
#define MY_CREATE_NEW(class, variable)\
vtkSmartPointer<class> variable = vtkSmartPointer<class>::New();
......
......@@ -870,12 +870,12 @@ void vtkOpenGLShaderState::PrintSelf(ostream &os,
}
int ShaderTypeValueTable[2]={
static int ShaderTypeValueTable[2]={
vtkgl::VERTEX_SHADER,
vtkgl::FRAGMENT_SHADER
};
const char *ShaderTypeStringTable[2]={
static const char *ShaderTypeStringTable[2]={
"GL_VERTEX_SHADER",
"GL_FRAGMENT_SHADER"
};
......@@ -956,7 +956,7 @@ void vtkOpenGLBufferObjectState::BufferAccessFlagsToStream(ostream &os)
}
}
int BufferUsageValueTable[9]={
static int BufferUsageValueTable[9]={
vtkgl::STREAM_DRAW,
vtkgl::STREAM_READ,
vtkgl::STREAM_COPY,
......@@ -968,7 +968,7 @@ int BufferUsageValueTable[9]={
vtkgl::DYNAMIC_COPY
};
const char *BufferUsageStringTable[9]={
static const char *BufferUsageStringTable[9]={
"GL_STREAM_DRAW",
"GL_STREAM_READ",
"GL_STREAM_COPY",
......@@ -986,13 +986,13 @@ const char *vtkOpenGLBufferObjectState::BufferUsageToString()
BufferUsageStringTable, 9);
}
int BufferAccessValueTable[3]={
static int BufferAccessValueTable[3]={
vtkgl::READ_ONLY,
vtkgl::WRITE_ONLY,
vtkgl::READ_WRITE
};
const char *BufferAccessStringTable[3]={
static const char *BufferAccessStringTable[3]={
"GL_READ_ONLY",
"GL_WRITE_ONLY",
"GL_READ_WRITE"
......@@ -1027,24 +1027,22 @@ void vtkOpenGLComponentTransform::PrintSelf(ostream &os,
os << indent << "Bias=" << this->Bias << endl;
}
// Unknown is a reserved value on BCC:
// Bcc55\include\winioctl.h 682:
const char *UnknownValue="Unknown value";
const char *NA="N/A";
static const char *UnknownValue="Unknown value";
static const char *NA="N/A";
int BooleanValueTable[2]=
static int BooleanValueTable[2]=
{
GL_FALSE,
GL_TRUE
};
const char *BooleanStringTable[2]=
static const char *BooleanStringTable[2]=
{
"GL_FALSE",
"GL_TRUE"
};
int MatrixModeValueTable[4]=
static int MatrixModeValueTable[4]=
{
GL_MODELVIEW,
GL_PROJECTION,
......@@ -1052,7 +1050,7 @@ int MatrixModeValueTable[4]=
GL_COLOR
};
const char *MatrixModeStringTable[4]=
static const char *MatrixModeStringTable[4]=
{
"GL_MODELVIEW",
"GL_PROJECTION",
......@@ -1060,59 +1058,59 @@ const char *MatrixModeStringTable[4]=
"GL_COLOR"
};
int ShadeModelValueTable[2]=
static int ShadeModelValueTable[2]=
{
GL_SMOOTH,
GL_FLAT
};
const char *ShadeModelStringTable[2]=
static const char *ShadeModelStringTable[2]=
{
"GL_SMOOTH",
"GL_FLAT"
};
int CullFaceModeValueTable[3]=
static int CullFaceModeValueTable[3]=
{
GL_FRONT,
GL_BACK,
GL_FRONT_AND_BACK
};
const char *CullFaceModeStringTable[3]=
static const char *CullFaceModeStringTable[3]=
{
"GL_FRONT",
"GL_BACK",
"GL_FRONT_AND_BACK"
};
int FrontFaceValueTable[2]=
static int FrontFaceValueTable[2]=
{
GL_CW,
GL_CCW
};
const char *FrontFaceStringTable[2]=
static const char *FrontFaceStringTable[2]=
{
"GL_CW",
"GL_CCW",
};
int PolygonModeValueTable[3]=
static int PolygonModeValueTable[3]=
{
GL_POINT,
GL_LINE,
GL_FILL
};
const char *PolygonModeStringTable[3]=
static const char *PolygonModeStringTable[3]=
{
"GL_POINT",
"GL_LINE",
"GL_FILL"
};
int AlphaTestFuncValueTable[8]=
static int AlphaTestFuncValueTable[8]=
{
GL_NEVER,
GL_ALWAYS,
......@@ -1124,7 +1122,7 @@ int AlphaTestFuncValueTable[8]=
GL_NOTEQUAL
};
const char *AlphaTestFuncStringTable[8]=
static const char *AlphaTestFuncStringTable[8]=
{
"GL_NEVER",
"GL_ALWAYS",
......@@ -1136,33 +1134,33 @@ const char *AlphaTestFuncStringTable[8]=
"GL_NOTEQUAL"
};
int RenderModeValueTable[3]=
static int RenderModeValueTable[3]=
{
GL_RENDER,
GL_SELECT,
GL_FEEDBACK
};
const char *RenderModeStringTable[3]=
static const char *RenderModeStringTable[3]=
{
"GL_RENDER",
"GL_SELECT",
"GL_FEEDBACK"
};
int ListModeValueTable[2]=
static int ListModeValueTable[2]=
{
GL_COMPILE,
GL_COMPILE_AND_EXECUTE
};
const char *ListModeStringTable[2]=
static const char *ListModeStringTable[2]=
{
"GL_COMPILE",
"GL_COMPILE_AND_EXECUTE"
};
int BlendFuncValueTable[15]=
static int BlendFuncValueTable[15]=