Commit b0338cff authored by loring's avatar loring
Browse files

libsim: cleanup warnings reported by -Wall



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23272 18c085ea-50e0-402c-830e-de6fd14e8384
parent 8d66faff
......@@ -53,6 +53,7 @@ void simv2_end_trace_indent(void);
#define LIBSIM_API_ENTER2(FUNC, FMT, A, B)
#define LIBSIM_API_ENTER3(FUNC, FMT, A, B, C)
#define LIBSIM_API_LEAVE(FUNC)
#define LIBSIM_API_LEAVE0(FUNC, FMT)
#define LIBSIM_API_LEAVE1(FUNC, FMT, A)
#define LIBSIM_API_LEAVE2(FUNC, FMT, A, B)
#define LIBSIM_API_LEAVE3(FUNC, FMT, A, B, C)
......@@ -105,6 +106,14 @@ void simv2_end_trace_indent(void);
fflush(simv2_trace_file()); \
}
#define LIBSIM_API_LEAVE0(FUNC, FMT) if(simv2_trace_file() != NULL) {\
simv2_end_trace_indent(); \
fprintf(simv2_trace_file(), "%s ", #FUNC); \
fprintf(simv2_trace_file(), FMT); \
fprintf(simv2_trace_file(), "\n");\
fflush(simv2_trace_file()); \
}
#define LIBSIM_API_LEAVE2(FUNC, FMT, A, B) if(simv2_trace_file() != NULL) {\
simv2_end_trace_indent(); \
......
......@@ -42,7 +42,6 @@
#include "DeclareDataCallbacks.h"
#include "SimUI.h"
#ifdef _WIN32
#if _MSC_VER < 1600
#define _WIN32_WINNT 0x0502
......@@ -1584,16 +1583,13 @@ LIBSIM_MESSAGE1("Error: %x", GetLastError());
* Author: Cyrus Harrison
*
* Modifications:
* Burlen Loring, Sat May 3 10:52:13 PDT 2014
* fix bug, return a value. report if the env var is not found
*
*******************************************************************************/
int Preload_OSMesaGL(void)
{
/* load library */
#ifdef __APPLE__
const char *extension = "dylib";
#else
const char *extension = "so";
#endif
/* load library */
void *gl_dl_handle = NULL;
if(getenv("VISIT_MESA_LIB") != NULL)
{
......@@ -1604,8 +1600,12 @@ int Preload_OSMesaGL(void)
{
LIBSIM_MESSAGE1("dlopen error: %s", dlerror());
LIBSIM_MESSAGE1("failed to preload osmesa from VISIT_MESA_LIB: %s",osmesa_lib_path);
return -1;
}
return 0;
}
LIBSIM_MESSAGE("Not preloading osmesa, VISIT_MESA_LIB was not set");
return -1;
}
static int LoadVisItLibrary_UNIX(void)
......@@ -3799,25 +3799,22 @@ VisItAddPlot(const char *plotType, const char *var, int *plotID)
if(plotType == NULL)
{
LIBSIM_API_LEAVE1(VisItAddPlot,
"VisItAddPlot: NULL was passed for the plot type.",
VISIT_ERROR);
LIBSIM_API_LEAVE0(VisItAddPlot,
"VisItAddPlot: NULL was passed for the plot type.");
return VISIT_ERROR;
}
if(var == NULL)
{
LIBSIM_API_LEAVE1(VisItAddPlot,
"VisItAddPlot: NULL was passed for the variable.",
VISIT_ERROR);
LIBSIM_API_LEAVE0(VisItAddPlot,
"VisItAddPlot: NULL was passed for the variable.");
return VISIT_ERROR;
}
if(plotID == NULL)
{
LIBSIM_API_LEAVE1(VisItAddPlot,
"VisItAddPlot: NULL was passed for the plotID pointer.",
VISIT_ERROR);
LIBSIM_API_LEAVE0(VisItAddPlot,
"VisItAddPlot: NULL was passed for the plotID pointer.");
return VISIT_ERROR;
}
......@@ -3863,17 +3860,15 @@ VisItAddOperator(int plotID, const char *operatorType, int *operatorID)
if(operatorType == NULL)
{
LIBSIM_API_LEAVE1(VisItAddOperator,
"VisItAddOperator: NULL was passed for the operator type.",
VISIT_ERROR);
LIBSIM_API_LEAVE0(VisItAddOperator,
"VisItAddOperator: NULL was passed for the operator type.");
return VISIT_ERROR;
}
if(operatorID == NULL)
{
LIBSIM_API_LEAVE1(VisItAddOperator,
"VisItAddOperator: NULL was passed for the operatorID pointer.",
VISIT_ERROR);
LIBSIM_API_LEAVE0(VisItAddOperator,
"VisItAddOperator: NULL was passed for the operatorID pointer.");
return VISIT_ERROR;
}
......
......@@ -40,6 +40,7 @@
#include <VisItInterfaceTypes_V2.h>
#include <VisItInterfaceTypes_V2P.h>
#include <DebugStream.h>
#include <Engine.h>
#include <NetworkManager.h>
#include <LostConnectionException.h>
......@@ -147,7 +148,7 @@ int simv2_initialize(void *e, int argc, char *argv[])
retval = 0;
}
ENDTRY
return 1;
return retval;
}
int simv2_connect_viewer(void *e, int argc, char *argv[])
......@@ -180,8 +181,6 @@ int simv2_get_descriptor(void *e)
return engine->GetInputSocket();
}
#include <DebugStream.h>
int simv2_process_input(void *e)
{
Engine *engine = (Engine*)(e);
......
......@@ -6,7 +6,6 @@
#include <vector>
#include <algorithm>
VisIt_ObjectBase::VisIt_ObjectBase(int t) : object_type(t)
{
}
......@@ -34,9 +33,10 @@ VisIt_ObjectBase *
VisItGetPointer(visit_handle h)
{
VisIt_ObjectBase *retval = NULL;
if ((h >=0 ) && (h < visit_pointers.size()))
size_t i = static_cast<size_t>(h);
if (i < visit_pointers.size())
{
retval = visit_pointers[h];
retval = visit_pointers[i];
}
return retval;
}
......@@ -44,9 +44,10 @@ VisItGetPointer(visit_handle h)
void
VisItFreePointer(visit_handle h)
{
if ((h >=0 ) && (h < visit_pointers.size()))
size_t i = static_cast<size_t>(h);
if (i < visit_pointers.size())
{
visit_pointers[h] = NULL;
visit_pointers[i] = NULL;
}
}
......
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