From: Ralf Hartmann Date: Wed, 28 Sep 2005 14:35:59 +0000 (+0000) Subject: Replace cumbersome char * and strncat calls by std::string. X-Git-Tag: v8.0.0~13059 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39d2a5b6a304c3f84d4901888da4b0cdbd4c7751;p=dealii.git Replace cumbersome char * and strncat calls by std::string. git-svn-id: https://svn.dealii.org/trunk@11544 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/data_out_base.cc b/deal.II/base/source/data_out_base.cc index 5db2cb6e46..dd2c0a0fae 100644 --- a/deal.II/base/source/data_out_base.cc +++ b/deal.II/base/source/data_out_base.cc @@ -3327,7 +3327,7 @@ void DataOutBase::write_tecplot (const std::vector > &patche float & TecplotMacros::nd (const unsigned int i, const unsigned int j) { - return nodalData[(i)*(n_nodes) + (j)]; + return nodalData[i*n_nodes+j]; } @@ -3336,7 +3336,7 @@ void DataOutBase::write_tecplot (const std::vector > &patche int & TecplotMacros::cd (const unsigned int i, const unsigned int j) { - return connData[(i) + (j)*(n_vert)]; + return connData[i+j*n_vert]; } } @@ -3451,57 +3451,37 @@ void DataOutBase::write_tecplot_binary (const std::vector > int is_double = 0, tec_debug = 0, cell_type; - - - unsigned int string_size = 0; - - if (spacedim==2) - string_size = 3; - else if (spacedim==3) - string_size = 5; - - - for (unsigned int data_set=0; data_set > num_cells = static_cast(n_cells); char dot[2] = {'.', 0}; + // Unfortunately, TECINI takes a + // char *, but c_str() gives a + // const char *. As we don't do + // anything else with + // tec_var_names following + // const_cast is ok + char *var_names=const_cast (tec_var_names.c_str()); ierr = TECINI (NULL, - tecVarNames, + var_names, file_name, dot, &tec_debug, @@ -3739,10 +3726,6 @@ void DataOutBase::write_tecplot_binary (const std::vector > Assert (ierr == 0, ExcTecplotAPIError()); } - - - delete [] tecVarNames; - #endif }