From b5e2752ad6d942a5dcee5f9fd4fad0a2e89c4a67 Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Tue, 8 Sep 1998 14:15:44 -0500 Subject: [svn-r673] Changes since 19980908 ---------------------- ./COPYING Reformatted as text instead of C. Removed zlib crew from the list of contributors since no zlib code is actually in the hdf5 library. ./INSTALL ./INSTALL.ascired ./MANIFEST Minor updates for Beta release including version number change. ./INSTALL_MAINT Added information about making a release. ./RELEASE Updated function list based on public header files. ./bin/checkposix Got rid of complaints about some obvious things. ./doc/html/H5.api.html ./doc/html/RM_H5F.html ./src/H5F.c ./src/H5Fpublic.h ./test/tfile.c Changed H5Fget_create_template() and H5Fget_access_template() to H5Fget_create_plist() and H5Fget_access_plist() since that conforms better to lots of other names. ./doc/html/Datatypes.html ./doc/html/ExternalFiles.html ./doc/html/Files.html ./doc/html/H5.api.html ./doc/html/H5.sample_code.html ./doc/html/RM_H5F.html ./doc/html/RM_H5Front.html Changed `template' to `property list', etc. ./doc/html/Ragged.html [NEW] Documentation for ragged arrays. ./src/H5Iprivate.h ./src/H5Ipublic.h ./src/H5I.c Changed the scope of some symbols to be more local. ./src/H5.c ./src/H5AC.c ./src/H5D.c ./src/H5E.c ./src/H5F.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5I.c ./src/H5O.c ./src/H5Ocomp.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Omtime.c ./src/H5Oname.c ./src/H5P.c ./src/H5S.c ./src/H5Shyper.c ./src/H5Tbit.c ./src/H5Tconv.c ./src/H5V.c ./src/H5Z.c ./src/H5private.h Fixed some violations of our naming scheme by adding HD to the beginning of all Posix functions. --- COPYING | 63 +++--- INSTALL | 72 ++++--- INSTALL.ascired | 8 +- INSTALL_MAINT | 12 ++ MANIFEST | 6 +- RELEASE | 149 +++++++------ bin/checkposix | 9 +- doc/html/Datatypes.html | 4 +- doc/html/ExternalFiles.html | 26 +-- doc/html/Files.html | 26 +-- doc/html/H5.api.html | 486 ++++++++++++++++++++++--------------------- doc/html/H5.sample_code.html | 2 +- doc/html/RM_H5F.html | 26 +-- doc/html/RM_H5Front.html | 2 +- doc/html/Ragged.html | 138 ++++++++++++ src/H5.c | 150 ++++++------- src/H5AC.c | 10 +- src/H5D.c | 2 +- src/H5Distore.c | 2 +- src/H5E.c | 2 +- src/H5F.c | 74 ++++--- src/H5Ffamily.c | 2 +- src/H5Fistore.c | 2 +- src/H5Flow.c | 4 +- src/H5Fpublic.h | 4 +- src/H5Fsec2.c | 14 +- src/H5Fsplit.c | 24 +-- src/H5Fstdio.c | 30 +-- src/H5G.c | 12 +- src/H5Gnode.c | 4 +- src/H5HG.c | 4 +- src/H5I.c | 74 +++++-- src/H5Iprivate.h | 34 --- src/H5Ipublic.h | 12 -- src/H5O.c | 2 +- src/H5Ocomp.c | 8 +- src/H5Odtype.c | 2 +- src/H5Oefl.c | 24 +-- src/H5Omtime.c | 14 +- src/H5Oname.c | 6 +- src/H5P.c | 20 +- src/H5S.c | 7 +- src/H5Shyper.c | 10 +- src/H5Tbit.c | 4 +- src/H5Tconv.c | 30 +-- src/H5V.c | 2 +- src/H5Z.c | 4 +- src/H5private.h | 2 +- test/tfile.c | 16 +- 49 files changed, 920 insertions(+), 720 deletions(-) create mode 100644 doc/html/Ragged.html diff --git a/COPYING b/COPYING index 6bed88f..15e39b5 100644 --- a/COPYING +++ b/COPYING @@ -1,48 +1,39 @@ -/*======================================================================= +Copyright Notice and Statement for NCSA Hierarchical Data Format (HDF) +Software Library and Utilities -Copyright Notice and Statement for -NCSA Hierarchical Data Format (HDF) Software Library and Utilities +NCSA Hierarchical Data Format (HDF) Software Library and Utilities Copyright +1998 the Board of Trustees of the University of Illinois. All rights reserved. - -NCSA Hierarchical Data Format (HDF) Software Library and Utilities -Copyright 1998 the Board of Trustees of the University of Illinois -All rights reserved. - -Contributors: National Center for Supercomputing Applications (NCSA) at -the University of Illinois, Lawrence Livermore Nat'l Laboratory (LLNL), -Sandia National Laboratories (SNL), Los Alamos National Laboratory (LANL), -Jean-loup Gailly and Mark Adler (gzip library) +Contributors: National Center for Supercomputing Applications (NCSA) at the +University of Illinois, Lawrence Livermore Nat'l Laboratory (LLNL), Sandia +National Laboratories (SNL), Los Alamos National Laboratory (LANL). Redistribution and use in source and binary forms, with or without modification, are permitted for any purpose (including commercial purposes) provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or materials provided with the distribution. - -3. In addition, redistributions of modified forms of the source or binary -code must carry prominent notices stating that the original code was -changed and the date of the change. - -4. All publications or advertising materials mentioning features or use of -this software must acknowledge that it was developed by the National Center -for Supercomputing Applications at the University of Illinois, and credit -the Contributors. +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. -5. Neither the name of the University nor the names of the Contributors may -be used to endorse or promote products derived from this software without -specific prior written permission from the University or the Contributors. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or materials provided with the distribution. -6. THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND THE CONTRIBUTORS "AS IS" -WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. In no event -shall the University or the Contributors be liable for any damages suffered -by the users arising out of the use of this software, even if advised of -the possibility of such damage. +3. In addition, redistributions of modified forms of the source or binary + code must carry prominent notices stating that the original code was + changed and the date of the change. +4. All publications or advertising materials mentioning features or use of + this software must acknowledge that it was developed by the National + Center for Supercomputing Applications at the University of Illinois, and + credit the Contributors. -=======================================================================*/ +5. Neither the name of the University nor the names of the Contributors may + be used to endorse or promote products derived from this software without + specific prior written permission from the University or the Contributors. +6. THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND THE CONTRIBUTORS "AS IS" + WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. In no event + shall the University or the Contributors be liable for any damages + suffered by the users arising out of the use of this software, even if + advised of the possibility of such damage. diff --git a/INSTALL b/INSTALL index 650c24d..239c621 100644 --- a/INSTALL +++ b/INSTALL @@ -26,28 +26,27 @@ for the install may be found in the file: INSTALL.ascired. Step 0: Install optional third-party packages. * GNU zlib compression library, version 1.0.2 or later is used for - the `deflate' compression method. If libz.a cannot be found then - this form of compression is not compiled into the library. + the `deflate' compression method if available; otherwise no + compression filters will be predefined. Step 1. Unpack the source tree. - * The tarball will unpack into an hdf5-1.0.0a directory with one of + * The tarball will unpack into an hdf5-1.1.0 directory with one of the following commands: - $ tar xf hdf5-1.0.0a.tar OR - $ gunzip ) { # calls. next if $name =~ /^(if|for|return|sizeof|switch|while|void)$/; + # Ignore things that get misdetected because of the simplified + # parsing that takes place here. + next if $name =~ /^int$/; + # These are really HDF5 functions/macros even though they don't # start with `h' or `H'. next if $name =~ /^FUNC_(ENTER|LEAVE)(_INIT)?$/; next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)$/; - next if $name =~ /^(MIN|MAX3?|NELMTS|BOUND|CONSTR)$/; + next if $name =~ /^(MIN3?|MAX3?|NELMTS|BOUND|CONSTR)$/; + next if $name =~ /^addr_defined$/; # These functions/macros are exempt. - next if $name =~ /^(assert|main|[fs]?printf)$/; + next if $name =~ /^(assert|main|[fs]?printf|va_(start|arg|end))$/; print "$ARGV:$.: $name\n"; } diff --git a/doc/html/Datatypes.html b/doc/html/Datatypes.html index 50e0ab7..4c57359 100644 --- a/doc/html/Datatypes.html +++ b/doc/html/Datatypes.html @@ -1157,7 +1157,7 @@ typedef herr_t (*H5T_conv_t)(hid_t src_type, initialized. This is useful for those functions requiring some extra buffer space as the buffer can probably be allocated more efficiently by the library (the application can supply - the buffer as part of the dataset transfer template). + the buffer as part of the dataset transfer property list).

