diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 2e00046a9bb511055558729aa6e985df175a3f1e..1570085433706a691a06df86bfaf6d0a4e37ea44 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -18,6 +18,7 @@ #include "OS.h" #include "StringUtils.h" #include "GeomMeshMatcher.h" +#include "Field.h" #if defined(HAVE_PARSER) #include "Parser.h" @@ -414,7 +415,7 @@ int MergeFile(std::string fileName, bool warnIfMissing) if(!status) Msg::Error("Error loading '%s'", fileName.c_str()); Msg::StatusBar(2, true, "Done reading '%s'", fileName.c_str()); - // merge the associated option file if there is one + // merge the associated option file if there is one if(!StatFile(fileName + ".opt")) MergeFile(fileName + ".opt"); diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index 8bbc7cef22b5ab8bb6aa11a4843c3ff4368b7563..afcdc30badaaf8c759885dba5edf49fd7da91d55 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -549,8 +549,7 @@ bool GFaceCompound::checkOrientation(int iter) const return checkOrientation(iter+1); } else if (oriented && iter < iterMax){ - Msg::Info("Parametrization is bijective (no flips)"); - //printStuff(); + Msg::Debug("Parametrization is bijective (no flips)"); } return oriented; @@ -640,6 +639,7 @@ bool GFaceCompound::parametrize() const bool hasOverlap = parametrize_conformal_spectral(); if (hasOverlap || !checkOrientation(0) ){ Msg::Warning("!!! Overlap or Flipping: parametrization switched to 'FE conformal' map"); + printStuff(22); hasOverlap = parametrize_conformal(0, NULL, NULL); } if (hasOverlap || !checkOrientation(0) ){ @@ -1197,10 +1197,9 @@ bool GFaceCompound::parametrize_conformal_spectral() const // mettre max NC contraintes par bord int NB = _ordered.size(); - int NC = std::min(70,NB); + int NC = std::min(60,NB); int jump = (int) NB/NC; int nbLoop = (int) NB/jump ; - for (int i = 0; i< nbLoop; i++){ MVertex *v1 = _ordered[i*jump]; myAssembler.assemble(v1, 0, 1, v1, 0, 1, 1.0); @@ -1344,8 +1343,8 @@ bool GFaceCompound::parametrize_conformal(int iter, MVertex *v1, MVertex *v2) co // check for overlap and compute new mapping with new pinned // vertices std::vector<MVertex *> vert; - bool hasOverlap = checkOverlap(vert); - if (hasOverlap && iter < 3){ + bool hasOverlap = checkOverlap(vert);; + if ( hasOverlap && iter < 3){ Msg::Info("Loop FE conformal iter (%d) v1=%d v2=%d", iter, vert[0]->getNum(), vert[1]->getNum()); printStuff(100+iter); diff --git a/Geo/GModelIO_Geo.cpp b/Geo/GModelIO_Geo.cpp index 0c05cf7229551caac400c56ecd7536ee4cc12496..70e32c247438648bcb273d9d6fcf2ac97f1f9255 100644 --- a/Geo/GModelIO_Geo.cpp +++ b/Geo/GModelIO_Geo.cpp @@ -40,7 +40,9 @@ void GModel::_deleteGEOInternals() int GModel::readGEO(const std::string &name) { ParseFile(name, true); - return GModel::current()->importGEOInternals(); + int imported = GModel::current()->importGEOInternals(); + + return imported; } int GModel::exportDiscreteGEOInternals() diff --git a/Mesh/CenterlineField.cpp b/Mesh/CenterlineField.cpp index c69d79b201a785a5d99dfe77819b1831c8ce45bb..898d0e8b03867aba949dc391e56579fa5eb655db 100644 --- a/Mesh/CenterlineField.cpp +++ b/Mesh/CenterlineField.cpp @@ -309,23 +309,31 @@ void cutTriangle(MTriangle *tri, } Centerline::Centerline(std::string fileName): kdtree(0), nodes(0){ + + recombine = CTX::instance()->mesh.recombineAll; index = new ANNidx[1]; dist = new ANNdist[1]; - update_needed = false; + printf("cetreline filename =%s \n", fileName.c_str()); importFile(fileName); buildKdTree(); + update_needed = false; + } Centerline::Centerline(): kdtree(0), nodes(0){ index = new ANNidx[1]; dist = new ANNdist[1]; - options["FileName"] = new FieldOptionString (fileName, "File name for the centerlines", &update_needed); + recombine = CTX::instance()->mesh.recombineAll; fileName = "centerlines.vtk";//default + options["FileName"] = new FieldOptionString (fileName, "File name for the centerlines", &update_needed); + callbacks["cutMesh"] = new cutAction(this, "Cut the initial mesh in different mesh partitions using the centerlines \n"); + //callbacks["test"] = new FieldCallbackGeneric<MathEvalField>(this, MathEvalField::myFunc, "description") + } Centerline::~Centerline(){ @@ -344,6 +352,7 @@ void Centerline::importFile(std::string fileName){ current->getEntities(entities) ; for(unsigned int i = 0; i < entities.size(); i++){ if(entities[i]->dim() != 2) continue; + recombine = std::max(recombine, (double)(((GFace*)entities[i])->meshAttributes.recombine)); for(int j = 0; j < entities[i]->getNumMeshElements(); j++){ MElement *e = entities[i]->getMeshElement(j); if (e->getType() != TYPE_TRI){ @@ -682,7 +691,6 @@ void Centerline::remeshSplitMesh(){ GFaceCompound::typeOfMapping typ = GFaceCompound::CONFORMAL; GFaceCompound *gfc = new GFaceCompound(split, num_gfc, f_compound, U0, typ, 0); - int recombine = 0;//EMI TODO RECUPERER LE RECOMBINE gfc->meshAttributes.recombine = recombine; split->add(gfc); gfc->parametrize(); @@ -818,23 +826,6 @@ void Centerline::createFaces(){ } printf("%d faces created \n", faces.size()); - // FILE * f3 = fopen("myCUT.pos","w"); - // fprintf(f3, "View \"\"{\n"); - // for (int i= 0; i< faces.size(); i++){ - // std::vector<MTriangle*> tris = faces[i]; - // for (int j= 0; j< tris.size(); j++){ - // MTriangle *t = tris[j]; - // fprintf(f3, "ST(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g};\n", - // t->getVertex(0)->x(), t->getVertex(0)->y(), t->getVertex(0)->z(), - // t->getVertex(1)->x(), t->getVertex(1)->y(), t->getVertex(1)->z(), - // t->getVertex(2)->x(), t->getVertex(2)->y(), t->getVertex(2)->z(), - // (double)i, (double)i, (double)i); - // } - // } - // fprintf(f3,"};\n"); - // fclose(f3); - - //create discFaces int numBef = split->getMaxElementaryNumber(2) + 1; for(unsigned int i = 0; i < faces.size(); ++i){ @@ -859,9 +850,19 @@ void Centerline::createFaces(){ } -void Centerline::splitMesh(){ - - Msg::Info("Splitting surface mesh (%d tris) with centerline field ", triangles.size()); +void Centerline::cutMesh(){ + + if (update_needed){ + std::ifstream input; + input.open(fileName.c_str()); + if(StatFile(fileName)) Msg::Fatal("Centerline file '%s' does not exist", fileName.c_str()); + importFile(fileName); + buildKdTree(); + printf("fileName =%s , recombine =%g \n", fileName.c_str(), recombine); + update_needed = false; + } + + Msg::Info("Splitting surface mesh (%d tris) with centerline %s ", triangles.size(), fileName.c_str()); split = new GModel(); //splitMesh @@ -912,6 +913,7 @@ void Centerline::splitMesh(){ //remesh splitted mesh remeshSplitMesh(); + Msg::Info("Writing new mesh 'myMESH.msh'"); split->writeMSH("myMESH.msh", 2.2, false, true); //print @@ -929,6 +931,7 @@ void Centerline::splitMesh(){ // fprintf(f2,"};\n"); // fclose(f2); + Msg::Info("Splitting mesh by centerlines done "); exit(1); @@ -1024,11 +1027,11 @@ double Centerline::operator() (double x, double y, double z, GEntity *ge){ if (update_needed){ std::ifstream input; input.open(fileName.c_str()); - if(StatFile(fileName)) Msg::Fatal("Centerline file '%s' does not exist", fileName.c_str()); - importFile(fileName); buildKdTree(); + printf("fileName =%s , recombine =%g \n", fileName.c_str(), recombine); + exit(1); update_needed = false; } @@ -1063,31 +1066,18 @@ void Centerline::printSplit() const{ fprintf(f,"};\n"); fclose(f); - FILE * f2 = fopen("myCOLORS.pos","w"); - fprintf(f2, "View \"\"{\n"); - std::map<MVertex*, int>::const_iterator itp = colorp.begin(); - while (itp != colorp.end()){ - MVertex *v = itp->first; - fprintf(f2, "SP(%g,%g,%g){%g};\n", - v->x(), v->y(), v->z(), - (double)v->getNum()); - itp++; - } - fprintf(f2,"};\n"); - fclose(f2); - - FILE * f3 = fopen("myJUNCTIONS.pos","w"); - fprintf(f3, "View \"\"{\n"); - std::set<MVertex*>::const_iterator itj = junctions.begin(); - while (itj != junctions.end()){ - MVertex *v = *itj; - fprintf(f3, "SP(%g,%g,%g){%g};\n", - v->x(), v->y(), v->z(), - (double)v->getNum()); - itj++; - } - fprintf(f3,"};\n"); - fclose(f3); + // FILE * f3 = fopen("myJUNCTIONS.pos","w"); + // fprintf(f3, "View \"\"{\n"); + // std::set<MVertex*>::const_iterator itj = junctions.begin(); + // while (itj != junctions.end()){ + // MVertex *v = *itj; + // fprintf(f3, "SP(%g,%g,%g){%g};\n", + // v->x(), v->y(), v->z(), + // (double)v->getNum()); + // itj++; + // } + // fprintf(f3,"};\n"); + // fclose(f3); FILE * f4 = fopen("myRADII.pos","w"); fprintf(f4, "View \"\"{\n"); diff --git a/Mesh/CenterlineField.h b/Mesh/CenterlineField.h index e8c51669f800a4b97bebb64af66a53cfc3b21cd4..1ce9f605c7ec7c3ef7d9485b15b674c7ecd431ae 100644 --- a/Mesh/CenterlineField.h +++ b/Mesh/CenterlineField.h @@ -49,6 +49,19 @@ struct Branch{ class Centerline : public Field{ + class cutAction : public FieldCallback{ + private: + Centerline *myField; + public: + cutAction(Centerline *field, std::string help):FieldCallback(help) { + myField = field; + } + void run(){ + printf("calling action cutMesh \n"); + myField->cutMesh(); + } + }; + protected: GModel *current; //current GModel GModel *mod; //centerline GModel @@ -58,6 +71,7 @@ class Centerline : public Field{ ANNidxArray index; ANNdistArray dist; std::string fileName; + double recombine; //all (unique) lines of centerlines std::vector<MLine*> lines; @@ -125,7 +139,7 @@ class Centerline : public Field{ void distanceToLines(); // Cut the mesh in different parts of small aspect ratio - void splitMesh(); + void cutMesh(); // Cut the tubular structure with a disk // perpendicular to the tubular structure diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index 8cb2b02656248fb7a8068f75293e6cd2c3542985..4b6d6f30cb57d46f175285c2fcb7d4a5efc66d6a 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -44,89 +44,6 @@ Field::~Field() { } } -class FieldOptionDouble : public FieldOption -{ - public: - double &val; - FieldOptionType getType(){ return FIELD_OPTION_DOUBLE; } - FieldOptionDouble(double &_val, std::string _help, bool *_status=0) - : FieldOption(_help, _status), val(_val){} - double numericalValue() const { return val; } - void numericalValue(double v){ modified(); val = v; } - void getTextRepresentation(std::string &v_str) - { - std::ostringstream sstream; - sstream.precision(16); - sstream << val; - v_str = sstream.str(); - } -}; - -class FieldOptionInt : public FieldOption -{ - public: - int &val; - FieldOptionType getType(){ return FIELD_OPTION_INT; } - FieldOptionInt(int &_val, std::string _help, bool *_status=0) - : FieldOption(_help, _status), val(_val){} - double numericalValue() const { return val; } - void numericalValue(double v){ modified(); val = (int)v; } - void getTextRepresentation(std::string & v_str) - { - std::ostringstream sstream; - sstream << val; - v_str = sstream.str(); - } -}; - -class FieldOptionList : public FieldOption -{ - public: - std::list<int> &val; - FieldOptionType getType(){ return FIELD_OPTION_LIST; } - FieldOptionList(std::list<int> &_val, std::string _help, bool *_status=0) - : FieldOption(_help, _status), val(_val) {} - std::list<int> &list(){ modified(); return val; } - const std::list<int>& list() const { return val; } - void getTextRepresentation(std::string & v_str) - { - std::ostringstream sstream; - sstream << "{"; - for(std::list<int>::iterator it = val.begin(); it != val.end(); it++) { - if(it != val.begin()) - sstream << ", "; - sstream << *it; - } - sstream << "}"; - v_str = sstream.str(); - } -}; - -class FieldOptionPath : public FieldOptionString -{ - public: - virtual FieldOptionType getType(){ return FIELD_OPTION_PATH; } - FieldOptionPath(std::string &_val, std::string _help, bool *_status=0) - : FieldOptionString(_val, _help, _status) {} -}; - -class FieldOptionBool : public FieldOption -{ - public: - bool & val; - FieldOptionType getType(){ return FIELD_OPTION_BOOL; } - FieldOptionBool(bool & _val, std::string _help, bool *_status=0) - : FieldOption(_help, _status), val(_val) {} - double numericalValue() const { return val; } - void numericalValue(double v){ modified(); val = v; } - void getTextRepresentation(std::string & v_str) - { - std::ostringstream sstream; - sstream << val; - v_str = sstream.str(); - } -}; - void FieldManager::reset() { for(std::map<int, Field *>::iterator it = begin(); it != end(); it++) { @@ -993,12 +910,26 @@ class MathEvalField : public Field { MathEvalExpression expr; std::string f; + class testAction : public FieldCallback{ + private: + MathEvalField *myField; + public: + testAction(MathEvalField *field, std::string help):FieldCallback(help) { + myField = field; + } + void run(){ + myField->myAction(); + printf("calling action matheval \n"); + } + }; public: MathEvalField() { options["F"] = new FieldOptionString (f, "Mathematical function to evaluate.", &update_needed); f = "F2 + Sin(z)"; + callbacks["test"] = new testAction(this, "description blabla \n"); + //callbacks["test"] = new FieldCallbackGeneric<MathEvalField>(this, MathEvalField::myFunc, "description") } double operator() (double x, double y, double z, GEntity *ge=0) { @@ -1010,6 +941,9 @@ class MathEvalField : public Field } return expr.evaluate(x, y, z); } + void myAction(){ + printf("doing sthg \n"); + } const char *getName() { return "MathEval"; diff --git a/Mesh/Field.h b/Mesh/Field.h index 4d28ebb41ce39b1821d6533d0d37b13552ff6155..aee44ef0635a6c5aec28ff1db6f1c34499492be2 100644 --- a/Mesh/Field.h +++ b/Mesh/Field.h @@ -87,6 +87,7 @@ class Field { // anisotropic virtual void operator() (double x, double y, double z, SMetric3 &, GEntity *ge=0){} bool update_needed; + //void update(){ printf("up f \n"); return;} virtual const char *getName() = 0; #if defined(HAVE_POST) void putOnView(PView * view, int comp = -1); @@ -143,7 +144,6 @@ class BoundaryLayerField : public Field { virtual void operator() (double x, double y, double z, SMetric3 &metr, GEntity *ge=0); }; #endif - class FieldOptionString : public FieldOption { public: @@ -161,4 +161,89 @@ class FieldOptionString : public FieldOption } }; + +class FieldOptionDouble : public FieldOption +{ + public: + double &val; + FieldOptionType getType(){ return FIELD_OPTION_DOUBLE; } + FieldOptionDouble(double &_val, std::string _help, bool *_status=0) + : FieldOption(_help, _status), val(_val){} + double numericalValue() const { return val; } + void numericalValue(double v){ modified(); val = v; } + void getTextRepresentation(std::string &v_str) + { + std::ostringstream sstream; + sstream.precision(16); + sstream << val; + v_str = sstream.str(); + } +}; + +class FieldOptionInt : public FieldOption +{ + public: + int &val; + FieldOptionType getType(){ return FIELD_OPTION_INT; } + FieldOptionInt(int &_val, std::string _help, bool *_status=0) + : FieldOption(_help, _status), val(_val){} + double numericalValue() const { return val; } + void numericalValue(double v){ modified(); val = (int)v; } + void getTextRepresentation(std::string & v_str) + { + std::ostringstream sstream; + sstream << val; + v_str = sstream.str(); + } +}; + +class FieldOptionList : public FieldOption +{ + public: + std::list<int> &val; + FieldOptionType getType(){ return FIELD_OPTION_LIST; } + FieldOptionList(std::list<int> &_val, std::string _help, bool *_status=0) + : FieldOption(_help, _status), val(_val) {} + std::list<int> &list(){ modified(); return val; } + const std::list<int>& list() const { return val; } + void getTextRepresentation(std::string & v_str) + { + std::ostringstream sstream; + sstream << "{"; + for(std::list<int>::iterator it = val.begin(); it != val.end(); it++) { + if(it != val.begin()) + sstream << ", "; + sstream << *it; + } + sstream << "}"; + v_str = sstream.str(); + } +}; + +class FieldOptionPath : public FieldOptionString +{ + public: + virtual FieldOptionType getType(){ return FIELD_OPTION_PATH; } + FieldOptionPath(std::string &_val, std::string _help, bool *_status=0) + : FieldOptionString(_val, _help, _status) {} +}; + +class FieldOptionBool : public FieldOption +{ + public: + bool & val; + FieldOptionType getType(){ return FIELD_OPTION_BOOL; } + FieldOptionBool(bool & _val, std::string _help, bool *_status=0) + : FieldOption(_help, _status), val(_val) {} + double numericalValue() const { return val; } + void numericalValue(double v){ modified(); val = v; } + void getTextRepresentation(std::string & v_str) + { + std::ostringstream sstream; + sstream << val; + v_str = sstream.str(); + } +}; + + #endif diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index 2bc746933ebd95c8ec895b1a079f8e13e8b9f276..e7cc92b77dbe299aff2d692321a8f444b54417c2 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -73,6 +73,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -103,8 +104,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -161,15 +160,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -181,7 +172,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int gmsh_yyleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t gmsh_yyleng; extern FILE *gmsh_yyin, *gmsh_yyout; @@ -207,11 +203,6 @@ extern FILE *gmsh_yyin, *gmsh_yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -229,7 +220,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -299,8 +290,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when gmsh_yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int gmsh_yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t gmsh_yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -328,7 +319,7 @@ static void gmsh_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE gmsh_yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE gmsh_yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE gmsh_yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE gmsh_yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *gmsh_yyalloc (yy_size_t ); void *gmsh_yyrealloc (void *,yy_size_t ); @@ -954,7 +945,7 @@ void skipline(void); #define YY_NO_UNISTD_H #endif -#line 958 "Gmsh.yy.cpp" +#line 949 "Gmsh.yy.cpp" #define INITIAL 0 @@ -993,7 +984,7 @@ FILE *gmsh_yyget_out (void ); void gmsh_yyset_out (FILE * out_str ); -int gmsh_yyget_leng (void ); +yy_size_t gmsh_yyget_leng (void ); char *gmsh_yyget_text (void ); @@ -1035,12 +1026,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1048,7 +1034,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( gmsh_yytext, gmsh_yyleng, 1, gmsh_yyout )) {} } while (0) +#define ECHO fwrite( gmsh_yytext, gmsh_yyleng, 1, gmsh_yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1059,7 +1045,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( gmsh_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1144,7 +1130,7 @@ YY_DECL #line 49 "Gmsh.l" -#line 1148 "Gmsh.yy.cpp" +#line 1134 "Gmsh.yy.cpp" if ( !(yy_init) ) { @@ -2009,7 +1995,7 @@ YY_RULE_SETUP #line 233 "Gmsh.l" ECHO; YY_BREAK -#line 2013 "Gmsh.yy.cpp" +#line 1999 "Gmsh.yy.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2195,7 +2181,7 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2209,7 +2195,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2240,7 +2226,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2350,7 +2336,7 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; + register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -2399,7 +2385,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2423,7 +2409,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( gmsh_yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2675,7 +2661,7 @@ void gmsh_yypop_buffer_state (void) */ static void gmsh_yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -2767,17 +2753,16 @@ YY_BUFFER_STATE gmsh_yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to gmsh_yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE gmsh_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE gmsh_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - int i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2859,7 +2844,7 @@ FILE *gmsh_yyget_out (void) /** Get the length of the current token. * */ -int gmsh_yyget_leng (void) +yy_size_t gmsh_yyget_leng (void) { return gmsh_yyleng; }