diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index aa4102361bf1774498929a06948b1e892c6b4aa6..abb57f38cd569844f77a5479dc0dd3de1eb3b258 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -6,10 +6,29 @@ /* A lexical scanner generated by flex */ +#define yy_create_buffer gmsh_yy_create_buffer +#define yy_delete_buffer gmsh_yy_delete_buffer +#define yy_flex_debug gmsh_yy_flex_debug +#define yy_init_buffer gmsh_yy_init_buffer +#define yy_flush_buffer gmsh_yy_flush_buffer +#define yy_load_buffer_state gmsh_yy_load_buffer_state +#define yy_switch_to_buffer gmsh_yy_switch_to_buffer +#define yyin gmsh_yyin +#define yyleng gmsh_yyleng +#define yylex gmsh_yylex +#define yylineno gmsh_yylineno +#define yyout gmsh_yyout +#define yyrestart gmsh_yyrestart +#define yytext gmsh_yytext +#define yywrap gmsh_yywrap +#define yyalloc gmsh_yyalloc +#define yyrealloc gmsh_yyrealloc +#define yyfree gmsh_yyfree + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -31,7 +50,7 @@ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -94,11 +113,12 @@ typedef unsigned int flex_uint32_t; #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -152,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; @@ -178,16 +203,6 @@ extern FILE *gmsh_yyin, *gmsh_yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -205,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 @@ -275,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; @@ -304,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 ); @@ -888,7 +903,7 @@ void skipline(void); #define YY_NO_UNISTD_H #endif -#line 892 "Gmsh.yy.cpp" +#line 907 "Gmsh.yy.cpp" #define INITIAL 0 @@ -906,6 +921,35 @@ void skipline(void); static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int gmsh_yylex_destroy (void ); + +int gmsh_yyget_debug (void ); + +void gmsh_yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE gmsh_yyget_extra (void ); + +void gmsh_yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *gmsh_yyget_in (void ); + +void gmsh_yyset_in (FILE * in_str ); + +FILE *gmsh_yyget_out (void ); + +void gmsh_yyset_out (FILE * out_str ); + +yy_size_t gmsh_yyget_leng (void ); + +char *gmsh_yyget_text (void ); + +int gmsh_yyget_lineno (void ); + +void gmsh_yyset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -948,7 +992,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 (void) fwrite( gmsh_yytext, gmsh_yyleng, 1, gmsh_yyout ) +#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, @@ -959,7 +1003,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; \ @@ -1044,7 +1088,7 @@ YY_DECL #line 49 "Gmsh.l" -#line 1048 "Gmsh.yy.cpp" +#line 1092 "Gmsh.yy.cpp" if ( !(yy_init) ) { @@ -1869,7 +1913,7 @@ YY_RULE_SETUP #line 224 "Gmsh.l" ECHO; YY_BREAK -#line 1873 "Gmsh.yy.cpp" +#line 1917 "Gmsh.yy.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2055,7 +2099,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 ) @@ -2069,7 +2113,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; @@ -2124,6 +2168,14 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) gmsh_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -2202,7 +2254,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 = @@ -2251,7 +2303,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( ) ) @@ -2527,7 +2579,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)) { @@ -2539,7 +2591,9 @@ static void gmsh_yyensure_buffer_stack (void) (yy_buffer_stack) = (struct yy_buffer_state**)gmsh_yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in gmsh_yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -2557,6 +2611,8 @@ static void gmsh_yyensure_buffer_stack (void) ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in gmsh_yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2601,7 +2657,7 @@ YY_BUFFER_STATE gmsh_yy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to gmsh_yylex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use @@ -2620,12 +2676,11 @@ YY_BUFFER_STATE gmsh_yy_scan_string (yyconst char * yystr ) * * @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; @@ -2707,7 +2762,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; } diff --git a/Plugin/Particles.cpp b/Plugin/Particles.cpp index 57623cc7cf8bc6be553dcd273a21371dd11a1e3c..af33e5c2a7e417020a8c268a23cbad62eed6dabb 100644 --- a/Plugin/Particles.cpp +++ b/Plugin/Particles.cpp @@ -149,24 +149,24 @@ std::string GMSH_ParticlesPlugin::getHelp() const { return "Plugin(Particles) computes the trajectory\n" - "of a particule in the force field given by the\n" + "of particules in the force field given by the\n" "`TimeStep'-th time step of a vector view\n" "`iView'. The plugin takes as input a grid defined\n" "by the 3 points (`X0',`Y0',`Z0') (origin),\n" "(`X1',`Y1',`Z1') (axis of U) and (`X2',`Y2',`Z2')\n" - "(axis of V). The number of points along U and V\n" + "(axis of V). The number of particles along U and V\n" "that are to be transported is set with the\n" "options `nPointsU' and `nPointsV'. The equation\n" - "A2*d^2X(t)/dt^2+A1*dX(t)/dt+A0*X(t)=F(x,y,z) is then\n" + "A2*d^2X(t)/dt^2+A1*dX(t)/dt+A0*X(t)=F is then\n" "solved with the initial conditions X(t=0) chosen\n" - "as the grid, dX/dt(t=0)=0, and with F(x,y,z)\n" + "as the grid, dX/dt(t=0)=0, and with F\n" "interpolated from the vector view. Time stepping\n" "is done using a Newmark scheme with step size `DT'\n" "and `MaxIter' maximum number of iterations. If\n" "`iView' < 0 the plugin is run on the current view.\n" "\n" - "Plugin(Particles) creates one new view. This\n" - "view contains multi-step vector points.\n"; + "Plugin(Particles) creates one new view containing\n" + "multi-step vector points.\n"; } int GMSH_ParticlesPlugin::getNbOptions() const