diff options
Diffstat (limited to 'test/dt_arith.c')
-rw-r--r-- | test/dt_arith.c | 1276 |
1 files changed, 638 insertions, 638 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c index a26945f..c7b72cb 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -99,8 +99,8 @@ typedef enum dtype_t { static int without_hardware_g = 0; /* Allocates memory aligned on a certain boundary. */ -#define aligned_malloc(Z) ((void *)((char *)HDmalloc(ALIGNMENT + Z) + ALIGNMENT)) -#define aligned_free(M) HDfree((char *)(M)-ALIGNMENT) +#define aligned_malloc(Z) ((void *)((char *)malloc(ALIGNMENT + Z) + ALIGNMENT)) +#define aligned_free(M) free((char *)(M)-ALIGNMENT) /* Initialize source buffer of integer for integer->integer and integer->floating-point conversion test. * This algorithm is mainly to avoid any casting and comparison between source and destination types @@ -116,8 +116,8 @@ static int without_hardware_g = 0; NELMTS = SRC_PREC * 3; \ BUF = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ SAVED = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ - HDmemset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ - HDmemset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + memset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + memset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ \ buf_p = BUF; \ saved_p = SAVED; \ @@ -126,14 +126,14 @@ static int without_hardware_g = 0; /*VALUE2 ascends from 00000000, to 00000011, 00000111,..., until 11111111.*/ \ for (n = 0; n < SRC_PREC; n++) { \ { \ - HDmemcpy(buf_p, &value1, SRC_SIZE); \ - HDmemcpy(saved_p, &value1, SRC_SIZE); \ + memcpy(buf_p, &value1, SRC_SIZE); \ + memcpy(saved_p, &value1, SRC_SIZE); \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } \ { \ - HDmemcpy(buf_p, &value2, SRC_SIZE); \ - HDmemcpy(saved_p, &value2, SRC_SIZE); \ + memcpy(buf_p, &value2, SRC_SIZE); \ + memcpy(saved_p, &value2, SRC_SIZE); \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } \ @@ -152,8 +152,8 @@ static int without_hardware_g = 0; /* VALUE2 descends from 11111111 to 11111110, 11111100, ..., until 10000000. */ \ for (n = 0; n < SRC_PREC - 1; n++) { \ { \ - HDmemcpy(buf_p, &value2, SRC_SIZE); \ - HDmemcpy(saved_p, &value2, SRC_SIZE); \ + memcpy(buf_p, &value2, SRC_SIZE); \ + memcpy(saved_p, &value2, SRC_SIZE); \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } \ @@ -233,8 +233,8 @@ static int without_hardware_g = 0; /* Allocate buffers */ \ BUF = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ SAVED = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ - HDmemset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ - HDmemset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + memset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + memset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ \ buf_p = BUF; \ saved_p = SAVED; \ @@ -244,15 +244,15 @@ static int without_hardware_g = 0; value2 = -SRC_MIN; \ for (n = 0; n < num_norm; n++) { \ if (value1 < SRC_MAX) { /*positive*/ \ - HDmemcpy(buf_p, &value1, SRC_SIZE); \ - HDmemcpy(saved_p, &value1, SRC_SIZE); \ + memcpy(buf_p, &value1, SRC_SIZE); \ + memcpy(saved_p, &value1, SRC_SIZE); \ value1 *= multiply; \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } \ if (value2 > -SRC_MAX) { /*negative*/ \ - HDmemcpy(buf_p, &value2, SRC_SIZE); \ - HDmemcpy(saved_p, &value2, SRC_SIZE); \ + memcpy(buf_p, &value2, SRC_SIZE); \ + memcpy(saved_p, &value2, SRC_SIZE); \ value2 *= multiply; \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ @@ -260,14 +260,14 @@ static int without_hardware_g = 0; } \ \ value1 = SRC_MAX; /*maximal value*/ \ - HDmemcpy(buf_p, &value1, SRC_SIZE); \ - HDmemcpy(saved_p, &value1, SRC_SIZE); \ + memcpy(buf_p, &value1, SRC_SIZE); \ + memcpy(saved_p, &value1, SRC_SIZE); \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ \ value2 = -SRC_MAX; /*negative value*/ \ - HDmemcpy(buf_p, &value2, SRC_SIZE); \ - HDmemcpy(saved_p, &value2, SRC_SIZE); \ + memcpy(buf_p, &value2, SRC_SIZE); \ + memcpy(saved_p, &value2, SRC_SIZE); \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } @@ -288,25 +288,25 @@ static int without_hardware_g = 0; /* Allocate buffers */ \ BUF = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ SAVED = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ - HDmemset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ - HDmemset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + memset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + memset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ \ - tmp1 = (unsigned char *)HDcalloc((size_t)1, (size_t)SRC_SIZE); \ - tmp2 = (unsigned char *)HDcalloc((size_t)1, (size_t)SRC_SIZE); \ + tmp1 = (unsigned char *)calloc((size_t)1, (size_t)SRC_SIZE); \ + tmp2 = (unsigned char *)calloc((size_t)1, (size_t)SRC_SIZE); \ \ buf_p = BUF; \ saved_p = SAVED; \ \ /*Denormalized values. Exponent is 0. Let mantissa starts from 00000001, 00000011, \ *00000111,..., until 11111111.*/ \ - HDmemset(tmp1, 0, SRC_SIZE); \ - HDmemset(tmp2, 0, SRC_SIZE); \ + memset(tmp1, 0, SRC_SIZE); \ + memset(tmp2, 0, SRC_SIZE); \ H5T__bit_set(tmp2, SRC_PREC - 1, (size_t)1, TRUE); /*the negative value*/ \ for (n = 0; n < SRC_MANT_DIG - 1; n++) { \ H5T__bit_set(tmp1, n, (size_t)1, TRUE); /*turn on 1 bit each time*/ \ CHANGE_ORDER(tmp1, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ - HDmemcpy(buf_p, tmp1, SRC_SIZE); \ - HDmemcpy(saved_p, tmp1, SRC_SIZE); \ + memcpy(buf_p, tmp1, SRC_SIZE); \ + memcpy(saved_p, tmp1, SRC_SIZE); \ CHANGE_ORDER(tmp1, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ @@ -314,14 +314,14 @@ static int without_hardware_g = 0; /*negative values*/ \ H5T__bit_set(tmp2, n, (size_t)1, TRUE); \ CHANGE_ORDER(tmp2, SRC_ORDR, SRC_SIZE); \ - HDmemcpy(buf_p, tmp2, SRC_SIZE); \ - HDmemcpy(saved_p, tmp2, SRC_SIZE); \ + memcpy(buf_p, tmp2, SRC_SIZE); \ + memcpy(saved_p, tmp2, SRC_SIZE); \ CHANGE_ORDER(tmp2, SRC_ORDR, SRC_SIZE); \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } \ - HDfree(tmp1); \ - HDfree(tmp2); \ + free(tmp1); \ + free(tmp2); \ } /* Allocate buffer and initialize it with floating-point special values, +/-0, +/-infinity, @@ -340,24 +340,24 @@ static int without_hardware_g = 0; /* Allocate buffers */ \ BUF = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ SAVED = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ - HDmemset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ - HDmemset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ - value = (unsigned char *)HDcalloc(SRC_SIZE, sizeof(unsigned char)); \ + memset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + memset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + value = (unsigned char *)calloc(SRC_SIZE, sizeof(unsigned char)); \ \ buf_p = BUF; \ \ /* +0 */ \ H5T__bit_set(value, (size_t)0, SRC_PREC, FALSE); \ - HDmemcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ + memcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ buf_p += SRC_SIZE; \ \ for (n = 0; n < 2; n++) { \ if (n == 1) { \ - HDmemset(value, 0, SRC_SIZE * sizeof(unsigned char)); \ + memset(value, 0, SRC_SIZE * sizeof(unsigned char)); \ /* -0 */ \ H5T__bit_set(value, (size_t)(SRC_PREC - 1), (size_t)1, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ - HDmemcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ + memcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \ buf_p += SRC_SIZE; \ } \ @@ -365,27 +365,27 @@ static int without_hardware_g = 0; /* +/-infinity */ \ H5T__bit_set(value, (size_t)(SRC_MANT_DIG - 1), SRC_PREC - SRC_MANT_DIG, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ - HDmemcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ + memcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \ buf_p += SRC_SIZE; \ \ /* +/-SNaN */ \ H5T__bit_set(value, (size_t)0, (size_t)1, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ - HDmemcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ + memcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \ buf_p += SRC_SIZE; \ \ /* +/-QNaN */ \ H5T__bit_set(value, (size_t)(SRC_MANT_DIG - 2), (size_t)1, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ - HDmemcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ + memcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \ buf_p += SRC_SIZE; \ } \ \ - HDmemcpy(SAVED, BUF, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ - HDfree(value); \ + memcpy(SAVED, BUF, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ + free(value); \ } static hbool_t overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits); @@ -414,7 +414,7 @@ fpe_handler(int H5_ATTR_UNUSED signo) HDputs(" Remaining tests could not be run."); HDputs(" Please turn off SIGFPE on overflows and try again."); #endif - HDexit(255); + exit(255); } /*------------------------------------------------------------------------- @@ -522,7 +522,7 @@ test_hard_query(void) /* Verify the conversion from int to float is a hard conversion. */ if (H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); - HDprintf("Can't query conversion function\n"); + printf("Can't query conversion function\n"); goto error; } @@ -532,7 +532,7 @@ test_hard_query(void) (H5T_conv_t)((void (*)(void))H5T__conv_int_float)); if (H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != FALSE) { H5_FAILED(); - HDprintf("Can't query conversion function\n"); + printf("Can't query conversion function\n"); goto error; } @@ -542,7 +542,7 @@ test_hard_query(void) (H5T_conv_t)((void (*)(void))H5T__conv_int_float)); if (H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); - HDprintf("Can't query conversion function\n"); + printf("Can't query conversion function\n"); goto error; } @@ -637,7 +637,7 @@ test_particular_fp_integer(void) if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { H5_FAILED(); - HDprintf("Can't create data transfer property list\n"); + printf("Can't create data transfer property list\n"); goto error; } @@ -645,28 +645,28 @@ test_particular_fp_integer(void) endian = H5Tget_order(H5T_NATIVE_DOUBLE); src_size1 = H5Tget_size(H5T_NATIVE_DOUBLE); dst_size1 = H5Tget_size(H5T_NATIVE_SCHAR); - buf1 = (unsigned char *)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); - saved_buf1 = (unsigned char *)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); + buf1 = (unsigned char *)calloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); + saved_buf1 = (unsigned char *)calloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); - HDmemcpy(buf1, &src_d, src_size1); - HDmemcpy(saved_buf1, &src_d, src_size1); + memcpy(buf1, &src_d, src_size1); + memcpy(saved_buf1, &src_d, src_size1); /* Register exception handling function and signal the destination is "signed char". */ flag = 1; if (H5Pset_type_conv_cb(dxpl_id, expt_handle, &flag) < 0) { H5_FAILED(); - HDprintf("Can't register conversion callback\n"); + printf("Can't register conversion callback\n"); goto error; } /* Do conversion */ if (H5Tconvert(H5T_NATIVE_DOUBLE, H5T_NATIVE_SCHAR, (size_t)1, buf1, NULL, dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't convert data\n"); + printf("Can't convert data\n"); goto error; } - HDmemcpy(&dst_c, buf1, dst_size1); + memcpy(&dst_c, buf1, dst_size1); /* Print errors */ if (dst_c != SCHAR_MAX) { @@ -676,29 +676,29 @@ test_particular_fp_integer(void) if (0 == fails_this_test++) H5_FAILED(); - HDprintf(" test double to signed char:\n"); - HDprintf(" src = "); + printf(" test double to signed char:\n"); + printf(" src = "); for (j = 0; j < src_size1; j++) - HDprintf(" %02x", saved_buf1[ENDIAN(src_size1, j, endian)]); + printf(" %02x", saved_buf1[ENDIAN(src_size1, j, endian)]); - HDmemcpy(&x, saved_buf1, src_size1); - HDprintf(" %29.20e\n", x); + memcpy(&x, saved_buf1, src_size1); + printf(" %29.20e\n", x); - HDprintf(" dst = "); + printf(" dst = "); for (j = 0; j < dst_size1; j++) - HDprintf(" %02x", buf1[ENDIAN(dst_size1, j, endian)]); + printf(" %02x", buf1[ENDIAN(dst_size1, j, endian)]); - HDmemcpy(&y, buf1, dst_size1); - HDprintf(" %29d\n", y); + memcpy(&y, buf1, dst_size1); + printf(" %29d\n", y); } /* Test conversion from float (the value is INT_MAX) to int. */ src_size2 = H5Tget_size(H5T_NATIVE_FLOAT); dst_size2 = H5Tget_size(H5T_NATIVE_INT); - buf2 = (unsigned char *)HDcalloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); - saved_buf2 = (unsigned char *)HDcalloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); - HDmemcpy(buf2, &src_f, src_size2); - HDmemcpy(saved_buf2, &src_f, src_size2); + buf2 = (unsigned char *)calloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); + saved_buf2 = (unsigned char *)calloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); + memcpy(buf2, &src_f, src_size2); + memcpy(saved_buf2, &src_f, src_size2); /* signal exception handling function that the destination is "int". */ flag = 0; @@ -706,11 +706,11 @@ test_particular_fp_integer(void) /* Do conversion */ if (H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)1, buf2, NULL, dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't convert data\n"); + printf("Can't convert data\n"); goto error; } - HDmemcpy(&dst_i, buf2, dst_size2); + memcpy(&dst_i, buf2, dst_size2); /* Print errors */ if (dst_i != fill_value) { @@ -720,20 +720,20 @@ test_particular_fp_integer(void) if (0 == fails_this_test++) H5_FAILED(); - HDprintf(" test float to int:\n"); - HDprintf(" src = "); + printf(" test float to int:\n"); + printf(" src = "); for (j = 0; j < src_size2; j++) - HDprintf(" %02x", saved_buf2[ENDIAN(src_size2, j, endian)]); + printf(" %02x", saved_buf2[ENDIAN(src_size2, j, endian)]); - HDmemcpy(&x, saved_buf2, src_size2); - HDprintf(" %29.20e\n", (double)x); + memcpy(&x, saved_buf2, src_size2); + printf(" %29.20e\n", (double)x); - HDprintf(" dst = "); + printf(" dst = "); for (j = 0; j < dst_size2; j++) - HDprintf(" %02x", buf2[ENDIAN(dst_size2, j, endian)]); + printf(" %02x", buf2[ENDIAN(dst_size2, j, endian)]); - HDmemcpy(&y, buf2, dst_size2); - HDprintf(" %29d\n", y); + memcpy(&y, buf2, dst_size2); + printf(" %29d\n", y); } if (fails_this_test) @@ -741,37 +741,37 @@ test_particular_fp_integer(void) if (H5Pclose(dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't close property list\n"); + printf("Can't close property list\n"); goto error; } if (buf1) - HDfree(buf1); + free(buf1); if (buf2) - HDfree(buf2); + free(buf2); if (saved_buf1) - HDfree(saved_buf1); + free(saved_buf1); if (saved_buf2) - HDfree(saved_buf2); + free(saved_buf2); PASSED(); return 0; error: - HDfflush(stdout); + fflush(stdout); H5E_BEGIN_TRY { H5Pclose(dxpl_id); } H5E_END_TRY; if (buf1) - HDfree(buf1); + free(buf1); if (buf2) - HDfree(buf2); + free(buf2); if (saved_buf1) - HDfree(saved_buf1); + free(saved_buf1); if (saved_buf2) - HDfree(saved_buf2); + free(saved_buf2); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -818,25 +818,25 @@ test_derived_flt(void) h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename); if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); - HDprintf("Can't create file\n"); + printf("Can't create file\n"); goto error; } if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { H5_FAILED(); - HDprintf("Can't create data transfer property list\n"); + printf("Can't create data transfer property list\n"); goto error; } if ((tid1 = H5Tcopy(H5T_IEEE_F64LE)) < 0) { H5_FAILED(); - HDprintf("Can't copy data type\n"); + printf("Can't copy data type\n"); goto error; } if ((tid2 = H5Tcopy(H5T_IEEE_F32LE)) < 0) { H5_FAILED(); - HDprintf("Can't copy data type\n"); + printf("Can't copy data type\n"); goto error; } @@ -860,44 +860,44 @@ test_derived_flt(void) *-----------------------------------------------------------------------*/ if (H5Tset_fields(tid1, (size_t)44, (size_t)34, (size_t)10, (size_t)3, (size_t)31) < 0) { H5_FAILED(); - HDprintf("Can't set fields\n"); + printf("Can't set fields\n"); goto error; } if (H5Tset_offset(tid1, (size_t)3) < 0) { H5_FAILED(); - HDprintf("Can't set offset\n"); + printf("Can't set offset\n"); goto error; } if (H5Tset_precision(tid1, (size_t)42) < 0) { H5_FAILED(); - HDprintf("Can't set precision 1\n"); + printf("Can't set precision 1\n"); goto error; } if (H5Tset_size(tid1, (size_t)7) < 0) { H5_FAILED(); - HDprintf("Can't set size\n"); + printf("Can't set size\n"); goto error; } if (H5Tset_ebias(tid1, (size_t)511) < 0) { H5_FAILED(); - HDprintf("Can't set exponent bias\n"); + printf("Can't set exponent bias\n"); goto error; } if (H5Tset_pad(tid1, H5T_PAD_ZERO, H5T_PAD_ZERO) < 0) { H5_FAILED(); - HDprintf("Can't set padding\n"); + printf("Can't set padding\n"); goto error; } if (H5Tcommit2(file, "new float type 1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - HDprintf("Can't set inpad\n"); + printf("Can't set inpad\n"); goto error; } if (H5Tclose(tid1) < 0) { H5_FAILED(); - HDprintf("Can't close datatype\n"); + printf("Can't close datatype\n"); goto error; } @@ -905,33 +905,33 @@ test_derived_flt(void) FAIL_PUTS_ERROR("Can't open datatype"); if (H5Tget_fields(tid1, &spos, &epos, &esize, &mpos, &msize) < 0) { H5_FAILED(); - HDprintf("Can't get fields\n"); + printf("Can't get fields\n"); goto error; } if (spos != 44 || epos != 34 || esize != 10 || mpos != 3 || msize != 31) { H5_FAILED(); - HDprintf("Wrong field values\n"); + printf("Wrong field values\n"); goto error; } if (H5Tget_precision(tid1) != 42) { H5_FAILED(); - HDprintf("Can't get precision or wrong precision\n"); + printf("Can't get precision or wrong precision\n"); goto error; } if (H5Tget_offset(tid1) != 3) { H5_FAILED(); - HDprintf("Can't get offset or wrong offset\n"); + printf("Can't get offset or wrong offset\n"); goto error; } if ((size = H5Tget_size(tid1)) != 7) { H5_FAILED(); - HDprintf("Can't get size or wrong size\n"); + printf("Can't get size or wrong size\n"); goto error; } if (H5Tget_ebias(tid1) != 511) { H5_FAILED(); - HDprintf("Can't get exponent bias or wrong bias\n"); + printf("Can't get exponent bias or wrong bias\n"); goto error; } @@ -941,11 +941,11 @@ test_derived_flt(void) */ src_size = H5Tget_size(H5T_NATIVE_INT); endian = H5Tget_order(H5T_NATIVE_INT); - buf = (unsigned char *)HDmalloc(nelmts * (MAX(src_size, size))); - saved_buf = (unsigned char *)HDmalloc(nelmts * src_size); - HDmemset(buf, 0, nelmts * MAX(src_size, size)); - HDmemset(saved_buf, 0, nelmts * src_size); - aligned = (int *)HDcalloc((size_t)1, src_size); + buf = (unsigned char *)malloc(nelmts * (MAX(src_size, size))); + saved_buf = (unsigned char *)malloc(nelmts * src_size); + memset(buf, 0, nelmts * MAX(src_size, size)); + memset(saved_buf, 0, nelmts * src_size); + aligned = (int *)calloc((size_t)1, src_size); for (i = 0; i < nelmts * src_size; i++) buf[i] = saved_buf[i] = (unsigned char)HDrand(); @@ -954,13 +954,13 @@ test_derived_flt(void) * The mantissa is big enough to retain the integer's precision. */ if (H5Tconvert(H5T_NATIVE_INT, tid1, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't convert data\n"); + printf("Can't convert data\n"); goto error; } /* Convert data from the derived floating-point type back to native integer. */ if (H5Tconvert(tid1, H5T_NATIVE_INT, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't convert data\n"); + printf("Can't convert data\n"); goto error; } @@ -976,25 +976,25 @@ test_derived_flt(void) if (0 == fails_this_test++) { HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); - HDprintf("%-70s", str); - HDfflush(stdout); + printf("%-70s", str); + fflush(stdout); H5_FAILED(); } - HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); + printf(" test %u elmt %u: \n", 1, (unsigned)i); - HDprintf(" src = "); + printf(" src = "); for (j = 0; j < src_size; j++) - HDprintf(" %02x", saved_buf[i * src_size + ENDIAN(src_size, j, endian)]); + printf(" %02x", saved_buf[i * src_size + ENDIAN(src_size, j, endian)]); - HDmemcpy(aligned, saved_buf + i * sizeof(int), sizeof(int)); - HDprintf(" %29d\n", *aligned); + memcpy(aligned, saved_buf + i * sizeof(int), sizeof(int)); + printf(" %29d\n", *aligned); - HDprintf(" dst = "); + printf(" dst = "); for (j = 0; j < src_size; j++) - HDprintf(" %02x", buf[i * src_size + ENDIAN(src_size, j, endian)]); + printf(" %02x", buf[i * src_size + ENDIAN(src_size, j, endian)]); - HDmemcpy(aligned, buf + i * sizeof(int), sizeof(int)); - HDprintf(" %29d\n", *aligned); + memcpy(aligned, buf + i * sizeof(int), sizeof(int)); + printf(" %29d\n", *aligned); if (fails_this_test >= max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1003,9 +1003,9 @@ test_derived_flt(void) } fails_this_test = 0; - HDfree(buf); - HDfree(saved_buf); - HDfree(aligned); + free(buf); + free(saved_buf); + free(aligned); buf = NULL; saved_buf = NULL; aligned = NULL; @@ -1021,43 +1021,43 @@ test_derived_flt(void) *--------------------------------------------------------------------------*/ if (H5Tset_fields(tid2, (size_t)23, (size_t)16, (size_t)7, (size_t)0, (size_t)16) < 0) { H5_FAILED(); - HDprintf("Can't set fields\n"); + printf("Can't set fields\n"); goto error; } if (H5Tset_offset(tid2, (size_t)0) < 0) { H5_FAILED(); - HDprintf("Can't set offset\n"); + printf("Can't set offset\n"); goto error; } if (H5Tset_precision(tid2, (size_t)24) < 0) { H5_FAILED(); - HDprintf("Can't set precision 2\n"); + printf("Can't set precision 2\n"); goto error; } if (H5Tset_size(tid2, (size_t)3) < 0) { H5_FAILED(); - HDprintf("Can't set size\n"); + printf("Can't set size\n"); goto error; } if (H5Tset_ebias(tid2, (size_t)63) < 0) { H5_FAILED(); - HDprintf("Can't set size\n"); + printf("Can't set size\n"); goto error; } if (H5Tset_pad(tid2, H5T_PAD_ZERO, H5T_PAD_ZERO) < 0) { H5_FAILED(); - HDprintf("Can't set padding\n"); + printf("Can't set padding\n"); goto error; } if (H5Tcommit2(file, "new float type 2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - HDprintf("Can't set inpad\n"); + printf("Can't set inpad\n"); goto error; } if (H5Tclose(tid2) < 0) { H5_FAILED(); - HDprintf("Can't close datatype\n"); + printf("Can't close datatype\n"); goto error; } @@ -1065,33 +1065,33 @@ test_derived_flt(void) FAIL_PUTS_ERROR("Can't open datatype"); if (H5Tget_fields(tid2, &spos, &epos, &esize, &mpos, &msize) < 0) { H5_FAILED(); - HDprintf("Can't get fields\n"); + printf("Can't get fields\n"); goto error; } if (spos != 23 || epos != 16 || esize != 7 || mpos != 0 || msize != 16) { H5_FAILED(); - HDprintf("Wrong field values\n"); + printf("Wrong field values\n"); goto error; } if (H5Tget_precision(tid2) != 24) { H5_FAILED(); - HDprintf("Can't get precision or wrong precision\n"); + printf("Can't get precision or wrong precision\n"); goto error; } if (H5Tget_offset(tid2) != 0) { H5_FAILED(); - HDprintf("Can't get offset or wrong offset\n"); + printf("Can't get offset or wrong offset\n"); goto error; } if ((size = H5Tget_size(tid2)) != 3) { H5_FAILED(); - HDprintf("Can't get size or wrong size\n"); + printf("Can't get size or wrong size\n"); goto error; } if (H5Tget_ebias(tid2) != 63) { H5_FAILED(); - HDprintf("Can't get exponent bias or wrong bias\n"); + printf("Can't get exponent bias or wrong bias\n"); goto error; } @@ -1102,10 +1102,10 @@ test_derived_flt(void) src_size = H5Tget_size(tid2); dst_size = H5Tget_size(tid1); endian = H5Tget_order(tid2); - buf = (unsigned char *)HDmalloc(nelmts * (MAX(src_size, dst_size))); - saved_buf = (unsigned char *)HDmalloc(nelmts * src_size); - HDmemset(buf, 0, nelmts * MAX(src_size, dst_size)); - HDmemset(saved_buf, 0, nelmts * src_size); + buf = (unsigned char *)malloc(nelmts * (MAX(src_size, dst_size))); + saved_buf = (unsigned char *)malloc(nelmts * src_size); + memset(buf, 0, nelmts * MAX(src_size, dst_size)); + memset(saved_buf, 0, nelmts * src_size); for (i = 0; i < nelmts * src_size; i++) buf[i] = saved_buf[i] = (unsigned char)HDrand(); @@ -1115,13 +1115,13 @@ test_derived_flt(void) * the precision and exponent power. */ if (H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't convert data\n"); + printf("Can't convert data\n"); goto error; } /* Convert data from the 1st back to the 2nd derived floating-point type. */ if (H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't convert data\n"); + printf("Can't convert data\n"); goto error; } @@ -1145,21 +1145,21 @@ test_derived_flt(void) if (0 == fails_this_test++) { HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); - HDprintf("%-70s", str); - HDfflush(stdout); + printf("%-70s", str); + fflush(stdout); H5_FAILED(); } - HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); + printf(" test %u elmt %u: \n", 1, (unsigned)i); - HDprintf(" src = "); + printf(" src = "); for (j = 0; j < src_size; j++) - HDprintf(" %02x", saved_buf[i * src_size + ENDIAN(src_size, j, endian)]); - HDprintf("\n"); + printf(" %02x", saved_buf[i * src_size + ENDIAN(src_size, j, endian)]); + printf("\n"); - HDprintf(" dst = "); + printf(" dst = "); for (j = 0; j < src_size; j++) - HDprintf(" %02x", buf[i * src_size + ENDIAN(src_size, j, endian)]); - HDprintf("\n"); + printf(" %02x", buf[i * src_size + ENDIAN(src_size, j, endian)]); + printf("\n"); if (fails_this_test >= max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1168,31 +1168,31 @@ test_derived_flt(void) } if (buf) - HDfree(buf); + free(buf); if (saved_buf) - HDfree(saved_buf); + free(saved_buf); if (H5Tclose(tid1) < 0) { H5_FAILED(); - HDprintf("Can't close datatype\n"); + printf("Can't close datatype\n"); goto error; } if (H5Tclose(tid2) < 0) { H5_FAILED(); - HDprintf("Can't close datatype\n"); + printf("Can't close datatype\n"); goto error; } if (H5Pclose(dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't close property list\n"); + printf("Can't close property list\n"); goto error; } if (H5Fclose(file) < 0) { H5_FAILED(); - HDprintf("Can't close file\n"); + printf("Can't close file\n"); goto error; } /* end if */ @@ -1207,12 +1207,12 @@ test_derived_flt(void) error: if (buf) - HDfree(buf); + free(buf); if (saved_buf) - HDfree(saved_buf); + free(saved_buf); if (aligned) - HDfree(aligned); - HDfflush(stdout); + free(aligned); + fflush(stdout); H5E_BEGIN_TRY { H5Tclose(tid1); @@ -1265,25 +1265,25 @@ test_derived_integer(void) h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof filename); if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5_FAILED(); - HDprintf("Can't create file\n"); + printf("Can't create file\n"); goto error; } if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { H5_FAILED(); - HDprintf("Can't create data transfer property list\n"); + printf("Can't create data transfer property list\n"); goto error; } if ((tid1 = H5Tcopy(H5T_STD_I32LE)) < 0) { H5_FAILED(); - HDprintf("Can't copy data type\n"); + printf("Can't copy data type\n"); goto error; } if ((tid2 = H5Tcopy(H5T_STD_U64LE)) < 0) { H5_FAILED(); - HDprintf("Can't copy data type\n"); + printf("Can't copy data type\n"); goto error; } @@ -1301,37 +1301,37 @@ test_derived_integer(void) *--------------------------------------------------------------------------*/ if (H5Tset_offset(tid1, (size_t)0) < 0) { H5_FAILED(); - HDprintf("Can't set offset\n"); + printf("Can't set offset\n"); goto error; } if (H5Tset_size(tid1, (size_t)3) < 0) { H5_FAILED(); - HDprintf("Can't set size\n"); + printf("Can't set size\n"); goto error; } if (H5Tset_precision(tid1, (size_t)24) < 0) { H5_FAILED(); - HDprintf("Can't set precision\n"); + printf("Can't set precision\n"); goto error; } if (H5Tset_order(tid1, H5T_ORDER_BE) < 0) { H5_FAILED(); - HDprintf("Can't set order\n"); + printf("Can't set order\n"); goto error; } if (H5Tcommit2(file, "new integer type 1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - HDprintf("Can't commit data type\n"); + printf("Can't commit data type\n"); goto error; } if (H5Tclose(tid1) < 0) { H5_FAILED(); - HDprintf("Can't close datatype\n"); + printf("Can't close datatype\n"); goto error; } @@ -1339,22 +1339,22 @@ test_derived_integer(void) FAIL_PUTS_ERROR("Can't open datatype"); if (H5Tget_precision(tid1) != 24) { H5_FAILED(); - HDprintf("Can't get precision or wrong precision\n"); + printf("Can't get precision or wrong precision\n"); goto error; } if (H5Tget_offset(tid1) != 0) { H5_FAILED(); - HDprintf("Can't get offset or wrong offset\n"); + printf("Can't get offset or wrong offset\n"); goto error; } if (H5Tget_size(tid1) != 3) { H5_FAILED(); - HDprintf("Can't get size or wrong size\n"); + printf("Can't get size or wrong size\n"); goto error; } if (H5Tget_order(tid1) != H5T_ORDER_BE) { H5_FAILED(); - HDprintf("Can't get order or wrong order\n"); + printf("Can't get order or wrong order\n"); goto error; } @@ -1368,31 +1368,31 @@ test_derived_integer(void) *--------------------------------------------------------------------------*/ if (H5Tset_precision(tid2, (size_t)48) < 0) { H5_FAILED(); - HDprintf("Can't set precision\n"); + printf("Can't set precision\n"); goto error; } if (H5Tset_offset(tid2, (size_t)10) < 0) { H5_FAILED(); - HDprintf("Can't set offset\n"); + printf("Can't set offset\n"); goto error; } if (H5Tset_sign(tid2, H5T_SGN_2) < 0) { H5_FAILED(); - HDprintf("Can't set offset\n"); + printf("Can't set offset\n"); goto error; } if (H5Tcommit2(file, "new integer type 2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); - HDprintf("Can't commit data type\n"); + printf("Can't commit data type\n"); goto error; } if (H5Tclose(tid2) < 0) { H5_FAILED(); - HDprintf("Can't close datatype\n"); + printf("Can't close datatype\n"); goto error; } @@ -1400,22 +1400,22 @@ test_derived_integer(void) FAIL_PUTS_ERROR("Can't open datatype"); if (H5Tget_precision(tid2) != 48) { H5_FAILED(); - HDprintf("Can't get precision or wrong precision\n"); + printf("Can't get precision or wrong precision\n"); goto error; } if (H5Tget_offset(tid2) != 10) { H5_FAILED(); - HDprintf("Can't get offset or wrong offset\n"); + printf("Can't get offset or wrong offset\n"); goto error; } if (H5Tget_size(tid2) != 8) { H5_FAILED(); - HDprintf("Can't get size or wrong size\n"); + printf("Can't get size or wrong size\n"); goto error; } if (H5Tget_sign(tid2) != H5T_SGN_2) { H5_FAILED(); - HDprintf("Can't get sign or wrong sign\n"); + printf("Can't get sign or wrong sign\n"); goto error; } @@ -1426,10 +1426,10 @@ test_derived_integer(void) src_size = H5Tget_size(tid1); dst_size = H5Tget_size(tid2); endian = H5Tget_order(tid1); - buf = (unsigned char *)HDmalloc(nelmts * (MAX(src_size, dst_size))); - saved_buf = (unsigned char *)HDmalloc(nelmts * src_size); - HDmemset(buf, 0, nelmts * MAX(src_size, dst_size)); - HDmemset(saved_buf, 0, nelmts * src_size); + buf = (unsigned char *)malloc(nelmts * (MAX(src_size, dst_size))); + saved_buf = (unsigned char *)malloc(nelmts * src_size); + memset(buf, 0, nelmts * MAX(src_size, dst_size)); + memset(saved_buf, 0, nelmts * src_size); for (i = 0; i < nelmts * src_size; i++) buf[i] = saved_buf[i] = (unsigned char)HDrand(); @@ -1439,13 +1439,13 @@ test_derived_integer(void) * the 1st type's precision. */ if (H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't convert data\n"); + printf("Can't convert data\n"); goto error; } /* Convert data from the 2nd back to the 1st derived integer type. */ if (H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't convert data\n"); + printf("Can't convert data\n"); goto error; } @@ -1461,21 +1461,21 @@ test_derived_integer(void) if (0 == fails_this_test++) { HDsnprintf(str, sizeof(str), "\nTesting random sw derived integer -> derived integer conversions"); - HDprintf("%-70s", str); - HDfflush(stdout); + printf("%-70s", str); + fflush(stdout); H5_FAILED(); } - HDprintf(" test %u elmt %u: \n", 1, (unsigned)i); + printf(" test %u elmt %u: \n", 1, (unsigned)i); - HDprintf(" src = "); + printf(" src = "); for (j = 0; j < src_size; j++) - HDprintf(" %02x", saved_buf[i * src_size + ENDIAN(src_size, j, endian)]); - HDprintf("\n"); + printf(" %02x", saved_buf[i * src_size + ENDIAN(src_size, j, endian)]); + printf("\n"); - HDprintf(" dst = "); + printf(" dst = "); for (j = 0; j < src_size; j++) - HDprintf(" %02x", buf[i * src_size + ENDIAN(src_size, j, endian)]); - HDprintf("\n"); + printf(" %02x", buf[i * src_size + ENDIAN(src_size, j, endian)]); + printf("\n"); if (fails_this_test >= max_fails) { HDputs(" maximum failures reached, aborting test..."); @@ -1485,30 +1485,30 @@ test_derived_integer(void) if (H5Tclose(tid1) < 0) { H5_FAILED(); - HDprintf("Can't close datatype\n"); + printf("Can't close datatype\n"); goto error; } if (H5Tclose(tid2) < 0) { H5_FAILED(); - HDprintf("Can't close datatype\n"); + printf("Can't close datatype\n"); goto error; } if (H5Pclose(dxpl_id) < 0) { H5_FAILED(); - HDprintf("Can't close property list\n"); + printf("Can't close property list\n"); goto error; } if (H5Fclose(file) < 0) { H5_FAILED(); - HDprintf("Can't close file\n"); + printf("Can't close file\n"); goto error; } /* end if */ - HDfree(buf); - HDfree(saved_buf); + free(buf); + free(saved_buf); PASSED(); @@ -1521,10 +1521,10 @@ test_derived_integer(void) error: if (buf) - HDfree(buf); + free(buf); if (saved_buf) - HDfree(saved_buf); - HDfflush(stdout); + free(saved_buf); + fflush(stdout); H5E_BEGIN_TRY { H5Tclose(tid1); @@ -1692,15 +1692,15 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) /* Sanity checks */ if (OTHER == src_type || OTHER == dst_type) { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); + printf("%-70s", str); H5_FAILED(); HDputs(" Unknown data type."); goto error; } else { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); - HDfflush(stdout); + printf("%-70s", str); + fflush(stdout); fails_this_test = 0; } @@ -1712,7 +1712,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) dst_nbits = H5Tget_precision(dst); /* not 8*dst_size, esp on J90 - QAK */ src_sign = H5Tget_sign(src); dst_sign = H5Tget_sign(dst); - aligned = HDcalloc((size_t)1, sizeof(long long)); + aligned = calloc((size_t)1, sizeof(long long)); /* Allocate and initialize the source buffer through macro INIT_INTEGER. The BUF * will be used for the conversion while the SAVED buffer will be @@ -1761,43 +1761,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_char; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_char = (signed char)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_char = (signed char)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_char = (signed char)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_char = (signed char)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_char = (signed char)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_char = (signed char)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_char = (signed char)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_char = (signed char)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_char = (signed char)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_char = (signed char)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -1805,7 +1805,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -1813,43 +1813,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_uchar; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_uchar = (unsigned char)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_uchar = (unsigned char)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_uchar = (unsigned char)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_uchar = (unsigned char)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_uchar = (unsigned char)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_uchar = (unsigned char)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_uchar = (unsigned char)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_uchar = (unsigned char)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_uchar = (unsigned char)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_uchar = (unsigned char)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -1857,7 +1857,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -1865,43 +1865,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_short; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(char), sizeof(char)); + memcpy(aligned, saved + j * sizeof(char), sizeof(char)); hw_short = (short)(*((char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_short = (short)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_short = (short)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_short = (short)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_short = (short)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_short = (short)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_short = (short)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_short = (short)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_short = (short)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_short = (short)(*((unsigned long long *)aligned)); break; @@ -1910,7 +1910,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -1918,43 +1918,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_ushort; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_ushort = (unsigned short)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_ushort = (unsigned short)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_ushort = (unsigned short)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_ushort = (unsigned short)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_ushort = (unsigned short)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_ushort = (unsigned short)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_ushort = (unsigned short)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_ushort = (unsigned short)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_ushort = (unsigned short)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_ushort = (unsigned short)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -1962,7 +1962,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -1970,43 +1970,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_int; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_int = (int)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_int = (int)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_int = (int)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_int = (int)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_int = (int)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_int = (int)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_int = (int)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_int = (int)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_int = (int)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_int = (int)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -2014,7 +2014,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2022,43 +2022,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_uint; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_uint = (unsigned int)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_uint = (unsigned int)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_uint = (unsigned int)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_uint = (unsigned int)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_uint = (unsigned int)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_uint = (unsigned int)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_uint = (unsigned int)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_uint = (unsigned int)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_uint = (unsigned int)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_uint = (unsigned int)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -2066,7 +2066,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2074,43 +2074,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_long; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_long = (long int)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_long = (long int)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_long = (long int)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_long = (long int)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_long = (long int)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_long = (long int)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_long = (long int)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_long = (long int)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_long = (long int)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_long = (long int)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -2118,7 +2118,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2126,43 +2126,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_ulong; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_ulong = (unsigned long)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_ulong = (unsigned long)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_ulong = (unsigned long)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_ulong = (unsigned long)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_ulong = (unsigned long)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_ulong = (unsigned long)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_ulong = (unsigned long)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_ulong = (unsigned long)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_ulong = (unsigned long)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_ulong = (unsigned long)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -2170,7 +2170,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2178,43 +2178,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_llong; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(char), sizeof(char)); + memcpy(aligned, saved + j * sizeof(char), sizeof(char)); hw_llong = (long long)(*((char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_llong = (long long)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_llong = (long long)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_llong = (long long)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_llong = (long long)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_llong = (long long)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_llong = (long long)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_llong = (long long)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_llong = (long long)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_llong = (long long)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -2222,7 +2222,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2230,43 +2230,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char *)&hw_ullong; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_ullong = (unsigned long long)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_ullong = (unsigned long long)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_ullong = (unsigned long long)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_ullong = (unsigned long long)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_ullong = (unsigned long long)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_ullong = (unsigned long long)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_ullong = (unsigned long long)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_ullong = (unsigned long long)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_ullong = (unsigned long long)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_ullong = (unsigned long long)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -2274,13 +2274,13 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } /* Make certain that there isn't some weird number of destination bits */ - HDassert(dst_nbits % 8 == 0); + assert(dst_nbits % 8 == 0); /* Are the two results the same? */ for (k = (dst_size - (dst_nbits / 8)); k < dst_size; k++) @@ -2404,157 +2404,157 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) /* Print errors */ if (0 == fails_this_test++) H5_FAILED(); - HDprintf(" elmt %u\n", (unsigned)j); + printf(" elmt %u\n", (unsigned)j); - HDprintf(" src = "); + printf(" src = "); for (k = 0; k < src_size; k++) - HDprintf(" %02x", saved[j * src_size + ENDIAN(src_size, k, endian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)dst_size - (ssize_t)src_size)), ""); + printf(" %02x", saved[j * src_size + ENDIAN(src_size, k, endian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)dst_size - (ssize_t)src_size)), ""); switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); - HDprintf(" %29d\n", (int)*((signed char *)aligned)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + printf(" %29d\n", (int)*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); - HDprintf(" %29u\n", (unsigned)*((unsigned char *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + printf(" %29u\n", (unsigned)*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); - HDprintf(" %29hd\n", *((short *)aligned)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); + printf(" %29hd\n", *((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); - HDprintf(" %29hu\n", *((unsigned short *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + printf(" %29hu\n", *((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); - HDprintf(" %29d\n", *((int *)aligned)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); + printf(" %29d\n", *((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); - HDprintf(" %29u\n", *((unsigned *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + printf(" %29u\n", *((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); - HDprintf(" %29ld\n", *((long *)aligned)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); + printf(" %29ld\n", *((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); - HDprintf(" %29lu\n", *((unsigned long *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + printf(" %29lu\n", *((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); - HDfprintf(stdout, " %29lld\n", *((long long *)aligned)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + fprintf(stdout, " %29lld\n", *((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); - HDfprintf(stdout, " %29llu\n", *((unsigned long long *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + fprintf(stdout, " %29llu\n", *((unsigned long long *)aligned)); break; case FLT_FLOAT: case FLT_DOUBLE: case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } - HDprintf(" dst = "); + printf(" dst = "); for (k = 0; k < dst_size; k++) - HDprintf(" %02x", buf[j * dst_size + ENDIAN(dst_size, k, endian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); + printf(" %02x", buf[j * dst_size + ENDIAN(dst_size, k, endian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); switch (dst_type) { case INT_SCHAR: - HDmemcpy(aligned, buf + j * sizeof(signed char), sizeof(signed char)); - HDprintf(" %29d\n", (int)*((signed char *)aligned)); + memcpy(aligned, buf + j * sizeof(signed char), sizeof(signed char)); + printf(" %29d\n", (int)*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, buf + j * sizeof(unsigned char), sizeof(unsigned char)); - HDprintf(" %29u\n", (unsigned)*((unsigned char *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned char), sizeof(unsigned char)); + printf(" %29u\n", (unsigned)*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, buf + j * sizeof(short), sizeof(short)); - HDprintf(" %29hd\n", *((short *)aligned)); + memcpy(aligned, buf + j * sizeof(short), sizeof(short)); + printf(" %29hd\n", *((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, buf + j * sizeof(unsigned short), sizeof(unsigned short)); - HDprintf(" %29hu\n", *((unsigned short *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned short), sizeof(unsigned short)); + printf(" %29hu\n", *((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, buf + j * sizeof(int), sizeof(int)); - HDprintf(" %29d\n", *((int *)aligned)); + memcpy(aligned, buf + j * sizeof(int), sizeof(int)); + printf(" %29d\n", *((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, buf + j * sizeof(unsigned), sizeof(unsigned)); - HDprintf(" %29u\n", *((unsigned *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned), sizeof(unsigned)); + printf(" %29u\n", *((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, buf + j * sizeof(long), sizeof(long)); - HDprintf(" %29ld\n", *((long *)aligned)); + memcpy(aligned, buf + j * sizeof(long), sizeof(long)); + printf(" %29ld\n", *((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, buf + j * sizeof(unsigned long), sizeof(unsigned long)); - HDprintf(" %29lu\n", *((unsigned long *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned long), sizeof(unsigned long)); + printf(" %29lu\n", *((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, buf + j * sizeof(long long), sizeof(long long)); - HDfprintf(stdout, " %29lld\n", *((long long *)aligned)); + memcpy(aligned, buf + j * sizeof(long long), sizeof(long long)); + fprintf(stdout, " %29lld\n", *((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, buf + j * sizeof(long long), sizeof(unsigned long long)); - HDfprintf(stdout, " %29llu\n", *((unsigned long long *)aligned)); + memcpy(aligned, buf + j * sizeof(long long), sizeof(unsigned long long)); + fprintf(stdout, " %29llu\n", *((unsigned long long *)aligned)); break; case FLT_FLOAT: case FLT_DOUBLE: case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } - HDprintf(" ans = "); + printf(" ans = "); for (k = 0; k < dst_size; k++) - HDprintf(" %02x", hw[ENDIAN(dst_size, k, endian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); + printf(" %02x", hw[ENDIAN(dst_size, k, endian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); switch (dst_type) { case INT_SCHAR: - HDprintf(" %29d\n", (int)*((signed char *)((void *)hw))); + printf(" %29d\n", (int)*((signed char *)((void *)hw))); break; case INT_UCHAR: - HDprintf(" %29u\n", (unsigned)*((unsigned char *)((void *)hw))); + printf(" %29u\n", (unsigned)*((unsigned char *)((void *)hw))); break; case INT_SHORT: - HDprintf(" %29hd\n", *((short *)((void *)hw))); + printf(" %29hd\n", *((short *)((void *)hw))); break; case INT_USHORT: - HDprintf(" %29hu\n", *((unsigned short *)((void *)hw))); + printf(" %29hu\n", *((unsigned short *)((void *)hw))); break; case INT_INT: - HDprintf(" %29d\n", *((int *)((void *)hw))); + printf(" %29d\n", *((int *)((void *)hw))); break; case INT_UINT: - HDprintf(" %29u\n", *((unsigned *)((void *)hw))); + printf(" %29u\n", *((unsigned *)((void *)hw))); break; case INT_LONG: - HDprintf(" %29ld\n", *((long *)((void *)hw))); + printf(" %29ld\n", *((long *)((void *)hw))); break; case INT_ULONG: - HDprintf(" %29lu\n", *((unsigned long *)((void *)hw))); + printf(" %29lu\n", *((unsigned long *)((void *)hw))); break; case INT_LLONG: - HDfprintf(stdout, " %29lld\n", *((long long *)((void *)hw))); + fprintf(stdout, " %29lld\n", *((long long *)((void *)hw))); break; case INT_ULLONG: - HDfprintf(stdout, " %29llu\n", *((unsigned long long *)((void *)hw))); + fprintf(stdout, " %29llu\n", *((unsigned long long *)((void *)hw))); break; case FLT_FLOAT: case FLT_DOUBLE: case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } @@ -2572,8 +2572,8 @@ done: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); - HDfflush(stdout); + free(aligned); + fflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -2588,8 +2588,8 @@ error: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); - HDfflush(stdout); + free(aligned); + fflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -2621,11 +2621,11 @@ test_conv_int_2(void) hid_t src_type, dst_type; char *buf; - HDprintf("%-70s", "Testing overlap calculations"); - HDfflush(stdout); + printf("%-70s", "Testing overlap calculations"); + fflush(stdout); - buf = (char *)HDcalloc(TMP_BUF_DIM1, TMP_BUF_DIM2); - HDassert(buf); + buf = (char *)calloc(TMP_BUF_DIM1, TMP_BUF_DIM2); + assert(buf); for (i = 1; i <= TMP_BUF_DIM1; i++) { for (j = 1; j <= TMP_BUF_DIM1; j++) { @@ -2648,7 +2648,7 @@ test_conv_int_2(void) } } PASSED(); - HDfree(buf); + free(buf); return 0; } @@ -2672,18 +2672,18 @@ my_isnan(dtype_t type, void *val) if (FLT_FLOAT == type) { float x = 0.0; - HDmemcpy(&x, val, sizeof(float)); + memcpy(&x, val, sizeof(float)); retval = isnan(x); } else if (FLT_DOUBLE == type) { double x = 0.0; - HDmemcpy(&x, val, sizeof(double)); + memcpy(&x, val, sizeof(double)); retval = isnan(x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE } else if (FLT_LDOUBLE == type) { long double x = 0.0L; - HDmemcpy(&x, val, sizeof(long double)); + memcpy(&x, val, sizeof(long double)); retval = isnan(x); #endif } @@ -2699,20 +2699,20 @@ my_isnan(dtype_t type, void *val) if (FLT_FLOAT == type) { float x = 0.0; - HDmemcpy(&x, val, sizeof(float)); + memcpy(&x, val, sizeof(float)); HDsnprintf(s, sizeof(s), "%g", (double)x); } else if (FLT_DOUBLE == type) { double x = 0.0; - HDmemcpy(&x, val, sizeof(double)); + memcpy(&x, val, sizeof(double)); HDsnprintf(s, sizeof(s), "%g", x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE } else if (FLT_LDOUBLE == type) { long double x = 0.0L; - HDmemcpy(&x, val, sizeof(long double)); + memcpy(&x, val, sizeof(long double)); HDsnprintf(s, sizeof(s), "%Lg", x); #endif } @@ -2746,7 +2746,7 @@ my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t int retval = 0; size_t i; - bits = (unsigned char *)HDcalloc((size_t)1, size); + bits = (unsigned char *)calloc((size_t)1, size); for (i = 0; i < size; i++) bits[size - (i + 1)] = *(val + ENDIAN(size, i, endian)); @@ -2755,7 +2755,7 @@ my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t H5T__bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) retval = 1; - HDfree(bits); + free(bits); return retval; } @@ -2822,8 +2822,8 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) * fork here and let the child run the test and return the number of * failures with the exit status. */ - HDfflush(stdout); - HDfflush(stderr); + fflush(stdout); + fflush(stderr); if ((child_pid = HDfork()) < 0) { HDperror("fork"); return 1; @@ -2911,7 +2911,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); + printf("%-70s", str); H5_FAILED(); HDputs(" Unknown data type."); goto error; @@ -2930,8 +2930,8 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); - HDfflush(stdout); + printf("%-70s", str); + fflush(stdout); fails_this_test = 0; } @@ -2947,7 +2947,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) dendian = H5Tget_order(dst); /* Allocate buffers */ - aligned = HDcalloc((size_t)1, MAX(sizeof(long double), sizeof(double))); + aligned = calloc((size_t)1, MAX(sizeof(long double), sizeof(double))); /* Allocate and initialize the source buffer through macro INIT_FP_NORM or INIT_FP_SPECIAL. * The BUF will be used for the conversion while the SAVED buffer will be used for @@ -3032,7 +3032,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) /* The hardware conversion */ /* Check for underflow when src is a "larger" float than dst.*/ if (FLT_FLOAT == src_type) { - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); if (FLT_FLOAT == dst_type) { hw_f = *((float *)aligned); hw = (unsigned char *)&hw_f; @@ -3049,7 +3049,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) } } else if (FLT_DOUBLE == src_type) { - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); if (FLT_FLOAT == dst_type) { hw_f = (float)(*((double *)aligned)); hw = (unsigned char *)&hw_f; @@ -3069,7 +3069,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE } else { - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); if (FLT_FLOAT == dst_type) { hw_f = (float)*((long double *)aligned); hw = (unsigned char *)&hw_f; @@ -3158,7 +3158,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) if (FLT_FLOAT == dst_type) { float x = 0.0; - HDmemcpy(&x, &buf[j * dst_size], sizeof(float)); + memcpy(&x, &buf[j * dst_size], sizeof(float)); if (underflow && HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) continue; /* all underflowed, no error */ if (overflow && my_isinf(dendian, buf + j * sizeof(float), dst_size, dst_mpos, dst_msize, @@ -3169,7 +3169,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) } else if (FLT_DOUBLE == dst_type) { double x = 0.0; - HDmemcpy(&x, &buf[j * dst_size], sizeof(double)); + memcpy(&x, &buf[j * dst_size], sizeof(double)); if (underflow && HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) continue; /* all underflowed, no error */ if (overflow && my_isinf(dendian, buf + j * sizeof(double), dst_size, dst_mpos, dst_msize, @@ -3181,7 +3181,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) } else { long double x = 0.0L; - HDmemcpy(&x, &buf[j * dst_size], sizeof(long double)); + memcpy(&x, &buf[j * dst_size], sizeof(long double)); /* dst is largest float, no need to check underflow. */ check_mant[0] = (double)HDfrexpl(x, check_expo + 0); check_mant[1] = (double)HDfrexpl(hw_ld, check_expo + 1); @@ -3220,63 +3220,63 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) H5_WARNING(); } } - HDprintf(" elmt %u\n", (unsigned)j); + printf(" elmt %u\n", (unsigned)j); - HDprintf(" src ="); + printf(" src ="); for (k = 0; k < src_size; k++) - HDprintf(" %02x", saved[j * src_size + ENDIAN(src_size, k, sendian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)dst_size - (ssize_t)src_size)), ""); + printf(" %02x", saved[j * src_size + ENDIAN(src_size, k, sendian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)dst_size - (ssize_t)src_size)), ""); if (FLT_FLOAT == src_type) { float x = 0.0; - HDmemcpy(&x, &saved[j * src_size], sizeof(float)); - HDprintf(" %29.20e\n", (double)x); + memcpy(&x, &saved[j * src_size], sizeof(float)); + printf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE == src_type) { double x = 0.0; - HDmemcpy(&x, &saved[j * src_size], sizeof(double)); - HDprintf(" %29.20e\n", x); + memcpy(&x, &saved[j * src_size], sizeof(double)); + printf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE } else { long double x = 0.0L; - HDmemcpy(&x, &saved[j * src_size], sizeof(long double)); - HDfprintf(stdout, " %29.20Le\n", x); + memcpy(&x, &saved[j * src_size], sizeof(long double)); + fprintf(stdout, " %29.20Le\n", x); #endif } - HDprintf(" dst ="); + printf(" dst ="); for (k = 0; k < dst_size; k++) - HDprintf(" %02x", buf[j * dst_size + ENDIAN(dst_size, k, dendian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); + printf(" %02x", buf[j * dst_size + ENDIAN(dst_size, k, dendian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); if (FLT_FLOAT == dst_type) { float x = 0.0; - HDmemcpy(&x, &buf[j * dst_size], sizeof(float)); - HDprintf(" %29.20e\n", (double)x); + memcpy(&x, &buf[j * dst_size], sizeof(float)); + printf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE == dst_type) { double x = 0.0; - HDmemcpy(&x, &buf[j * dst_size], sizeof(double)); - HDprintf(" %29.20e\n", x); + memcpy(&x, &buf[j * dst_size], sizeof(double)); + printf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE } else { long double x = 0.0L; - HDmemcpy(&x, &buf[j * dst_size], sizeof(long double)); - HDfprintf(stdout, " %29.20Le\n", x); + memcpy(&x, &buf[j * dst_size], sizeof(long double)); + fprintf(stdout, " %29.20Le\n", x); #endif } - HDprintf(" ans ="); + printf(" ans ="); for (k = 0; k < dst_size; k++) - HDprintf(" %02x", hw[ENDIAN(dst_size, k, dendian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); + printf(" %02x", hw[ENDIAN(dst_size, k, dendian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); if (FLT_FLOAT == dst_type) - HDprintf(" %29.20e\n", (double)hw_f); + printf(" %29.20e\n", (double)hw_f); else if (FLT_DOUBLE == dst_type) - HDprintf(" %29.20e\n", hw_d); + printf(" %29.20e\n", hw_d); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE else - HDfprintf(stdout, " %29.20Le\n", hw_ld); + fprintf(stdout, " %29.20Le\n", hw_ld); #endif /* If the source is normalized values, print out error message; if it is @@ -3301,14 +3301,14 @@ done: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); - HDfflush(stdout); + free(aligned); + fflush(stdout); #ifdef HANDLE_SIGFPE if (run_test == TEST_NOOP || run_test == TEST_NORMAL) - HDexit(MIN((int)fails_all_tests, 254)); + exit(MIN((int)fails_all_tests, 254)); else if (run_test == TEST_DENORM || run_test == TEST_SPECIAL) - HDexit(EXIT_SUCCESS); - HDassert(0 && "Should not reach this point!"); + exit(EXIT_SUCCESS); + assert(0 && "Should not reach this point!"); return 1; #else /* Restore the default error handler (set in h5_reset()) */ @@ -3330,14 +3330,14 @@ error: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); - HDfflush(stdout); + free(aligned); + fflush(stdout); #ifdef HANDLE_SIGFPE if (run_test == TEST_NOOP || run_test == TEST_NORMAL) - HDexit(MIN(MAX((int)fails_all_tests, 1), 254)); + exit(MIN(MAX((int)fails_all_tests, 1), 254)); else if (run_test == TEST_DENORM || run_test == TEST_SPECIAL) - HDexit(EXIT_FAILURE); - HDassert(0 && "Should not reach this point!"); + exit(EXIT_FAILURE); + assert(0 && "Should not reach this point!"); return 1; #else /* Restore the default error handler (set in h5_reset()) */ @@ -3539,7 +3539,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) /* Sanity checks */ if (OTHER == src_type || OTHER == dst_type) { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); + printf("%-70s", str); H5_FAILED(); HDputs(" Unknown data type."); goto error; @@ -3550,7 +3550,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INT_LLONG == src_type || INT_ULLONG == src_type) && (FLT_FLOAT != dst_type && FLT_DOUBLE != dst_type && FLT_LDOUBLE != dst_type)) { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); + printf("%-70s", str); H5_FAILED(); HDputs(" 1. Not an integer-float conversion."); goto error; @@ -3561,7 +3561,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INT_INT != dst_type && INT_UINT != dst_type && INT_LONG != dst_type && INT_ULONG != dst_type && INT_LLONG != dst_type && INT_ULLONG != dst_type)) { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); + printf("%-70s", str); H5_FAILED(); HDputs(" 2. Not a float-integer conversion."); goto error; @@ -3571,8 +3571,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INT_INT == src_type || INT_UINT == src_type || INT_LONG == src_type || INT_ULONG == src_type || INT_LLONG == src_type || INT_ULLONG == src_type) { HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); - HDfflush(stdout); + printf("%-70s", str); + fflush(stdout); fails_this_test = 0; } else { @@ -3585,8 +3585,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) else HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, src_type_name, dst_type_name); - HDprintf("%-70s", str); - HDfflush(stdout); + printf("%-70s", str); + fflush(stdout); fails_this_test = 0; } @@ -3597,7 +3597,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) dst_size = H5Tget_size(dst); src_nbits = H5Tget_precision(src); /* not 8*src_size, esp on J90 - QAK */ dst_nbits = H5Tget_precision(dst); /* not 8*dst_size, esp on J90 - QAK */ - aligned = HDcalloc((size_t)1, MAX(sizeof(long double), sizeof(long long))); + aligned = calloc((size_t)1, MAX(sizeof(long double), sizeof(long long))); #ifdef SHOW_OVERFLOWS noverflows_g = 0; #endif @@ -3606,7 +3606,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) * 12 bytes but precision is 10 bytes. The 2 unused bytes may * have garbage causing wrong value comparison. */ - HDmemset(&hw_ldouble, 0, sizeof(long double)); + memset(&hw_ldouble, 0, sizeof(long double)); /* Create a dataset transfer property list and datatype conversion * exception handler function and pass in fill value. This is mainly @@ -3721,43 +3721,43 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_float; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_float = (float)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_float = (float)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_float = (float)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_float = (float)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_float = (float)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_float = (float)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_float = (float)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_float = (float)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_float = (float)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_float = (float)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -3765,7 +3765,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3773,43 +3773,43 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_double; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_double = (double)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_double = (double)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_double = (double)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_double = (double)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_double = (double)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_double = (double)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_double = (double)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_double = (double)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_double = (double)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_double = (double)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -3817,7 +3817,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3825,43 +3825,43 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_ldouble; switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); hw_ldouble = (long double)(*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); hw_ldouble = (long double)(*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); hw_ldouble = (long double)(*((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); hw_ldouble = (long double)(*((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); hw_ldouble = (long double)(*((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); hw_ldouble = (long double)(*((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); hw_ldouble = (long double)(*((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); hw_ldouble = (long double)(*((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); hw_ldouble = (long double)(*((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); hw_ldouble = (long double)(*((unsigned long long *)aligned)); break; case FLT_FLOAT: @@ -3869,7 +3869,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3877,15 +3877,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_schar; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_schar = (signed char)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_schar = (signed char)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_schar = (signed char)(*((long double *)aligned)); break; case INT_SCHAR: @@ -3900,7 +3900,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3908,15 +3908,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_uchar; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_uchar = (unsigned char)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_uchar = (unsigned char)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_uchar = (unsigned char)(*((long double *)aligned)); break; case INT_SCHAR: @@ -3931,7 +3931,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3939,15 +3939,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_short; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_short = (short)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_short = (short)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_short = (short)(*((long double *)aligned)); break; case INT_SCHAR: @@ -3962,7 +3962,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3970,15 +3970,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_ushort; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_ushort = (unsigned short)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_ushort = (unsigned short)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_ushort = (unsigned short)(*((long double *)aligned)); break; case INT_SCHAR: @@ -3993,7 +3993,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4001,15 +4001,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_int; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_int = (int)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_int = (int)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_int = (int)(*((long double *)aligned)); break; case INT_SCHAR: @@ -4024,7 +4024,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4032,15 +4032,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_uint; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_uint = (unsigned int)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_uint = (unsigned int)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_uint = (unsigned int)(*((long double *)aligned)); break; case INT_SCHAR: @@ -4055,7 +4055,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4063,15 +4063,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_long; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_long = (long)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_long = (long)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_long = (long)(*((long double *)aligned)); break; case INT_SCHAR: @@ -4086,7 +4086,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4094,15 +4094,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_ulong; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_ulong = (unsigned long)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_ulong = (unsigned long)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_ulong = (unsigned long)(*((long double *)aligned)); break; case INT_SCHAR: @@ -4117,7 +4117,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4125,15 +4125,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_llong; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_llong = (long long)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_llong = (long long)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_llong = (long long)(*((long double *)aligned)); break; case INT_SCHAR: @@ -4148,7 +4148,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4156,15 +4156,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char *)&hw_ullong; switch (src_type) { case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); hw_ullong = (unsigned long long)(*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); hw_ullong = (unsigned long long)(*((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); hw_ullong = (unsigned long long)(*((long double *)aligned)); break; case INT_SCHAR: @@ -4179,13 +4179,13 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } /* Make certain that there isn't some weird number of destination bits */ - HDassert(dst_nbits % 8 == 0); + assert(dst_nbits % 8 == 0); /* For Intel machines, the size of "long double" is 12 bytes, precision * is 80 bits; for AMD processors, the size of "long double" is 16 bytes, @@ -4321,181 +4321,181 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) H5_WARNING(); } } - HDprintf(" elmt %u: \n", (unsigned)j); + printf(" elmt %u: \n", (unsigned)j); - HDprintf(" src = "); + printf(" src = "); for (k = 0; k < src_size; k++) - HDprintf(" %02x", saved[j * src_size + ENDIAN(src_size, k, sendian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)dst_size - (ssize_t)src_size)), ""); + printf(" %02x", saved[j * src_size + ENDIAN(src_size, k, sendian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)dst_size - (ssize_t)src_size)), ""); switch (src_type) { case INT_SCHAR: - HDmemcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); - HDprintf(" %29d\n", (int)*((signed char *)aligned)); + memcpy(aligned, saved + j * sizeof(signed char), sizeof(signed char)); + printf(" %29d\n", (int)*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); - HDprintf(" %29u\n", (unsigned)*((unsigned char *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned char), sizeof(unsigned char)); + printf(" %29u\n", (unsigned)*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, saved + j * sizeof(short), sizeof(short)); - HDprintf(" %29hd\n", *((short *)aligned)); + memcpy(aligned, saved + j * sizeof(short), sizeof(short)); + printf(" %29hd\n", *((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); - HDprintf(" %29hu\n", *((unsigned short *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned short), sizeof(unsigned short)); + printf(" %29hu\n", *((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, saved + j * sizeof(int), sizeof(int)); - HDprintf(" %29d\n", *((int *)aligned)); + memcpy(aligned, saved + j * sizeof(int), sizeof(int)); + printf(" %29d\n", *((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); - HDprintf(" %29u\n", *((unsigned *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned), sizeof(unsigned)); + printf(" %29u\n", *((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, saved + j * sizeof(long), sizeof(long)); - HDprintf(" %29ld\n", *((long *)aligned)); + memcpy(aligned, saved + j * sizeof(long), sizeof(long)); + printf(" %29ld\n", *((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); - HDprintf(" %29lu\n", *((unsigned long *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned long), sizeof(unsigned long)); + printf(" %29lu\n", *((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); - HDfprintf(stdout, " %29lld\n", *((long long *)aligned)); + memcpy(aligned, saved + j * sizeof(long long), sizeof(long long)); + fprintf(stdout, " %29lld\n", *((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); - HDfprintf(stdout, " %29llu\n", *((unsigned long long *)aligned)); + memcpy(aligned, saved + j * sizeof(unsigned long long), sizeof(unsigned long long)); + fprintf(stdout, " %29llu\n", *((unsigned long long *)aligned)); break; case FLT_FLOAT: - HDmemcpy(aligned, saved + j * sizeof(float), sizeof(float)); - HDprintf(" %29f\n", (double)*((float *)aligned)); + memcpy(aligned, saved + j * sizeof(float), sizeof(float)); + printf(" %29f\n", (double)*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, saved + j * sizeof(double), sizeof(double)); - HDprintf(" %29f\n", *((double *)aligned)); + memcpy(aligned, saved + j * sizeof(double), sizeof(double)); + printf(" %29f\n", *((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); - HDprintf(" %29Lf\n", *((long double *)aligned)); + memcpy(aligned, saved + j * sizeof(long double), sizeof(long double)); + printf(" %29Lf\n", *((long double *)aligned)); break; case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } - HDprintf(" dst = "); + printf(" dst = "); for (k = 0; k < dst_size; k++) - HDprintf(" %02x", buf[j * dst_size + ENDIAN(dst_size, k, dendian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); + printf(" %02x", buf[j * dst_size + ENDIAN(dst_size, k, dendian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); switch (dst_type) { case INT_SCHAR: - HDmemcpy(aligned, buf + j * sizeof(signed char), sizeof(signed char)); - HDprintf(" %29d\n", (int)*((signed char *)aligned)); + memcpy(aligned, buf + j * sizeof(signed char), sizeof(signed char)); + printf(" %29d\n", (int)*((signed char *)aligned)); break; case INT_UCHAR: - HDmemcpy(aligned, buf + j * sizeof(unsigned char), sizeof(unsigned char)); - HDprintf(" %29u\n", (unsigned)*((unsigned char *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned char), sizeof(unsigned char)); + printf(" %29u\n", (unsigned)*((unsigned char *)aligned)); break; case INT_SHORT: - HDmemcpy(aligned, buf + j * sizeof(short), sizeof(short)); - HDprintf(" %29hd\n", *((short *)aligned)); + memcpy(aligned, buf + j * sizeof(short), sizeof(short)); + printf(" %29hd\n", *((short *)aligned)); break; case INT_USHORT: - HDmemcpy(aligned, buf + j * sizeof(unsigned short), sizeof(unsigned short)); - HDprintf(" %29hu\n", *((unsigned short *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned short), sizeof(unsigned short)); + printf(" %29hu\n", *((unsigned short *)aligned)); break; case INT_INT: - HDmemcpy(aligned, buf + j * sizeof(int), sizeof(int)); - HDprintf(" %29d\n", *((int *)aligned)); + memcpy(aligned, buf + j * sizeof(int), sizeof(int)); + printf(" %29d\n", *((int *)aligned)); break; case INT_UINT: - HDmemcpy(aligned, buf + j * sizeof(unsigned), sizeof(unsigned)); - HDprintf(" %29u\n", *((unsigned *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned), sizeof(unsigned)); + printf(" %29u\n", *((unsigned *)aligned)); break; case INT_LONG: - HDmemcpy(aligned, buf + j * sizeof(long), sizeof(long)); - HDprintf(" %29ld\n", *((long *)aligned)); + memcpy(aligned, buf + j * sizeof(long), sizeof(long)); + printf(" %29ld\n", *((long *)aligned)); break; case INT_ULONG: - HDmemcpy(aligned, buf + j * sizeof(unsigned long), sizeof(unsigned long)); - HDprintf(" %29lu\n", *((unsigned long *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned long), sizeof(unsigned long)); + printf(" %29lu\n", *((unsigned long *)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, buf + j * sizeof(long long), sizeof(long long)); - HDfprintf(stdout, " %29lld\n", *((long long *)aligned)); + memcpy(aligned, buf + j * sizeof(long long), sizeof(long long)); + fprintf(stdout, " %29lld\n", *((long long *)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, buf + j * sizeof(unsigned long long), sizeof(unsigned long long)); - HDfprintf(stdout, " %29llu\n", *((unsigned long long *)aligned)); + memcpy(aligned, buf + j * sizeof(unsigned long long), sizeof(unsigned long long)); + fprintf(stdout, " %29llu\n", *((unsigned long long *)aligned)); break; case FLT_FLOAT: - HDmemcpy(aligned, buf + j * sizeof(float), sizeof(float)); - HDprintf(" %29f\n", (double)*((float *)aligned)); + memcpy(aligned, buf + j * sizeof(float), sizeof(float)); + printf(" %29f\n", (double)*((float *)aligned)); break; case FLT_DOUBLE: - HDmemcpy(aligned, buf + j * sizeof(double), sizeof(double)); - HDprintf(" %29f\n", *((double *)aligned)); + memcpy(aligned, buf + j * sizeof(double), sizeof(double)); + printf(" %29f\n", *((double *)aligned)); break; case FLT_LDOUBLE: - HDmemcpy(aligned, buf + j * sizeof(long double), sizeof(long double)); - HDprintf(" %29Lf\n", *((long double *)aligned)); + memcpy(aligned, buf + j * sizeof(long double), sizeof(long double)); + printf(" %29Lf\n", *((long double *)aligned)); break; case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } - HDprintf(" and = "); + printf(" and = "); for (k = 0; k < dst_size; k++) - HDprintf(" %02x", hw[ENDIAN(dst_size, k, dendian)]); - HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); + printf(" %02x", hw[ENDIAN(dst_size, k, dendian)]); + printf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); switch (dst_type) { case INT_SCHAR: - HDprintf(" %29d\n", (int)*((signed char *)((void *)hw))); + printf(" %29d\n", (int)*((signed char *)((void *)hw))); break; case INT_UCHAR: - HDprintf(" %29u\n", (unsigned)*((unsigned char *)((void *)hw))); + printf(" %29u\n", (unsigned)*((unsigned char *)((void *)hw))); break; case INT_SHORT: - HDprintf(" %29hd\n", *((short *)((void *)hw))); + printf(" %29hd\n", *((short *)((void *)hw))); break; case INT_USHORT: - HDprintf(" %29hu\n", *((unsigned short *)((void *)hw))); + printf(" %29hu\n", *((unsigned short *)((void *)hw))); break; case INT_INT: - HDprintf(" %29d\n", *((int *)((void *)hw))); + printf(" %29d\n", *((int *)((void *)hw))); break; case INT_UINT: - HDprintf(" %29u\n", *((unsigned int *)((void *)hw))); + printf(" %29u\n", *((unsigned int *)((void *)hw))); break; case INT_LONG: - HDprintf(" %29ld\n", *((long *)((void *)hw))); + printf(" %29ld\n", *((long *)((void *)hw))); break; case INT_ULONG: - HDprintf(" %29lu\n", *((unsigned long *)((void *)hw))); + printf(" %29lu\n", *((unsigned long *)((void *)hw))); break; case INT_LLONG: - HDfprintf(stdout, " %29lld\n", *((long long *)((void *)hw))); + fprintf(stdout, " %29lld\n", *((long long *)((void *)hw))); break; case INT_ULLONG: - HDfprintf(stdout, " %29llu\n", *((unsigned long long *)((void *)hw))); + fprintf(stdout, " %29llu\n", *((unsigned long long *)((void *)hw))); break; case FLT_FLOAT: - HDprintf(" %29f\n", (double)*((float *)((void *)hw))); + printf(" %29f\n", (double)*((float *)((void *)hw))); break; case FLT_DOUBLE: - HDprintf(" %29f\n", *((double *)((void *)hw))); + printf(" %29f\n", *((double *)((void *)hw))); break; case FLT_LDOUBLE: - HDprintf(" %29Lf\n", *((long double *)((void *)hw))); + printf(" %29Lf\n", *((long double *)((void *)hw))); break; case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } @@ -4521,8 +4521,8 @@ done: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); - HDfflush(stdout); + free(aligned); + fflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -4541,8 +4541,8 @@ error: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); - HDfflush(stdout); + free(aligned); + fflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -4552,7 +4552,7 @@ error: if (run_test == TEST_NORMAL) return MAX((int)fails_all_tests, 1); else { - HDassert(run_test == TEST_DENORM || run_test == TEST_SPECIAL); + assert(run_test == TEST_DENORM || run_test == TEST_SPECIAL); return 1; } } @@ -4585,8 +4585,8 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) ssize_t indx; unsigned char bits[32], mant_bits[32]; - HDmemset(bits, 0, (size_t)32); - HDmemset(mant_bits, 0, (size_t)32); + memset(bits, 0, (size_t)32); + memset(mant_bits, 0, (size_t)32); /* * Sometimes, type size isn't equal to the precision like Linux's "long @@ -4598,7 +4598,7 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) bias = H5Tget_ebias(src_id); norm = H5Tget_norm(src_id); - HDmemcpy(bits, origin_bits, src_prec / 8 + 1); + memcpy(bits, origin_bits, src_prec / 8 + 1); /*Check for special cases: +Inf, -Inf*/ if (H5T__bit_find(bits, mpos, mant_digits, H5T_BIT_LSB, TRUE) < 0) { @@ -4853,7 +4853,7 @@ run_fp_tests(const char *name) HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, "long double", "float"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); } @@ -4877,7 +4877,7 @@ run_fp_tests(const char *name) HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double", "float or double"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); } @@ -4956,7 +4956,7 @@ run_int_fp_conv(const char *name) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "(unsigned) long", "long double"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to the special algorithm of hardware conversion."); } @@ -4970,7 +4970,7 @@ run_int_fp_conv(const char *name) char str[256]; /*hello string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long long", "long double"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to compiler error in handling conversion."); } @@ -4983,7 +4983,7 @@ run_int_fp_conv(const char *name) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "unsigned long long", "long double"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to compiler not handling conversion."); } @@ -5075,7 +5075,7 @@ run_fp_int_conv(const char *name) HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double", "signed and unsigned char, short, int, long"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); #endif @@ -5098,7 +5098,7 @@ run_fp_int_conv(const char *name) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "(unsigned) long"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to the special algorithm of hardware conversion."); } @@ -5113,7 +5113,7 @@ run_fp_int_conv(const char *name) char str[256]; /*string */ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "long long"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to hardware conversion error."); } @@ -5126,7 +5126,7 @@ run_fp_int_conv(const char *name) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "unsigned long long"); - HDprintf("%-70s", str); + printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to hardware conversion error."); } @@ -5163,7 +5163,7 @@ main(void) reset_hdf5(); if (ALIGNMENT) - HDprintf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); + printf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); /* Do the tests */ @@ -5229,9 +5229,9 @@ main(void) h5_restore_err(); if (nerrors) { - HDprintf("***** %lu FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S"); - HDexit(EXIT_FAILURE); + printf("***** %lu FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S"); + exit(EXIT_FAILURE); } - HDprintf("All data type tests passed.\n"); + printf("All data type tests passed.\n"); return 0; } |