diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 150 | ||||
-rw-r--r-- | src/H5AC.c | 10 | ||||
-rw-r--r-- | src/H5D.c | 2 | ||||
-rw-r--r-- | src/H5Distore.c | 2 | ||||
-rw-r--r-- | src/H5E.c | 2 | ||||
-rw-r--r-- | src/H5F.c | 74 | ||||
-rw-r--r-- | src/H5Ffamily.c | 2 | ||||
-rw-r--r-- | src/H5Fistore.c | 2 | ||||
-rw-r--r-- | src/H5Flow.c | 4 | ||||
-rw-r--r-- | src/H5Fpublic.h | 4 | ||||
-rw-r--r-- | src/H5Fsec2.c | 14 | ||||
-rw-r--r-- | src/H5Fsplit.c | 24 | ||||
-rw-r--r-- | src/H5Fstdio.c | 30 | ||||
-rw-r--r-- | src/H5G.c | 12 | ||||
-rw-r--r-- | src/H5Gnode.c | 4 | ||||
-rw-r--r-- | src/H5HG.c | 4 | ||||
-rw-r--r-- | src/H5I.c | 74 | ||||
-rw-r--r-- | src/H5Iprivate.h | 34 | ||||
-rw-r--r-- | src/H5Ipublic.h | 12 | ||||
-rw-r--r-- | src/H5O.c | 2 | ||||
-rw-r--r-- | src/H5Ocomp.c | 8 | ||||
-rw-r--r-- | src/H5Odtype.c | 2 | ||||
-rw-r--r-- | src/H5Oefl.c | 24 | ||||
-rw-r--r-- | src/H5Omtime.c | 14 | ||||
-rw-r--r-- | src/H5Oname.c | 6 | ||||
-rw-r--r-- | src/H5P.c | 20 | ||||
-rw-r--r-- | src/H5S.c | 7 | ||||
-rw-r--r-- | src/H5Shyper.c | 10 | ||||
-rw-r--r-- | src/H5Tbit.c | 4 | ||||
-rw-r--r-- | src/H5Tconv.c | 30 | ||||
-rw-r--r-- | src/H5V.c | 2 | ||||
-rw-r--r-- | src/H5Z.c | 4 | ||||
-rw-r--r-- | src/H5private.h | 2 |
33 files changed, 296 insertions, 299 deletions
@@ -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 (i<sizeof pkg_name) pkg_name[i] = *s; } pkg_name[MIN(sizeof(pkg_name)-1, i)] = '\0'; /* Trace, all, or one? */ - if (!strcmp(pkg_name, "trace")) { + if (!HDstrcmp(pkg_name, "trace")) { H5_debug_g.trace = clear?NULL:stream; - } else if (!strcmp(pkg_name, "all")) { + } else if (!HDstrcmp(pkg_name, "all")) { for (i=0; i<H5_NPKGS; i++) { H5_debug_g.pkg[i].stream = clear?NULL:stream; } } else { for (i=0; i<H5_NPKGS; i++) { - if (!strcmp(H5_debug_g.pkg[i].name, pkg_name)) { + if (!HDstrcmp(H5_debug_g.pkg[i].name, pkg_name)) { H5_debug_g.pkg[i].stream = clear?NULL:stream; break; } @@ -388,10 +388,10 @@ H5_debug_mask(const char *s) } } - } else if (isdigit(*s)) { + } else if (HDisdigit(*s)) { int fd = (int)HDstrtol (s, &rest, 0); if ((stream=HDfdopen(fd, "w"))) { - setvbuf (stream, NULL, _IOLBF, 0); + HDsetvbuf (stream, NULL, _IOLBF, 0); } s = rest; } else { @@ -469,16 +469,16 @@ H5check_version (unsigned majnum, unsigned minnum, unsigned relnum) if (H5_VERS_MAJOR!=majnum || H5_VERS_MINOR!=minnum || H5_VERS_RELEASE!=relnum) { - fputs ("Warning! The HDF5 header files included by this application " - "do not match the\nversion used by the HDF5 library to which " - "this application is linked. Data\ncorruption or segmentation " - "faults would be likely if the application were\nallowed to " - "continue.\n", stderr); + HDfputs ("Warning! The HDF5 header files included by this application " + "do not match the\nversion used by the HDF5 library to which " + "this application is linked. Data\ncorruption or " + "segmentation faults would be likely if the application " + "were\nallowed to continue.\n", stderr); fprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", majnum, minnum, relnum, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); - fputs ("Bye...\n", stderr); - abort (); + HDfputs ("Bye...\n", stderr); + HDabort (); } return SUCCEED; } @@ -599,14 +599,14 @@ HDfprintf (FILE *stream, const char *fmt, ...) modifier[0] = '\0'; if ('%'==fmt[0] && '%'==fmt[1]) { - putc ('%', stream); + HDputc ('%', stream); fmt += 2; nout++; } else if ('%'==fmt[0]) { s = fmt+1; /* Flags */ - while (strchr ("-+ #", *s)) { + while (HDstrchr ("-+ #", *s)) { switch (*s) { case '-': leftjust = 1; @@ -625,9 +625,9 @@ HDfprintf (FILE *stream, const char *fmt, ...) } /* Field width */ - if (isdigit (*s)) { + if (HDisdigit (*s)) { zerofill = ('0'==*s); - fwidth = (int)strtol (s, &rest, 10); + fwidth = (int)HDstrtol (s, &rest, 10); s = rest; } else if ('*'==*s) { fwidth = va_arg (ap, int); @@ -641,8 +641,8 @@ HDfprintf (FILE *stream, const char *fmt, ...) /* Precision */ if ('.'==*s) { s++; - if (isdigit (*s)) { - prec = (int)strtol (s, &rest, 10); + if (HDisdigit (*s)) { + prec = (int)HDstrtol (s, &rest, 10); s = rest; } else if ('*'==*s) { prec = va_arg (ap, int); @@ -652,20 +652,20 @@ HDfprintf (FILE *stream, const char *fmt, ...) } /* Type modifier */ - if (strchr ("ZHhlq", *s)) { + if (HDstrchr ("ZHhlq", *s)) { switch (*s) { case 'H': if (sizeof(hsize_t)==sizeof(long)) { - strcpy (modifier, "l"); + HDstrcpy (modifier, "l"); } else if (sizeof(hsize_t)==sizeof(long long)) { - strcpy (modifier, PRINTF_LL_WIDTH); + HDstrcpy (modifier, PRINTF_LL_WIDTH); } break; case 'Z': if (sizeof(size_t)==sizeof(long)) { - strcpy (modifier, "l"); + HDstrcpy (modifier, "l"); } else if (sizeof(size_t)==sizeof(long long)) { - strcpy (modifier, PRINTF_LL_WIDTH); + HDstrcpy (modifier, PRINTF_LL_WIDTH); } else if (sizeof(size_t)==sizeof(int)) { modifier[0] = '\0'; } @@ -687,28 +687,28 @@ HDfprintf (FILE *stream, const char *fmt, ...) leftjust?"-":"", plussign?"+":"", ldspace?" ":"", prefix?"#":"", zerofill?"0":""); if (fwidth>0) { - 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; i<NELMTS(asize); i++) asize[i] = -1; /* Parse the argument types */ - for (argno=0; *type; argno++, type+=isupper(*type)?2:1) { + for (argno=0; *type; argno++, type+=HDisupper(*type)?2:1) { /* Count levels of indirection */ for (ptr=0; '*'==*type; type++) ptr++; if ('['==*type) { if ('a'==type[1]) { - asize_idx = (int)strtol(type+2, &rest, 10); + asize_idx = (int)HDstrtol(type+2, &rest, 10); assert(']'==*rest); type = rest+1; } else { - rest = strchr(type, ']'); + rest = HDstrchr(type, ']'); assert(rest); type = rest+1; asize_idx = -1; @@ -1199,9 +1199,9 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) */ argname = va_arg (ap, char*); if (argname) { - n = MAX (0, (int)strlen(argname)-3); - if (!strcmp (argname+n, "_id")) { - strncpy (buf, argname, MIN ((int)sizeof(buf)-1, n)); + n = MAX (0, (int)HDstrlen(argname)-3); + if (!HDstrcmp (argname+n, "_id")) { + HDstrncpy (buf, argname, MIN ((int)sizeof(buf)-1, n)); buf[MIN((int)sizeof(buf)-1, n)] = '\0'; argname = buf; } @@ -1536,7 +1536,7 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) break; case H5_FILE: fprintf(out, "%ld", (long)obj); - if (strcmp (argname, "file")) { + if (HDstrcmp (argname, "file")) { fprintf (out, " (file)"); } break; @@ -1549,13 +1549,13 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) case H5_TEMPLATE_6: case H5_TEMPLATE_7: fprintf(out, "%ld", (long)obj); - if (strcmp (argname, "plist")) { + if (HDstrcmp (argname, "plist")) { fprintf (out, " (plist)"); } break; case H5_GROUP: fprintf(out, "%ld", (long)obj); - if (strcmp (argname, "group")) { + if (HDstrcmp (argname, "group")) { fprintf (out, " (group)"); } break; @@ -1648,14 +1648,14 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) fprintf(out, "H5T_FORTRAN_S1"); } else { fprintf(out, "%ld", (long)obj); - if (strcmp (argname, "type")) { + if (HDstrcmp (argname, "type")) { fprintf (out, " (type)"); } } break; case H5_DATASPACE: fprintf(out, "%ld", (long)obj); - if (strcmp (argname, "space")) { + if (HDstrcmp (argname, "space")) { fprintf (out, " (space)"); } /*Save the rank of simple data spaces for arrays*/ @@ -1668,25 +1668,25 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) break; case H5_DATASET: fprintf(out, "%ld", (long)obj); - if (strcmp (argname, "dset")) { + if (HDstrcmp (argname, "dset")) { fprintf (out, " (dset)"); } break; case H5_ATTR: fprintf(out, "%ld", (long)obj); - if (strcmp (argname, "attr")) { + if (HDstrcmp (argname, "attr")) { fprintf (out, " (attr)"); } break; case H5_TEMPBUF: fprintf(out, "%ld", (long)obj); - if (strcmp(argname, "tbuf")) { + if (HDstrcmp(argname, "tbuf")) { fprintf(out, " (tbuf"); } break; case H5_RAGGED: fprintf(out, "%ld", (long)obj); - if (strcmp(argname, "array")) { + if (HDstrcmp(argname, "array")) { fprintf(out, " (array)"); } break; @@ -2221,7 +2221,7 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) break; default: - if (isupper (type[0])) { + if (HDisupper (type[0])) { fprintf (out, "BADTYPE(%c%c)", type[0], type[1]); } else { fprintf (out, "BADTYPE(%c)", type[0]); @@ -2237,7 +2237,7 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) } else { fprintf (out, ")"); } - fflush (out); + HDfflush (out); return; } @@ -869,19 +869,19 @@ H5AC_debug(H5F_t __unused__ *f) switch (i) { case H5AC_BT_ID: - strcpy(s, "B-tree nodes"); + HDstrcpy(s, "B-tree nodes"); break; case H5AC_SNODE_ID: - strcpy(s, "symbol table nodes"); + HDstrcpy(s, "symbol table nodes"); break; case H5AC_LHEAP_ID: - strcpy (s, "local heaps"); + HDstrcpy (s, "local heaps"); break; case H5AC_GHEAP_ID: - strcpy (s, "global heaps"); + HDstrcpy (s, "global heaps"); break; case H5AC_OHDR_ID: - strcpy(s, "object headers"); + HDstrcpy(s, "object headers"); break; default: sprintf(s, "unknown id %d", i); @@ -978,7 +978,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, if (efl->nused>0) { size_t heap_size = H5HL_ALIGN (1); for (i=0; i<efl->nused; 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; i<udata->mesg.ndims; i++) { HDfprintf (stream, "%s%Hd", i?", ":"", key->offset[i]); } - fputs ("}\n", stream); + HDfputs ("}\n", stream); FUNC_LEAVE (SUCCEED); } @@ -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); @@ -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; i<udata->mesg.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); @@ -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); @@ -952,12 +952,12 @@ H5HG_debug(H5F_t *f, const haddr_t *addr, FILE *stream, intn indent, if (j+k<size) { fprintf (stream, "%02x ", p[j+k]); } else { - fputs (" ", stream); + HDfputs(" ", stream); } } for (k=0; k<16 && j+k<size; k++) { if (8==k) fprintf (stream, " "); - fputc (p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream); + HDfputc(p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream); } fprintf (stream, "\n"); } @@ -63,11 +63,58 @@ static char RcsId[] = "@(#)$Revision$"; #include <H5Eprivate.h> #include <H5MMprivate.h> +/* 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)<<ID_BITS)| \ + ((hid_t)(i)&ID_MASK)) + +#ifdef IDS_ARE_CACHED /* Array of pointers to ID groups */ static hid_t H5I_id_cache[ID_CACHE_SIZE] = {-1, -1, -1, -1}; static void *H5I_obj_cache[ID_CACHE_SIZE]; @@ -79,11 +126,6 @@ static H5I_id_group_t *id_group_list[MAXGROUP]; /* Pointer to the atom node free list */ static H5I_id_info_t *id_free_list = NULL; -/* Interface initialialization? */ -static hbool_t interface_initialize_g = FALSE; -#define INTERFACE_INIT H5I_init_interface -static herr_t H5I_init_interface(void); - /*--------------------- Local function prototypes ---------------------------*/ static H5I_id_info_t *H5I_find_id(hid_t id); static H5I_id_info_t *H5I_get_id_node(void); @@ -261,7 +303,7 @@ H5I_destroy_group(H5I_group_t grp) * Remove atoms from the global atom cache. */ for (i=0; i<ID_CACHE_SIZE; i++) { - if (ID_TO_GROUP(H5I_id_cache[i]) == grp) { + if (H5I_GROUP(H5I_id_cache[i]) == grp) { H5I_id_cache[i] = (-1); H5I_obj_cache[i] = NULL; } @@ -334,7 +376,7 @@ H5I_register(H5I_group_t grp, /* IN: Group to register the object in */ HGOTO_DONE(FAIL); /* Create the struct & it's ID */ - new_id = MAKE_ID(grp, grp_ptr->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 <H5private.h> -/* 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)<<ID_BITS)| \ - ((hid_t)(i)&ID_MASK)) - #ifdef __cplusplus extern "C" { #endif @@ -1290,7 +1290,7 @@ static herr_t H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force) { intn idx; - time_t now = time(NULL); + time_t now = HDtime(NULL); size_t size; FUNC_ENTER(H5O_touch_oh, FAIL); diff --git a/src/H5Ocomp.c b/src/H5Ocomp.c index 1b959a1..3f6ff54 100644 --- a/src/H5Ocomp.c +++ b/src/H5Ocomp.c @@ -112,7 +112,7 @@ H5O_pline_decode(H5F_t __unused__ *f, const uint8 *p, * should be, but to be safe...) */ pline->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<to_read) { HDmemset (buf+n, 0, to_read-n); } - close (fd); + HDclose (fd); fd = -1; size -= to_read; buf += to_read; @@ -472,7 +472,7 @@ H5O_efl_read (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); } @@ -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); } @@ -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'; } @@ -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; i<num_reg; i++) { if(ret_value[curr_reg].start!=ret_value[i].start && ret_value[curr_reg].end!=ret_value[i].end) { @@ -1977,8 +1977,10 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src) /* Sort the boundary arrays */ for(i=0; i<src->extent.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: @@ -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); @@ -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() |