diff --git a/Common/CreateFile.cpp b/Common/CreateFile.cpp index e23a30c2523842675b3a12680fbc5f97125fea61..b7e7b7afbc569e0c8b676c3f017092c1a33e8fcd 100644 --- a/Common/CreateFile.cpp +++ b/Common/CreateFile.cpp @@ -1,4 +1,4 @@ -// $Id: CreateFile.cpp,v 1.1 2008-07-04 15:02:47 geuzaine Exp $ +// $Id: CreateFile.cpp,v 1.2 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -124,7 +124,7 @@ void CreateOutputFile(const char *filename, int format) else strcpy(name, filename); - splitFileName(name, no_ext, ext, base); + SplitFileName(name, no_ext, ext, base); int oldformat = CTX.print.format; CTX.print.format = format; diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 3f027395fb0735a23a4bb20bb64144a5b0da2cd1..ea092bb6524e3351c3ab41db9b4958282e78f277 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -1,4 +1,4 @@ -// $Id: OpenFile.cpp,v 1.1 2008-07-04 15:02:47 geuzaine Exp $ +// $Id: OpenFile.cpp,v 1.2 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -234,7 +234,7 @@ void ParseString(const char *str) void SetProjectName(const char *name) { char no_ext[256], ext[256], base[256]; - splitFileName(name, no_ext, ext, base); + SplitFileName(name, no_ext, ext, base); if(CTX.filename != name) // yes, we mean to compare the pointers strncpy(CTX.filename, name, 255); @@ -265,7 +265,7 @@ int MergeFile(const char *name, int warn_if_missing) Msg::StatusBar(2, true, "Reading '%s'", name); char no_ext[256], ext[256], base[256]; - splitFileName(name, no_ext, ext, base); + SplitFileName(name, no_ext, ext, base); #if defined(HAVE_FLTK) if(!CTX.batch) { diff --git a/Common/StringUtils.cpp b/Common/StringUtils.cpp index 3067be56daf785753b51df70e5b5702479a0f69d..fa882d6722048291a6fda4257dbab9e2a6073285 100644 --- a/Common/StringUtils.cpp +++ b/Common/StringUtils.cpp @@ -1,4 +1,4 @@ -// $Id: StringUtils.cpp,v 1.4 2008-07-04 14:58:30 geuzaine Exp $ +// $Id: StringUtils.cpp,v 1.5 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -25,7 +25,7 @@ #include "StringUtils.h" -void swapBytes(char *array, int size, int n) +void SwapBytes(char *array, int size, int n) { char *x = new char[size]; for(int i = 0; i < n; i++) { @@ -37,7 +37,7 @@ void swapBytes(char *array, int size, int n) delete [] x; } -std::string extractDoubleQuotedString(const char *str, int len) +std::string ExtractDoubleQuotedString(const char *str, int len) { char *c = strstr((char*)str, "\""); if(!c) return ""; @@ -49,7 +49,7 @@ std::string extractDoubleQuotedString(const char *str, int len) return ret; } -std::string sanitizeTeXString(const char *in, int equation) +std::string SanitizeTeXString(const char *in, int equation) { // if there is a '$' or a '\' in the string, assume the author knows // what he's doing: @@ -76,7 +76,7 @@ std::string sanitizeTeXString(const char *in, int equation) return out; } -void fixWindowsPath(const char *in, char *out) +void FixWindowsPath(const char *in, char *out) { #if defined(__CYGWIN__) cygwin_conv_to_win32_path(in, out); @@ -85,7 +85,7 @@ void fixWindowsPath(const char *in, char *out) #endif } -void splitFileName(const char *name, char *no_ext, char *ext, char *base) +void SplitFileName(const char *name, char *no_ext, char *ext, char *base) { strcpy(no_ext, name); strcpy(ext, ""); diff --git a/Common/StringUtils.h b/Common/StringUtils.h index b1de98651def7a6432b5ae74f8293dc7aa1c9bde..c11d76d1153e2799f8cbc98c32fd48b16c7a144d 100644 --- a/Common/StringUtils.h +++ b/Common/StringUtils.h @@ -23,10 +23,10 @@ #include <string.h> #include <string> -void swapBytes(char *array, int size, int n); -std::string extractDoubleQuotedString(const char *str, int len); -std::string sanitizeTeXString(const char *in, int equation); -void fixWindowsPath(const char *in, char *out); -void splitFileName(const char *name, char *no_ext, char *ext, char *base); +void SwapBytes(char *array, int size, int n); +std::string ExtractDoubleQuotedString(const char *str, int len); +std::string SanitizeTeXString(const char *in, int equation); +void FixWindowsPath(const char *in, char *out); +void SplitFileName(const char *name, char *no_ext, char *ext, char *base); #endif diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index e8864b761781d68792a1e5dfe5b80d389fc560de..641bbda7451606b245c1221870bdb30241b76b26 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.587 2008-07-04 14:58:30 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.588 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -2602,7 +2602,7 @@ void _replace_multi_format(const char *in, const char *val, char *out) void help_online_cb(CALLBACK_ARGS) { char prog[1024], cmd[1024]; - fixWindowsPath(CTX.web_browser, prog); + FixWindowsPath(CTX.web_browser, prog); _replace_multi_format(prog, "http://www.geuz.org/gmsh/doc/texinfo/", cmd); SystemCall(cmd); } @@ -2610,7 +2610,7 @@ void help_online_cb(CALLBACK_ARGS) void help_credits_cb(CALLBACK_ARGS) { char prog[1024], cmd[1024]; - fixWindowsPath(CTX.web_browser, prog); + FixWindowsPath(CTX.web_browser, prog); _replace_multi_format(prog, "http://www.geuz.org/gmsh/doc/CREDITS", cmd); SystemCall(cmd); } @@ -2662,8 +2662,8 @@ void geometry_physical_cb(CALLBACK_ARGS) void geometry_edit_cb(CALLBACK_ARGS) { char prog[1024], file[1024], cmd[1024]; - fixWindowsPath(CTX.editor, prog); - fixWindowsPath(CTX.filename, file); + FixWindowsPath(CTX.editor, prog); + FixWindowsPath(CTX.filename, file); _replace_multi_format(prog, file, cmd); SystemCall(cmd); } @@ -3979,7 +3979,7 @@ void solver_cb(CALLBACK_ARGS) } if(SINFO[num].nboptions) { char file[256], tmp[256]; - fixWindowsPath(WID->solver[num].input[0]->value(), file); + FixWindowsPath(WID->solver[num].input[0]->value(), file); sprintf(tmp, "\"%s\"", file); sprintf(file, SINFO[num].name_command, tmp); sprintf(tmp, "%s %s", SINFO[num].option_command, file); @@ -4000,7 +4000,7 @@ void solver_file_open_cb(CALLBACK_ARGS) WID->solver[num].input[0]->value(file_chooser_get_name(1).c_str()); if(SINFO[num].nboptions) { char file[1024]; - fixWindowsPath(file_chooser_get_name(1).c_str(), file); + FixWindowsPath(file_chooser_get_name(1).c_str(), file); sprintf(tmp, "\"%s\"", file); sprintf(file, SINFO[num].name_command, tmp); sprintf(tmp, "%s %s", SINFO[num].option_command, file); @@ -4013,8 +4013,8 @@ void solver_file_edit_cb(CALLBACK_ARGS) { char prog[1024], file[1024], cmd[1024]; int num = (int)(long)data; - fixWindowsPath(CTX.editor, prog); - fixWindowsPath(WID->solver[num].input[0]->value(), file); + FixWindowsPath(CTX.editor, prog); + FixWindowsPath(WID->solver[num].input[0]->value(), file); _replace_multi_format(prog, file, cmd); SystemCall(cmd); } @@ -4049,7 +4049,7 @@ void solver_command_cb(CALLBACK_ARGS) WID->create_message_window(true); if(strlen(WID->solver[num].input[1]->value())) { - fixWindowsPath(WID->solver[num].input[1]->value(), mesh); + FixWindowsPath(WID->solver[num].input[1]->value(), mesh); sprintf(tmp, "\"%s\"", mesh); sprintf(mesh, SINFO[num].mesh_command, tmp); } @@ -4071,7 +4071,7 @@ void solver_command_cb(CALLBACK_ARGS) strcpy(command, SINFO[num].button_command[idx]); } - fixWindowsPath(WID->solver[num].input[0]->value(), tmp); + FixWindowsPath(WID->solver[num].input[0]->value(), tmp); sprintf(arg, "\"%s\"", tmp); sprintf(tmp, SINFO[num].name_command, arg); sprintf(arg, "%s %s %s", tmp, mesh, command); diff --git a/Fltk/GUI_Projection.cpp b/Fltk/GUI_Projection.cpp index e91890de8df317ba3a1fef391e4b3a35d0f7a803..37310ca8f03dc7641ea2fcc596755c07f31605db 100644 --- a/Fltk/GUI_Projection.cpp +++ b/Fltk/GUI_Projection.cpp @@ -902,7 +902,7 @@ void save_projection_cb(Fl_Widget *w, void *data) return; } char no_ext[256], ext[256], base[256]; - splitFileName(name.c_str(), no_ext, ext, base); + SplitFileName(name.c_str(), no_ext, ext, base); fprintf(fp, "1\n%s\n%s\n", base, ps->GetName().c_str()); for(unsigned int i = 0; i < p->parameters.size(); i++) fprintf(fp, "%.16g\n", p->parameters[i]->value()); diff --git a/Fltk/Opengl.cpp b/Fltk/Opengl.cpp index 93fc2c785a86daa01d16e12c15a8b1615612118c..03862b603348dbd73f476138eaa52af94cb27e6f 100644 --- a/Fltk/Opengl.cpp +++ b/Fltk/Opengl.cpp @@ -1,4 +1,4 @@ -// $Id: Opengl.cpp,v 1.80 2008-03-20 11:44:03 geuzaine Exp $ +// $Id: Opengl.cpp,v 1.81 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -83,7 +83,7 @@ void Draw_String(const char *s, const char *font_name, int font_enum, int font_s } else{ if(CTX.print.format == FORMAT_TEX){ - std::string tmp = sanitizeTeXString(s, CTX.print.tex_as_equation); + std::string tmp = SanitizeTeXString(s, CTX.print.tex_as_equation); int opt; switch(align){ case 1: opt = GL2PS_TEXT_B; break; // bottom center diff --git a/Fltk/Solvers.cpp b/Fltk/Solvers.cpp index 57cae93f11471a842e40c34358db9c4f1e9705ab..27537e0069eb605da59ef4bec9094eb03b0fb3b6 100644 --- a/Fltk/Solvers.cpp +++ b/Fltk/Solvers.cpp @@ -1,4 +1,4 @@ -// $Id: Solvers.cpp,v 1.65 2008-07-04 14:58:30 geuzaine Exp $ +// $Id: Solvers.cpp,v 1.66 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -87,7 +87,7 @@ int Solver(int num, const char *args) GmshServer server(CTX.solver.max_delay); if(num >= 0){ - fixWindowsPath(SINFO[num].executable_name, prog); + FixWindowsPath(SINFO[num].executable_name, prog); if(!SINFO[num].client_server) { sprintf(command, "%s %s", prog, args); #if !defined(WIN32) @@ -113,7 +113,7 @@ int Solver(int num, const char *args) sprintf(tmp, "%s%s-%d", CTX.home_dir, CTX.solver.socket_name, num); else sprintf(tmp, "%s%s", CTX.home_dir, CTX.solver.socket_name); - fixWindowsPath(tmp, sockname); + FixWindowsPath(tmp, sockname); } else{ // TCP/IP socket diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp index 7be95c325d5130055a295c0f4e3a669b4bc80023..cf7d039555089ad1b00d0a683e801b74167f597f 100644 --- a/Geo/GModelIO_Mesh.cpp +++ b/Geo/GModelIO_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: GModelIO_Mesh.cpp,v 1.56 2008-06-10 08:37:33 remacle Exp $ +// $Id: GModelIO_Mesh.cpp,v 1.57 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -252,7 +252,7 @@ int GModel::readMSH(const std::string &name) int num; if(fscanf(fp, "%d", &num) != 1) return 0; if(!fgets(str, sizeof(str), fp)) return 0; - std::string name = extractDoubleQuotedString(str, 256); + std::string name = ExtractDoubleQuotedString(str, 256); if(name.size()) setPhysicalName(name, num); } @@ -275,9 +275,9 @@ int GModel::readMSH(const std::string &name) } else{ if(fread(&num, sizeof(int), 1, fp) != 1) return 0; - if(swap) swapBytes((char*)&num, sizeof(int), 1); + if(swap) SwapBytes((char*)&num, sizeof(int), 1); if(fread(xyz, sizeof(double), 3, fp) != 3) return 0; - if(swap) swapBytes((char*)xyz, sizeof(double), 3); + if(swap) SwapBytes((char*)xyz, sizeof(double), 3); } minVertex = std::min(minVertex, num); maxVertex = std::max(maxVertex, num); @@ -353,7 +353,7 @@ int GModel::readMSH(const std::string &name) while(numElementsPartial < numElements){ int header[3]; if(fread(header, sizeof(int), 3, fp) != 3) return 0; - if(swap) swapBytes((char*)header, sizeof(int), 3); + if(swap) SwapBytes((char*)header, sizeof(int), 3); int type = header[0]; int numElms = header[1]; int numTags = header[2]; @@ -362,7 +362,7 @@ int GModel::readMSH(const std::string &name) int *data = new int[n]; for(int i = 0; i < numElms; i++) { if(fread(data, sizeof(int), n, fp) != n) return 0; - if(swap) swapBytes((char*)data, sizeof(int), n); + if(swap) SwapBytes((char*)data, sizeof(int), n); int num = data[0]; int physical = (numTags > 0) ? data[4 - numTags] : 0; int elementary = (numTags > 1) ? data[4 - numTags + 1] : 0; @@ -801,7 +801,7 @@ int GModel::readSTL(const std::string &name, double tolerance) if(nfacets > 10000000){ Msg::Info("Swapping bytes from binary file"); swap = true; - swapBytes((char*)&nfacets, sizeof(unsigned int), 1); + SwapBytes((char*)&nfacets, sizeof(unsigned int), 1); } if(ret && nfacets){ char *data = new char[nfacets * 50 * sizeof(char)]; @@ -809,7 +809,7 @@ int GModel::readSTL(const std::string &name, double tolerance) if(ret == nfacets * 50){ for(unsigned int i = 0; i < nfacets; i++) { float *xyz = (float *)&data[i * 50 * sizeof(char)]; - if(swap) swapBytes((char*)xyz, sizeof(float), 12); + if(swap) SwapBytes((char*)xyz, sizeof(float), 12); for(int j = 0; j < 3; j++){ SPoint3 p(xyz[3 + 3 * j], xyz[3 + 3 * j + 1], xyz[3 + 3 * j + 2]); points.push_back(p); diff --git a/Geo/GeoStringInterface.cpp b/Geo/GeoStringInterface.cpp index 1a4646c52895692026a37e5f912af4cc9c750f79..17a8e8ef7a1dfb63b5656233a7a21d1ee9179780 100644 --- a/Geo/GeoStringInterface.cpp +++ b/Geo/GeoStringInterface.cpp @@ -1,4 +1,4 @@ -// $Id: GeoStringInterface.cpp,v 1.26 2008-07-04 14:58:31 geuzaine Exp $ +// $Id: GeoStringInterface.cpp,v 1.27 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -125,7 +125,7 @@ void add_infile(const char *text, const char *fich, bool deleted_something) if(!CTX.expert_mode) { char no_ext[256], ext[256], base[256]; - splitFileName(fich, no_ext, ext, base); + SplitFileName(fich, no_ext, ext, base); if(strlen(ext) && strcmp(ext, ".geo") && strcmp(ext, ".GEO")){ char question[1024]; sprintf(question, diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp index d8bce170975a3453ccd441f7b6b0818226156c54..0f2887f46fff993697f70e33b86ede0f3e421ae0 100644 --- a/Post/PViewDataGModelIO.cpp +++ b/Post/PViewDataGModelIO.cpp @@ -1,4 +1,4 @@ -// $Id: PViewDataGModelIO.cpp,v 1.46 2008-07-02 17:40:56 geuzaine Exp $ +// $Id: PViewDataGModelIO.cpp,v 1.47 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -84,7 +84,7 @@ bool PViewDataGModel::readMSH(std::string fileName, int fileIndex, FILE *fp, int num; if(binary){ if(fread(&num, sizeof(int), 1, fp) != 1) return false; - if(swap) swapBytes((char*)&num, sizeof(int), 1); + if(swap) SwapBytes((char*)&num, sizeof(int), 1); } else{ if(fscanf(fp, "%d", &num) != 1) return false; @@ -93,7 +93,7 @@ bool PViewDataGModel::readMSH(std::string fileName, int fileIndex, FILE *fp, if(_type == ElementNodeData || _type == GaussPointData){ if(binary){ if(fread(&mult, sizeof(int), 1, fp) != 1) return false; - if(swap) swapBytes((char*)&mult, sizeof(int), 1); + if(swap) SwapBytes((char*)&mult, sizeof(int), 1); } else{ if(fscanf(fp, "%d", &mult) != 1) return false; @@ -103,7 +103,7 @@ bool PViewDataGModel::readMSH(std::string fileName, int fileIndex, FILE *fp, if(binary){ if((int)fread(d, sizeof(double), numComp * mult, fp) != numComp * mult) return false; - if(swap) swapBytes((char*)d, sizeof(double), numComp * mult); + if(swap) SwapBytes((char*)d, sizeof(double), numComp * mult); } else{ for(int j = 0; j < numComp * mult; j++) diff --git a/Post/PViewIO.cpp b/Post/PViewIO.cpp index 93a418e657c58276c833c716fb0fc12de476b05f..c467694aec6d0e25abe53f6d9732c6c5fed9df9d 100644 --- a/Post/PViewIO.cpp +++ b/Post/PViewIO.cpp @@ -1,4 +1,4 @@ -// $Id: PViewIO.cpp,v 1.8 2008-05-06 21:11:54 geuzaine Exp $ +// $Id: PViewIO.cpp,v 1.9 2008-07-04 16:58:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -165,9 +165,9 @@ bool PView::readMSH(std::string fileName, int fileIndex) for(int i = 0; i < numTags; i++){ if(!fgets(str, sizeof(str), fp)) return false; if(i == 0) - viewName = extractDoubleQuotedString(str, sizeof(str)); + viewName = ExtractDoubleQuotedString(str, sizeof(str)); else if(i == 1) - interpolName = extractDoubleQuotedString(str, sizeof(str)); + interpolName = ExtractDoubleQuotedString(str, sizeof(str)); } // double tags double time = 0.;