2003-10-23 05:30:19 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-10-23 05:30:19 +08:00
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
2017-04-18 03:32:16 +08:00
|
|
|
* the COPYING file, which can be found at the root of the source code *
|
2021-02-17 22:52:36 +08:00
|
|
|
* distribution tree, or in https://www.hdfgroup.org/licenses. *
|
2017-04-18 03:32:16 +08:00
|
|
|
* If you do not have access to either file, you may request a copy from *
|
|
|
|
* help@hdfgroup.org. *
|
2003-10-23 05:30:19 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
2003-12-03 22:26:51 +08:00
|
|
|
#include "H5private.h"
|
2008-10-30 03:56:24 +08:00
|
|
|
#include "h5tools.h"
|
2011-02-09 05:35:54 +08:00
|
|
|
#include "h5tools_utils.h"
|
|
|
|
#include "h5diff.h"
|
|
|
|
#include "ph5diff.h"
|
2008-10-30 03:56:24 +08:00
|
|
|
|
2005-02-01 12:13:42 +08:00
|
|
|
/* global variables */
|
2020-09-30 22:27:10 +08:00
|
|
|
int g_nTasks = 1;
|
2005-01-27 07:03:29 +08:00
|
|
|
|
2003-10-23 05:30:19 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2007-02-22 04:05:04 +08:00
|
|
|
* Function: print_dimensions
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Purpose: print dimensions
|
2003-10-23 05:30:19 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2007-02-22 04:05:04 +08:00
|
|
|
void
|
2020-09-30 22:27:10 +08:00
|
|
|
print_dimensions(int rank, hsize_t *dims)
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
int i;
|
2008-11-04 10:44:40 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (rank <= 0)
|
|
|
|
parallel_print("H5S_SCALAR");
|
2017-05-11 00:09:55 +08:00
|
|
|
else {
|
2011-10-25 05:50:13 +08:00
|
|
|
if (!dims)
|
|
|
|
parallel_print("dimension is NULL");
|
2017-05-11 00:09:55 +08:00
|
|
|
else {
|
2011-10-25 05:50:13 +08:00
|
|
|
parallel_print("[");
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < rank - 1; i++) {
|
2022-02-22 05:31:57 +08:00
|
|
|
parallel_print("%" PRIuHSIZE, dims[i]);
|
2011-10-25 05:50:13 +08:00
|
|
|
parallel_print("x");
|
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2022-02-22 05:31:57 +08:00
|
|
|
parallel_print("%" PRIuHSIZE, dims[rank - 1]);
|
2020-09-30 22:27:10 +08:00
|
|
|
parallel_print("]");
|
2011-10-25 05:50:13 +08:00
|
|
|
}
|
|
|
|
}
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2003-10-29 01:40:05 +08:00
|
|
|
* Function: print_type
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Purpose: Print name of datatype
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Return: void
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only
|
2003-10-23 05:30:19 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
void
|
|
|
|
print_type(hid_t type)
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
2017-05-11 00:09:55 +08:00
|
|
|
switch (H5Tget_class(type)) {
|
2020-09-30 22:27:10 +08:00
|
|
|
case H5T_INTEGER:
|
|
|
|
if (H5Tequal(type, H5T_STD_I8BE))
|
|
|
|
parallel_print("H5T_STD_I8BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_I8LE))
|
|
|
|
parallel_print("H5T_STD_I8LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_I16BE))
|
|
|
|
parallel_print("H5T_STD_I16BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_I16LE))
|
|
|
|
parallel_print("H5T_STD_I16LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_I32BE))
|
|
|
|
parallel_print("H5T_STD_I32BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_I32LE))
|
|
|
|
parallel_print("H5T_STD_I32LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_I64BE))
|
|
|
|
parallel_print("H5T_STD_I64BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_I64LE))
|
|
|
|
parallel_print("H5T_STD_I64LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_U8BE))
|
|
|
|
parallel_print("H5T_STD_U8BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_U8LE))
|
|
|
|
parallel_print("H5T_STD_U8LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_U16BE))
|
|
|
|
parallel_print("H5T_STD_U16BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_U16LE))
|
|
|
|
parallel_print("H5T_STD_U16LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_U32BE))
|
|
|
|
parallel_print("H5T_STD_U32BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_U32LE))
|
|
|
|
parallel_print("H5T_STD_U32LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_U64BE))
|
|
|
|
parallel_print("H5T_STD_U64BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_U64LE))
|
|
|
|
parallel_print("H5T_STD_U64LE");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_SCHAR))
|
|
|
|
parallel_print("H5T_NATIVE_SCHAR");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_UCHAR))
|
|
|
|
parallel_print("H5T_NATIVE_UCHAR");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_SHORT))
|
|
|
|
parallel_print("H5T_NATIVE_SHORT");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_USHORT))
|
|
|
|
parallel_print("H5T_NATIVE_USHORT");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_INT))
|
|
|
|
parallel_print("H5T_NATIVE_INT");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_UINT))
|
|
|
|
parallel_print("H5T_NATIVE_UINT");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_LONG))
|
|
|
|
parallel_print("H5T_NATIVE_LONG");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_ULONG))
|
|
|
|
parallel_print("H5T_NATIVE_ULONG");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_LLONG))
|
|
|
|
parallel_print("H5T_NATIVE_LLONG");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_ULLONG))
|
|
|
|
parallel_print("H5T_NATIVE_ULLONG");
|
|
|
|
else
|
|
|
|
parallel_print("undefined integer");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case H5T_FLOAT:
|
|
|
|
if (H5Tequal(type, H5T_IEEE_F32BE))
|
|
|
|
parallel_print("H5T_IEEE_F32BE");
|
|
|
|
else if (H5Tequal(type, H5T_IEEE_F32LE))
|
|
|
|
parallel_print("H5T_IEEE_F32LE");
|
|
|
|
else if (H5Tequal(type, H5T_IEEE_F64BE))
|
|
|
|
parallel_print("H5T_IEEE_F64BE");
|
|
|
|
else if (H5Tequal(type, H5T_IEEE_F64LE))
|
|
|
|
parallel_print("H5T_IEEE_F64LE");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_FLOAT))
|
|
|
|
parallel_print("H5T_NATIVE_FLOAT");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_DOUBLE))
|
|
|
|
parallel_print("H5T_NATIVE_DOUBLE");
|
|
|
|
else if (H5Tequal(type, H5T_NATIVE_LDOUBLE))
|
|
|
|
parallel_print("H5T_NATIVE_LDOUBLE");
|
|
|
|
else
|
|
|
|
parallel_print("undefined float");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case H5T_BITFIELD:
|
|
|
|
if (H5Tequal(type, H5T_STD_B8BE))
|
|
|
|
parallel_print("H5T_STD_B8BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_B8LE))
|
|
|
|
parallel_print("H5T_STD_B8LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_B16BE))
|
|
|
|
parallel_print("H5T_STD_B16BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_B16LE))
|
|
|
|
parallel_print("H5T_STD_B16LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_B32BE))
|
|
|
|
parallel_print("H5T_STD_B32BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_B32LE))
|
|
|
|
parallel_print("H5T_STD_B32LE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_B64BE))
|
|
|
|
parallel_print("H5T_STD_B64BE");
|
|
|
|
else if (H5Tequal(type, H5T_STD_B64LE))
|
|
|
|
parallel_print("H5T_STD_B64LE");
|
|
|
|
else
|
|
|
|
parallel_print("undefined bitfield");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case H5T_TIME:
|
|
|
|
case H5T_STRING:
|
|
|
|
case H5T_OPAQUE:
|
|
|
|
case H5T_COMPOUND:
|
|
|
|
case H5T_REFERENCE:
|
|
|
|
case H5T_ENUM:
|
|
|
|
case H5T_VLEN:
|
|
|
|
case H5T_ARRAY:
|
|
|
|
case H5T_NO_CLASS:
|
|
|
|
case H5T_NCLASSES:
|
|
|
|
default:
|
|
|
|
return;
|
2015-09-01 03:04:23 +08:00
|
|
|
|
|
|
|
} /* end switch */
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2003-10-29 01:40:05 +08:00
|
|
|
* Function: diff_basename
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Purpose: Returns a pointer to the last component absolute name
|
2003-10-23 05:30:19 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
H5_ATTR_PURE const char *
|
2003-10-29 01:40:05 +08:00
|
|
|
diff_basename(const char *name)
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
2008-05-01 03:51:13 +08:00
|
|
|
size_t i;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (name == NULL)
|
2008-05-01 03:51:13 +08:00
|
|
|
return NULL;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-05-01 03:51:13 +08:00
|
|
|
/* Find the end of the base name */
|
2023-09-16 06:13:18 +08:00
|
|
|
i = strlen(name);
|
2020-09-30 22:27:10 +08:00
|
|
|
while (i > 0 && '/' == name[i - 1])
|
2008-05-01 03:51:13 +08:00
|
|
|
--i;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-05-01 03:51:13 +08:00
|
|
|
/* Skip backward over base name */
|
2020-09-30 22:27:10 +08:00
|
|
|
while (i > 0 && '/' != name[i - 1])
|
2008-05-01 03:51:13 +08:00
|
|
|
--i;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
return (name + i);
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: get_type
|
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Purpose: Returns the type as a string
|
2003-10-23 05:30:19 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
H5_ATTR_CONST const char *
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
get_type(h5trav_type_t type)
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
switch (type) {
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
case H5TRAV_TYPE_DATASET:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5G_DATASET");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
case H5TRAV_TYPE_GROUP:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5G_GROUP");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
case H5TRAV_TYPE_NAMED_DATATYPE:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5G_TYPE");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
case H5TRAV_TYPE_LINK:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5G_LINK");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
case H5TRAV_TYPE_UDLINK:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5G_UDLINK");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
2015-09-01 03:04:23 +08:00
|
|
|
case H5TRAV_TYPE_UNKNOWN:
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
default:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("unknown type");
|
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay!
Lots of misc. library fixes to remove confusion between links and
objects. The tools could still use another pass, to remove h5trav_type_t type
and make the correct distinction between links & objects.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 06:18:33 +08:00
|
|
|
}
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: get_sign
|
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Purpose: Returns the sign as a string
|
2003-10-23 05:30:19 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
H5_ATTR_CONST const char *
|
2003-10-23 05:30:19 +08:00
|
|
|
get_sign(H5T_sign_t sign)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
switch (sign) {
|
2015-09-01 03:04:23 +08:00
|
|
|
case H5T_SGN_NONE:
|
|
|
|
return "H5T_SGN_NONE";
|
2016-06-29 05:53:48 +08:00
|
|
|
|
2015-09-01 03:04:23 +08:00
|
|
|
case H5T_SGN_2:
|
|
|
|
return "H5T_SGN_2";
|
2016-06-29 05:53:48 +08:00
|
|
|
|
2015-09-01 03:04:23 +08:00
|
|
|
case H5T_SGN_ERROR:
|
|
|
|
return "H5T_SGN_ERROR";
|
2016-06-29 05:53:48 +08:00
|
|
|
|
2015-09-01 03:04:23 +08:00
|
|
|
case H5T_NSGN:
|
|
|
|
return "H5T_NSGN";
|
2016-06-29 05:53:48 +08:00
|
|
|
|
2015-09-01 03:04:23 +08:00
|
|
|
default:
|
|
|
|
return "unknown sign value";
|
|
|
|
} /* end switch */
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: get_class
|
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Purpose: Returns the class as a string
|
2003-10-23 05:30:19 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
H5_ATTR_CONST const char *
|
2003-10-23 05:30:19 +08:00
|
|
|
get_class(H5T_class_t tclass)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
switch (tclass) {
|
2016-06-29 05:53:48 +08:00
|
|
|
case H5T_TIME:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_TIME");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_INTEGER:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_INTEGER");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_FLOAT:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_FLOAT");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_STRING:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_STRING");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_BITFIELD:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_BITFIELD");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_OPAQUE:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_OPAQUE");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_COMPOUND:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_COMPOUND");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_REFERENCE:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_REFERENCE");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_ENUM:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_ENUM");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_VLEN:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_VLEN");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_ARRAY:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("H5T_ARRAY");
|
2016-06-29 05:53:48 +08:00
|
|
|
|
|
|
|
case H5T_NO_CLASS:
|
|
|
|
case H5T_NCLASSES:
|
|
|
|
default:
|
2020-09-30 22:27:10 +08:00
|
|
|
return ("Invalid class");
|
2015-09-01 03:04:23 +08:00
|
|
|
} /* end switch */
|
|
|
|
} /* end get_class() */
|
2003-10-23 05:30:19 +08:00
|
|
|
|
2004-07-21 03:21:03 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: print_found
|
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Purpose: print number of differences found
|
2004-07-21 03:21:03 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
void
|
|
|
|
print_found(hsize_t nfound)
|
2004-07-21 03:21:03 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
if (g_Parallel)
|
Squash my changes on branch `fprintf-experiment` into one commit for
reapplication to my new warnings branch, `warnings-again`. These
changes are included:
commit 915551b7bf64e777dd2007386ec77b1d117770da
Merge: 63858c2 a8892bb
Author: David Young <dyoung@hdfgroup.org>
Date: Mon Nov 25 17:39:49 2019 -0600
Merge remote-tracking branch 'hdf5/develop' into fprintf-experiment
commit a8892bb42d6f6e4fbc30fae0eb2b957f81c938b9
Merge: 5c911d8 f907b51
Author: David Young <dyoung@hdfgroup.org>
Date: Mon Nov 25 17:33:54 2019 -0600
Merge pull request #2055 in HDFFV/hdf5 from ~DYOUNG/vchoi_fork:add-werror-and-squash-some to develop
* commit 'f907b511d06612dafc7814a7c30f2f3d2b76d52b':
Oops, remove more C99 designated initializers for VS 2010 compatibility.
commit 63858c22e168acaec0af8ced6641f26102cc6bb0
Merge: 20ae787 5c911d8
Author: David Young <dyoung@hdfgroup.org>
Date: Mon Nov 25 17:04:42 2019 -0600
Merge remote-tracking branch 'hdf5/develop' into fprintf-experiment
commit 5c911d8baf3ee7fe654269088eebdf07f59a8192
Merge: b8a5671 62208b0
Author: David Young <dyoung@hdfgroup.org>
Date: Mon Nov 25 16:58:27 2019 -0600
Merge pull request #2030 in HDFFV/hdf5 from ~DYOUNG/vchoi_fork:add-werror-and-squash-some to develop
* commit '62208b056a09c01855fbac7f75146be58ad6bfe5': (44 commits)
Add an #include to get a function declaration.
Don't use C99 designated initializers, they're not compatible with Visual Studio 2010.
Quiet some more maybe-uninitialized warnings---each is a false positive, *sigh*. This is more code that may not compile with VS2010, *sigh sigh*.
Always warn on maybe-uninitialized. -Wincompatible-pointer-types was not available until GCC 5, so enable it only if that's the GCC version we're using.
Only promote maybe-uninitialized warnings to errors on GCC 8. Even on GCC 8, there may be false positives at low optimization levels? I need to check.
Only use -Werror=cast-function-type with GCC 8 and later.
Put all of the -W options back into the order I found them in so that it's easier to compare old and new config/gnu-flags.
Add new source files to CMakeLists.txt.
Mention the -Werror= flags in libhdf5.settings.in.
free -> HDfree
Promote decleration-after-statement warnings to errors.
Quiet decleration-after-statement warnings.
Move a statement under some declarations since some vintages of Visual Studio don't like declarations after statements.
Document H5D__chunk_mem_xfree_wrapper().
Undo accidental test deletion.
Oops, delete a debug printf that snuck in here.
Undo my changes to the HD macros, hadn't really intended those to be on this branch....
Make errors of some more warnings. Move disabled warnings to DEVELOPER_WARNING_CFLAGS. Put just one warning option on a line, and sort some of the options.
Cast to the parameter type, H5VL_token_t *, instead of to unsigned char *.
Change hdset_reg_ref_t and H5R_ref_t from arrays of unsigned char to structs containing those arrays. Encapsulating the arrays in this way makes it easier to write and think about pointers to these types, casts to/from these types, etc.
...
commit 20ae7877e33931b95e8c3502b027d6c3fe94a11f
Merge: 46f8c61 edd5297
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 15:34:09 2019 -0600
Merge remote-tracking branch 'origin/add-werror-and-squash-some' into fprintf-experiment
commit 46f8c613d5117a8be5bc8385a072daa0b4262f06
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 15:29:00 2019 -0600
GCC really wants us to use `ll` to format `long long`, so try to make that work
before any other format modifier. Seems like we're not compiling the autoconf
test program with -Werror=format ? Probably should.
commit eee35b8ef3759c391327cd48a9b3c56b6f8abc99
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 15:28:05 2019 -0600
It's hard to know just how wide an HDoff_t will be, and I don't think POSIX or
C standards provide a PRI macro for it, so cast to intmax_t and format using
PRIdMAX.
commit 86eab12df7a89b546a38e99f8178dd2adbcb3433
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 15:26:25 2019 -0600
URemove some casts.se the right format string for the argument. Here and there
stop casting a printf argument.
commit f722f7cbecbaa99449941484b014426f62f1bed5
Merge: 58e3743 6d5ec83
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 14:44:16 2019 -0600
Merge branch 'add-werror-and-squash-some' into fprintf-experiment
commit 58e3743b7faa9836606ee91798fe80dfc0040da7
Author: David Young <dyoung@hdfgroup.org>
Date: Wed Nov 20 21:07:21 2019 -0600
Remove custom HDfprintf implementation, using the standard library's,
instead. Take a swipe at repairing fprintf format strings, mainly
replacing "%Hu" with "%" PRIuHSIZE, "%a" with "%" PRIuHADDR, "%Zu" with
"%zu".
Here and there remove an awkward cast of a printf argument to `long
long` and use PRI[doux]8, PRI[doux]32, or PRI[doux]64, instead.
Change occurrences of "%t" to "%s" and perform a suitable change of
argument, `cond` -> `cond ? "TRUE" : "FALSE"`.
Some occurrences of %Hu, %a, and %t remain, they just weren't flagged by
the compiler because of #ifdef'age.
commit d4366909293fa970c23512ac80e5d865d76cddbf
Author: David Young <dyoung@hdfgroup.org>
Date: Wed Nov 20 20:54:32 2019 -0600
Promote format-string warnigns to errors.
2019-11-28 03:58:43 +08:00
|
|
|
parallel_print("%" PRIuHSIZE " differences found\n", nfound);
|
2016-06-29 05:53:48 +08:00
|
|
|
else
|
2023-06-28 23:31:32 +08:00
|
|
|
fprintf(stdout, "%" PRIuHSIZE " differences found\n", nfound);
|
2004-07-21 03:21:03 +08:00
|
|
|
}
|
|
|
|
|
2012-08-16 00:04:26 +08:00
|
|
|
/*-----------------------------------------------------------------
|
|
|
|
* Function: match_up_memsize
|
2017-05-09 23:41:00 +08:00
|
|
|
*
|
2017-10-14 05:34:01 +08:00
|
|
|
* Purpose: match smaller memory size up to bigger memory size
|
2012-08-16 00:04:26 +08:00
|
|
|
*------------------------------------------------------------------
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t
|
|
|
|
match_up_memsize(hid_t f_tid1_id, hid_t f_tid2_id, hid_t *m_tid1, hid_t *m_tid2, size_t *m_size1,
|
|
|
|
size_t *m_size2)
|
2012-08-16 00:04:26 +08:00
|
|
|
{
|
2019-12-28 16:16:44 +08:00
|
|
|
herr_t ret_value = SUCCEED;
|
2012-08-16 00:04:26 +08:00
|
|
|
|
2021-05-06 06:08:10 +08:00
|
|
|
H5TOOLS_START_DEBUG(" ");
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((*m_size1) != (*m_size2)) {
|
|
|
|
if ((*m_size1) < (*m_size2)) {
|
2017-10-14 05:34:01 +08:00
|
|
|
H5Tclose(*m_tid1);
|
2012-08-16 00:04:26 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0)
|
2019-12-28 13:02:26 +08:00
|
|
|
H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_native_type failed");
|
2012-08-16 00:04:26 +08:00
|
|
|
|
2017-10-14 05:34:01 +08:00
|
|
|
*m_size1 = H5Tget_size(*m_tid1);
|
2012-08-16 00:04:26 +08:00
|
|
|
} /* end if */
|
|
|
|
else {
|
|
|
|
H5Tclose(*m_tid2);
|
2003-10-23 05:30:19 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0)
|
2019-12-28 13:02:26 +08:00
|
|
|
H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_native_type failed");
|
2012-08-16 00:04:26 +08:00
|
|
|
|
|
|
|
*m_size2 = H5Tget_size(*m_tid2);
|
|
|
|
} /* end else */
|
2020-09-30 22:27:10 +08:00
|
|
|
} /* end if */
|
|
|
|
if ((*m_size1) != (*m_size2))
|
2019-12-28 13:02:26 +08:00
|
|
|
H5TOOLS_GOTO_ERROR(FAIL, "native type sizes do not compare");
|
2012-08-16 00:04:26 +08:00
|
|
|
|
2017-10-14 05:34:01 +08:00
|
|
|
done:
|
2021-05-06 06:08:10 +08:00
|
|
|
H5TOOLS_ENDDEBUG(" ");
|
2017-10-14 05:34:01 +08:00
|
|
|
return ret_value;
|
2012-08-16 00:04:26 +08:00
|
|
|
}
|