Commit 652ffdba authored by bonnell's avatar bonnell

Fix compilation errors on windows.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@7145 18c085ea-50e0-402c-830e-de6fd14e8384
parent 37532298
......@@ -63,6 +63,7 @@
#include <DebugStream.h>
#include <ExpressionException.h>
#include <snprintf.h>
using namespace std;
......@@ -536,7 +537,7 @@ avtExpressionFilter::SetExpressionAttributes(const avtDataAttributes &inputAtts,
char str[256];
for (int i=0; i<dim; i++)
{
snprintf(str, 256, "subvar%d", i);
SNPRINTF(str, 256, "subvar%d", i);
subnames.push_back(str);
}
outAtts.SetVariableSubnames(subnames, outputVariableName);
......
......@@ -57,6 +57,7 @@
#include <avtCallback.h>
#include <avtMetaData.h>
#include <snprintf.h>
#include <DebugStream.h>
#include <ExpressionException.h>
#include <ImproperUseException.h>
......@@ -305,7 +306,7 @@ avtGeodesicVectorQuantizeExpression::UpdateDataObjectInfo(void)
for (int i = 0 ; i < geodesic_sphere_npts ; i++)
{
char str[256];
snprintf(str,256,"node%03d",i);
SNPRINTF(str,256,"node%03d",i);
subnames[i] = str;
}
......
......@@ -262,7 +262,7 @@ ZooMIR::ReconstructMesh(vtkDataSet *mesh_orig, avtMaterial *mat_orig, int dim)
}
int *conn_ptr = conn.connectivity;
double actualVFStorage[nMaterials];
double *actualVFStorage = new double[nMaterials];
double *actualVFs = (options.numIterations>0) ? actualVFStorage : NULL;
double maxdiff = 0;
for (int c = 0 ; c < nCells ; c++, conn_ptr += (*conn_ptr) + 1)
......@@ -298,7 +298,7 @@ ZooMIR::ReconstructMesh(vtkDataSet *mesh_orig, avtMaterial *mat_orig, int dim)
}
visitTimer->StopTimer(timerHandle2, "MIR: Cell clipping");
delete [] actualVFStorage;
delete cr;
}
......
......@@ -50,6 +50,7 @@
#include <Environment.h>
#include <DebugStream.h>
#include <snprintf.h>
namespace Environment {
......@@ -79,11 +80,23 @@ exists(const char *variable)
void
set(const char *k, const char *v)
{
#ifndef WIN32
if(setenv(k, v, 1) != 0)
{
debug1 << "setenv(" << k << " = " << v << ") failed!" << std::endl
<< "Error: " << errno << ": '" << strerror(errno) << std::endl;
}
#else
int size = strlen(k) + strlen(v) +1;
char *envVar = new char [size + 1];
SNPRINTF(envVar, size, "%s=%s", k, v);
if(putenv(envVar) != 0)
{
debug1 << "putenv(" << k << " = " << v << ") failed!" << std::endl
<< "Error: " << errno << ": '" << strerror(errno) << std::endl;
}
delete [] envVar;
#endif
}
/// Removes a variable definition. Implementations appear to differ a bit
......
......@@ -156,16 +156,13 @@ GetDefaultConfigFile(const char *filename, const char *home)
GetUserName(username, &namelen);
retval = new char[realhome.length() + namelen + 5 + filenameLength + 2 + 7];
std::ostringstream ini;
ini << realhome << "\\" << configFileName << " for " << username
<< ".ini";
sprintf(retval, "%s\\%s for %s.ini", realhome.c_str(),
configFileName, username);
}
else
{
// System config.
retval = new char[strlen(realhome) + filenameLength + 2 + 7];
retval = new char[realhome.length() + filenameLength + 2 + 7];
sprintf(retval, "%s\\%s.ini", realhome.c_str(), configFileName);
}
}
......
......@@ -617,7 +617,7 @@ avtEnzoFileFormat::DetermineVariablesFromGridFile()
}
else
{
#if HAVE_LIBHDF5
#ifdef HAVE_LIBHDF5
hid_t fileId = H5Fopen(gridFileName.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
if (fileId < 0)
{
......
......@@ -50,7 +50,7 @@
#include <visit-config.h>
#if HAVE_LIBHDF5
#ifdef HAVE_LIBHDF5
// Define this symbol BEFORE including hdf5.h to indicate the HDF5 code
// in this file uses version 1.6 of the HDF5 API. This is harmless for
// versions of HDF5 before 1.8 and ensures correct compilation with
......@@ -142,7 +142,7 @@ VistaTree::GetTop() const
const int avtVistaFileFormat::MASTER_FILE_INDEX = 0;
int avtVistaFileFormat::objcnt = 0;
#if HAVE_LIBHDF5
#ifdef HAVE_LIBHDF5
// ****************************************************************************
// Function: avtVistaFileFormat::InitializeHDF5
//
......@@ -316,7 +316,7 @@ avtVistaFileFormat::avtVistaFileFormat(const char *filename,
DBShowErrors(DB_ALL, 0);
fileHandles[MASTER_FILE_INDEX] = dbfile;
}
#if HAVE_LIBHDF5
#ifdef HAVE_LIBHDF5
else
{
isSilo = false;
......@@ -414,7 +414,7 @@ avtVistaFileFormat::~avtVistaFileFormat()
avtVistaFileFormat::objcnt--;
// handle HDF5 library termination on descrution of last instance
#if HAVE_LIBHDF5
#ifdef HAVE_LIBHDF5
if (!isSilo && (avtVistaFileFormat::objcnt == 0))
FinalizeHDF5();
#endif
......@@ -510,7 +510,7 @@ avtVistaFileFormat::OpenFile(int f)
{
fileHandles[f] = (void *) DBOpen(filenames[f], DB_UNKNOWN, DB_READ);
}
#if HAVE_LIBHDF5
#ifdef HAVE_LIBHDF5
else
{
fileHandles[f] = (void *) new hid_t;
......@@ -614,7 +614,7 @@ avtVistaFileFormat::CloseFile(int f)
{
DBClose((DBfile*) fileHandles[f]);
}
#if HAVE_LIBHDF5
#ifdef HAVE_LIBHDF5
else
{
H5Fclose(*((hid_t*) fileHandles[f]));
......@@ -796,7 +796,7 @@ avtVistaFileFormat::ReadDataset(const char *fileName, const char *dsName,
}
}
#if HAVE_LIBHDF5
#ifdef HAVE_LIBHDF5
else
{
// open the dataset
......
......@@ -214,7 +214,7 @@ avtXDMFFileFormat::OpenFile(const char *n)
}
else
{
int lastSlash = fname.find_last_of(SLASH_STRING);
int lastSlash = fname.find_last_of(VISIT_SLASH_STRING);
if (lastSlash == string::npos)
{
strcpy(name, n);
......
......@@ -51,7 +51,7 @@
#include <unistd.h> // for alarm()
#else
#include <process.h> // for _getpid()
#include <winsock.h> // for gethostname()
#include <winsock2.h> // for gethostname()
#endif
#include <new>
......
......@@ -669,7 +669,7 @@ QvisMainWindow::QvisMainWindow(int orientation, const char *captionString)
spinModeAct = winPopup->addAction(tr("Spin"),
this, SLOT(toggleSpinMode()));
#if not defined(Q_WS_MACX)
#ifndef Q_WS_MACX
// We put the Help menu here on all platforms other than the Mac. The Mac
// help menu is done lower down.
......
......@@ -40,7 +40,9 @@
#include <VisItException.h>
#include <HostProfile.h>
#include <string>
#ifndef WIN32
#include <unistd.h>
#endif
#include <VisItInit.h>
#include <avtSIL.h>
......
......@@ -610,6 +610,7 @@ ParallelCoordinatesViewerPluginInfo::InitializePlotAtts(
*(ParallelCoordinatesAttributes*)atts = *defaultAtts;
}
Target: xml2info
Function: ParallelCoordinatesViewerPluginInfo::Permits2DViewScaling
Declaration: virtual bool Permits2DViewScaling() const;
Definition:
......
......@@ -670,7 +670,7 @@ islandChecks( vector< Point >& points,
// the hull is convex the base point may the centroid of all of the
// points or based upon a point that is perpendicular to the
// principal axis of the group of points.
unsigned int nodes[toroidalWinding];
vector<unsigned int>nodes(toroidalWinding);
for( unsigned int i=0; i<toroidalWinding; i++ ) {
......@@ -2682,7 +2682,7 @@ smoothCurve( vector< vector < Point > > &bins,
{
unsigned int nodes = bins[i].size();
pair< Point, unsigned int > newPts[add*nodes];
vector<pair< Point, unsigned int >> newPts(add*nodes);
for( unsigned int j=0; j<add*nodes; j++ )
newPts[j] = pair< Point, unsigned int > (Point(0,0,0), 0 );
......@@ -2995,7 +2995,7 @@ mergeOverlap( vector< vector < Point > > &bins,
}
} else {
vector < Point > tmp_bins[toroidalWinding];
vector<vector < Point >> tmp_bins(toroidalWinding);
// This gives the minimal number of nodes for each group.
surfaceOverlapCheck( bins, toroidalWinding, skip, nnodes );
......
......@@ -48,11 +48,18 @@
#define VERDICT_DBL_MAX 1.0E+300
#endif
#ifdef __cplusplus
#define C_FUNC_DEF extern "C"
#if defined(_WIN32)
#if defined(VERDICT_EXPORTS) || defined(visit_verdict_EXPORTS)
#define C_FUNC_DEF __declspec(dllexport)
#else
#define C_FUNC_DEF __declspec(dllimport)
#endif
#else
#define C_FUNC_DEF
#ifdef __cplusplus
#define C_FUNC_DEF extern "C"
#else
#define C_FUNC_DEF
#endif
#endif
......
......@@ -57,7 +57,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
vtkStandardNewMacro(vtkUnstructuredGridRelevantPointsFilter);
#include <avtParallel.h>
//------------------------------------------------------------------------------
// Modifications:
//
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment