mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Merge branch 'gh323' of github.com:Unidata/netcdf-c into gh323
This commit is contained in:
commit
2b30af71f7
33
align_test.c
33
align_test.c
@ -1,33 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define is_aligned(POINTER, BYTE_COUNT) \
|
||||
(((uintptr_t)(const void *)(POINTER)) % (BYTE_COUNT) == 0)
|
||||
|
||||
#ifndef uintptr_t
|
||||
#define uintptr_t int
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
float lat;
|
||||
float lon;
|
||||
char* stid;
|
||||
double time;
|
||||
float temp;
|
||||
} obs_t;
|
||||
|
||||
int main (int argc, char **argv) {
|
||||
|
||||
obs_t p;
|
||||
|
||||
|
||||
printf("Sizeof(int): %d\n",sizeof(int));
|
||||
|
||||
printf("IS_ALIGNED (p,4): %d\n",is_aligned(&p,4u));
|
||||
printf("IS_ALIGNED (p,8): %d\n",is_aligned(&p,8u));
|
||||
printf("IS_ALIGNED (p,16): %d\n",is_aligned(&p,16u));
|
||||
printf("IS_ALIGNED (p,32): %d\n",is_aligned(&p,32u));
|
||||
printf("IS_ALIGNED (p,64): %d\n",is_aligned(&p,64u));
|
||||
printf("Finished.\n");
|
||||
|
||||
}
|
8
gdb.txt
8
gdb.txt
@ -1,8 +0,0 @@
|
||||
break semantics.c:641
|
||||
command
|
||||
watch offset
|
||||
end
|
||||
|
||||
|
||||
|
||||
run -k nc4 gh323.cdl
|
@ -23,7 +23,7 @@ man_MANS = ncgen.1
|
||||
# These files all need to be distributed.
|
||||
EXTRA_DIST = ncgen.y ncgen.l ncgenl.c $(man_MANS) internals.html \
|
||||
run_tests.sh run_nc4_tests.sh c0.cdl c0_4.cdl ref_camrun.cdl \
|
||||
ncf199.cdl CMakeLists.txt XGetopt.c c5.cdl
|
||||
ncf199.cdl CMakeLists.txt XGetopt.c c5.cdl compound_datasize_test.cdl
|
||||
|
||||
# This shell script causes ncgen to build a classic and a 64-bit
|
||||
# offset file from a cdl file shipped with the distribution.
|
||||
@ -35,7 +35,7 @@ endif # USE_NETCDF4
|
||||
#endif # !BUILD_DLL
|
||||
|
||||
CLEANFILES = c0.nc c0_64.nc c0_4.nc c0_4c.nc ref_camrun.c \
|
||||
ncf199.nc c5.nc
|
||||
ncf199.nc c5.nc compound_datasize_test.nc
|
||||
|
||||
# These rules are used if someone wants to rebuild ncgenl.c or ncgeny.c
|
||||
# Otherwise never invoked, but records how to do it.
|
||||
|
@ -1,3 +1,5 @@
|
||||
// Test for an issue related to CDL compound structs.
|
||||
// See https://github.com/Unidata/netcdf-c/issues/323 for more information
|
||||
netcdf stations {
|
||||
types:
|
||||
compound obs_t {
|
@ -1,19 +0,0 @@
|
||||
netcdf stations {
|
||||
types:
|
||||
compound obs_t {
|
||||
float lat ;
|
||||
float lon ;
|
||||
string stid ;
|
||||
float temperature ;
|
||||
double time ;
|
||||
}; // obs_t
|
||||
dimensions:
|
||||
n = UNLIMITED ;
|
||||
variables:
|
||||
obs_t obs(n) ;
|
||||
|
||||
data:
|
||||
|
||||
obs = {39.9, -104.9, "KDEN", 7776000, 15},
|
||||
{40, -105, "KBOU", 7776000, 16} ;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
netcdf stations {
|
||||
types:
|
||||
compound obs_t {
|
||||
int lat;
|
||||
double lon;
|
||||
}; // obs_t
|
||||
dimensions:
|
||||
n = UNLIMITED ;
|
||||
variables:
|
||||
obs_t obs(n) ;
|
||||
|
||||
data:
|
||||
|
||||
obs = {39.9, -104},
|
||||
{40, -105} ;
|
||||
}
|
@ -20,7 +20,7 @@ echo "*** test for jira NCF-199 bug"
|
||||
./ncgen -k nc4 $srcdir/ncf199.cdl
|
||||
|
||||
echo "*** creating binary file for github issue 323..."
|
||||
./ncgen -k nc4 $srcdir/gh323.cdl
|
||||
./ncgen -k nc4 $srcdir/compound_datasize_test.cdl
|
||||
|
||||
echo "*** Test successful!"
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user