From 91188cea7aa7e5e9cbe9163b08979304971d2e5f Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 15 Jan 2013 22:43:09 +0000 Subject: [PATCH] Merging CMake branch into trunk. Changes include: CMake related changes in CMakeLists.txt files, cmake_config.h.in. Other changes relate to Windows-specific issues, and changes made when regenerating generated source files. --- CMakeLists.txt | 43 ++++- cmake_config.h.in | 1 + configure.ac | 2 + include/netcdf.h | 3 +- libdispatch/dv2i.c | 27 ++-- liblib/CMakeLists.txt | 4 + libsrc4/nc4file.c | 7 +- nc_test/CMakeLists.txt | 18 +-- nc_test4/CMakeLists.txt | 24 +-- ncgen/CMakeLists.txt | 17 ++ ncgen/ncgentab.c | 339 ++++++++++++++++++---------------------- ncgen/ncgentab.h | 6 +- ncgen/ncgenyy.c | 63 ++++---- 13 files changed, 287 insertions(+), 267 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96371ddbf..224ae4bc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,17 +196,33 @@ IF(ENABLE_LOGGING) SET(LOGGING ON) ENDIF() # Option to use HDF4 -OPTION (USE_HDF4 "Build NetCDF-4 with HDF5 read capability (HDF4, HDF5 and Zlib required." OFF) -IF (USE_HDF4) - FIND_PACKAGE(HDF4) - IF(NOT HDF4_FOUND) - MESSAGE(FATAL_ERROR "HDF4 Support specified, but HDF4 libraries were not found.") - ENDIF(NOT HDF4_FOUND) +OPTION (ENABLE_HDF4 "Build NetCDF-4 with HDF5 read capability (HDF4, HDF5 and Zlib required)." OFF) +IF (ENABLE_HDF4) + SET(USE_HDF4 ON) + # Check for include files, libraries. CHECK_INCLUDE_FILE("mfhdf.h" HAVE_MFHDF_H) IF(NOT HAVE_MFHDF_H) MESSAGE(FATAL_ERROR "HDF4 Support specified, cannot find file mfhdf.h") ENDIF(NOT HAVE_MFHDF_H) -ENDIF (USE_HDF4) + + FIND_LIBRARY(HDF4_DF_LIB NAMES df libdf) + IF(NOT HDF4_DF_LIB) + MESSAGE(FATAL_ERROR "HDF4 Support enabled, but cannot find df lib.") + ENDIF() + + FIND_LIBRARY(HDF4_MFHDF_LIB NAMES mfhdf libmfhdf) + IF(NOT HDF4_MFHDF_LIB) + MESSAGE(FATAL_ERROR "HDF4 Support enabled, but cannot find mfhdf lib.") + ENDIF() + + SET(HDF4_LIBRARIES ${HDF4_DF_LIB} ${HDF4_MFHDF_LIB}) + # End include files, libraries. + MESSAGE(STATUS "HDF4 Libraries: ${HDF4_DF_LIB}, ${HDF4_MFHDF_LIB}") + OPTION(ENABLE_HDF4_FILE_TESTS "Run HDF4 File Tests.",OFF) + IF(ENABLE_HDF4_FILE_TESTS) + SET(USE_HDF4_FILE_TESTS ON) + ENDIF() +ENDIF () # Option to Build DLL IF(WIN32) @@ -306,6 +322,13 @@ ELSE() SET(ENABLE_DAP_GROUPS OFF CACHE BOOL "Whether netcdf4 group names should be enabled.") ENDIF() + +# Enable some developer-only tests +OPTION(ENABLE_EXTRA_TESTS "Enable Extra tests. Some may not work because of known issues. Developers only." OFF) +IF(ENABLE_EXTRA_TESTS) + SET(EXTRA_TESTS ON) +ENDIF() + # Option to use bundled XGetopt in place of getopt(). This is mostly useful # for MSVC builds. If not building utilities, getopt() isn't required at all. IF(MSVC) @@ -421,6 +444,12 @@ SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_SOURCE_DIR}/libsrc) # Library include checks CHECK_INCLUDE_FILE("math.h" HAVE_MATH_H) CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) +# Solve a compatibility issue in ncgen/, which checks +# for NO_UNISTD_H +IF(NOT HAVE_UNISTD_H) + SET(YY_NO_UNISTD_H TRUE) +ENDIF() + CHECK_INCLUDE_FILE("alloca.h" HAVE_ALLOCA_H) CHECK_INCLUDE_FILE("ctype.h" HAVE_CTYPE_H) CHECK_INCLUDE_FILE("dirent.h" HAVE_DIRENT_H) diff --git a/cmake_config.h.in b/cmake_config.h.in index e35cb8ea3..e67f5b579 100644 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -104,6 +104,7 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@ +#cmakedefine YY_NO_UNISTD_H @YY_NO_UNISTD_H@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DLFCN_H @HAVE_DLFCN_H@ diff --git a/configure.ac b/configure.ac index b29c8f65c..9ae261855 100644 --- a/configure.ac +++ b/configure.ac @@ -723,6 +723,8 @@ dnl fi fi AC_CHECK_LIB([df], [Hclose], [], []) AC_CHECK_LIB([mfhdf], [SDcreate], [], []) + #AC_SEARCH_LIBS([Hclose],[df], [], [AC_MSG_ERROR([Can't find or link to the hdf4 df library. See config.log for errors.])]) + #AC_SEARCH_LIBS([SDcreate],[mfhdf], [], [AC_MSG_ERROR([Can't find or link to the hdf4 mfhdf library. See config.log for errors.])]) AC_DEFINE([USE_HDF4], [1], [if true, use HDF4 too]) fi fi diff --git a/include/netcdf.h b/include/netcdf.h index 2e7530bd1..c644310f3 100644 --- a/include/netcdf.h +++ b/include/netcdf.h @@ -412,8 +412,7 @@ by the desired type. */ /* Define for 64 bit windows. */ #if defined (_WIN64) #define off_t __int64 -#define size_t __int64 -//#define lseek _lseeki64 +#define size_t unsigned __int64 #define _OFF_T_DEFINED #endif diff --git a/libdispatch/dv2i.c b/libdispatch/dv2i.c index 022e9b085..70591be30 100644 --- a/libdispatch/dv2i.c +++ b/libdispatch/dv2i.c @@ -56,26 +56,32 @@ nvdims(int ncid, int varid) return ndims; } -static void* nvmalloc(int ct, int size) { - int mct = ct; - if(ct < 0) mct = 1; - - return malloc(mct * size); +/* Used to avoid errors on 64-bit windows related to + c89 macros and flow control/conditionals. */ +static void* nvmalloc(off_t size) { + if(size < 0) + return NULL; + + return malloc(size); } -#define NDIMS_DECL const int ndims = nvdims(ncid, varid); +#define NDIMS_DECL const int ndims = nvdims(ncid, varid); \ + + +# define A_DECL(name, type, ndims, rhs) \ + type *const name = (type*) nvmalloc((ndims) * sizeof(type)) -# define A_DECL(name, type, ndims, rhs) \ - ALLOC_ONSTACK(name, type, ndims) +// ALLOC_ONSTACK(name, type, ndims) + # define A_FREE(name) \ FREE_ONSTACK(name) # define A_INIT(lhs, type, ndims, rhs) \ { \ - if(ndims >= 0) { \ + if((off_t)ndims >= 0) { \ const long *lp = rhs; \ type *tp = lhs; \ type *const end = lhs + ndims; \ @@ -86,7 +92,7 @@ static void* nvmalloc(int ct, int size) { } \ } \ \ - if (ndims < 0) {nc_advise("nvdims",NC_EMAXDIMS,"ndims %d",ndims); return -1;} + if ((off_t)ndims < 0) {nc_advise("nvdims",NC_EMAXDIMS,"ndims %d",ndims); return -1;} #endif @@ -788,7 +794,6 @@ ncvarputs( { NDIMS_DECL - A_DECL(stp, size_t, ndims, start); A_DECL(cntp, size_t, ndims, count); A_DECL(strdp, ptrdiff_t, ndims, stride); diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt index 0f5a170ae..1dac471bf 100644 --- a/liblib/CMakeLists.txt +++ b/liblib/CMakeLists.txt @@ -41,6 +41,10 @@ IF(USE_DAP) SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARIES}) ENDIF() +IF(USE_HDF4) + SET(TLL_LIBS ${TLL_LIBS} ${HDF4_LIBRARIES}) +ENDIF() + IF(USE_HDF5 OR USE_NETCDF4) SET(TLL_LIBS ${TLL_LIBS} ${SZIP_LIBRARY} ${HDF5_LIBRARIES}) ENDIF() diff --git a/libsrc4/nc4file.c b/libsrc4/nc4file.c index 596542a14..7d31bb0e2 100644 --- a/libsrc4/nc4file.c +++ b/libsrc4/nc4file.c @@ -1244,9 +1244,10 @@ read_type(NC_GRP_INFO_T *grp, char *type_name) /* Insert new field into this type's list of fields. */ if ((retval = nc4_enum_member_add(&type->enum_member, type->size, member_name, value))) - return retval; - free(member_name); /* Where is this defined? */ - } + return retval; + free(member_name); + + } /* Free the tempory memory for one value, and the member name * (which HDF5 allocated for us). */ diff --git a/nc_test/CMakeLists.txt b/nc_test/CMakeLists.txt index 2c8a02fc8..06410f9bb 100644 --- a/nc_test/CMakeLists.txt +++ b/nc_test/CMakeLists.txt @@ -12,38 +12,34 @@ ADD_EXECUTABLE(nc_test ${nc_test_SRC}) TARGET_LINK_LIBRARIES(nc_test netcdf) # Some extra tests -SET(EXTRA_TSTS t_nc tst_small tst_misc tst_norm tst_names tst_nofill tst_nofill2 tst_nofill3) +SET(TESTS t_nc tst_small tst_misc tst_norm tst_names tst_nofill tst_nofill2 tst_nofill3) IF(NOT MSVC) - SET(EXTRA_TSTS ${EXTRA_TSTS} tst_atts3) + SET(TESTS ${TESTS} tst_atts3) ENDIF() IF(USE_NETCDF4) - SET(EXTRA_TSTS ${EXTRA_TSTS} tst_atts) + SET(TESTS ${TESTS} tst_atts) ENDIF() IF(LARGE_FILE_TESTS) - SET(EXTRA_TSTS ${EXTRA_TSTS} quick_large_files tst_big_var6 tst_big_var2 tst_big_rvar tst_big_var tst_large large_files) + SET(TESTS ${TESTS} quick_large_files tst_big_var6 tst_big_var2 tst_big_rvar tst_big_var tst_large large_files) ENDIF() IF(BUILD_DISKLESS) - SET(EXTRA_TSTS ${EXTRA_TSTS} tst_diskless tst_diskless3 tst_diskless4) + SET(TESTS ${TESTS} tst_diskless tst_diskless3 tst_diskless4) IF(USE_NETCDF4) - SET(EXTRA_TSTS ${EXTRA_TSTS} tst_diskless2) + SET(TESTS ${TESTS} tst_diskless2) ENDIF() ENDIF() -FOREACH(CTEST ${EXTRA_TSTS}) +FOREACH(CTEST ${TESTS}) add_bin_test(nc_test ${CTEST}) #ADD_EXECUTABLE(${CTEST} ${CTEST}.c) #TARGET_LINK_LIBRARIES(${CTEST} netcdf) ENDFOREACH() - - - - ## Tests ADD_TEST(nc_test ${EXECUTABLE_OUTPUT_PATH}/nc_test) diff --git a/nc_test4/CMakeLists.txt b/nc_test4/CMakeLists.txt index cf6980f1d..e4e57ae89 100644 --- a/nc_test4/CMakeLists.txt +++ b/nc_test4/CMakeLists.txt @@ -2,7 +2,7 @@ SET(CMAKE_INCLUDE_CURRENT_DIR ON) INCLUDE_DIRECTORIES(".") # Some extra tests -SET(EXTRA_TSTS4 tst_dims tst_dims2 tst_dims3 tst_files tst_files4 tst_vars tst_varms tst_unlim_vars tst_converts tst_converts2 tst_grps tst_grps2 +SET(NC4_TESTS tst_dims tst_dims2 tst_dims3 tst_files tst_files4 tst_vars tst_varms tst_unlim_vars tst_converts tst_converts2 tst_grps tst_grps2 tst_compounds tst_compounds2 tst_compounds3 tst_opaques tst_strings tst_strings2 tst_interops tst_interops4 tst_interops6 tst_enums tst_coords tst_coords2 tst_coords3 tst_vars3 tst_vars4 @@ -12,23 +12,27 @@ t_type cdm_sea_soundings tst_vl tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug) IF(NOT MSVC) - SET(EXTRA_TSTS4 ${EXTRA_TSTS4} tst_interops5 tst_camrun) + SET(NC4_TESTS ${NC4_TESTS} tst_interops5 tst_camrun) +ENDIF() + +IF(USE_HDF4) + SET(NC4_TESTS ${NC4_TESTS} tst_interops2) ENDIF() + + # Copy some test files from current source dir to out-of-tree build dir. -FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nc) +FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -FOREACH(CTEST ${EXTRA_TSTS4}) +FOREACH(CTEST ${NC4_TESTS}) add_bin_test(nc_test4 ${CTEST}) - #ADD_EXECUTABLE(${CTEST} ${CTEST}.c) - #TARGET_LINK_LIBRARIES(${CTEST} netcdf) - #ADD_TEST(${CTEST} ${EXECUTABLE_OUTPUT_PATH}/${CTEST}) ENDFOREACH() - - - +IF(USE_HDF4_FILE_TESTS) + add_sh_test(nc_test4 run_get_hdf4_files) + add_bin_test(nc_test4 tst_interops3) +ENDIF() diff --git a/ncgen/CMakeLists.txt b/ncgen/CMakeLists.txt index 62b86dd82..f6cc6d078 100644 --- a/ncgen/CMakeLists.txt +++ b/ncgen/CMakeLists.txt @@ -13,6 +13,10 @@ TARGET_LINK_LIBRARIES(ncgen netcdf ${ALL_TLL_LIBS}) INSTALL(TARGETS ncgen DESTINATION bin COMPONENT utilities) +# Copy the input for the flex file (ncgen.l) +FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.l ${CMAKE_CURRENT_SOURCE_DIR}/*.y) +FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) + # Stuff to build if tests are enabled. IF(ENABLE_TESTS) FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) @@ -33,3 +37,16 @@ ENDIF() SET(CLEANFILES c0.nc c0_64.nc c0_4.nc c0_4c.nc ref_camrun.c) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}") +ADD_CUSTOM_COMMAND( + OUTPUT ncgentab.h + COMMAND flex -Pncg -B ncgen.l + COMMAND rm -f ncgenyy.c + COMMAND mv lex.ncg.c ncgenyy.c + COMMAND bison -pncg -t -d ncgen.y + COMMAND rm -f ncgentab.c ncgentab.h + COMMAND mv ncgen.tab.c ncgentab.c + COMMAND mv ncgen.tab.h ncgentab.h +) + +ADD_CUSTOM_TARGET(makeparser DEPENDS ncgentab.h) + diff --git a/ncgen/ncgentab.c b/ncgen/ncgentab.c index ccf348cdc..73d9a0883 100644 --- a/ncgen/ncgentab.c +++ b/ncgen/ncgentab.c @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.6.4. */ +/* A Bison parser, made by GNU Bison 2.7. */ /* Bison implementation for Yacc-like parsers in C @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.6.4" +#define YYBISON_VERSION "2.7" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -69,7 +69,7 @@ #define yynerrs ncgnerrs /* Copy the first part of user declarations. */ -/* Line 358 of yacc.c */ +/* Line 371 of yacc.c */ #line 11 "ncgen.y" /* @@ -188,7 +188,7 @@ static void yyerror(fmt,va_alist) const char* fmt; va_dcl; extern int lex_init(void); -/* Line 358 of yacc.c */ +/* Line 371 of yacc.c */ #line 193 "ncgen.tab.c" # ifndef YY_NULL @@ -279,7 +279,7 @@ extern int ncgdebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 374 of yacc.c */ +/* Line 387 of yacc.c */ #line 131 "ncgen.y" Symbol* sym; @@ -290,7 +290,7 @@ Datalist* datalist; Constant constant; -/* Line 374 of yacc.c */ +/* Line 387 of yacc.c */ #line 295 "ncgen.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 @@ -318,7 +318,7 @@ int ncgparse (); /* Copy the second part of user declarations. */ -/* Line 377 of yacc.c */ +/* Line 390 of yacc.c */ #line 323 "ncgen.tab.c" #ifdef short @@ -1027,47 +1027,18 @@ do \ } \ while (YYID (0)) - +/* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) - - /* This macro is provided for backward compatibility. */ - #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif /* YYLEX -- calling `yylex' with the right arguments. */ - #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else @@ -1130,7 +1101,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) switch (yytype) { default: - break; + break; } } @@ -1372,7 +1343,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, { YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULL; @@ -1435,11 +1405,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, break; } yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } } } } @@ -1459,10 +1431,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, # undef YYCASE_ } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } if (*yymsg_alloc < yysize) { @@ -1522,7 +1496,7 @@ yydestruct (yymsg, yytype, yyvaluep) { default: - break; + break; } } @@ -1533,16 +1507,16 @@ yydestruct (yymsg, yytype, yyvaluep) int yychar; -#ifndef YYLVAL_INITIALIZE -# define YYLVAL_INITIALIZE() -#endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); /* Number of syntax errors so far. */ int yynerrs; @@ -1618,8 +1592,8 @@ yyparse () Keep to zero when no symbol should be popped. */ int yylen = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1628,15 +1602,6 @@ yyparse () yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - YYLVAL_INITIALIZE (); goto yysetstate; /*------------------------------------------------------------. @@ -1816,13 +1781,13 @@ yyreduce: switch (yyn) { case 2: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 210 "ncgen.y" {if (error_count > 0) YYABORT;} break; case 7: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 230 "ncgen.y" { Symbol* id = (yyvsp[(2) - (3)].sym); @@ -1834,25 +1799,25 @@ yyreduce: break; case 8: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 239 "ncgen.y" {listpop(groupstack);} break; case 11: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 245 "ncgen.y" {} break; case 12: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 247 "ncgen.y" {markcdf4("Type specification");} break; case 15: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 253 "ncgen.y" { /* Use when defining a type */ (yyvsp[(1) - (1)].sym)->objectclass = NC_TYPE; @@ -1864,19 +1829,19 @@ yyreduce: break; case 16: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 262 "ncgen.y" {} break; case 17: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 262 "ncgen.y" {} break; case 24: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 276 "ncgen.y" { int i; @@ -1907,13 +1872,13 @@ yyreduce: break; case 25: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 305 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));} break; case 26: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 307 "ncgen.y" { int i; @@ -1932,7 +1897,7 @@ yyreduce: break; case 27: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "ncgen.y" { (yyvsp[(1) - (3)].sym)->objectclass=NC_TYPE; @@ -1943,7 +1908,7 @@ yyreduce: break; case 28: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 333 "ncgen.y" { vercheck(NC_OPAQUE); @@ -1957,7 +1922,7 @@ yyreduce: break; case 29: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 345 "ncgen.y" { Symbol* basetype = (yyvsp[(1) - (5)].sym); @@ -1973,7 +1938,7 @@ yyreduce: break; case 30: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 359 "ncgen.y" { int i,j; @@ -2007,19 +1972,19 @@ yyreduce: break; case 31: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 391 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (2)].mark);} break; case 32: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 392 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark);} break; case 33: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 396 "ncgen.y" { int i; @@ -2035,97 +2000,97 @@ yyreduce: break; case 34: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 409 "ncgen.y" { (yyval.sym) = primsymbols[NC_CHAR]; } break; case 35: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 410 "ncgen.y" { (yyval.sym) = primsymbols[NC_BYTE]; } break; case 36: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 411 "ncgen.y" { (yyval.sym) = primsymbols[NC_SHORT]; } break; case 37: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 412 "ncgen.y" { (yyval.sym) = primsymbols[NC_INT]; } break; case 38: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 413 "ncgen.y" { (yyval.sym) = primsymbols[NC_FLOAT]; } break; case 39: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 414 "ncgen.y" { (yyval.sym) = primsymbols[NC_DOUBLE]; } break; case 40: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 415 "ncgen.y" { vercheck(NC_UBYTE); (yyval.sym) = primsymbols[NC_UBYTE]; } break; case 41: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 416 "ncgen.y" { vercheck(NC_USHORT); (yyval.sym) = primsymbols[NC_USHORT]; } break; case 42: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 417 "ncgen.y" { vercheck(NC_UINT); (yyval.sym) = primsymbols[NC_UINT]; } break; case 43: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 418 "ncgen.y" { vercheck(NC_INT64); (yyval.sym) = primsymbols[NC_INT64]; } break; case 44: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 419 "ncgen.y" { vercheck(NC_UINT64); (yyval.sym) = primsymbols[NC_UINT64]; } break; case 46: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 423 "ncgen.y" {} break; case 47: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 424 "ncgen.y" {} break; case 50: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 431 "ncgen.y" {} break; case 51: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 431 "ncgen.y" {} break; case 54: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 439 "ncgen.y" { (yyvsp[(1) - (3)].sym)->dim.declsize = (size_t)uint32_val; @@ -2136,7 +2101,7 @@ fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned lo break; case 55: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 446 "ncgen.y" { if(int32_val <= 0) { @@ -2151,7 +2116,7 @@ fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned lo break; case 56: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 457 "ncgen.y" { /* for rare case where 2^31 < dimsize < 2^32 */ if (double_val <= 0) @@ -2168,7 +2133,7 @@ fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned lo break; case 57: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 470 "ncgen.y" { (yyvsp[(1) - (3)].sym)->dim.declsize = NC_UNLIMITED; @@ -2180,7 +2145,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 58: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 480 "ncgen.y" { (yyvsp[(1) - (1)].sym)->objectclass=NC_DIM; @@ -2194,31 +2159,31 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 60: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 492 "ncgen.y" {} break; case 61: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 493 "ncgen.y" {} break; case 64: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 500 "ncgen.y" {} break; case 65: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 500 "ncgen.y" {} break; case 66: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 503 "ncgen.y" { int i; @@ -2242,7 +2207,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 67: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 525 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym)); @@ -2250,13 +2215,13 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 68: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 529 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));} break; case 69: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 533 "ncgen.y" { int i; @@ -2285,31 +2250,31 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 70: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 559 "ncgen.y" {(yyval.mark)=listlength(stack);} break; case 71: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 560 "ncgen.y" {(yyval.mark)=(yyvsp[(2) - (3)].mark);} break; case 72: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 563 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));} break; case 73: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 565 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));} break; case 74: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 569 "ncgen.y" {Symbol* dimsym = (yyvsp[(1) - (1)].sym); dimsym->objectclass = NC_DIM; @@ -2324,7 +2289,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 75: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 583 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym)); @@ -2332,13 +2297,13 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 76: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 587 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));} break; case 77: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 592 "ncgen.y" { int i; @@ -2369,31 +2334,31 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 78: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 620 "ncgen.y" {(yyval.mark)=listlength(stack);} break; case 79: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 621 "ncgen.y" {(yyval.mark)=(yyvsp[(2) - (3)].mark);} break; case 80: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 625 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));} break; case 81: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 627 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));} break; case 82: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 632 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ @@ -2407,7 +2372,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 83: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 642 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ @@ -2425,7 +2390,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 84: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 662 "ncgen.y" {Symbol* vsym = (yyvsp[(1) - (1)].sym); if(vsym->objectclass != NC_VAR) { @@ -2437,7 +2402,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 85: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 673 "ncgen.y" {Symbol* tsym = (yyvsp[(1) - (1)].sym); if(tsym->objectclass != NC_TYPE) { @@ -2449,7 +2414,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 86: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 684 "ncgen.y" {Symbol* tvsym = (yyvsp[(1) - (1)].sym); Symbol* sym; /* disambiguate*/ @@ -2472,31 +2437,31 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 87: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 702 "ncgen.y" {(yyval.sym)=(yyvsp[(1) - (1)].sym);} break; case 88: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 709 "ncgen.y" {} break; case 89: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 709 "ncgen.y" {} break; case 90: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 713 "ncgen.y" { (yyval.sym)=makeattribute((yyvsp[(2) - (4)].sym),NULL,NULL,(yyvsp[(4) - (4)].datalist),ATTRGLOBAL);} break; case 91: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 715 "ncgen.y" {Symbol* tsym = (yyvsp[(1) - (6)].sym); Symbol* vsym = (yyvsp[(2) - (6)].sym); Symbol* asym = (yyvsp[(4) - (6)].sym); if(vsym->objectclass == NC_VAR) { @@ -2509,7 +2474,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 92: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 724 "ncgen.y" {Symbol* sym = (yyvsp[(1) - (5)].sym); Symbol* asym = (yyvsp[(3) - (5)].sym); if(sym->objectclass == NC_VAR) { @@ -2524,67 +2489,67 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 93: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 735 "ncgen.y" {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)(yyvsp[(5) - (5)].datalist),0);} break; case 94: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 737 "ncgen.y" {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[(2) - (6)].sym),(yyvsp[(1) - (6)].sym),(void*)(yyvsp[(6) - (6)].datalist),0);} break; case 95: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 739 "ncgen.y" {(yyval.sym) = makespecial(_STORAGE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} break; case 96: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 741 "ncgen.y" {(yyval.sym) = makespecial(_CHUNKSIZES_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)(yyvsp[(5) - (5)].datalist),0);} break; case 97: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 743 "ncgen.y" {(yyval.sym) = makespecial(_FLETCHER32_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} break; case 98: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 745 "ncgen.y" {(yyval.sym) = makespecial(_DEFLATE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} break; case 99: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 747 "ncgen.y" {(yyval.sym) = makespecial(_SHUFFLE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} break; case 100: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 749 "ncgen.y" {(yyval.sym) = makespecial(_ENDIAN_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} break; case 101: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 751 "ncgen.y" {(yyval.sym) = makespecial(_NOFILL_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} break; case 102: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 753 "ncgen.y" {(yyval.sym) = makespecial(_FORMAT_FLAG,NULL,NULL,(void*)&(yyvsp[(4) - (4)].constant),1);} break; case 103: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 758 "ncgen.y" { (yyval.sym)=(yyvsp[(1) - (1)].sym); @@ -2594,7 +2559,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 104: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 764 "ncgen.y" { (yyval.sym)=(yyvsp[(1) - (1)].sym); @@ -2605,242 +2570,242 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); break; case 106: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 773 "ncgen.y" {} break; case 107: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 774 "ncgen.y" {} break; case 110: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 782 "ncgen.y" {(yyvsp[(1) - (3)].sym)->data = (yyvsp[(3) - (3)].datalist);} break; case 111: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 785 "ncgen.y" {(yyval.datalist) = (yyvsp[(1) - (1)].datalist);} break; case 112: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 786 "ncgen.y" {(yyval.datalist) = (yyvsp[(1) - (1)].datalist);} break; case 113: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 790 "ncgen.y" {(yyval.datalist) = builddatalist(0);} break; case 114: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 794 "ncgen.y" {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));} break; case 115: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 796 "ncgen.y" {datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant))); (yyval.datalist)=(yyvsp[(1) - (3)].datalist);} break; case 116: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 800 "ncgen.y" {(yyval.constant)=(yyvsp[(1) - (1)].constant);} break; case 117: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 801 "ncgen.y" {(yyval.constant)=builddatasublist((yyvsp[(2) - (3)].datalist));} break; case 118: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 805 "ncgen.y" {(yyval.constant)=(yyvsp[(1) - (1)].constant);} break; case 119: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 806 "ncgen.y" {(yyval.constant)=makeconstdata(NC_OPAQUE);} break; case 120: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 807 "ncgen.y" {(yyval.constant)=makeconstdata(NC_FILLVALUE);} break; case 121: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 808 "ncgen.y" {(yyval.constant)=makeenumconst((yyvsp[(1) - (1)].sym));} break; case 123: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 813 "ncgen.y" {(yyval.constant)=evaluate((yyvsp[(1) - (4)].sym),(yyvsp[(3) - (4)].datalist));} break; case 124: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 818 "ncgen.y" {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));} break; case 125: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 820 "ncgen.y" {datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant))); (yyval.datalist)=(yyvsp[(1) - (3)].datalist);} break; case 126: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 824 "ncgen.y" {(yyval.constant)=makeconstdata(NC_CHAR);} break; case 127: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 825 "ncgen.y" {(yyval.constant)=makeconstdata(NC_BYTE);} break; case 128: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 826 "ncgen.y" {(yyval.constant)=makeconstdata(NC_SHORT);} break; case 129: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 827 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT);} break; case 130: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 828 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT64);} break; case 131: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 829 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UBYTE);} break; case 132: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 830 "ncgen.y" {(yyval.constant)=makeconstdata(NC_USHORT);} break; case 133: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 831 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT);} break; case 134: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 832 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT64);} break; case 135: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 833 "ncgen.y" {(yyval.constant)=makeconstdata(NC_FLOAT);} break; case 136: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 834 "ncgen.y" {(yyval.constant)=makeconstdata(NC_DOUBLE);} break; case 137: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 835 "ncgen.y" {(yyval.constant)=makeconstdata(NC_STRING);} break; case 138: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 839 "ncgen.y" {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));} break; case 139: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 840 "ncgen.y" {(yyval.datalist)=(yyvsp[(1) - (3)].datalist); datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant)));} break; case 140: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 845 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT);} break; case 141: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 847 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT);} break; case 142: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 849 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT64);} break; case 143: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 851 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT64);} break; case 144: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 855 "ncgen.y" {(yyval.constant)=makeconstdata(NC_STRING);} break; case 145: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 859 "ncgen.y" {(yyval.constant)=(yyvsp[(1) - (1)].constant);} break; case 146: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 860 "ncgen.y" {(yyval.constant)=(yyvsp[(1) - (1)].constant);} break; case 147: -/* Line 1813 of yacc.c */ +/* Line 1792 of yacc.c */ #line 866 "ncgen.y" {(yyval.sym)=(yyvsp[(1) - (1)].sym);} break; -/* Line 1813 of yacc.c */ -#line 2844 "ncgen.tab.c" +/* Line 1792 of yacc.c */ +#line 2809 "ncgen.tab.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3071,7 +3036,7 @@ yyreturn: } -/* Line 2076 of yacc.c */ +/* Line 2055 of yacc.c */ #line 869 "ncgen.y" diff --git a/ncgen/ncgentab.h b/ncgen/ncgentab.h index 51bf73601..ade75e46f 100644 --- a/ncgen/ncgentab.h +++ b/ncgen/ncgentab.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.6.4. */ +/* A Bison parser, made by GNU Bison 2.7. */ /* Bison interface for Yacc-like parsers in C @@ -100,7 +100,7 @@ extern int ncgdebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2077 of yacc.c */ +/* Line 2058 of yacc.c */ #line 131 "ncgen.y" Symbol* sym; @@ -111,7 +111,7 @@ Datalist* datalist; Constant constant; -/* Line 2077 of yacc.c */ +/* Line 2058 of yacc.c */ #line 116 "ncgen.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/ncgen/ncgenyy.c b/ncgen/ncgenyy.c index 54c7cde3d..18a544780 100644 --- a/ncgen/ncgenyy.c +++ b/ncgen/ncgenyy.c @@ -27,7 +27,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -72,7 +72,6 @@ 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,6 +102,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -171,7 +172,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int ncgleng; +#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 FILE *ncgin, *ncgout; @@ -197,11 +203,6 @@ 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 @@ -219,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 @@ -289,8 +290,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 int yy_n_chars; /* number of characters read into yy_ch_buf */ -int ncgleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t ncgleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -318,7 +319,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,int len ); +YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,yy_size_t len ); void *ncgalloc (yy_size_t ); void *ncgrealloc (void *,yy_size_t ); @@ -1324,7 +1325,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 1328 "lex.ncg.c" +#line 1329 "lex.ncg.c" #define INITIAL 0 #define ST_C_COMMENT 1 @@ -1365,7 +1366,7 @@ FILE *ncgget_out (void ); void ncgset_out (FILE * out_str ); -int ncgget_leng (void ); +yy_size_t ncgget_leng (void ); char *ncgget_text (void ); @@ -1426,7 +1427,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( ncgin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1510,7 +1511,7 @@ YY_DECL #line 168 "ncgen.l" -#line 1514 "lex.ncg.c" +#line 1515 "lex.ncg.c" if ( !(yy_init) ) { @@ -2159,7 +2160,7 @@ YY_RULE_SETUP #line 553 "ncgen.l" ECHO; YY_BREAK -#line 2163 "lex.ncg.c" +#line 2164 "lex.ncg.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TEXT): yyterminate(); @@ -2346,21 +2347,21 @@ 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 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); 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; @@ -2391,7 +2392,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); } @@ -2486,7 +2487,7 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 446); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) @@ -2501,7 +2502,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 = @@ -2550,7 +2551,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( ) ) @@ -2710,10 +2711,6 @@ static void ncg_load_buffer_state (void) ncgfree((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a ncgrestart() or at EOF. @@ -2826,7 +2823,7 @@ void ncgpop_buffer_state (void) */ static void ncgensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -2918,12 +2915,12 @@ YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to ncglex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -3010,7 +3007,7 @@ FILE *ncgget_out (void) /** Get the length of the current token. * */ -int ncgget_leng (void) +yy_size_t ncgget_leng (void) { return ncgleng; }