Commit 357759eb authored by miller86's avatar miller86

fixing warnings in DataManualExamples

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23766 18c085ea-50e0-402c-830e-de6fd14e8384
parent 748d9f5c
......@@ -57,6 +57,8 @@ write_curv3d(DBfile *dbfile)
};
int dims[] = {4, 3, 2};
int ndims = 3;
float *coords[3];
coords[0] = (float*)x; coords[1] = (float*)y; coords[2] = (float*)z;
float *coords[] = {(float*)x, (float*)y, (float*)z};
DBPutQuadmesh(dbfile, "quadmesh", NULL, coords, dims, ndims,
DB_FLOAT, DB_NONCOLLINEAR, NULL);
......
......@@ -9,10 +9,11 @@ write_rect2d(DBfile *dbfile)
float y[] = {0., 2., 2.25, 2.55, 5.};
int dims[] = {4, 5};
int ndims = 2;
float *coords[] = {x, y};
float *coords[2];
/* Create an option list for saving cycle and time values. */
int cycle = 100;
double dtime = 1.23456789;
coords[0] = x; coords[1] = y;
DBoptlist *optlist = DBMakeOptlist(2);
DBAddOption(optlist, DBOPT_CYCLE, (void *)&cycle);
DBAddOption(optlist, DBOPT_DTIME, (void *)&dtime);
......
......@@ -58,7 +58,8 @@ write_curv3d(DBfile *dbfile)
};
int dims[] = {4, 3, 2};
int ndims = 3;
float *coords[] = {(float*)x, (float*)y, (float*)z};
float *coords[3];
coords[0] (float*)x; coords[1] (float*)y; coords[2] (float*)z;
DBPutQuadmesh(dbfile, "quadmesh", NULL, coords, dims, ndims,
DB_FLOAT, DB_NONCOLLINEAR, NULL);
}
......
......@@ -58,7 +58,8 @@ write_curv3d(DBfile *dbfile)
};
int dims[] = {4, 3, 2};
int ndims = 3;
float *coords[] = {(float*)x, (float*)y, (float*)z};
float *coords[3];
coords[0] = (float*)x; coords[1] = (float*)y; coords[2] = (float*)z;
DBPutQuadmesh(dbfile, "quadmesh", NULL, coords, dims, ndims,
DB_FLOAT, DB_NONCOLLINEAR, NULL);
}
......
......@@ -152,7 +152,7 @@ void simulate_one_timestep(simulation_data *sim)
{
++sim->cycle;
sim->time += 0.0134;
printf("Simulating time step: cycle=%d, time=%lg\n", sim->cycle, sim->time);
printf("Simulating time step: cycle=%d, time=%g\n", sim->cycle, sim->time);
sim_sleep(1);
VisItTimeStepChanged();
......@@ -434,7 +434,7 @@ SimGetMetaData(void *cbdata)
}
/* Add some custom commands. */
for(i = 0; i < sizeof(cmd_names)/sizeof(const char *); ++i)
for(i = 0; i < (int) (sizeof(cmd_names)/sizeof(const char *)); ++i)
{
visit_handle cmd = VISIT_INVALID_HANDLE;
if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
......@@ -520,7 +520,7 @@ visit_handle
SimGetVariable(int domain, const char *name, void *cbdata)
{
visit_handle h = VISIT_INVALID_HANDLE;
int nComponents = 1, nTuples = 0;
int nComponents = 1;
if(VisIt_VariableData_alloc(&h) == VISIT_OKAY)
{
......@@ -578,7 +578,6 @@ visit_handle
SimGetDomainNesting(const char *name, void *cbdata)
{
visit_handle h = VISIT_INVALID_HANDLE;
simulation_data *sim = (simulation_data *)cbdata;
if(VisIt_DomainNesting_alloc(&h) != VISIT_ERROR)
{
......@@ -596,6 +595,7 @@ SimGetDomainNesting(const char *name, void *cbdata)
*/
#ifdef VARYING_NUMBER_OF_PATCHES
int np = NPATCHES-1;
simulation_data *sim = (simulation_data *)cbdata;
if(sim->cycle % 2 == 1)
{
np = NPATCHES;
......
......@@ -350,7 +350,7 @@ void simulate_one_timestep(simulation_data *sim)
sim->time += (M_PI / 10.);
if(sim->par_rank == 0)
printf("Simulating time step: cycle=%d, time=%lg\n", sim->cycle, sim->time);
printf("Simulating time step: cycle=%d, time=%g\n", sim->cycle, sim->time);
simulation_data_update(sim);
......@@ -409,7 +409,7 @@ void SlaveProcessCallback(void *cbdata)
/* Process commands from viewer on all processors. */
int ProcessVisItCommand(simulation_data *sim)
{
int command;
int command = VISIT_COMMAND_FAILURE;
if (sim->par_rank==0)
{
int success = VisItProcessEngineCommand();
......@@ -504,7 +504,7 @@ ProcessConsoleCommand(simulation_data *sim)
void mainloop(simulation_data *sim)
{
int blocking, visitstate, err = 0;
int blocking, visitstate = 0, err = 0;
/* If we're not running by default then simulate once there's something
* once VisIt connects.
......@@ -713,12 +713,9 @@ SimGetMetaData(void *cbdata)
if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY)
{
int i;
double extents[6];
visit_handle mmd = VISIT_INVALID_HANDLE;
visit_handle vmd = VISIT_INVALID_HANDLE;
visit_handle cmd = VISIT_INVALID_HANDLE;
visit_handle emd = VISIT_INVALID_HANDLE;
/* Set the simulation state. */
VisIt_SimulationMetaData_setMode(md, (sim->runMode == SIM_STOPPED) ?
......@@ -750,7 +747,7 @@ SimGetMetaData(void *cbdata)
}
/* Add some commands. */
for(i = 0; i < sizeof(cmd_names)/sizeof(const char *); ++i)
for(i = 0; i < (int) (sizeof(cmd_names)/sizeof(const char *)); ++i)
{
visit_handle cmd = VISIT_INVALID_HANDLE;
if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
......
......@@ -88,7 +88,7 @@ void simulate_one_timestep(simulation_data *sim)
{
++sim->cycle;
sim->time += 0.0134;
printf("Simulating time step: cycle=%d, time=%lg\n", sim->cycle, sim->time);
printf("Simulating time step: cycle=%d, time=%g\n", sim->cycle, sim->time);
sim_sleep(1);
}
......@@ -336,7 +336,6 @@ SimGetMetaData(void *cbdata)
if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY)
{
int i;
visit_handle cmd = VISIT_INVALID_HANDLE;
/* Set the simulation state. */
VisIt_SimulationMetaData_setMode(md, (sim->runMode == SIM_STOPPED) ?
......@@ -370,7 +369,7 @@ SimGetMetaData(void *cbdata)
}
/* Add some commands. */
for(i = 0; i < sizeof(cmd_names)/sizeof(const char *); ++i)
for(i = 0; i < (int) (sizeof(cmd_names)/sizeof(const char *)); ++i)
{
visit_handle cmd = VISIT_INVALID_HANDLE;
if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
......
......@@ -27,7 +27,6 @@
#ifdef PARALLEL
MPI_Comm comm;
//#define comm MPI_COMM_WORLD
#endif
/* Data Access Function prototypes */
......@@ -135,9 +134,10 @@ life_data_allocate(life_data *life, int par_rank, int par_size)
void
life_data_simulate(life_data *life, int par_rank, int par_size)
{
int nsum, i, j, JPNN, JNN, JMNN, source, dest;
int nsum, i, j, JPNN, JNN, JMNN;
int *true_life = NULL, *working_life = NULL;
#ifdef PARALLEL
int source, dest;
MPI_Status status;
MPI_Request request;
#endif
......@@ -452,7 +452,7 @@ void SlaveProcessCallback(void)
/* Process commands from viewer on all processors. */
int ProcessVisItCommand(simulation_data *sim)
{
int command;
int command = VISIT_COMMAND_FAILURE;
if (sim->par_rank==0)
{
int success = VisItProcessEngineCommand();
......@@ -552,7 +552,7 @@ ProcessConsoleCommand(simulation_data *sim)
void mainloop(simulation_data *sim)
{
int blocking, visitstate, err = 0;
int blocking, visitstate = 0, err = 0;
if (sim->par_rank == 0)
{
......@@ -644,7 +644,9 @@ void mainloop(simulation_data *sim)
int main(int argc, char **argv)
{
#ifdef PARALLEL
int i, customcomm = 0;
#endif
simulation_data sim;
simulation_data_ctor(&sim);
......@@ -756,7 +758,6 @@ SimGetMetaData(void *cbdata)
int i;
visit_handle m1 = VISIT_INVALID_HANDLE;
visit_handle vmd = VISIT_INVALID_HANDLE;
visit_handle cmd = VISIT_INVALID_HANDLE;
/* Set the simulation state. */
VisIt_SimulationMetaData_setMode(md, (sim->runMode == SIM_STOPPED) ?
......@@ -792,7 +793,7 @@ SimGetMetaData(void *cbdata)
}
/* Add some custom commands. */
for(i = 0; i < sizeof(cmd_names)/sizeof(const char *); ++i)
for(i = 0; i < (int) (sizeof(cmd_names)/sizeof(const char *)); ++i)
{
visit_handle cmd = VISIT_INVALID_HANDLE;
if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
......
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