Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDF4-visual studio interference #370

Merged
merged 2 commits into from
Feb 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ncgen/ncgen.l
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ yytext[MAXTRST-1] = '\0';

compound|struct|structure {return lexdebug(COMPOUND);}
enum {return lexdebug(ENUM);}
opaque {return lexdebug(OPAQUE);}
opaque {return lexdebug(OPAQUE_);}

float|real {return lexdebug(FLOAT_K);}
char {return lexdebug(CHAR_K);}
Expand Down
4 changes: 2 additions & 2 deletions ncgen/ncgen.y
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ NCConstant constant;
TYPES
COMPOUND
ENUM
OPAQUE
OPAQUE_ /* 'OPAQUE' apparently conflicts with HDF4 code */
OPAQUESTRING /* 0x<even number of hexdigits> */
GROUP
PATH /* / or (/IDENT)+(.IDENT)? */
Expand Down Expand Up @@ -340,7 +340,7 @@ enumid: ident '=' constint
}
;

opaquedecl: OPAQUE '(' INT_CONST ')' typename
opaquedecl: OPAQUE_ '(' INT_CONST ')' typename
{
vercheck(NC_OPAQUE);
addtogroup($5); /*sets prefix*/
Expand Down
58 changes: 29 additions & 29 deletions ncgen/ncgenl.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#line 3 "lex.ncg.c"
#line 3 "ncgenl.c"

#define YY_INT_ALIGNED short int

Expand Down Expand Up @@ -65,7 +65,6 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
Expand Down Expand Up @@ -172,12 +171,7 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

extern yy_size_t ncgleng;
extern int ncgleng;

extern FILE *ncgin, *ncgout;

Expand All @@ -203,6 +197,11 @@ extern FILE *ncgin, *ncgout;

#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
Expand All @@ -220,7 +219,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
yy_size_t yy_n_chars;
int 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
Expand Down Expand Up @@ -290,8 +289,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */

/* yy_hold_char holds the character lost when ncgtext is formed. */
static char yy_hold_char;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t ncgleng;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int ncgleng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
Expand Down Expand Up @@ -319,7 +318,7 @@ static void ncg_init_buffer (YY_BUFFER_STATE b,FILE *file );

YY_BUFFER_STATE ncg_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE ncg_scan_string (yyconst char *yy_str );
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,yy_size_t len );
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,int len );

void *ncgalloc (yy_size_t );
void *ncgrealloc (void *,yy_size_t );
Expand Down Expand Up @@ -374,7 +373,7 @@ static void yy_fatal_error (yyconst char msg[] );
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
ncgleng = (yy_size_t) (yy_cp - yy_bp); \
ncgleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
Expand Down Expand Up @@ -1320,7 +1319,7 @@ ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})*
/* Note: this definition of string will work for utf8 as well,
although it is a very relaxed definition
*/
#line 1324 "lex.ncg.c"
#line 1323 "ncgenl.c"

#define INITIAL 0
#define ST_C_COMMENT 1
Expand Down Expand Up @@ -1361,7 +1360,7 @@ FILE *ncgget_out (void );

void ncgset_out (FILE * out_str );

yy_size_t ncgget_leng (void );
int ncgget_leng (void );

char *ncgget_text (void );

Expand Down Expand Up @@ -1422,7 +1421,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
yy_size_t n; \
int n; \
for ( n = 0; n < max_size && \
(c = getc( ncgin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
Expand Down Expand Up @@ -1506,7 +1505,7 @@ YY_DECL

#line 217 "ncgen.l"

#line 1510 "lex.ncg.c"
#line 1509 "ncgenl.c"

if ( !(yy_init) )
{
Expand Down Expand Up @@ -1659,7 +1658,7 @@ YY_RULE_SETUP
case 7:
YY_RULE_SETUP
#line 264 "ncgen.l"
{return lexdebug(OPAQUE);}
{return lexdebug(OPAQUE_);}
YY_BREAK
case 8:
YY_RULE_SETUP
Expand Down Expand Up @@ -2119,7 +2118,7 @@ YY_RULE_SETUP
#line 570 "ncgen.l"
ECHO;
YY_BREAK
#line 2123 "lex.ncg.c"
#line 2122 "ncgenl.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(TEXT):
yyterminate();
Expand Down Expand Up @@ -2306,7 +2305,7 @@ static int yy_get_next_buffer (void)

else
{
yy_size_t num_to_read =
int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;

while ( num_to_read <= 0 )
Expand All @@ -2320,7 +2319,7 @@ static int yy_get_next_buffer (void)

if ( b->yy_is_our_buffer )
{
yy_size_t new_size = b->yy_buf_size * 2;
int new_size = b->yy_buf_size * 2;

if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
Expand Down Expand Up @@ -2351,7 +2350,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), num_to_read );
(yy_n_chars), (size_t) num_to_read );

YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
Expand Down Expand Up @@ -2461,7 +2460,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 yy_size_t number_to_move = (yy_n_chars) + 2;
register int 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 =
Expand Down Expand Up @@ -2510,7 +2509,7 @@ static int yy_get_next_buffer (void)

else
{ /* need more input */
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
int offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);

switch ( yy_get_next_buffer( ) )
Expand All @@ -2534,7 +2533,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( ncgwrap( ) )
return 0;
return EOF;

if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
Expand Down Expand Up @@ -2786,7 +2785,7 @@ void ncgpop_buffer_state (void)
*/
static void ncgensure_buffer_stack (void)
{
yy_size_t num_to_alloc;
int num_to_alloc;

if (!(yy_buffer_stack)) {

Expand Down Expand Up @@ -2883,11 +2882,12 @@ YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr )
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n, i;
yy_size_t n;
int i;

/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
Expand Down Expand Up @@ -2969,7 +2969,7 @@ FILE *ncgget_out (void)
/** Get the length of the current token.
*
*/
yy_size_t ncgget_leng (void)
int ncgget_leng (void)
{
return ncgleng;
}
Expand Down
Loading