Commit f5b12cf6 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

replced c arrat with c++ vector (streamNames in process_t)

parent 55bc14c4
......@@ -579,7 +579,7 @@ int expand_wildcards(int processID, int streamCnt)
Free(Process[processID].streamNames[0].argv);
Free(Process[processID].streamNames[0].args);
Process[processID].streamNames = (argument_t*) Realloc(Process[processID].streamNames, streamCnt*sizeof(argument_t));
Process[processID].streamNames.resize(streamCnt);
// move output streams to the end
for ( i = 1; i < Process[processID].streamCnt; ++i )
......@@ -687,7 +687,7 @@ void setStreams(int argc, char *argv[])
Process[processID].streamCnt = 0; /* filled in setStreamNames */
if ( streamCnt )
Process[processID].streamNames = (argument_t*) Malloc(streamCnt*sizeof(argument_t));
Process[processID].streamNames = std::vector<argument_t>(streamCnt);
for ( int i = 0; i < streamCnt; i++ )
{
Process[processID].streamNames[i].argc = 0;
......@@ -1006,7 +1006,7 @@ void print_process(int p_process_id)
std::cout << " nvars : " << Process[p_process_id].nvars << std::endl;
std::cout << " ntimesteps : " << Process[p_process_id].ntimesteps << std::endl;
std::cout << " streamCnt : " << Process[p_process_id].streamCnt << std::endl;
std::cout << " streamNames : " << Process[p_process_id].streamNames << std::endl;
// std::cout << " streamNames : " << Process[p_process_id].streamNames << std::endl;
std::cout << " xoperator : " << Process[p_process_id].xoperator << std::endl;
std::cout << " operatorName : " << Process[p_process_id].operatorName << std::endl;
std::cout << " operatorArg : " << Process[p_process_id].operatorArg << std::endl;
......
......@@ -19,6 +19,7 @@
#define _PROCESS_H
#include <sys/types.h> /* off_t */
#include <vector>
#include "util.h"
#include "pstream.h"
......@@ -57,7 +58,7 @@ typedef struct {
short nvars;
int ntimesteps;
short streamCnt;
argument_t *streamNames;
std::vector<argument_t> streamNames;
char *xoperator;
const char *operatorName;
char *operatorArg;
......
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