H5T_BKG_YES @@ -1388,7 +1388,7 @@ H5Tregister_soft ("cus2be", H5T_INTEGER, H5T_INTEGER, cray_ushort2be);
Quincey Koziol
-Last modified: Fri Aug 7 10:24:52 EDT 1998 +Last modified: Tue Sep 8 14:43:32 EDT 1998 diff --git a/doc/html/ExternalFiles.html b/doc/html/ExternalFiles.html index 39ebd2b..91b72c7 100644 --- a/doc/html/ExternalFiles.html +++ b/doc/html/ExternalFiles.html @@ -110,16 +110,16 @@ Currently, the default low-level file driver is used for all family members (H5F_LOW_DFLT, usually set to be Section 2 I/O or Section 3 stdio), but we'll probably eventually want to pass - that as a parameter of the file access template, which hasn't - been implemented yet. When creating a family, a default family - member size is used (defined at the top H5Ffamily.c, currently - 64MB) but that also should be settable in the file access - template. When opening an existing family, the size of the first - member is used to determine the member size (flushing/closing a - family ensures that the first member is the correct size) but - the other family members don't have to be that large (the local - address space, however, is logically the same size for all - members). + that as a parameter of the file access property list, which + hasn't been implemented yet. When creating a family, a default + family member size is used (defined at the top H5Ffamily.c, + currently 64MB) but that also should be settable in the file + access property list. When opening an existing family, the size + of the first member is used to determine the member size + (flushing/closing a family ensures that the first member is the + correct size) but the other family members don't have to be that + large (the local address space, however, is logically the same + size for all members).

I haven't implemented a split meta/raw family yet but am rather curious to see how it would perform. I was planning to use the @@ -130,7 +130,7 @@ then we'll chose the split family and use the default low level driver for each of the two family members. Eventually we'll want to pass these kinds of things through the file access - template instead of relying on naming convention. + property list instead of relying on naming convention.

External Raw Data

@@ -199,7 +199,7 @@ struct H5F_mount_t {

The H5Fmount function takes the ID of an open file, the name of a to-be-mounted file, the name of the mount - point, and a file access template (like H5Fopen). + point, and a file access property list (like H5Fopen). It opens the new file and adds a record to the parent's mount table. The H5Funmount function takes the parent file ID and the name of the mount point and closes the file @@ -272,7 +272,7 @@ struct H5F_mount_t {

Robb Matzke
-Last modified: Wed Nov 12 15:01:14 EST 1997 +Last modified: Tue Sep 8 14:43:32 EDT 1998 diff --git a/doc/html/Files.html b/doc/html/Files.html index d620b75..36512f7 100644 --- a/doc/html/Files.html +++ b/doc/html/Files.html @@ -61,7 +61,7 @@ set. The access_properties is a file access property list ID or H5P_DEFAULT for the default I/O access parameters. Creating and changing the parameters for access - templates is documented further below. Files which are opened + property lists is documented further below. Files which are opened more than once return a unique identifier for each H5Fopen() call and can be accessed through all file IDs. The return value is an ID for the open file and it @@ -200,40 +200,40 @@ an address which is a multiple of some number. -

5. Examples of using file templates

+

5. Examples of using file property lists

-

5.1. Example of using file creation templates

+

5.1. Example of using file creation property lists

This following example shows how to create a file with 64-bit object offsets and lengths:

-        hid_t create_template;
+        hid_t create_plist;
         hid_t file_id;
 
-        create_template = H5Pcreate(H5P_FILE_CREATE);
-        H5Pset_sizes(create_template, 8, 8);
+        create_plist = H5Pcreate(H5P_FILE_CREATE);
+        H5Pset_sizes(create_plist, 8, 8);
 
         file_id = H5Fcreate("test.h5", H5F_ACC_TRUNC,
-                             create_template, H5P_DEFAULT);
+                             create_plist, H5P_DEFAULT);
         .
         .
         .
         H5Fclose(file_id);
     
-

5.2. Example of using file creation templates

+

5.2. Example of using file creation plist

This following example shows how to open an existing file for independent datasets access by MPI parallel I/O:

-        hid_t access_template;
+        hid_t access_plist;
         hid_t file_id;
 
-        access_template = H5Pcreate(H5P_FILE_ACCESS);
-        H5Pset_mpi(access_template, MPI_COMM_WORLD, MPI_INFO_NULL);
+        access_plist = H5Pcreate(H5P_FILE_ACCESS);
+        H5Pset_mpi(access_plist, MPI_COMM_WORLD, MPI_INFO_NULL);
 
 	/* H5Fopen must be called collectively */
-        file_id = H5Fopen("test.h5", H5F_ACC_RDWR, access_template);
+        file_id = H5Fopen("test.h5", H5F_ACC_RDWR, access_plist);
         .
         .
         .
@@ -532,7 +532,7 @@
     
