mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
fix bug in ncgen -lc handling of single character vars
This commit is contained in:
parent
75e00f3341
commit
629f712c77
6
cf
6
cf
@ -102,10 +102,10 @@ FLAGS="$FLAGS --disable-pnetcdf"
|
||||
#FLAGS="$FLAGS --with-udunits"
|
||||
#FLAGS="$FLAGS --with-libcf"
|
||||
#FLAGS="$FLAGS --enable-benchmarks"
|
||||
#FLAGS="$FLAGS --enable-extra-tests"
|
||||
FLAGS="$FLAGS --enable-logging"
|
||||
FLAGS="$FLAGS --enable-extra-tests"
|
||||
#FLAGS="$FLAGS --enable-logging"
|
||||
|
||||
FLAGS="$FLAGS --disable-shared"
|
||||
#FLAGS="$FLAGS --disable-shared"
|
||||
#FLAGS="$FLAGS --enable-shared"
|
||||
|
||||
if test "x$HDF5" = "x" ; then
|
||||
|
@ -1,8 +1,10 @@
|
||||
L="-lc"
|
||||
K="-k1"
|
||||
alias q0="./ncgen -d $K $L test.cdl"
|
||||
alias qq="gdb --args ./ncgen -d $K $L test.cdl"
|
||||
alias qv="valgrind --leak-check=full ./ncgen -d $K $L test.cdl"
|
||||
F="test"
|
||||
NCGEN="./.libs/ncgen"
|
||||
alias q0="$NCGEN -d $K $L $F.cdl"
|
||||
alias qq="gdb --args $NCGEN -d $K $L $F.cdl"
|
||||
alias qv="valgrind --leak-check=full $NCGEN -d $K $L $F.cdl"
|
||||
|
||||
|
||||
|
||||
|
@ -958,13 +958,6 @@ genc_writevar(Generator* generator, Symbol* vsym, Bytebuffer* code,
|
||||
|
||||
if(rank == 0) {
|
||||
codelined(1,"size_t zero = 0;");
|
||||
if(typecode == NC_CHAR) {
|
||||
cquotestring(code,'"');
|
||||
bbprintf0(stmt,"%sstatic char* %s_data = %s;\n",
|
||||
indented(1),
|
||||
cname(vsym),
|
||||
bbContents(code));
|
||||
} else {
|
||||
/* We make the data be an array so we do not need to
|
||||
ampersand it later => we need an outer pair of braces
|
||||
*/
|
||||
@ -974,7 +967,6 @@ genc_writevar(Generator* generator, Symbol* vsym, Bytebuffer* code,
|
||||
ctypename(basetype),
|
||||
cname(vsym),
|
||||
bbContents(code));
|
||||
}
|
||||
codedump(stmt);
|
||||
bbprintf0(stmt,"%sstat = nc_put_var1(%s, %s, &zero, %s_data);\n",
|
||||
indented(1),
|
||||
|
Loading…
Reference in New Issue
Block a user