# Commands covered: apply # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2005-2006 Miguel Sofer # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.2 namespace import -force ::tcltest::* } if {[info commands ::apply] eq {}} { return } testConstraint memory [llength [info commands memory]] # Tests for wrong number of arguments test apply-1.1 {too few arguments} -returnCodes error -body { apply } -result {wrong # args: should be "apply lambdaExpr ?arg ...?"} # Tests for malformed lambda test apply-2.0 {malformed lambda} -returnCodes error -body { set lambda a apply $lambda } -result {can't interpret "a" as a lambda expression} test apply-2.1 {malformed lambda} -returnCodes error -body { set lambda [list a b c d] apply $lambda } -result {can't interpret "a b c d" as a lambda expression} test apply-2.2 {malformed lambda} { set lambda [list {{}} boo] list [catch {apply $lambda} msg] $msg $::errorInfo } {1 {argument with no name} {argument with no name (parsing lambda expression "{{}} boo") invoked from within "apply $lambda"}} test apply-2.3 {malformed lambda} { set lambda [list {{a b c}} boo] list [catch {apply $lambda} msg] $msg $::errorInfo } {1 {too many fields in argument specifier "a b c"} {too many fields in argument specifier "a b c" (parsing lambda expression "{{a b c}} boo") invoked from within "apply $lambda"}} test apply-2.4 {malformed lambda} { set lambda [list a(1) boo] list [catch {apply $lambda} msg] $msg $::errorInfo } {1 {formal parameter "a(1)" is an array element} {formal parameter "a(1)" is an array element (parsing lambda expression "a(1) boo") invoked from within "apply $lambda"}} test apply-2.5 {malformed lambda} { set lambda [list a::b boo] list [catch {apply $lambda} msg] $msg $::errorInfo } {1 {formal parameter "a::b" is not a simple name} {formal parameter "a::b" is not a simple name (parsing lambda expression "a::b boo") invoked from within "apply $lambda"}} # Tests for runtime errors in the lambda expression test apply-3.1 {non-existing namespace} -body { apply [list x {set x 1} ::NONEXIST::FOR::SURE] x } -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-3.2 {non-existing namespace} -body { namespace eval ::NONEXIST::FOR::SURE {} set lambda [list x {set x 1} ::NONEXIST::FOR::SURE] apply $lambda x namespace delete ::NONEXIST apply $lambda x } -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-3.3 {non-existing namespace} -body { apply [list x {set x 1} NONEXIST::FOR::SURE] x } -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-3.4 {non-existing namespace} -body { namespace eval ::NONEXIST::FOR::SURE {} set lambda [list x {set x 1} NONEXIST::FOR::SURE] apply $lambda x namespace delete ::NONEXIST apply $lambda x } -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-4.1 {error in arguments to lambda expression} -body { set lambda [list x {set x 1}] apply $lambda } -returnCodes error -result {wrong # args: should be "apply lambdaExpr x"} test apply-4.2 {error in arguments to lambda expression} -body { set lambda [list x {set x 1}] apply $lambda a b } -returnCodes error -result {wrong # args: should be "apply lambdaExpr x"} test apply-4.3 {error in arguments to lambda expression} -body { interp alias {} foo {} ::apply [list x {set x 1}] foo a b } -cleanup { rename foo {} } -returnCodes error -result {wrong # args: should be "foo x"} test apply-4.4 {error in arguments to lambda expression} -body { interp alias {} foo {} ::apply [list x {set x 1}] a foo b } -cleanup { rename foo {} } -returnCodes error -result {wrong # args: should be "foo"} test apply-4.5 {error in arguments to lambda expression} -body { set lambda [list x {set x 1}] namespace eval a { namespace ensemble create -command ::bar -map {id {::a::const foo}} proc const val { return $val } proc alias {object slot = command args} { set map [namespace ensemble configure $object -map] dict set map $slot [linsert $args 0 $command] namespace ensemble configure $object -map $map } proc method {object name params body} { set params [linsert $params 0 self] alias $object $name = ::apply [list $params $body] $object } method ::bar boo x {return "[expr {$x*$x}] - $self"} } bar boo } -cleanup { namespace delete ::a } -returnCodes error -result {wrong # args: should be "bar boo x"} test apply-5.1 {runtime error in lambda expression} { set lambda [list {} {error foo}] set res [catch {apply $lambda}] list $res $::errorInfo } {1 {foo while executing "error foo" (lambda term "{} {error foo}" line 1) invoked from within "apply $lambda"}} # Tests for correct execution; as the implementation is the same as that for # procs, the general functionality is mostly tested elsewhere test apply-6.1 {info level} { set lev [info level] set lambda [list {} {info level}] expr {[apply $lambda] - $lev} } 1 test apply-6.2 {info level} { set lambda [list {} {info level 0}] apply $lambda } {apply {{} {info level 0}}} test apply-6.3 {info level} { set lambda [list args {info level 0}] apply $lambda x y } {apply {args {info level 0}} x y} # Tests for correct namespace scope namespace eval ::testApply { proc testApply args {return testApply} } test apply-7.1 {namespace access} { set ::testApply::x 0 set body {set x 1; set x} list [apply [list args $body ::testApply]] $::testApply::x } {1 0} test apply-7.2 {namespace access} { set ::testApply::x 0 set body {variable x; set x} list [apply [list args $body ::testApply]] $::testApply::x } {0 0} test apply-7.3 {namespace access} { set ::testApply::x 0 set body {variable x; set x 1} list [apply [list args $body ::testApply]] $::testApply::x } {1 1} test apply-7.4 {namespace access} { set ::testApply::x 0 set body {testApply} apply [list args $body ::testApply] } testApply test apply-7.5 {namespace access} { set ::testApply::x 0 set body {set x 1; set x} list [apply [list args $body testApply]] $::testApply::x } {1 0} test apply-7.6 {namespace access} { set ::testApply::x 0 set body {variable x; set x} list [apply [list args $body testApply]] $::testApply::x } {0 0} test apply-7.7 {namespace access} { set ::testApply::x 0 set body {variable x; set x 1} list [apply [list args $body testApply]] $::testApply::x } {1 1} test apply-7.8 {namespace access} { set ::testApply::x 0 set body {testApply} apply [list args $body testApply] } testApply # Tests for correct argument treatment set applyBody { set res {} foreach v [info locals] { if {$v eq "res"} continue lappend res [list $v [set $v]] } set res } test apply-8.1 {args treatment} { apply [list args $applyBody] 1 2 3 } {{args {1 2 3}}} test apply-8.2 {args treatment} { apply [list {x args} $applyBody] 1 2 } {{x 1} {args 2}} test apply-8.3 {args treatment} { apply [list {x args} $applyBody] 1 2 3 } {{x 1} {args {2 3}}} test apply-8.4 {default values} { apply [list {{x 1} {y 2}} $applyBody] } {{x 1} {y 2}} test apply-8.5 {default values} { apply [list {{x 1} {y 2}} $applyBody] 3 4 } {{x 3} {y 4}} test apply-8.6 {default values} { apply [list {{x 1} {y 2}} $applyBody] 3 } {{x 3} {y 2}} test apply-8.7 {default values} { apply [list {x {y 2}} $applyBody] 1 } {{x 1} {y 2}} test apply-8.8 {default values} { apply [list {x {y 2}} $applyBody] 1 3 } {{x 1} {y 3}} test apply-8.9 {default values} { apply [list {x {y 2} args} $applyBody] 1 } {{x 1} {y 2} {args {}}} test apply-8.10 {default values} { apply [list {x {y 2} args} $applyBody] 1 3 } {{x 1} {y 3} {args {}}} # Tests for leaks test apply-9.1 {leaking internal rep} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } set lam [list {} {set a 1}] } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { ::apply [lrange $lam 0 end] set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { rename getbytes {} unset -nocomplain lam end i tmp leakedBytes } -result 0 test apply-9.2 {leaking internal rep} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { ::apply [list {} {set a 1}] set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { rename getbytes {} unset -nocomplain end i tmp leakedBytes } -result 0 test apply-9.3 {leaking internal rep} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { set x [list {} {set a 1} ::NS::THAT::DOES::NOT::EXIST] catch {::apply $x} set x {} set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { rename getbytes {} unset -nocomplain end i x tmp leakedBytes } -result 0 # Tests for the avoidance of recompilation # cleanup namespace delete testApply ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: s-git/hdf5.git/commit/?h=architecture_docs&id=6c0f954d683142e123baa4d48f5a69d5e20aa11d'>6c0f954d683142e123baa4d48f5a69d5e20aa11d (diff)downloadhdf5-16eab69bcd5219bef52cf9de88d8e1fa7557fc48.zip
hdf5-16eab69bcd5219bef52cf9de88d8e1fa7557fc48.tar.gz
hdf5-16eab69bcd5219bef52cf9de88d8e1fa7557fc48.tar.bz2
Replaces C std library calls with H5MM equivalents
Mostly H5MM_memcpy in newer VFDs
Diffstat
-rw-r--r--src/H5FDhdfs.c8
-rw-r--r--src/H5FDmirror.c22
-rw-r--r--src/H5FDros3.c8
-rw-r--r--src/H5FDs3comms.c30
-rw-r--r--src/H5FDsplitter.c6
-rw-r--r--src/H5Tref.c4
6 files changed, 39 insertions, 39 deletions
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
index b4aecfd..38145d0 100644
--- a/src/H5FDhdfs.c
+++ b/src/H5FDhdfs.c
@@ -674,7 +674,7 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
/* Copy the hdfs fapl data out */
- HDmemcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t));
+ H5MM_memcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t));
done:
FUNC_LEAVE_API(ret_value)
@@ -709,7 +709,7 @@ H5FD__hdfs_fapl_get(H5FD_t *_file)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed")
/* Copy the fields of the structure */
- HDmemcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t));
+ H5MM_memcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t));
ret_value = fa;
@@ -747,7 +747,7 @@ H5FD__hdfs_fapl_copy(const void *_old_fa)
if (new_fa == NULL)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed")
- HDmemcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t));
+ H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t));
ret_value = new_fa;
done:
@@ -904,7 +904,7 @@ H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr
if (file == NULL)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct")
file->hdfs_handle = handle;
- HDmemcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t));
+ H5MM_memcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t));
#if HDFS_STATS
if (FAIL == hdfs__reset_stats(file))
diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c
index 8f1d25c..7ea9609 100644
--- a/src/H5FDmirror.c
+++ b/src/H5FDmirror.c
@@ -298,7 +298,7 @@ H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *_buf)
HDassert(_buf && out);
- HDmemcpy(&n, _buf, sizeof(n));
+ H5MM_memcpy(&n, _buf, sizeof(n));
*out = (uint16_t)HDntohs(n);
return 2; /* number of bytes eaten */
@@ -326,7 +326,7 @@ H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf)
HDassert(_buf && out);
- HDmemcpy(&n, _buf, sizeof(n));
+ H5MM_memcpy(&n, _buf, sizeof(n));
*out = (uint32_t)HDntohl(n);
return 4; /* number of bytes eaten */
@@ -385,7 +385,7 @@ H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf)
HDassert(_buf && out);
- HDmemcpy(&n, _buf, sizeof(n));
+ H5MM_memcpy(&n, _buf, sizeof(n));
if (TRUE == is_host_little_endian())
*out = BSWAP_64(n);
else
@@ -412,7 +412,7 @@ H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *_buf)
HDassert(_buf && out);
- HDmemcpy(out, _buf, sizeof(uint8_t));
+ H5MM_memcpy(out, _buf, sizeof(uint8_t));
return 1; /* number of bytes eaten */
} /* end H5FD__mirror_xmit_decode_uint8() */
@@ -439,7 +439,7 @@ H5FD__mirror_xmit_encode_uint16(unsigned char *_dest, uint16_t v)
HDassert(_dest);
n = (uint16_t)HDhtons(v);
- HDmemcpy(_dest, &n, sizeof(n));
+ H5MM_memcpy(_dest, &n, sizeof(n));
return 2;
} /* end H5FD__mirror_xmit_encode_uint16() */
@@ -466,7 +466,7 @@ H5FD__mirror_xmit_encode_uint32(unsigned char *_dest, uint32_t v)
HDassert(_dest);
n = (uint32_t)HDhtonl(v);
- HDmemcpy(_dest, &n, sizeof(n));
+ H5MM_memcpy(_dest, &n, sizeof(n));
return 4;
} /* end H5FD__mirror_xmit_encode_uint32() */
@@ -494,7 +494,7 @@ H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v)
if (TRUE == is_host_little_endian())
n = BSWAP_64(v);
- HDmemcpy(_dest, &n, sizeof(n));
+ H5MM_memcpy(_dest, &n, sizeof(n));
return 8;
} /* H5FD__mirror_xmit_encode_uint64() */
@@ -519,7 +519,7 @@ H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v)
HDassert(dest);
- HDmemcpy(dest, &v, sizeof(v));
+ H5MM_memcpy(dest, &v, sizeof(v));
return 1;
} /* end H5FD__mirror_xmit_encode_uint8() */
@@ -1188,7 +1188,7 @@ H5FD__mirror_fapl_get(H5FD_t *_file)
if (NULL == fa)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "calloc failed");
- HDmemcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t));
+ H5MM_memcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t));
ret_value = fa;
@@ -1224,7 +1224,7 @@ H5FD__mirror_fapl_copy(const void *_old_fa)
if (new_fa == NULL)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed");
- HDmemcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t));
+ H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t));
ret_value = new_fa;
done:
@@ -1298,7 +1298,7 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out)
HDassert(fa->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */
- HDmemcpy(fa_out, fa, sizeof(H5FD_mirror_fapl_t));
+ H5MM_memcpy(fa_out, fa, sizeof(H5FD_mirror_fapl_t));
done:
FUNC_LEAVE_API(ret_value);
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index cc27fd0..a557f1d 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -500,7 +500,7 @@ H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
/* Copy the ros3 fapl data out */
- HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t));
+ H5MM_memcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t));
done:
FUNC_LEAVE_API(ret_value)
@@ -535,7 +535,7 @@ H5FD__ros3_fapl_get(H5FD_t *_file)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Copy the fields of the structure */
- HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t));
+ H5MM_memcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t));
/* Set return value */
ret_value = fa;
@@ -575,7 +575,7 @@ H5FD__ros3_fapl_copy(const void *_old_fa)
if (new_fa == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
- HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t));
+ H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t));
ret_value = new_fa;
done:
@@ -768,7 +768,7 @@ H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
file->s3r_handle = handle;
- HDmemcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t));
+ H5MM_memcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t));
#if ROS3_STATS
if (FAIL == ros3_reset_stats(file))
diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c
index 92921ad..ac58f67 100644
--- a/src/H5FDs3comms.c
+++ b/src/H5FDs3comms.c
@@ -144,7 +144,7 @@ curlwritecallback(char *ptr, size_t size, size_t nmemb, void *userdata)
return written;
if (size > 0) {
- HDmemcpy(&(sds->data[sds->size]), ptr, product);
+ H5MM_memcpy(&(sds->data[sds->size]), ptr, product);
sds->size += product;
written = product;
}
@@ -263,12 +263,12 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
namecpy = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
if (namecpy == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy.");
- HDmemcpy(namecpy, name, (namelen + 1));
+ H5MM_memcpy(namecpy, name, (namelen + 1));
valuecpy = (char *)H5MM_malloc(sizeof(char) * (valuelen + 1));
if (valuecpy == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy.");
- HDmemcpy(valuecpy, value, (valuelen + 1));
+ H5MM_memcpy(valuecpy, value, (valuelen + 1));
nvcat = (char *)H5MM_malloc(sizeof(char) * catwrite);
if (nvcat == NULL)
@@ -701,14 +701,14 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch
res = (char *)H5MM_malloc(sizeof(char) * (reslen + 1));
if (res == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string");
- HDmemcpy(res, _resource, (reslen + 1));
+ H5MM_memcpy(res, _resource, (reslen + 1));
}
else {
res = (char *)H5MM_malloc(sizeof(char) * (reslen + 2));
if (res == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string");
*res = '/';
- HDmemcpy((&res[1]), _resource, (reslen + 1));
+ H5MM_memcpy((&res[1]), _resource, (reslen + 1));
HDassert((reslen + 1) == HDstrlen(res));
} /* end if (else resource string not starting with '/') */
@@ -910,7 +910,7 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16);
if (handle->httpverb == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for S3 request HTTP verb");
- HDmemcpy(handle->httpverb, "HEAD", 5);
+ H5MM_memcpy(handle->httpverb, "HEAD", 5);
headerresponse = (char *)H5MM_malloc(sizeof(char) * CURL_MAX_HTTP_HEADER);
if (headerresponse == NULL)
@@ -1078,19 +1078,19 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
handle->region = (char *)H5MM_malloc(sizeof(char) * tmplen);
if (handle->region == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy.");
- HDmemcpy(handle->region, region, tmplen);
+ H5MM_memcpy(handle->region, region, tmplen);
tmplen = HDstrlen(id) + 1;
handle->secret_id = (char *)H5MM_malloc(sizeof(char) * tmplen);
if (handle->secret_id == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy.");
- HDmemcpy(handle->secret_id, id, tmplen);
+ H5MM_memcpy(handle->secret_id, id, tmplen);
tmplen = SHA256_DIGEST_LENGTH;
handle->signing_key = (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen);
if (handle->signing_key == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy.");
- HDmemcpy(handle->signing_key, signing_key, tmplen);
+ H5MM_memcpy(handle->signing_key, signing_key, tmplen);
} /* if authentication information provided */
/************************
@@ -1138,7 +1138,7 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
*********************/
HDassert(handle->httpverb != NULL);
- HDmemcpy(handle->httpverb, "GET", 4);
+ H5MM_memcpy(handle->httpverb, "GET", 4);
ret_value = handle;
@@ -2150,7 +2150,7 @@ H5FD_s3comms_nlowercase(char *dest, const char *s, size_t len)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.");
if (len > 0) {
- HDmemcpy(dest, s, len);
+ H5MM_memcpy(dest, s, len);
do {
len--;
dest[len] = (char)HDtolower((int)dest[len]);
@@ -2686,14 +2686,14 @@ H5FD_s3comms_tostringtosign(char *dest, const char *req, const char *now, const
if (ret <= 0 || ret >= 127)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem adding day and region to string")
- HDmemcpy((dest + d), "AWS4-HMAC-SHA256\n", 17);
+ H5MM_memcpy((dest + d), "AWS4-HMAC-SHA256\n", 17);
d = 17;
- HDmemcpy((dest + d), now, HDstrlen(now));
+ H5MM_memcpy((dest + d), now, HDstrlen(now));
d += HDstrlen(now);
dest[d++] = '\n';
- HDmemcpy((dest + d), tmp, HDstrlen(tmp));
+ H5MM_memcpy((dest + d), tmp, HDstrlen(tmp));
d += HDstrlen(tmp);
dest[d++] = '\n';
@@ -2777,7 +2777,7 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written)
s_len++;
/* write output into dest */
- HDmemcpy(dest, s, s_len);
+ H5MM_memcpy(dest, s, s_len);
}
}
diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c
index 698ae7e..6ecafe0 100644
--- a/src/H5FDsplitter.c
+++ b/src/H5FDsplitter.c
@@ -585,7 +585,7 @@ H5FD__splitter_fapl_copy(const void *_old_fa)
if (NULL == new_fa_ptr)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL")
- HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t));
+ H5MM_memcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t));
HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
@@ -1300,14 +1300,14 @@ H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const
char * s;
size = HDstrlen(atfunc) + HDstrlen(msg) + 3; /* ':', ' ', '\n' */
- s = (char *)HDmalloc(sizeof(char) * (size + 1));
+ s = (char *)H5MM_malloc(sizeof(char) * (size + 1));
if (NULL == s)
ret_value = FAIL;
else if (size < (size_t)HDsnprintf(s, size + 1, "%s: %s\n", atfunc, msg))
ret_value = FAIL;
else if (size != HDfwrite(s, 1, size, file->logfp))
ret_value = FAIL;
- HDfree(s);
+ H5MM_free(s);
}
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Tref.c b/src/H5Tref.c