Robb Matzke
-Last modified: Thu Aug 6 16:17:08 EDT 1998 +Last modified: Tue Sep 8 14:43:31 EDT 1998 diff --git a/doc/html/H5.api.html b/doc/html/H5.api.html index b2402a5..5f3cf78 100644 --- a/doc/html/H5.api.html +++ b/doc/html/H5.api.html @@ -19,33 +19,33 @@ HDF5 Draft API Specification
  • H5Fopen
  • H5Fcreate
  • H5Fis_hdf5 -
  • H5Fget_create_template +
  • H5Fget_create_plist
  • H5Fclose -
  • Template - H5P<name> - API for manipulating object templates +
  • Property list - H5P<name> - API for manipulating object property lists
      -
    1. H5Pcreate -
    2. H5Pget_class -
    3. H5Pcopy -
    4. H5Pclose -
    5. H5Pget_version -
    6. H5Pset_userblock -
    7. H5Pget_userblock -
    8. H5Pset_sizes -
    9. H5Pget_sizes -
    10. H5Pset_mpi -
    11. H5Pget_mpi -
    12. H5Pset_xfer -
    13. H5Pget_xfer -
    14. H5Pset_sym_k -
    15. H5Pget_sym_k -
    16. H5Pset_istore_k -
    17. H5Pget_istore_k -
    18. H5Pset_layout -
    19. H5Pget_layout -
    20. H5Pset_chunk -
    21. H5Pget_chunk +
    22. H5Pcreate +
    23. H5Pget_class +
    24. H5Pcopy +
    25. H5Pclose +
    26. H5Pget_version +
    27. H5Pset_userblock +
    28. H5Pget_userblock +
    29. H5Pset_sizes +
    30. H5Pget_sizes +
    31. H5Pset_mpi +
    32. H5Pget_mpi +
    33. H5Pset_xfer +
    34. H5Pget_xfer +
    35. H5Pset_sym_k +
    36. H5Pget_sym_k +
    37. H5Pset_istore_k +
    38. H5Pget_istore_k +
    39. H5Pset_layout +
    40. H5Pget_layout +
    41. H5Pset_chunk +
    42. H5Pget_chunk
    + +Last modified: Fri Aug 28 14:27:19 EDT 1998 + + + diff --git a/src/H5.c b/src/H5.c index 959ec19..5921884 100644 --- a/src/H5.c +++ b/src/H5.c @@ -135,7 +135,7 @@ H5_init_library(void) /* Debugging? */ H5_debug_mask("-all"); - H5_debug_mask(getenv("HDF5_DEBUG")); + H5_debug_mask(HDgetenv("HDF5_DEBUG")); FUNC_LEAVE(SUCCEED); } @@ -351,7 +351,7 @@ H5_debug_mask(const char *s) int clear; while (s && *s) { - if (isalpha(*s) || '-'==*s || '+'==*s) { + if (HDisalpha(*s) || '-'==*s || '+'==*s) { /* Enable or Disable debugging? */ if ('-'==*s) { clear = TRUE; @@ -364,21 +364,21 @@ H5_debug_mask(const char *s) } /* Get the name */ - for (i=0; isalpha(*s); i++, s++) { + for (i=0; HDisalpha(*s); i++, s++) { if (i0) { - sprintf (template+strlen (template), "%d", fwidth); + sprintf (template+HDstrlen(template), "%d", fwidth); } if (prec>0) { - sprintf (template+strlen (template), ".%d", prec); + sprintf (template+HDstrlen(template), ".%d", prec); } if (*modifier) { - sprintf (template+strlen (template), "%s", modifier); + sprintf (template+HDstrlen(template), "%s", modifier); } - sprintf (template+strlen (template), "%c", conv); + sprintf (template+HDstrlen(template), "%c", conv); /* Conversion */ switch (conv) { case 'd': case 'i': - if (!strcmp (modifier, "h")) { + if (!HDstrcmp(modifier, "h")) { short x = va_arg (ap, short); n = fprintf (stream, template, x); } else if (!*modifier) { int x = va_arg (ap, int); n = fprintf (stream, template, x); - } else if (!strcmp (modifier, "l")) { + } else if (!HDstrcmp (modifier, "l")) { long x = va_arg (ap, long); n = fprintf (stream, template, x); } else { @@ -721,13 +721,13 @@ HDfprintf (FILE *stream, const char *fmt, ...) case 'u': case 'x': case 'X': - if (!strcmp (modifier, "h")) { + if (!HDstrcmp (modifier, "h")) { unsigned short x = va_arg (ap, unsigned short); n = fprintf (stream, template, x); } else if (!*modifier) { unsigned int x = va_arg (ap, unsigned int); n = fprintf (stream, template, x); - } else if (!strcmp (modifier, "l")) { + } else if (!HDstrcmp (modifier, "l")) { unsigned long x = va_arg (ap, unsigned long); n = fprintf (stream, template, x); } else { @@ -741,10 +741,10 @@ HDfprintf (FILE *stream, const char *fmt, ...) case 'E': case 'g': case 'G': - if (!strcmp (modifier, "h")) { + if (!HDstrcmp (modifier, "h")) { float x = va_arg (ap, float); n = fprintf (stream, template, x); - } else if (!*modifier || !strcmp (modifier, "l")) { + } else if (!*modifier || !HDstrcmp (modifier, "l")) { double x = va_arg (ap, double); n = fprintf (stream, template, x); } else { @@ -771,24 +771,24 @@ HDfprintf (FILE *stream, const char *fmt, ...) ldspace?" ":"", prefix?"#":"", zerofill?"0":""); if (fwidth>0) { - sprintf(template+strlen(template), "%d", fwidth); + sprintf(template+HDstrlen(template), "%d", fwidth); } if (sizeof(x->offset)==SIZEOF_INT) { - strcat(template, "d"); + HDstrcat(template, "d"); } else if (sizeof(x->offset)==SIZEOF_LONG) { - strcat(template, "ld"); + HDstrcat(template, "ld"); } else if (sizeof(x->offset)==SIZEOF_LONG_LONG) { - strcat(template, PRINTF_LL_WIDTH); - strcat(template, "d"); + HDstrcat(template, PRINTF_LL_WIDTH); + HDstrcat(template, "d"); } n = fprintf(stream, template, x->offset); } else { - strcpy(template, "%"); - if (leftjust) strcat(template, "-"); + HDstrcpy(template, "%"); + if (leftjust) HDstrcat(template, "-"); if (fwidth) { - sprintf(template+strlen(template), "%d", fwidth); + sprintf(template+HDstrlen(template), "%d", fwidth); } - strcat(template, "s"); + HDstrcat(template, "s"); fprintf(stream, template, x?"UNDEF":"NULL"); } } @@ -811,20 +811,20 @@ HDfprintf (FILE *stream, const char *fmt, ...) case 'n': if (1) { - template[strlen(template)-1] = 'u'; + template[HDstrlen(template)-1] = 'u'; n = fprintf (stream, template, nout); } break; default: - fputs (template, stream); - n = (int)strlen (template); + HDfputs (template, stream); + n = (int)HDstrlen (template); break; } nout += n; fmt = s; } else { - putc (*fmt, stream); + HDputc (*fmt, stream); fmt++; nout++; } @@ -891,7 +891,7 @@ HDstrtoll (const char *s, const char **rest, int base) } /* Skip white space */ - while (isspace (*s)) s++; + while (HDisspace (*s)) s++; /* Optional minus or plus sign */ if ('+'==*s) { @@ -1083,33 +1083,33 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds) double bw; if (nseconds<=0.0) { - strcpy(buf, " NaN"); + HDstrcpy(buf, " NaN"); } else { bw = nbytes/nseconds; if (bw==0.0) { - strcpy(buf, "0.000 B/s"); + HDstrcpy(buf, "0.000 B/s"); } else if (bw<1.0) { sprintf(buf, "%10.4e", bw); } else if (bw<1024.0) { sprintf(buf, "%05.4f", bw); - strcpy(buf+5, " B/s"); + HDstrcpy(buf+5, " B/s"); } else if (bw<1024.0*1024.0) { sprintf(buf, "%05.4f", bw/1024.0); - strcpy(buf+5, " kB/s"); + HDstrcpy(buf+5, " kB/s"); } else if (bw<1024.0*1024.0*1024.0) { sprintf(buf, "%05.4f", bw/(1024.0*1024.0)); - strcpy(buf+5, " MB/s"); + HDstrcpy(buf+5, " MB/s"); } else if (bw<1024.0*1024.0*1024.0*1024.0) { sprintf(buf, "%05.4f", bw/(1024.0*1024.0*1024.0)); - strcpy(buf+5, " GB/s"); + HDstrcpy(buf+5, " GB/s"); } else if (bw<1024.0*1024.0*1024.0*1024.0*1024.0) { sprintf(buf, "%05.4f", bw/(1024.0*1024.0*1024.0*1024.0)); - strcpy(buf+5, " TB/s"); + HDstrcpy(buf+5, " TB/s"); } else { sprintf(buf, "%10.4e", bw); - if (strlen(buf)>10) { + if (HDstrlen(buf)>10) { sprintf(buf, "%10.3e", bw); } } @@ -1174,16 +1174,16 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) for (i=0; inused>0) { size_t heap_size = H5HL_ALIGN (1); for (i=0; inused; i++) { - heap_size += H5HL_ALIGN (strlen (efl->slot[i].name)+1); + heap_size += H5HL_ALIGN (HDstrlen (efl->slot[i].name)+1); } if (H5HL_create (f, heap_size, &(efl->heap_addr))<0 || (size_t)(-1)==H5HL_insert (f, &(efl->heap_addr), 1, "")) { diff --git a/src/H5Distore.c b/src/H5Distore.c index 6f758a8..48ad749 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -272,7 +272,7 @@ H5F_istore_debug_key (FILE *stream, intn indent, intn fwidth, for (i=0; imesg.ndims; i++) { HDfprintf (stream, "%s%Hd", i?", ":"", key->offset[i]); } - fputs ("}\n", stream); + HDfputs ("}\n", stream); FUNC_LEAVE (SUCCEED); } diff --git a/src/H5E.c b/src/H5E.c index 54317f5..f3961fd 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -261,7 +261,7 @@ H5Eprint(FILE *stream) if (!stream) stream = stderr; fprintf (stream, "HDF5-DIAG: Error detected in thread 0."); if (estack && estack->nused>0) fprintf (stream, " Back trace follows."); - fputc ('\n', stream); + HDfputc ('\n', stream); status = H5E_walk (H5E_WALK_DOWNWARD, H5Ewalk_cb, (void*)stream); FUNC_LEAVE (status); diff --git a/src/H5F.c b/src/H5F.c index 6411a4e..a3e6782 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -142,8 +142,8 @@ H5F_init_interface(void) #ifdef HAVE_PARALLEL { /* Allow MPI buf-and-file-type optimizations? */ - const char *s = getenv ("HDF5_MPI_1_METAWRITE"); - if (s && isdigit(*s)) { + const char *s = HDgetenv ("HDF5_MPI_1_METAWRITE"); + if (s && HDisdigit(*s)) { H5_mpi_1_metawrite_g = (int)HDstrtol (s, NULL, 0); } } @@ -250,11 +250,11 @@ H5F_encode_length_unusual(const H5F_t *f, uint8 **p, uint8 *l) /*------------------------------------------------------------------------- - * Function: H5Fget_create_template + * Function: H5Fget_create_plist * - * Purpose: Get an atom for a copy of the file-creation template for this - * file. This function returns an atom with a copy of the - * template parameters used to create a file. + * Purpose: Get an atom for a copy of the file-creation property list for + * this file. This function returns an atom with a copy of the + * properties used to create a file. * * Return: Success: template ID * @@ -265,36 +265,35 @@ H5F_encode_length_unusual(const H5F_t *f, uint8 **p, uint8 *l) * Modifications: * * Robb Matzke, 18 Feb 1998 - * Calls H5P_copy() to copy the template and H5P_close() to free that - * template if an error occurs. + * Calls H5P_copy() to copy the property list and H5P_close() to free + * that property list if an error occurs. * *------------------------------------------------------------------------- */ hid_t -H5Fget_create_template(hid_t file_id) +H5Fget_create_plist(hid_t file_id) { H5F_t *file = NULL; hid_t ret_value = FAIL; - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; - FUNC_ENTER(H5Fget_create_template, FAIL); + FUNC_ENTER(H5Fget_create_plist, FAIL); H5TRACE1("i","i",file_id); /* check args */ - if (H5_FILE != H5I_group(file_id) || NULL==(file=H5I_object (file_id))) { + if (H5_FILE != H5I_group(file_id) || NULL==(file=H5I_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } - /* Create the template object to return */ - if (NULL==(tmpl=H5P_copy (H5P_FILE_CREATE, - file->shared->create_parms))) { - HRETURN_ERROR (H5E_INTERNAL, H5E_CANTINIT, FAIL, - "unable to copy file creation properties"); + /* Create the property list object to return */ + if (NULL==(plist=H5P_copy(H5P_FILE_CREATE, file->shared->create_parms))) { + HRETURN_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, + "unable to copy file creation properties"); } /* Create an atom */ - if ((ret_value = H5P_create(H5P_FILE_CREATE, tmpl)) < 0) { - H5P_close (H5P_FILE_CREATE, tmpl); + if ((ret_value = H5P_create(H5P_FILE_CREATE, plist)) < 0) { + H5P_close(H5P_FILE_CREATE, plist); HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register property list"); } @@ -304,13 +303,13 @@ H5Fget_create_template(hid_t file_id) /*------------------------------------------------------------------------- - * Function: H5Fget_access_template + * Function: H5Fget_access_plist * - * Purpose: Returns a copy of the file access template of the specified - * file. + * Purpose: Returns a copy of the file access property list of the + * specified file. * * Return: Success: Object ID for a copy of the file access - * template. + * property list. * * Failure: FAIL * @@ -322,35 +321,34 @@ H5Fget_create_template(hid_t file_id) *------------------------------------------------------------------------- */ hid_t -H5Fget_access_template(hid_t file_id) +H5Fget_access_plist(hid_t file_id) { H5F_t *f = NULL; - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; hid_t ret_value = FAIL; - FUNC_ENTER (H5Fget_access_template, FAIL); + FUNC_ENTER(H5Fget_access_plist, FAIL); H5TRACE1("i","i",file_id); /* Check args */ - if (H5_FILE!=H5I_group (file_id) || NULL==(f=H5I_object (file_id))) { - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); + if (H5_FILE!=H5I_group(file_id) || NULL==(f=H5I_object(file_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } - /* Create the template object to return */ - if (NULL==(tmpl=H5P_copy (H5P_FILE_ACCESS, - f->shared->access_parms))) { - HRETURN_ERROR (H5E_INTERNAL, H5E_CANTINIT, FAIL, - "unable to copy file access properties"); + /* Create the property list object to return */ + if (NULL==(plist=H5P_copy(H5P_FILE_ACCESS, f->shared->access_parms))) { + HRETURN_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, + "unable to copy file access properties"); } /* Create an atom */ - if ((ret_value = H5P_create (H5P_FILE_ACCESS, tmpl))<0) { - H5P_close (H5P_FILE_ACCESS, tmpl); - HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, - "unable to register property list"); + if ((ret_value = H5P_create(H5P_FILE_ACCESS, plist))<0) { + H5P_close(H5P_FILE_ACCESS, plist); + HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, + "unable to register property list"); } - FUNC_LEAVE (ret_value); + FUNC_LEAVE(ret_value); } diff --git a/src/H5Ffamily.c b/src/H5Ffamily.c index 464ffa1..8d429fa 100644 --- a/src/H5Ffamily.c +++ b/src/H5Ffamily.c @@ -117,7 +117,7 @@ H5F_fam_open(const char *name, const H5F_access_t *access_parms, access_parms->u.fam.memb_access, F_OK, NULL)) { break; - } else if (unlink(member_name) < 0) { + } else if (HDunlink(member_name) < 0) { HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "can't delete member"); } } diff --git a/src/H5Fistore.c b/src/H5Fistore.c index 6f758a8..48ad749 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -272,7 +272,7 @@ H5F_istore_debug_key (FILE *stream, intn indent, intn fwidth, for (i=0; imesg.ndims; i++) { HDfprintf (stream, "%s%Hd", i?", ":"", key->offset[i]); } - fputs ("}\n", stream); + HDfputs ("}\n", stream); FUNC_LEAVE (SUCCEED); } diff --git a/src/H5Flow.c b/src/H5Flow.c index 53124b1..31ba501 100644 --- a/src/H5Flow.c +++ b/src/H5Flow.c @@ -498,9 +498,9 @@ H5F_low_access(const H5F_low_class_t *type, const char *name, ret_value = (type->access) (name, access_parms, mode, key /*out*/); } else { - ret_value = (0 == access(name, mode) ? TRUE : FALSE); + ret_value = (0 == HDaccess(name, mode) ? TRUE : FALSE); if (key) { - stat(name, &sb); + HDstat(name, &sb); key->dev = sb.st_dev; key->ino = sb.st_ino; } diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 55f7f3d..d00c1d7 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -83,8 +83,8 @@ hid_t H5Fcreate (const char *filename, unsigned flags, hid_t create_plist, hid_t H5Fopen (const char *filename, unsigned flags, hid_t access_plist); herr_t H5Fflush(hid_t object_id); herr_t H5Fclose (hid_t file_id); -hid_t H5Fget_create_template (hid_t file_id); -hid_t H5Fget_access_template (hid_t file_id); +hid_t H5Fget_create_plist (hid_t file_id); +hid_t H5Fget_access_plist (hid_t file_id); #ifdef __cplusplus } diff --git a/src/H5Fsec2.c b/src/H5Fsec2.c index 9b6a0b5..96f6d0f 100644 --- a/src/H5Fsec2.c +++ b/src/H5Fsec2.c @@ -87,7 +87,7 @@ H5F_sec2_open(const char *name, const H5F_access_t __unused__ *access_parms, oflags |= (flags & H5F_ACC_EXCL) ? O_EXCL : 0; oflags |= (flags & H5F_ACC_TRUNC) ? O_TRUNC : 0; - if ((fd = open(name, oflags, 0666)) < 0) { + if ((fd = HDopen(name, oflags, 0666)) < 0) { HRETURN_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed"); } if (NULL==(lf = H5MM_calloc(sizeof(H5F_low_t)))) { @@ -97,7 +97,7 @@ H5F_sec2_open(const char *name, const H5F_access_t __unused__ *access_parms, lf->u.sec2.fd = fd; lf->u.sec2.op = H5F_OP_SEEK; lf->u.sec2.cur = 0; - fstat(fd, &sb); + HDfstat(fd, &sb); lf->eof.offset = sb.st_size; if (key) { @@ -131,7 +131,7 @@ H5F_sec2_close(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms) { FUNC_ENTER(H5F_sec2_close, FAIL); - if (close(lf->u.sec2.fd) < 0) { + if (HDclose(lf->u.sec2.fd) < 0) { HRETURN_ERROR(H5E_IO, H5E_CLOSEERROR, FAIL, "close failed"); } lf->u.sec2.fd = -1; @@ -210,7 +210,7 @@ H5F_sec2_read(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms, HRETURN_ERROR (H5E_IO, H5E_SEEKERROR, FAIL, "lseek64 failed"); } #else - if (lseek(lf->u.sec2.fd, offset, SEEK_SET) < 0) { + if (HDlseek(lf->u.sec2.fd, offset, SEEK_SET) < 0) { HRETURN_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "lseek failed"); } #endif @@ -230,7 +230,7 @@ H5F_sec2_read(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms, * Read the data. If a read error occurs then set the last file operation * to UNKNOWN because the file position isn't guaranteed by Posix. */ - if ((n = read(lf->u.sec2.fd, buf, size)) < 0) { + if ((n = HDread(lf->u.sec2.fd, buf, size)) < 0) { lf->u.sec2.op = H5F_OP_UNKNOWN; HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "read failed"); } else if ((size_t)n < size) { @@ -307,7 +307,7 @@ H5F_sec2_write(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms, if (!H5F_OPT_SEEK || lf->u.sec2.op == H5F_OP_UNKNOWN || lf->u.sec2.cur != offset) { - if (lseek(lf->u.sec2.fd, offset, SEEK_SET) < 0) { + if (HDlseek(lf->u.sec2.fd, offset, SEEK_SET) < 0) { HRETURN_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "lseek failed"); } lf->u.sec2.cur = offset; @@ -317,7 +317,7 @@ H5F_sec2_write(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms, * Write the data to the file. If the write failed then set the * operation back to UNKNOWN since Posix doesn't gurantee its value. */ - if (n != write(lf->u.sec2.fd, buf, size)) { + if (n != HDwrite(lf->u.sec2.fd, buf, size)) { lf->u.sec2.op = H5F_OP_UNKNOWN; HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write failed"); } diff --git a/src/H5Fsplit.c b/src/H5Fsplit.c index c49d2e0..e4a78f2 100644 --- a/src/H5Fsplit.c +++ b/src/H5Fsplit.c @@ -118,11 +118,11 @@ H5F_split_open(const char *name, const H5F_access_t *access_parms, /* Open the meta data file */ ext = access_parms->u.split.meta_ext ? access_parms->u.split.meta_ext : H5F_SPLIT_META_EXT; - if (strlen (name)+strlen (ext) >= sizeof fullname) { + if (HDstrlen(name)+HDstrlen(ext) >= sizeof fullname) { HGOTO_ERROR (H5E_IO, H5E_CANTINIT, NULL, "file name is too long"); } - strcpy (fullname, name); - strcat (fullname, ext); + HDstrcpy(fullname, name); + HDstrcat(fullname, ext); lf->u.split.meta = H5F_low_open(meta_type, fullname, access_parms->u.split.meta_access, @@ -134,11 +134,11 @@ H5F_split_open(const char *name, const H5F_access_t *access_parms, /* Open the raw data file */ ext = access_parms->u.split.raw_ext ? access_parms->u.split.raw_ext : H5F_SPLIT_RAW_EXT; - if (strlen (name)+strlen (ext) >= sizeof fullname) { + if (HDstrlen(name)+HDstrlen(ext) >= sizeof fullname) { HGOTO_ERROR (H5E_IO, H5E_CANTINIT, NULL, "file name is too long"); } - strcpy (fullname, name); - strcat (fullname, ext); + HDstrcpy(fullname, name); + HDstrcat(fullname, ext); lf->u.split.raw = H5F_low_open(raw_type, fullname, access_parms->u.split.raw_access, @@ -372,11 +372,11 @@ H5F_split_access(const char *name, const H5F_access_t *access_parms, meta_type = H5F_low_class (access_parms->u.split.meta_access->driver); ext = access_parms->u.split.meta_ext ? access_parms->u.split.meta_ext : H5F_SPLIT_META_EXT; - if (strlen (name)+strlen (ext) >= sizeof fullname) { + if (HDstrlen(name)+HDstrlen(ext) >= sizeof fullname) { HRETURN_ERROR (H5E_IO, H5E_CANTINIT, FAIL, "file name is too long"); } - strcpy (fullname, name); - strcat (fullname, ext); + HDstrcpy(fullname, name); + HDstrcat(fullname, ext); status = H5F_low_access(meta_type, fullname, access_parms->u.split.meta_access, @@ -391,11 +391,11 @@ H5F_split_access(const char *name, const H5F_access_t *access_parms, raw_type = H5F_low_class (access_parms->u.split.raw_access->driver); ext = access_parms->u.split.raw_ext ? access_parms->u.split.raw_ext : H5F_SPLIT_RAW_EXT; - if (strlen (name)+strlen (ext) >= sizeof fullname) { + if (HDstrlen(name)+HDstrlen(ext) >= sizeof fullname) { HRETURN_ERROR (H5E_IO, H5E_CANTINIT, FAIL, "file name is too long"); } - strcpy (fullname, name); - strcat (fullname, ext); + HDstrcpy(fullname, name); + HDstrcat(fullname, ext); status = H5F_low_access(raw_type, fullname, access_parms->u.split.raw_access, diff --git a/src/H5Fstdio.c b/src/H5Fstdio.c index db2b3e2..5fa8078 100644 --- a/src/H5Fstdio.c +++ b/src/H5Fstdio.c @@ -82,9 +82,9 @@ H5F_stdio_open(const char *name, const H5F_access_t __unused__ *access_parms, FUNC_ENTER(H5F_stdio_open, NULL); - if (access(name, F_OK) < 0) { + if (HDaccess(name, F_OK) < 0) { if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR)) { - f = fopen(name, "wb+"); + f = HDfopen(name, "wb+"); } else { HRETURN_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "file doesn't exist and CREAT wasn't specified"); @@ -96,12 +96,12 @@ H5F_stdio_open(const char *name, const H5F_access_t __unused__ *access_parms, } else if (flags & H5F_ACC_RDWR) { if (flags & H5F_ACC_TRUNC) - f = fopen(name, "wb+"); + f = HDfopen(name, "wb+"); else - f = fopen(name, "rb+"); + f = HDfopen(name, "rb+"); } else { - f = fopen(name, "rb"); + f = HDfopen(name, "rb"); } if (!f) HRETURN_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "fopen failed"); @@ -115,17 +115,17 @@ H5F_stdio_open(const char *name, const H5F_access_t __unused__ *access_parms, lf->u.stdio.op = H5F_OP_SEEK; lf->u.stdio.cur = 0; H5F_addr_reset(&(lf->eof)); - if (fseek(lf->u.stdio.f, 0, SEEK_END) < 0) { + if (HDfseek(lf->u.stdio.f, 0, SEEK_END) < 0) { lf->u.stdio.op = H5F_OP_UNKNOWN; } else { - hssize_t x = ftell (lf->u.stdio.f); + hssize_t x = HDftell (lf->u.stdio.f); assert (x>=0); H5F_addr_inc(&(lf->eof), (hsize_t)x); } /* The unique key */ if (key) { - fstat(fileno(f), &sb); + HDfstat(fileno(f), &sb); key->dev = sb.st_dev; key->ino = sb.st_ino; } @@ -156,7 +156,7 @@ H5F_stdio_close(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms) { FUNC_ENTER(H5F_stdio_close, FAIL); - if (fclose(lf->u.stdio.f) < 0) { + if (HDfclose(lf->u.stdio.f) < 0) { HRETURN_ERROR(H5E_IO, H5E_CLOSEERROR, FAIL, "fclose failed"); } lf->u.stdio.f = NULL; @@ -234,7 +234,7 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms, HRETURN_ERROR (H5E_IO, H5E_SEEKERROR, FAIL, "fseek64 failed"); } #else - if (fseek(lf->u.stdio.f, offset, SEEK_SET) < 0) { + if (HDfseek(lf->u.stdio.f, offset, SEEK_SET) < 0) { HRETURN_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "fseek failed"); } #endif @@ -255,8 +255,8 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms, * will advance the file position by N. If N is negative or an error * occurs then the file position is undefined. */ - n = fread(buf, 1, size, lf->u.stdio.f); - if (n <= 0 && ferror(lf->u.stdio.f)) { + n = HDfread(buf, 1, size, lf->u.stdio.f); + if (n <= 0 && HDferror(lf->u.stdio.f)) { lf->u.stdio.op = H5F_OP_UNKNOWN; HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "fread failed"); } else if (n < size) { @@ -341,7 +341,7 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms, HRETURN_ERROR (H5E_IO, H5E_SEEKERROR, FAIL, "fseek64 failed"); } #else - if (fseek(lf->u.stdio.f, offset, SEEK_SET) < 0) { + if (HDfseek(lf->u.stdio.f, offset, SEEK_SET) < 0) { HRETURN_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "fseek failed"); } #endif @@ -353,7 +353,7 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms, * advanced by the number of bytes read. Otherwise nobody knows where it * is. */ - if (n != fwrite(buf, 1, size, lf->u.stdio.f)) { + if (n != HDfwrite(buf, 1, size, lf->u.stdio.f)) { lf->u.stdio.op = H5F_OP_UNKNOWN; HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "fwrite failed"); } @@ -400,7 +400,7 @@ H5F_stdio_flush(H5F_low_t *lf, const H5F_access_t __unused__ *access_parms) /* * Flush */ - if (fflush(lf->u.stdio.f) < 0) { + if (HDfflush(lf->u.stdio.f) < 0) { HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "fflush failed"); } FUNC_LEAVE(SUCCEED); diff --git a/src/H5G.c b/src/H5G.c index 581bd7e..8e591bd 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -1001,7 +1001,7 @@ H5G_namei(H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/, } else { *obj_ent = *loc_ent; } - memset(grp_ent, 0, sizeof(H5G_entry_t)); + HDmemset(grp_ent, 0, sizeof(H5G_entry_t)); H5F_addr_undef(&(grp_ent->header)); @@ -1971,7 +1971,7 @@ H5G_link (H5G_entry_t *loc, H5G_link_t type, const char *cur_name, } if ((size_t)(-1)==(offset=H5HL_insert (grp_ent.file, &(stab_mesg.heap_addr), - strlen(cur_name)+1, + HDstrlen(cur_name)+1, cur_name))) { HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "unable to write link value to local heap"); @@ -2075,7 +2075,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "unable to read symbolic link value"); } - statbuf->linklen = strlen(s)+1; /*count the null terminator*/ + statbuf->linklen = HDstrlen(s)+1; /*count the null terminator*/ statbuf->objno[0] = statbuf->objno[1] = 0; statbuf->nlink = 0; statbuf->type = H5G_LINK; @@ -2179,7 +2179,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/) /* Copy to output buffer */ if (size>0 && buf) { - strncpy (buf, s, size); + HDstrncpy (buf, s, size); } FUNC_LEAVE (SUCCEED); @@ -2270,8 +2270,8 @@ H5G_get_comment(H5G_entry_t *loc, const char *name, size_t bufsize, char *buf) if (buf && bufsize>0) buf[0] = '\0'; retval = 0; } else { - strncpy(buf, comment.s, bufsize); - retval = (intn)strlen(comment.s); + HDstrncpy(buf, comment.s, bufsize); + retval = (intn)HDstrlen(comment.s); H5O_reset(H5O_NAME, &comment); } diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 5767b78..1751edb 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -923,7 +923,7 @@ H5G_node_iterate (H5F_t *f, const haddr_t *addr, void *_udata) name = H5HL_peek (f, &(bt_udata->group->ent.cache.stab.heap_addr), name_off[i]); assert (name); - n = strlen (name); + n = HDstrlen (name); if (n+1>sizeof(buf)) { if (NULL==(s = H5MM_malloc (n+1))) { HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, @@ -932,7 +932,7 @@ H5G_node_iterate (H5F_t *f, const haddr_t *addr, void *_udata) } else { s = buf; } - strcpy (s, name); + HDstrcpy (s, name); ret_value = (bt_udata->op)(bt_udata->group_id, s, bt_udata->op_data); if (s!=buf) H5MM_xfree (s); diff --git a/src/H5HG.c b/src/H5HG.c index 12917e4..b0e4c9d 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -952,12 +952,12 @@ H5HG_debug(H5F_t *f, const haddr_t *addr, FILE *stream, intn indent, if (j+k' ' && p[j+k]<='~' ? p[j+k] : '.', stream); + HDfputc(p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream); } fprintf (stream, "\n"); } diff --git a/src/H5I.c b/src/H5I.c index 50ea7d6..151d7ea 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -63,11 +63,58 @@ static char RcsId[] = "@(#)$Revision$"; #include #include +/* Interface initialialization? */ #define PABLO_MASK H5I_mask +static hbool_t interface_initialize_g = FALSE; +#define INTERFACE_INIT H5I_init_interface +static herr_t H5I_init_interface(void); + +/* + * Define the following macro for fast hash calculations (but limited + * hash sizes) + */ +#define HASH_SIZE_POWER_2 + +/* Define the following macro for atom caching over all the atoms */ +#define IDS_ARE_CACHED /*-------------------- Locally scoped variables -----------------------------*/ #ifdef IDS_ARE_CACHED +# define ID_CACHE_SIZE 4 /*# of previous atoms cached */ +#endif + +/* # of bits to use for Group ID in each atom (change if MAXGROUP>16) */ +#define GROUP_BITS 8 +#define GROUP_MASK 0xFF + +/* # of bits to use for the Atom index in each atom (assumes 8-bit bytes) */ +#define ID_BITS ((sizeof(hid_t)*8)-GROUP_BITS) +#define ID_MASK 0x0FFFFFFF + +/* Map an atom to a Group number */ +#define H5I_GROUP(a) ((H5I_group_t) \ + ((((hid_t)(a))>> \ + ((sizeof(hid_t)*8)-GROUP_BITS))&GROUP_MASK)) + +#ifdef HASH_SIZE_POWER_2 +/* + * Map an ID to a hash location (assumes s is a power of 2 and smaller + * than the ID_MASK constant). + */ +# define H5I_LOC(a,s) ((hid_t)((size_t)(a)&((s)-1))) +#else +/* + * Map an ID to a hash location. + */ +# define H5I_LOC(a,s) (((hid_t)(a)&ID_MASK)%(s)) +#endif + +/* Combine a Group number and an atom index into an atom */ +#define H5I_MAKE(g,i) ((((hid_t)(g)&GROUP_MASK)<nextid); + new_id = H5I_MAKE(grp, grp_ptr->nextid); id_ptr->id = new_id; id_ptr->count = 1; /*initial reference count*/ id_ptr->obj_ptr = object; @@ -365,9 +407,9 @@ H5I_register(H5I_group_t grp, /* IN: Group to register the object in */ do { /* new ID to check for */ - hid_t next_id = MAKE_ID(grp, grp_ptr->nextid); + hid_t next_id = H5I_MAKE(grp, grp_ptr->nextid); H5I_id_info_t *curr_id; /* ptr to the current atom */ - hash_loc = ID_TO_LOC (grp_ptr->nextid, grp_ptr->hash_size); + hash_loc = H5I_LOC (grp_ptr->nextid, grp_ptr->hash_size); curr_id = grp_ptr->id_list[hash_loc]; if (curr_id == NULL) break; /* Ha! this is not likely... */ @@ -411,7 +453,7 @@ H5I_register(H5I_group_t grp, /* IN: Group to register the object in */ hid_t H5I_inc_ref(hid_t id) { - H5I_group_t grp = ID_TO_GROUP(id); /* object's group */ + H5I_group_t grp = H5I_GROUP(id); /* object's group */ H5I_id_group_t *grp_ptr = NULL; /* ptr to the ID group*/ H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID */ hid_t ret_value = FAIL; @@ -509,7 +551,7 @@ H5I_group(hid_t id) FUNC_ENTER(H5I_group, BADGROUP); - ret_value = ID_TO_GROUP(id); + ret_value = H5I_GROUP(id); if (ret_value <= BADGROUP || ret_value >= MAXGROUP) { HGOTO_DONE(BADGROUP); } @@ -545,14 +587,14 @@ H5I_remove(hid_t id) FUNC_ENTER(H5I_remove, NULL); - grp = ID_TO_GROUP(id); + grp = H5I_GROUP(id); if (grp <= BADGROUP || grp >= MAXGROUP) HGOTO_DONE(NULL); grp_ptr = id_group_list[grp]; if (grp_ptr == NULL || grp_ptr->count <= 0) HGOTO_DONE(NULL); /* Get the location in which the ID is located */ - hash_loc = (uintn) ID_TO_LOC(id, grp_ptr->hash_size); + hash_loc = (uintn) H5I_LOC(id, grp_ptr->hash_size); curr_id = grp_ptr->id_list[hash_loc]; if (curr_id == NULL) HGOTO_DONE(NULL); @@ -622,7 +664,7 @@ H5I_remove(hid_t id) intn H5I_dec_ref(hid_t id) { - H5I_group_t grp = ID_TO_GROUP(id); /* Group the object is in */ + H5I_group_t grp = H5I_GROUP(id); /* Group the object is in */ H5I_id_group_t *grp_ptr = NULL; /* ptr to the group */ H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID */ void * obj; /* object to call 'free' function with */ @@ -728,7 +770,7 @@ H5I_find_id(hid_t id) FUNC_ENTER(H5I_find_id, NULL); - grp = ID_TO_GROUP(id); + grp = H5I_GROUP(id); if (grp <= BADGROUP || grp >= MAXGROUP) HGOTO_DONE(NULL); @@ -737,7 +779,7 @@ H5I_find_id(hid_t id) HGOTO_DONE(NULL); /* Get the location in which the ID is located */ - hash_loc = (uintn) ID_TO_LOC(id, grp_ptr->hash_size); + hash_loc = (uintn) H5I_LOC(id, grp_ptr->hash_size); id_ptr = grp_ptr->id_list[hash_loc]; if (id_ptr == NULL) HGOTO_DONE(NULL); diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 0cc0286..f475004 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -24,40 +24,6 @@ /* Private headers needed by this file */ #include -/* ID Feature controls */ - -/* - * Define the following macro for fast hash calculations (but limited - * hash sizes) - */ -#define HASH_SIZE_POWER_2 - -/* Define the following macro for atom caching over all the atoms */ -#define IDS_ARE_CACHED - -#ifdef IDS_ARE_CACHED -# define ID_CACHE_SIZE 4 /*# of previous atoms cached */ -#endif - -/* Map an atom to a Group number */ -#define ID_TO_GROUP(a) ((H5I_group_t)((((hid_t)(a))>> \ - ((sizeof(hid_t)*8)-GROUP_BITS))&GROUP_MASK)) - -#ifdef HASH_SIZE_POWER_2 - -/* - * Map an ID to a hash location (assumes s is a power of 2 and smaller - * than the ID_MASK constant). - */ -# define ID_TO_LOC(a,s) ((hid_t)((size_t)(a)&((s)-1))) -#else - -/* - * Map an ID to a hash location. - */ -# define ID_TO_LOC(a,s) (((hid_t)(a)&ID_MASK)%(s)) -#endif - /* Default sizes of the hash-tables for various atom groups */ #define H5I_ERRSTACK_HASHSIZE 64 #define H5I_FILEID_HASHSIZE 64 diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index d678fc8..88de38e 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -51,18 +51,6 @@ typedef enum { /* Type of atoms to return to users */ typedef int hid_t; -/* # of bits to use for Group ID in each atom (change if MAXGROUP>16) */ -#define GROUP_BITS 8 -#define GROUP_MASK 0xFF - -/* # of bits to use for the Atom index in each atom (assumes 8-bit bytes) */ -#define ID_BITS ((sizeof(hid_t)*8)-GROUP_BITS) -#define ID_MASK 0x0FFFFFFF - -/* Combine a Group number and an atom index into an atom */ -#define MAKE_ID(g,i) ((((hid_t)(g)&GROUP_MASK)<filter[i].name = H5MM_malloc(name_length+1); - memcpy(pline->filter[i].name, p, name_length); + HDmemcpy(pline->filter[i].name, p, name_length); pline->filter[i].name[name_length] = '\0'; p += name_length; } @@ -199,7 +199,7 @@ H5O_pline_encode (H5F_t __unused__ *f, uint8 *p/*out*/, const void *mesg) (cls=H5Z_find(pline->filter[i].id))) { name = cls->name; } - name_length = name ? strlen(name)+1 : 0; + name_length = name ? HDstrlen(name)+1 : 0; /* Encode the filter */ UINT16ENCODE(p, pline->filter[i].id); @@ -207,7 +207,7 @@ H5O_pline_encode (H5F_t __unused__ *f, uint8 *p/*out*/, const void *mesg) UINT16ENCODE(p, pline->filter[i].flags); UINT16ENCODE(p, pline->filter[i].cd_nelmts); if (name_length>0) { - memcpy(p, name, name_length); + HDmemcpy(p, name, name_length); p += name_length; while (name_length++ % 8) *p++ = 0; } @@ -339,7 +339,7 @@ H5O_pline_size (H5F_t __unused__ *f, const void *mesg) (cls=H5Z_find(pline->filter[i].id))) { name = cls->name; } - name_len = name ? strlen(name)+1 : 0; + name_len = name ? HDstrlen(name)+1 : 0; size += 2 + /*filter identification number */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index d4a4d6f..1653921 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -418,7 +418,7 @@ H5O_dtype_encode_helper(uint8 **pp, const H5T_t *dt) for (i = 0; i < dt->u.compnd.nmembs; i++) { /* Name, multiple of eight bytes */ HDstrcpy ((char*)(*pp), dt->u.compnd.memb[i].name); - n = strlen(dt->u.compnd.memb[i].name); + n = HDstrlen(dt->u.compnd.memb[i].name); for (z=n+1; z%8; z++) (*pp)[z] = '\0'; *pp += z; diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 1c8adcc..f961f57 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -189,7 +189,7 @@ H5O_efl_encode(H5F_t *f, uint8 *p, const void *_mesg) */ if (0==mesg->slot[i].name_offset) { offset = H5HL_insert (f, &(mesg->heap_addr), - strlen (mesg->slot[i].name)+1, + HDstrlen (mesg->slot[i].name)+1, mesg->slot[i].name); if ((size_t)(-1)==offset) { HRETURN_ERROR (H5E_EFL, H5E_CANTINIT, FAIL, @@ -447,22 +447,22 @@ H5O_efl_read (H5F_t __unused__ *f, const H5O_efl_t *efl, haddr_t *addr, HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed"); } - if ((fd=open (efl->slot[i].name, O_RDONLY))<0) { + if ((fd=HDopen (efl->slot[i].name, O_RDONLY, 0))<0) { HGOTO_ERROR (H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file"); } - if (lseek (fd, (off_t)(efl->slot[i].offset+skip), SEEK_SET)<0) { + if (HDlseek (fd, (off_t)(efl->slot[i].offset+skip), SEEK_SET)<0) { HGOTO_ERROR (H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file"); } to_read = MIN(efl->slot[i].size-skip, size); - if ((n=read (fd, buf, to_read))<0) { + if ((n=HDread (fd, buf, to_read))<0) { HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL, "read error in external raw data file"); } else if ((size_t)n=0) close (fd); + if (fd>=0) HDclose (fd); FUNC_LEAVE (ret_value); } @@ -532,8 +532,8 @@ H5O_efl_write (H5F_t __unused__ *f, const H5O_efl_t *efl, haddr_t *addr, HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed"); } - if ((fd=open (efl->slot[i].name, O_RDWR))<0) { - if (access (efl->slot[i].name, F_OK)<0) { + if ((fd=HDopen (efl->slot[i].name, O_RDWR, 0))<0) { + if (HDaccess (efl->slot[i].name, F_OK)<0) { HGOTO_ERROR (H5E_EFL, H5E_CANTOPENFILE, FAIL, "external raw data file does not exist"); } else { @@ -541,16 +541,16 @@ H5O_efl_write (H5F_t __unused__ *f, const H5O_efl_t *efl, haddr_t *addr, "unable to open external raw data file"); } } - if (lseek (fd, (off_t)(efl->slot[i].offset+skip), SEEK_SET)<0) { + if (HDlseek (fd, (off_t)(efl->slot[i].offset+skip), SEEK_SET)<0) { HGOTO_ERROR (H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file"); } to_write = MIN(efl->slot[i].size-skip, size); - if ((size_t)write (fd, buf, to_write)!=to_write) { + if ((size_t)HDwrite (fd, buf, to_write)!=to_write) { HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL, "write error in external raw data file"); } - close (fd); + HDclose (fd); fd = -1; size -= to_write; buf += to_write; @@ -560,7 +560,7 @@ H5O_efl_write (H5F_t __unused__ *f, const H5O_efl_t *efl, haddr_t *addr, ret_value = SUCCEED; done: - if (fd>=0) close (fd); + if (fd>=0) HDclose (fd); FUNC_LEAVE (ret_value); } diff --git a/src/H5Omtime.c b/src/H5Omtime.c index d55f179..f144364 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -76,11 +76,11 @@ H5O_mtime_decode(H5F_t __unused__ *f, const uint8 *p, assert (!sh); /* Initialize time zone information */ - if (0==ncalls++) tzset(); + if (0==ncalls++) HDtzset(); /* decode */ for (i=0; i<14; i++) { - if (!isdigit(p[i])) { + if (!HDisdigit(p[i])) { HRETURN_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message"); } @@ -92,7 +92,7 @@ H5O_mtime_decode(H5F_t __unused__ *f, const uint8 *p, * and then figure out the adjustment based on the local time zone and * daylight savings setting. */ - memset(&tm, 0, sizeof tm); + HDmemset(&tm, 0, sizeof tm); tm.tm_year = (p[0]-'0')*1000 + (p[1]-'0')*100 + (p[2]-'0')*10 + (p[3]-'0') - 1900; tm.tm_mon = (p[4]-'0')*10 + (p[5]-'0') - 1; @@ -101,7 +101,7 @@ H5O_mtime_decode(H5F_t __unused__ *f, const uint8 *p, tm.tm_min = (p[10]-'0')*10 + (p[11]-'0'); tm.tm_sec = (p[12]-'0')*10 + (p[13]-'0'); tm.tm_isdst = -1; /*figure it out*/ - if ((time_t)-1==(the_time=mktime(&tm))) { + if ((time_t)-1==(the_time=HDmktime(&tm))) { HRETURN_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message"); } @@ -188,7 +188,7 @@ H5O_mtime_encode(H5F_t __unused__ *f, uint8 *p, const void *_mesg) assert(mesg); /* encode */ - tm = gmtime(mesg); + tm = HDgmtime(mesg); sprintf((char*)p, "%04d%02d%02d%02d%02d%02d", 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); @@ -304,10 +304,10 @@ H5O_mtime_debug(H5F_t __unused__ *f, const void *_mesg, FILE *stream, assert(fwidth >= 0); /* debug */ - tm = localtime(mesg); + tm = HDlocaltime(mesg); - strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); + HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Time:", buf); diff --git a/src/H5Oname.c b/src/H5Oname.c index 97a7e10..420e6e5 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -83,12 +83,12 @@ H5O_name_decode(H5F_t __unused__ *f, const uint8 *p, /* decode */ if (NULL==(mesg = H5MM_calloc(sizeof(H5O_name_t))) || - NULL==(mesg->s = H5MM_malloc (strlen ((const char*)p)+1))) { + NULL==(mesg->s = H5MM_malloc (HDstrlen((const char*)p)+1))) { H5MM_xfree (mesg); HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); } - strcpy (mesg->s, (const char*)p); + HDstrcpy(mesg->s, (const char*)p); FUNC_LEAVE(mesg); } @@ -123,7 +123,7 @@ H5O_name_encode(H5F_t __unused__ *f, uint8 *p, const void *_mesg) assert(mesg && mesg->s); /* encode */ - strcpy ((char*)p, mesg->s); + HDstrcpy((char*)p, mesg->s); FUNC_LEAVE(SUCCEED); } diff --git a/src/H5P.c b/src/H5P.c index 9f33cda..93f5a02 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -161,7 +161,7 @@ H5Pcreate(H5P_class_t type) HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - memcpy(plist, &H5F_create_dflt, sizeof(H5F_create_t)); + HDmemcpy(plist, &H5F_create_dflt, sizeof(H5F_create_t)); break; case H5P_FILE_ACCESS: @@ -169,7 +169,7 @@ H5Pcreate(H5P_class_t type) HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - memcpy(plist, &H5F_access_dflt, sizeof(H5F_access_t)); + HDmemcpy(plist, &H5F_access_dflt, sizeof(H5F_access_t)); break; case H5P_DATASET_CREATE: @@ -177,7 +177,7 @@ H5Pcreate(H5P_class_t type) HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - memcpy(plist, &H5D_create_dflt, sizeof(H5D_create_t)); + HDmemcpy(plist, &H5D_create_dflt, sizeof(H5D_create_t)); break; case H5P_DATASET_XFER: @@ -185,7 +185,7 @@ H5Pcreate(H5P_class_t type) HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - memcpy(plist, &H5D_xfer_dflt, sizeof(H5D_xfer_t)); + HDmemcpy(plist, &H5D_xfer_dflt, sizeof(H5D_xfer_t)); break; default: @@ -1307,7 +1307,7 @@ H5Pget_external(hid_t plist_id, int idx, size_t name_size, char *name/*out*/, /* Return values */ if (name_size>0 && name) { - strncpy (name, plist->efl.slot[idx].name, name_size); + HDstrncpy (name, plist->efl.slot[idx].name, name_size); } if (offset) *offset = plist->efl.slot[idx].offset; if (size) *size = plist->efl.slot[idx].size; @@ -1731,16 +1731,16 @@ H5Pget_split(hid_t plist_id, size_t meta_ext_size, char *meta_ext/*out*/, /* Output arguments */ if (meta_ext && meta_ext_size>0) { if (plist->u.split.meta_ext) { - strncpy (meta_ext, plist->u.split.meta_ext, meta_ext_size); + HDstrncpy (meta_ext, plist->u.split.meta_ext, meta_ext_size); } else { - strncpy (meta_ext, ".meta", meta_ext_size); + HDstrncpy (meta_ext, ".meta", meta_ext_size); } } if (raw_ext && raw_ext_size>0) { if (plist->u.split.raw_ext) { - strncpy (raw_ext, plist->u.split.raw_ext, raw_ext_size); + HDstrncpy (raw_ext, plist->u.split.raw_ext, raw_ext_size); } else { - strncpy (raw_ext, ".raw", raw_ext_size); + HDstrncpy (raw_ext, ".raw", raw_ext_size); } } if (meta_properties) { @@ -2364,7 +2364,7 @@ H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/, H5Z_class_t *cls = H5Z_find(plist->pline.filter[idx].id); if (cls) s = cls->name; } - if (s) strncpy(name, s, namelen); + if (s) HDstrncpy(name, s, namelen); else name[0] = '\0'; } diff --git a/src/H5S.c b/src/H5S.c index bcbd64e..a5c7c9c 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -81,8 +81,8 @@ H5S_init_interface(void) #ifdef HAVE_PARALLEL { /* Allow MPI buf-and-file-type optimizations? */ - const char *s = getenv ("HDF5_MPI_OPT_TYPES"); - if (s && isdigit(*s)) { + const char *s = HDgetenv ("HDF5_MPI_OPT_TYPES"); + if (s && HDisdigit(*s)) { H5_mpi_opt_types_g = (int)HDstrtol (s, NULL, 0); } } @@ -113,11 +113,12 @@ static void H5S_term_interface(void) { size_t i; + +#ifdef H5S_DEBUG int j, nprints=0; H5S_conv_t *path=NULL; char buf[256]; -#ifdef H5S_DEBUG /* * Print statistics about each conversion path. */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 0b2be16..c59d38e 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -373,8 +373,8 @@ H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, /* Sort region list and eliminate duplicates if necessary */ if(num_reg>1) { - qsort(ret_value,num_reg,sizeof(H5S_hyper_region_t), - H5S_hyper_compare_regions); + HDqsort(ret_value,num_reg,sizeof(H5S_hyper_region_t), + H5S_hyper_compare_regions); for(i=1,curr_reg=0,uniq_reg=1; iextent.u.simple.rank; i++) { - qsort(new_hyper->lo_bounds[i],new_hyper->count,sizeof(H5S_hyper_bound_t),H5S_hyper_compare_bounds); - qsort(new_hyper->hi_bounds[i],new_hyper->count,sizeof(H5S_hyper_bound_t),H5S_hyper_compare_bounds); + HDqsort(new_hyper->lo_bounds[i], new_hyper->count, + sizeof(H5S_hyper_bound_t), H5S_hyper_compare_bounds); + HDqsort(new_hyper->hi_bounds[i], new_hyper->count, + sizeof(H5S_hyper_bound_t), H5S_hyper_compare_bounds); } /* end for */ #ifdef QAK printf("%s: check 7.0\n", FUNC); diff --git a/src/H5Tbit.c b/src/H5Tbit.c index d80c8b3..4d1d796 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -187,7 +187,7 @@ H5T_bit_get_d (uint8 *buf, size_t offset, size_t size) break; default: - abort (); + HDabort (); } FUNC_LEAVE (val); @@ -228,7 +228,7 @@ H5T_bit_set_d (uint8 *buf, size_t offset, size_t size, hsize_t val) break; default: - abort (); + HDabort (); } H5T_bit_copy (buf, offset, (uint8*)&val, 0, size); diff --git a/src/H5Tconv.c b/src/H5Tconv.c index a8dcbf3..0f1d120 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -644,14 +644,14 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, } else if (src->size>=dst->size) { sp = dp = (uint8*)buf; direction = 1; - olap = (size_t)(ceil((double)(src->size)/ - (double)(src->size-dst->size))-1); + olap = (size_t)(HDceil((double)(src->size)/ + (double)(src->size-dst->size))-1); } else { sp = (uint8*)buf + (nelmts-1) * src->size; dp = (uint8*)buf + (nelmts-1) * dst->size; direction = -1; - olap = (size_t)(ceil((double)(dst->size)/ - (double)(dst->size-src->size))-1); + olap = (size_t)(HDceil((double)(dst->size)/ + (double)(dst->size-src->size))-1); } /* The conversion loop */ @@ -1023,14 +1023,14 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, } else if (src_p->size>=dst_p->size) { sp = dp = (uint8*)buf; direction = 1; - olap = (size_t)(ceil((double)(src_p->size)/ - (double)(src_p->size-dst_p->size))-1); + olap = (size_t)(HDceil((double)(src_p->size)/ + (double)(src_p->size-dst_p->size))-1); } else { sp = (uint8*)buf + (nelmts-1) * src_p->size; dp = (uint8*)buf + (nelmts-1) * dst_p->size; direction = -1; - olap = (size_t)(ceil((double)(dst_p->size)/ - (double)(dst_p->size-src_p->size))-1); + olap = (size_t)(HDceil((double)(dst_p->size)/ + (double)(dst_p->size-src_p->size))-1); } /* The conversion loop */ @@ -1129,7 +1129,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, msize = src.u.f.msize; } else { assert("normalization method not implemented yet" && 0); - abort(); + HDabort(); } /* @@ -1151,7 +1151,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, expo -= src.u.f.ebias; } else { assert("normalization method not implemented yet" && 0); - abort(); + HDabort(); } /* @@ -1406,14 +1406,14 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (src->size>=dst->size) { sp = dp = (uint8*)buf; direction = 1; - olap = (size_t)(ceil((double)(src->size)/ - (double)(src->size-dst->size))-1); + olap = (size_t)(HDceil((double)(src->size)/ + (double)(src->size-dst->size))-1); } else { sp = (uint8*)buf + (nelmts-1) * src->size; dp = (uint8*)buf + (nelmts-1) * dst->size; direction = -1; - olap = (size_t)(ceil((double)(dst->size)/ - (double)(dst->size-src->size))-1); + olap = (size_t)(HDceil((double)(dst->size)/ + (double)(dst->size-src->size))-1); } /* Allocate the overlap buffer */ @@ -1471,7 +1471,7 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, nchars = src->size; while (nchars>0 && ' '==s[nchars-1]) --nchars; nchars = MIN(dst->size, nchars); - memcpy(d, s, nchars); + HDmemcpy(d, s, nchars); break; case H5T_STR_RESERVED_3: diff --git a/src/H5V.c b/src/H5V.c index f0ee13c..a72452f 100644 --- a/src/H5V.c +++ b/src/H5V.c @@ -157,7 +157,7 @@ H5V_hyper_stride(intn n, const hsize_t *size, hsize_t acc; /*accumulator */ int i; /*counter */ - FUNC_ENTER(H5V_hyper_stride, (abort(), 0)); + FUNC_ENTER(H5V_hyper_stride, (HDabort(), 0)); assert(n >= 0 && n < H5V_HYPER_NDIMS); assert(size); diff --git a/src/H5Z.c b/src/H5Z.c index 349e978..d16ea52 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -106,7 +106,7 @@ H5Z_term_interface (void) } /* Truncate the comment to fit in the field */ - strncpy(comment, H5Z_table_g[i].name, sizeof comment); + HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); comment[sizeof(comment)-1] = '\0'; /* @@ -388,7 +388,7 @@ H5Z_find(H5Z_filter_t id) *------------------------------------------------------------------------- */ herr_t -H5Z_pipeline(H5F_t *f, const H5O_pline_t *pline, uintn flags, +H5Z_pipeline(H5F_t __unused__ *f, const H5O_pline_t *pline, uintn flags, uintn *filter_mask/*in,out*/, size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/) { diff --git a/src/H5private.h b/src/H5private.h index 99da0dd..9efc617 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -359,7 +359,7 @@ int HDfprintf (FILE *stream, const char *fmt, ...); #define HDmkfifo(S,M) mkfifo(S,M) #define HDmktime(T) mktime(T) #define HDmodf(X,Y) modf(X,Y) -/* open() variable arguments */ +#define HDopen(S,F,M) open(S,F,M) #define HDopendir(S) opendir(S) #define HDpathconf(S,N) pathconf(S,N) #define HDpause() pause() diff --git a/test/tfile.c b/test/tfile.c index d1a6f00..f62f5ef 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -105,8 +105,8 @@ test_file_create(void) VERIFY(fid2, FAIL, "H5Fcreate"); /* Get the file-creation template */ - tmpl1 = H5Fget_create_template(fid1); - CHECK(tmpl1, FAIL, "H5Fget_create_template"); + tmpl1 = H5Fget_create_plist(fid1); + CHECK(tmpl1, FAIL, "H5Fget_create_plist"); /* Get the file-creation parameters */ ret = H5Pget_userblock(tmpl1, &ublock); @@ -159,8 +159,8 @@ test_file_create(void) CHECK(ret, FAIL, "H5Pclose"); /* Get the file-creation template */ - tmpl1 = H5Fget_create_template(fid2); - CHECK(tmpl1, FAIL, "H5Fget_create_template"); + tmpl1 = H5Fget_create_plist(fid2); + CHECK(tmpl1, FAIL, "H5Fget_create_plist"); /* Get the file-creation parameters */ ret = H5Pget_userblock(tmpl1, &ublock); @@ -201,8 +201,8 @@ test_file_create(void) CHECK(ret, FAIL, "H5Pclose"); /* Get the file-creation template */ - tmpl1 = H5Fget_create_template(fid3); - CHECK(tmpl1, FAIL, "H5Fget_create_template"); + tmpl1 = H5Fget_create_plist(fid3); + CHECK(tmpl1, FAIL, "H5Fget_create_plist"); /* Get the file-creation parameters */ ret = H5Pget_userblock(tmpl1, &ublock); @@ -260,8 +260,8 @@ test_file_open(void) CHECK(fid1, FAIL, "H5Fopen"); /* Get the file-creation template */ - tmpl1 = H5Fget_create_template(fid1); - CHECK(tmpl1, FAIL, "H5Fget_create_template"); + tmpl1 = H5Fget_create_plist(fid1); + CHECK(tmpl1, FAIL, "H5Fget_create_plist"); /* Get the file-creation parameters */ ret = H5Pget_userblock(tmpl1, &ublock); -- cgit v0.12