Skip to content
Snippets Groups Projects
Commit 4b575910 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

cleanup CTX.files

parent da71fed9
No related branches found
No related tags found
No related merge requests found
// $Id: Box.cpp,v 1.44 2008-03-11 20:03:09 geuzaine Exp $
// $Id: Box.cpp,v 1.45 2008-03-11 20:24:30 geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
......@@ -83,8 +83,8 @@ int GMSHBOX(int argc, char *argv[])
if(gmsh_yyerrorstate)
ParUtil::Instance()->Abort();
else {
for(int i = 1; i < List_Nbr(CTX.files); i++)
MergeFile(*(char**)List_Pointer(CTX.files, i));
for(unsigned int i = 1; i < CTX.files.size(); i++)
MergeFile(CTX.files[i].c_str());
if(CTX.bgm_filename) {
MergeFile(CTX.bgm_filename);
if(PView::list.size()){
......
// $Id: CommandLine.cpp,v 1.120 2008-02-23 19:49:35 geuzaine Exp $
// $Id: CommandLine.cpp,v 1.121 2008-03-11 20:24:30 geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
......@@ -668,13 +668,13 @@ void Get_Options(int argc, char *argv[])
}
else {
List_Add(CTX.files, &argv[i++]);
CTX.files.push_back(argv[i++]);
}
}
if(!List_Nbr(CTX.files))
if(CTX.files.empty())
strncpy(CTX.filename, CTX.default_filename_fullpath, 255);
else
strncpy(CTX.filename, *(char**)List_Pointer(CTX.files, 0), 255);
strncpy(CTX.filename, CTX.files[0].c_str(), 255);
}
......@@ -20,7 +20,8 @@
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include "List.h"
#include <vector>
#include <string>
// Interface-independent context
......@@ -33,7 +34,7 @@ class Context_T {
char no_ext_filename[256]; // the same without the extension
char base_filename[256]; // the base filename (no path, no extension)
const char *bgm_filename; // background mesh
List_T *files; // all the files on the command line
std::vector<std::string> files; // all the files on the command line
const char *output_filename; // output file specified with command line option '-o'
const char *default_filename;
char default_filename_fullpath[256]; // the name of the default file
......
// $Id: Options.cpp,v 1.386 2008-03-11 20:03:09 geuzaine Exp $
// $Id: Options.cpp,v 1.387 2008-03-11 20:24:30 geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
......@@ -120,7 +120,6 @@ void Init_Options(int num)
CTX.batch = 0;
CTX.output_filename = NULL;
CTX.bgm_filename = NULL;
CTX.files = List_Create(10, 10, sizeof(char*));
CTX.lc = 1.0;
CTX.viewport[0] = CTX.viewport[1] = 0;
CTX.min[0] = CTX.min[1] = CTX.min[2] = 0.0;
......
// $Id: Main.cpp,v 1.118 2008-03-11 20:03:09 geuzaine Exp $
// $Id: Main.cpp,v 1.119 2008-03-11 20:24:30 geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
......@@ -80,8 +80,8 @@ int main(int argc, char *argv[])
if(gmsh_yyerrorstate)
exit(1);
else {
for(int i = 1; i < List_Nbr(CTX.files); i++)
MergeFile(*(char**)List_Pointer(CTX.files, i));
for(unsigned int i = 1; i < CTX.files.size(); i++)
MergeFile(CTX.files[i].c_str());
if(CTX.post.combine_time)
PView::combine(true, 2, CTX.post.combine_remove_orig);
if(CTX.bgm_filename) {
......@@ -144,8 +144,8 @@ int main(int argc, char *argv[])
// Open project file and merge all other input files
OpenProject(CTX.filename);
for(int i = 1; i < List_Nbr(CTX.files); i++)
MergeFile(*(char**)List_Pointer(CTX.files, i));
for(unsigned int i = 1; i < CTX.files.size(); i++)
MergeFile(CTX.files[i].c_str());
if(CTX.post.combine_time){
PView::combine(true, 2, CTX.post.combine_remove_orig);
WID->update_views();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment