diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index 548e7b83d2e..371d48752c9 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -339,7 +339,7 @@ H5C__json_write_start_log_msg(void *udata) \"action\":\"logging start\"\ },\n\ ", - (long long)HDtime(NULL)); + (long long)time(NULL)); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -378,7 +378,7 @@ H5C__json_write_stop_log_msg(void *udata) }\n\ ]}\n\ ", - (long long)HDtime(NULL)); + (long long)time(NULL)); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -417,7 +417,7 @@ H5C__json_write_create_cache_log_msg(void *udata, herr_t fxn_ret_value) \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (int)fxn_ret_value); + (long long)time(NULL), (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -455,7 +455,7 @@ H5C__json_write_destroy_cache_log_msg(void *udata) \"action\":\"destroy\"\ },\n\ ", - (long long)HDtime(NULL)); + (long long)time(NULL)); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -494,7 +494,7 @@ H5C__json_write_evict_cache_log_msg(void *udata, herr_t fxn_ret_value) \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (int)fxn_ret_value); + (long long)time(NULL), (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -535,7 +535,7 @@ H5C__json_write_expunge_entry_log_msg(void *udata, haddr_t address, int type_id, \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)address, (int)type_id, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)address, (int)type_id, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -574,7 +574,7 @@ H5C__json_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (int)fxn_ret_value); + (long long)time(NULL), (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -618,7 +618,7 @@ H5C__json_write_insert_entry_log_msg(void *udata, haddr_t address, int type_id, \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)address, type_id, flags, (int)size, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)address, type_id, flags, (int)size, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -659,7 +659,7 @@ H5C__json_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t *e \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -700,7 +700,7 @@ H5C__json_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t *e \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -742,7 +742,7 @@ H5C__json_write_mark_unserialized_entry_log_msg(void *udata, const H5C_cache_ent \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -784,7 +784,7 @@ H5C__json_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entry \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -827,7 +827,7 @@ H5C__json_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_ad \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)old_addr, (unsigned long)new_addr, type_id, + (long long)time(NULL), (unsigned long)old_addr, (unsigned long)new_addr, type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -869,7 +869,7 @@ H5C__json_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, h \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -914,7 +914,7 @@ H5C__json_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, + (long long)time(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -966,7 +966,7 @@ H5C__json_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entr \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, type_id, rw_s, (int)entry->size, + (long long)time(NULL), (unsigned long)entry->addr, type_id, rw_s, (int)entry->size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1010,7 +1010,7 @@ H5C__json_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, (int)new_size, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)entry->addr, (int)new_size, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -1051,7 +1051,7 @@ H5C__json_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -1096,7 +1096,7 @@ H5C__json_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, + (long long)time(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1140,7 +1140,7 @@ H5C__json_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_i \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)address, type_id, flags, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)address, type_id, flags, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -1181,7 +1181,7 @@ H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (int)fxn_ret_value); + (long long)time(NULL), (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) @@ -1222,7 +1222,7 @@ H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry \"returned\":%d\ },\n\ ", - (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); + (long long)time(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__json_write_log_message(json_udata) < 0) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 307629f7718..84a0f25356f 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1184,8 +1184,8 @@ H5D__piece_io(H5D_io_info_t *io_info) HGOTO_ERROR(H5E_IO, H5E_OPENERROR, FAIL, "couldn't open debugging log file"); /* Print a short header for this I/O operation */ - time_now = HDtime(NULL); - fprintf(debug_log_file, "##### %s", HDasctime(HDlocaltime(&time_now))); + time_now = time(NULL); + fprintf(debug_log_file, "##### %s", asctime(localtime(&time_now))); debug_stream = debug_log_file; } diff --git a/src/H5FDcore.c b/src/H5FDcore.c index c74ef5ed28a..f6967e3e3be 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -391,7 +391,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) if (-1 == bytes_wrote) { /* error */ int myerrno = errno; - time_t mytime = HDtime(NULL); + time_t mytime = time(NULL); offset = HDlseek(file->fd, 0, SEEK_CUR); @@ -399,7 +399,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, " "errno = %d, error message = '%s', ptr = %p, total write size = %llu, bytes this " "sub-write = %llu, bytes actually written = %llu, offset = %llu", - HDctime(&mytime), file->name, file->fd, myerrno, strerror(myerrno), (void *)ptr, + ctime(&mytime), file->name, file->fd, myerrno, strerror(myerrno), (void *)ptr, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ @@ -900,7 +900,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr if (-1 == bytes_read) { /* error */ int myerrno = errno; - time_t mytime = HDtime(NULL); + time_t mytime = time(NULL); offset = HDlseek(file->fd, 0, SEEK_CUR); @@ -909,7 +909,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " "error message = '%s', file->mem = %p, total read size = %llu, bytes this " "sub-read = %llu, bytes actually read = %llu, offset = %llu", - HDctime(&mytime), file->name, file->fd, myerrno, strerror(myerrno), + ctime(&mytime), file->name, file->fd, myerrno, strerror(myerrno), (void *)file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 677382552e8..c85a6725ec9 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -1228,7 +1228,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had if (-1 == bytes_read) { /* error */ int myerrno = errno; - time_t mytime = HDtime(NULL); + time_t mytime = time(NULL); offset = HDlseek(file->fd, 0, SEEK_CUR); @@ -1240,7 +1240,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " "error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, " "bytes actually read = %llu, offset = %llu", - HDctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, + ctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } @@ -1447,7 +1447,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha if (-1 == bytes_wrote) { /* error */ int myerrno = errno; - time_t mytime = HDtime(NULL); + time_t mytime = time(NULL); offset = HDlseek(file->fd, 0, SEEK_CUR); @@ -1459,7 +1459,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " "error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = " "%llu, bytes actually written = %llu, offset = %llu", - HDctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, + ctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ diff --git a/src/H5FDonion.c b/src/H5FDonion.c index 65b7fa51dd8..516295bad5d 100644 --- a/src/H5FDonion.c +++ b/src/H5FDonion.c @@ -462,8 +462,8 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) FUNC_ENTER_PACKAGE - HDtime(&rawtime); - info = HDgmtime(&rawtime); + time(&rawtime); + info = gmtime(&rawtime); strftime(rec->time_of_creation, sizeof(rec->time_of_creation), "%Y%m%dT%H%M%SZ", info); rec->logical_eof = file->logical_eof; diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index 2b7b5419c61..f5be8f42f97 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -1598,8 +1598,8 @@ gmnow(void) struct tm *ret_value = NULL; /* Doctor assert, checks against error in time() */ - if ((time_t)(-1) != HDtime(now_ptr)) - ret_value = HDgmtime(now_ptr); + if ((time_t)(-1) != time(now_ptr)) + ret_value = gmtime(now_ptr); assert(ret_value != NULL); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 274a8ad3462..01a4bfd235e 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -695,7 +695,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if (-1 == bytes_read) { /* error */ int myerrno = errno; - time_t mytime = HDtime(NULL); + time_t mytime = time(NULL); offset = HDlseek(file->fd, 0, SEEK_CUR); @@ -703,7 +703,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " "error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, " "bytes actually read = %llu, offset = %llu", - HDctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, + ctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ @@ -801,7 +801,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN if (-1 == bytes_wrote) { /* error */ int myerrno = errno; - time_t mytime = HDtime(NULL); + time_t mytime = time(NULL); offset = HDlseek(file->fd, 0, SEEK_CUR); @@ -809,7 +809,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " "error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = " "%llu, bytes actually written = %llu, offset = %llu", - HDctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, + ctime(&mytime), file->filename, file->fd, myerrno, strerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ diff --git a/src/H5Odbg.c b/src/H5Odbg.c index dfc8e878d8f..78bace66392 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -307,16 +307,16 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int char buf[128]; /* Buffer for formatting time info */ /* Time fields */ - tm = HDlocaltime(&oh->atime); + tm = localtime(&oh->atime); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Access Time:", buf); - tm = HDlocaltime(&oh->mtime); + tm = localtime(&oh->mtime); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Modification Time:", buf); - tm = HDlocaltime(&oh->ctime); + tm = localtime(&oh->ctime); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Change Time:", buf); - tm = HDlocaltime(&oh->btime); + tm = localtime(&oh->btime); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Birth Time:", buf); } /* end if */ diff --git a/src/H5Omtime.c b/src/H5Omtime.c index cd7fba4c05f..66f8d1bf4d4 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -271,7 +271,7 @@ H5O__mtime_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, s assert(mesg); /* encode */ - tm = HDgmtime(mesg); + tm = gmtime(mesg); snprintf((char *)p, p_size, "%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); @@ -415,7 +415,7 @@ H5O__mtime_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int i assert(fwidth >= 0); /* debug */ - tm = HDlocaltime(mesg); + tm = localtime(mesg); strftime(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/H5private.h b/src/H5private.h index 904aa9f3652..e0148f43d70 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -685,15 +685,9 @@ typedef off_t h5_stat_size_t; #ifndef HDaccess #define HDaccess(F, M) access(F, M) #endif -#ifndef HDasctime -#define HDasctime(T) asctime(T) -#endif #ifndef HDchdir #define HDchdir(S) chdir(S) #endif -#ifndef HDclock -#define HDclock() clock() -#endif #ifndef HDclose #define HDclose(F) close(F) #endif @@ -703,12 +697,6 @@ typedef off_t h5_stat_size_t; #ifndef HDcreat #define HDcreat(S, M) creat(S, M) #endif -#ifndef HDctime -#define HDctime(T) ctime(T) -#endif -#ifndef HDdifftime -#define HDdifftime(X, Y) difftime(X, Y) -#endif #ifndef HDfdopen #define HDfdopen(N, S) fdopen(N, S) #endif @@ -771,15 +759,9 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDgettimeofday #define HDgettimeofday(S, P) gettimeofday(S, P) #endif -#ifndef HDgmtime -#define HDgmtime(T) gmtime(T) -#endif #ifndef HDisatty #define HDisatty(F) isatty(F) #endif -#ifndef HDlocaltime -#define HDlocaltime(T) localtime(T) -#endif #ifndef HDlseek #define HDlseek(F, O, W) lseek(F, O, W) #endif @@ -789,9 +771,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDmkdir #define HDmkdir(S, M) mkdir(S, M) #endif -#ifndef HDmktime -#define HDmktime(T) mktime(T) -#endif #ifndef HDnanosleep #define HDnanosleep(N, O) nanosleep(N, O) #endif @@ -911,9 +890,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDstrtok_r #define HDstrtok_r(X, Y, Z) strtok_r(X, Y, Z) #endif -#ifndef HDtime -#define HDtime(T) time(T) -#endif #ifndef HDtmpfile #define HDtmpfile() tmpfile() #endif @@ -923,9 +899,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDtoupper #define HDtoupper(C) toupper(C) #endif -#ifndef HDtzset -#define HDtzset() tzset() -#endif #ifndef HDunlink #define HDunlink(S) unlink(S) #endif diff --git a/src/H5system.c b/src/H5system.c index 7c540e5bf6b..1379fa7dc95 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -223,12 +223,12 @@ H5_make_time(struct tm *tm) /* Initialize timezone information */ if (!H5_ntzset) { - HDtzset(); + tzset(); H5_ntzset = true; - } /* end if */ + } /* Perform base conversion */ - if ((time_t)-1 == (the_time = HDmktime(tm))) + if ((time_t)-1 == (the_time = mktime(tm))) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCONVERT, FAIL, "badly formatted modification time message"); /* Adjust for timezones */ diff --git a/src/H5timer.c b/src/H5timer.c index ac04d157fe9..badbc659213 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -156,7 +156,7 @@ H5_now(void) now = now_tv.tv_sec; } #else /* H5_HAVE_GETTIMEOFDAY */ - now = HDtime(NULL); + now = time(NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ return (now); @@ -200,7 +200,7 @@ H5_now_usec(void) #else /* H5_HAVE_GETTIMEOFDAY */ /* Cast all values in this expression to uint64_t to ensure that all intermediate calculations * are done in 64 bit, to prevent overflow */ - now = ((uint64_t)HDtime(NULL) * ((uint64_t)1000 * (uint64_t)1000)); + now = ((uint64_t)time(NULL) * ((uint64_t)1000 * (uint64_t)1000)); #endif /* H5_HAVE_GETTIMEOFDAY */ return (now); @@ -238,7 +238,7 @@ H5_get_time(void) ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / 1000000.0); } #else - ret_value = (double)HDtime(NULL); + ret_value = (double)time(NULL); #endif FUNC_LEAVE_NOAPI(ret_value) diff --git a/test/API/H5_api_test.c b/test/API/H5_api_test.c index ff7ede34038..63dd095fa0f 100644 --- a/test/API/H5_api_test.c +++ b/test/API/H5_api_test.c @@ -143,7 +143,7 @@ main(int argc, char **argv) n_tests_failed_g = 0; n_tests_skipped_g = 0; - seed = (unsigned)HDtime(NULL); + seed = (unsigned)time(NULL); srand(seed); if (NULL == (test_path_prefix = getenv(HDF5_API_TEST_PATH_PREFIX))) diff --git a/test/accum.c b/test/accum.c index cabd4a84c7c..ac9754bf4b9 100644 --- a/test/accum.c +++ b/test/accum.c @@ -1920,7 +1920,7 @@ test_random_write(H5F_t *f) TESTING("random writes to accumulator"); /* Choose random # seed */ - seed = (unsigned)HDtime(NULL); + seed = (unsigned)time(NULL); #if 0 /* seed = (unsigned)1155438845; */ fprintf(stderr, "Random # seed was: %u\n", seed); diff --git a/test/app_ref.c b/test/app_ref.c index 1315f03c86b..7c4fe3e0f50 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -89,7 +89,7 @@ main(void) h5_reset(); h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename); - HDsrand((unsigned)HDtime(NULL)); + HDsrand((unsigned)time(NULL)); TESTING("library shutdown with reference count > 1"); diff --git a/test/big.c b/test/big.c index 03c7dd5246f..cf8a3f2ef38 100644 --- a/test/big.c +++ b/test/big.c @@ -752,7 +752,7 @@ main(int ac, char **av) sparse_support = is_sparse(); /* Choose random # seed */ - seed = (unsigned long)HDtime(NULL); + seed = (unsigned long)time(NULL); #if 0 /* seed = (unsigned long)1155438845; */ fprintf(stderr, "Random # seed was: %lu\n", seed); diff --git a/test/btree2.c b/test/btree2.c index fc7748c7b27..a44a2475732 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -2903,7 +2903,7 @@ test_insert_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t herr_t ret; /* Generic error return value */ /* Initialize random number seed */ - curr_time = HDtime(NULL); + curr_time = time(NULL); #if 0 curr_time=1109170019; fprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); @@ -4973,7 +4973,7 @@ test_update_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t herr_t ret; /* Generic error return value */ /* Initialize random number seed */ - curr_time = HDtime(NULL); + curr_time = time(NULL); #if 0 curr_time = 1451342093; fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); @@ -8619,7 +8619,7 @@ test_remove_lots(const char *driver_name, hid_t fapl, const H5B2_create_t *cpara bool single_file_vfd; /* Whether VFD used stores data in a single file */ /* Initialize random number seed */ - curr_time = HDtime(NULL); + curr_time = time(NULL); #if 0 curr_time = 1163537969; fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 227b0c3bae9..383ed7f1b5a 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -2831,7 +2831,7 @@ test_pack_ooo(void) * the compound */ unsigned i, j; /* Indices */ - HDsrand((unsigned)HDtime(NULL)); + HDsrand((unsigned)time(NULL)); /* Initialize "free_order" array to indicate that all slots in order are * free */ diff --git a/test/dsets.c b/test/dsets.c index 3cc9ccbeae6..ca985a85ec6 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -15921,7 +15921,7 @@ main(void) contig_addr_vfd = (bool)(strcmp(driver_name, "split") != 0 && strcmp(driver_name, "multi") != 0); /* Set the random # seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); /* Initialize global arrays */ /* points */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 3a91ef19a14..62f03aaa4b4 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -5978,7 +5978,7 @@ main(void) unsigned long nerrors = 0; /* Set the random # seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); reset_hdf5(); diff --git a/test/dtypes.c b/test/dtypes.c index a7a518e7e88..51dbf123fe0 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -10129,7 +10129,7 @@ main(void) hid_t fapl = H5I_INVALID_HID; /* Set the random # seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); reset_hdf5(); fapl = h5_fileaccess(); diff --git a/test/earray.c b/test/earray.c index 9cea8f4560a..3770ac44765 100644 --- a/test/earray.c +++ b/test/earray.c @@ -2317,7 +2317,7 @@ main(void) api_ctx_pushed = true; /* Seed random #'s */ - curr_time = HDtime(NULL); + curr_time = time(NULL); HDsrandom((unsigned)curr_time); /* Create an empty file to retrieve size */ diff --git a/test/farray.c b/test/farray.c index 791cb549f1b..a8f4352c984 100644 --- a/test/farray.c +++ b/test/farray.c @@ -1648,7 +1648,7 @@ main(void) api_ctx_pushed = true; /* Seed random #'s */ - curr_time = HDtime(NULL); + curr_time = time(NULL); HDsrandom((unsigned)curr_time); /* Create an empty file to retrieve size */ diff --git a/test/fheap.c b/test/fheap.c index cd1f0c5ec1f..0784aa775e9 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -6234,7 +6234,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa fill_size = get_fill_size(tparam); /* Choose random # seed */ - seed = (unsigned long)HDtime(NULL); + seed = (unsigned long)time(NULL); #if 0 /* seed = (unsigned long)1155438845; */ fprintf(stderr, "Random # seed was: %lu\n", seed); @@ -15142,7 +15142,7 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa } /* end else */ /* Choose random # seed */ - seed = (unsigned long)HDtime(NULL); + seed = (unsigned long)time(NULL); #if 0 /* seed = (unsigned long)1156158635; */ fprintf(stderr, "Random # seed was: %lu\n", seed); @@ -15345,7 +15345,7 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te } /* end else */ /* Choose random # seed */ - seed = (unsigned long)HDtime(NULL); + seed = (unsigned long)time(NULL); #if 0 /* seed = (unsigned long)1155181717; */ fprintf(stderr, "Random # seed was: %lu\n", seed); diff --git a/test/h5test.c b/test/h5test.c index ba68918c2a1..a472dc9d5c5 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1820,18 +1820,18 @@ h5_wait_message(const char *waitfor) /* Start timer. If this function runs for too long (i.e., expected signal is never received), it will return failure */ - HDtime(&t0); + time(&t0); /* Wait for return signal from some other process */ while ((returnfile = fopen(waitfor, "r")) == NULL) { /* make note of current time. */ - HDtime(&t1); + time(&t1); /* If we've been waiting for a signal for too long, then it was likely never sent and we should fail rather than loop infinitely */ - if (HDdifftime(t1, t0) > MESSAGE_TIMEOUT) { + if (difftime(t1, t0) > MESSAGE_TIMEOUT) { fprintf(stdout, "Error communicating between processes. Make sure test script is running.\n"); TEST_ERROR; } /* end if */ diff --git a/test/hyperslab.c b/test/hyperslab.c index 03b0e9a152b..da014d30355 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -1144,7 +1144,7 @@ main(int argc, char *argv[]) printf("\n"); /* Set the random # seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); /* * Open the library explicitly for thread-safe builds, so per-thread diff --git a/test/istore.c b/test/istore.c index 2062e9486b4..5a1fa0ff498 100644 --- a/test/istore.c +++ b/test/istore.c @@ -582,7 +582,7 @@ main(int argc, char *argv[]) printf("\n"); /* Set the random # seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); /* Check to see if the file system supports POSIX-style sparse files. * Windows NTFS does not, so we want to avoid tests which create diff --git a/test/links.c b/test/links.c index 4ea612ebdfd..ffac35651de 100644 --- a/test/links.c +++ b/test/links.c @@ -1770,8 +1770,8 @@ test_move_preserves(hid_t fapl_id, bool new_format) old_modification_time = oinfo.mtime; /* If this test happens too quickly, the times will all be the same. Make sure the time changes. */ - curr_time = HDtime(NULL); - while (HDtime(NULL) <= curr_time) + curr_time = time(NULL); + while (time(NULL) <= curr_time) ; /* Close the file and reopen it */ @@ -2603,8 +2603,8 @@ test_move_preserves_deprec(hid_t fapl_id, bool new_format) old_modification_time = oinfo.mtime; /* If this test happens too quickly, the times will all be the same. Make sure the time changes. */ - curr_time = HDtime(NULL); - while (HDtime(NULL) <= curr_time) + curr_time = time(NULL); + while (time(NULL) <= curr_time) ; /* Close the file and reopen it */ diff --git a/test/mdset.c b/test/mdset.c index 013eb775553..145618b60ea 100644 --- a/test/mdset.c +++ b/test/mdset.c @@ -646,7 +646,7 @@ main(void) fapl_id = h5_fileaccess(); /* Initialize random number seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); /* Fill dset_name array */ for (i = 0; i < MAX_DSETS; i++) { diff --git a/test/mtime.c b/test/mtime.c index 60bfaaaadc7..fad164b9e9c 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -64,7 +64,7 @@ main(void) TEST_ERROR; if ((dset = H5Dcreate2(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; - now = HDtime(NULL); + now = time(NULL); if (H5Dclose(dset) < 0) TEST_ERROR; if (H5Sclose(space) < 0) @@ -110,11 +110,11 @@ main(void) puts(" cannot be queried on this system. See H5O_mtime_decode()."); return 0; } - else if (fabs(HDdifftime(now, oi1.ctime)) > 60.0) { + else if (fabs(difftime(now, oi1.ctime)) > 60.0) { H5_FAILED(); - tm = HDlocaltime(&(oi1.ctime)); + tm = localtime(&(oi1.ctime)); strftime((char *)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm); - tm = HDlocaltime(&now); + tm = localtime(&now); strftime((char *)buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm); printf(" got: %s\n ans: %s\n", buf1, buf2); goto error; diff --git a/test/set_extent.c b/test/set_extent.c index 018421df45f..1db56bab6b9 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -119,7 +119,7 @@ main(void) contig_addr_vfd = (bool)(strcmp(driver_name, "split") != 0 && strcmp(driver_name, "multi") != 0); /* Initialize random number seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); h5_reset(); fapl = h5_fileaccess(); diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 18f204dee31..91057703e27 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -267,7 +267,7 @@ read_records(const char *filename, bool verbose, FILE *verbose_file, unsigned ra fprintf(verbose_file, "Reading records\n"); /* Get the starting time */ - start_time = HDtime(NULL); + start_time = time(NULL); curr_time = start_time; /* Create file access property list */ @@ -336,7 +336,7 @@ read_records(const char *filename, bool verbose, FILE *verbose_file, unsigned ra HDsleep(poll_time); /* Retrieve the current time */ - curr_time = HDtime(NULL); + curr_time = time(NULL); } /* end while */ /* Close the memory dataspace */ diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 614aed2cfa6..8cf22c3debc 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -262,7 +262,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, uns fprintf(stderr, "Reading records\n"); /* Get the starting time */ - start_time = HDtime(NULL); + start_time = time(NULL); curr_time = start_time; /* Create file access property list */ @@ -322,7 +322,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, uns HDsleep(poll_time); /* Retrieve the current time */ - curr_time = HDtime(NULL); + curr_time = time(NULL); } /* end while */ /* Close the fapl */ diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index a6d8fd49d38..695ca273b40 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -220,7 +220,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns fprintf(stderr, "Reading records\n"); /* Get the starting time */ - start_time = HDtime(NULL); + start_time = time(NULL); /* Read records */ for (u = 0; u < nrecords; u++) { @@ -257,7 +257,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns } /* end if */ /* Check for timeout */ - if (HDtime(NULL) >= (time_t)(start_time + (time_t)TIMEOUT)) { + if (time(NULL) >= (time_t)(start_time + (time_t)TIMEOUT)) { fprintf(stderr, "Reader timed out\n"); return -1; } /* end if */ diff --git a/test/tid.c b/test/tid.c index bf557fa34da..ccc61ba854d 100644 --- a/test/tid.c +++ b/test/tid.c @@ -1373,7 +1373,7 @@ void test_ids(void) { /* Set the random # seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n"); diff --git a/test/tselect.c b/test/tselect.c index e07b1b62dfb..b545eec0324 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -6362,21 +6362,17 @@ test_select_hyper_union_random_5d(hid_t read_plist) CHECK(sid2, FAIL, "H5Screate_simple"); /* Get initial random # seed */ - seed = (unsigned)HDtime(NULL) + (unsigned)HDclock(); + seed = (unsigned)time(NULL); + HDsrandom(seed); /* Crunch through a bunch of random hyperslab reads from the file dataset */ for (test_num = 0; test_num < NRAND_HYPER; test_num++) { - /* Save random # seed for later use */ - /* (Used in case of errors, to regenerate the hyperslab sequence) */ - seed += (unsigned)HDclock(); - HDsrandom(seed); - for (i = 0; i < NHYPERSLABS; i++) { /* Select random hyperslab location & size for selection */ for (j = 0; j < SPACE5_RANK; j++) { start[j] = ((hsize_t)HDrandom() % dims1[j]); count[j] = (((hsize_t)HDrandom() % (dims1[j] - start[j])) + 1); - } /* end for */ + } /* Select hyperslab */ ret = H5Sselect_hyperslab(sid1, (i == 0 ? H5S_SELECT_SET : H5S_SELECT_OR), start, NULL, count, @@ -6385,8 +6381,8 @@ test_select_hyper_union_random_5d(hid_t read_plist) if (ret < 0) { TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed); break; - } /* end if */ - } /* end for */ + } + } /* Get the number of elements selected */ npoints = H5Sget_select_npoints(sid1); @@ -6407,7 +6403,7 @@ test_select_hyper_union_random_5d(hid_t read_plist) if (ret < 0) { TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed); break; - } /* end if */ + } /* Compare data read with data written out */ tbuf = rbuf; @@ -6415,7 +6411,7 @@ test_select_hyper_union_random_5d(hid_t read_plist) if (ret < 0) { TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed); break; - } /* end if */ + } /* Set the read buffer back to all zeroes */ memset(rbuf, 0, (size_t)SPACE6_DIM1); diff --git a/test/tskiplist.c b/test/tskiplist.c index 7d4cda0dd29..4c76321047f 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -69,7 +69,7 @@ test_skiplist_init(void) CHECK_PTR(rev_sort_rand_num, "malloc"); /* Initialize random number seed */ - curr_time = HDtime(NULL); + curr_time = time(NULL); HDsrandom((unsigned)curr_time); /* Create randomized set of numbers */ diff --git a/test/ttime.c b/test/ttime.c index 32e6859018f..08e9f967ab7 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -150,7 +150,7 @@ test_time_io(void) CHECK(dsid, FAIL, "H5Dcreate2"); /* Initialize time data value */ - timenow = HDtime(NULL); + timenow = time(NULL); /* Write time to dataset */ status = H5Dwrite(dsid, H5T_UNIX_D32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &timenow); @@ -182,7 +182,7 @@ test_time_io(void) status = H5Dread(dsid, H5T_UNIX_D32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &timethen); CHECK(status, FAIL, "H5Dread"); - fprintf(stderr, "time written was: %s\n", HDctime(&timethen)); + fprintf(stderr, "time written was: %s\n", ctime(&timethen)); status = H5Dclose(dsid); CHECK(status, FAIL, "H5Dclose"); diff --git a/test/tunicode.c b/test/tunicode.c index a65b469a8a8..d3baf801692 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -815,7 +815,7 @@ test_unicode(void) MESSAGE(5, ("Testing UTF-8 Encoding\n")); /* Create a random string with length NUM_CHARS */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); memset(test_string, 0, sizeof(test_string)); for (x = 0; x < NUM_CHARS; x++) { diff --git a/test/unlink.c b/test/unlink.c index ae8da98b491..62c7e61a1b4 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2906,7 +2906,7 @@ main(void) double rdcc_w0; /* Set the random # seed */ - HDsrandom((unsigned)HDtime(NULL)); + HDsrandom((unsigned)time(NULL)); /* Open */ h5_reset(); diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c index 752cc509e24..b57c2f689dd 100644 --- a/test/vds_swmr_writer.c +++ b/test/vds_swmr_writer.c @@ -112,8 +112,8 @@ main(int argc, char *argv[]) TEST_ERROR; /* Wait one second between writing planes */ - delay = HDtime(0) + (time_t)1; - while (HDtime(0) < delay) + delay = time(0) + (time_t)1; + while (time(0) < delay) ; /* Flush */ diff --git a/testpar/API/H5_api_test_parallel.c b/testpar/API/H5_api_test_parallel.c index 224c1b8a7c4..71264af418c 100644 --- a/testpar/API/H5_api_test_parallel.c +++ b/testpar/API/H5_api_test_parallel.c @@ -223,7 +223,7 @@ main(int argc, char **argv) n_tests_skipped_g = 0; if (MAINPROCESS) { - seed = (unsigned)HDtime(NULL); + seed = (unsigned)time(NULL); } if (mpi_size > 1) { diff --git a/testpar/t_pmulti_dset.c b/testpar/t_pmulti_dset.c index 4d8bc7707ec..a61e1b4dcc4 100644 --- a/testpar/t_pmulti_dset.c +++ b/testpar/t_pmulti_dset.c @@ -657,7 +657,7 @@ main(int argc, char *argv[]) /* Generate random number seed, if rank 0 */ if (MAINPROCESS) - seed = (unsigned)HDtime(NULL); + seed = (unsigned)time(NULL); /* Broadcast seed from rank 0 (other ranks will receive rank 0's seed) */ if (MPI_SUCCESS != MPI_Bcast(&seed, 1, MPI_UNSIGNED, 0, MPI_COMM_WORLD)) diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index a5c1aa5b4dc..bef90cf9061 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -2189,9 +2189,9 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi struct tm *tm; if (simple_output_g) - tm = HDgmtime(&(oinfo->mtime)); + tm = gmtime(&(oinfo->mtime)); else - tm = HDlocaltime(&(oinfo->mtime)); + tm = localtime(&(oinfo->mtime)); if (tm) { strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); h5tools_str_reset(&buffer);