mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-12-27 08:49:16 +08:00
0428c38b1e
re: Github issue https://github.com/Unidata/netcdf-c/issues/1956 The function NC_compare_nc_types in libdispatch/dcopy.c uses an incorrect algorithm to search for types. The core of this is the function NC_rec_find_nc_type in libdispatch/dcopy.c. Currently it searchs the current group and its subtree. Additionally, the function NC4_inq_typeid in libsrc4/nc4internal.c has been extended to handle fully qualified names. It was originally designed to do this, but for some reason never completed. The NC_rec_find_nc_type algorithm has been altered to match the algorithm used by NC4_inq_typeid. It operates as follows. Given a file F, group G and a type T. It searches file F2, group G2, for another type T2 that is equivalent to T. The search order is as follows. 1. Search G2 for a type T2 equivalent to T. 2. Search upwards in the ancestor groups of G2 for a type T2 equivalent to T. 3. Search the complete group tree of F2 in pre-order, breadth-first order to locate T2 equivalent to T. Also add a test case to validate algorithm: ncdump/test_scope.sh. Note, this change may cause compatibility problems, though it is unlikely because two different equivalent type declarations in one dataset is unlikely. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
error4.c | ||
Makefile.am | ||
nc4attr.c | ||
nc4cache.c | ||
nc4dim.c | ||
nc4dispatch.c | ||
nc4filters.c | ||
nc4grp.c | ||
nc4internal.c | ||
nc4type.c | ||
nc4var.c | ||
ncfunc.c | ||
ncindex.c |