@@ -28,7 +28,7 @@ RT_API_ATTRS OwningPtr<char> SaveDefaultCharacter(
28
28
const char *s, std::size_t length, const Terminator &terminator) {
29
29
if (s) {
30
30
auto *p{static_cast <char *>(AllocateMemoryOrCrash (terminator, length + 1 ))};
31
- std ::memcpy (p, s, length);
31
+ Fortran::runtime ::memcpy (p, s, length);
32
32
p[length] = ' \0 ' ;
33
33
return OwningPtr<char >{p};
34
34
} else {
@@ -75,10 +75,10 @@ RT_API_ATTRS void ToFortranDefaultCharacter(
75
75
char *to, std::size_t toLength, const char *from) {
76
76
std::size_t len{Fortran::runtime::strlen (from)};
77
77
if (len < toLength) {
78
- std ::memcpy (to, from, len);
79
- std ::memset (to + len, ' ' , toLength - len);
78
+ Fortran::runtime ::memcpy (to, from, len);
79
+ Fortran::runtime ::memset (to + len, ' ' , toLength - len);
80
80
} else {
81
- std ::memcpy (to, from, toLength);
81
+ Fortran::runtime ::memcpy (to, from, toLength);
82
82
}
83
83
}
84
84
@@ -122,7 +122,7 @@ RT_API_ATTRS void ShallowCopyDiscontiguousToDiscontiguous(
122
122
std::size_t elementBytes{to.ElementBytes ()};
123
123
for (std::size_t n{to.Elements ()}; n-- > 0 ;
124
124
to.IncrementSubscripts (toAt), from.IncrementSubscripts (fromAt)) {
125
- std ::memcpy (
125
+ Fortran::runtime ::memcpy (
126
126
to.Element <char >(toAt), from.Element <char >(fromAt), elementBytes);
127
127
}
128
128
}
@@ -135,7 +135,7 @@ RT_API_ATTRS void ShallowCopyDiscontiguousToContiguous(
135
135
std::size_t elementBytes{to.ElementBytes ()};
136
136
for (std::size_t n{to.Elements ()}; n-- > 0 ;
137
137
toAt += elementBytes, from.IncrementSubscripts (fromAt)) {
138
- std ::memcpy (toAt, from.Element <char >(fromAt), elementBytes);
138
+ Fortran::runtime ::memcpy (toAt, from.Element <char >(fromAt), elementBytes);
139
139
}
140
140
}
141
141
@@ -147,15 +147,15 @@ RT_API_ATTRS void ShallowCopyContiguousToDiscontiguous(
147
147
std::size_t elementBytes{to.ElementBytes ()};
148
148
for (std::size_t n{to.Elements ()}; n-- > 0 ;
149
149
to.IncrementSubscripts (toAt), fromAt += elementBytes) {
150
- std ::memcpy (to.Element <char >(toAt), fromAt, elementBytes);
150
+ Fortran::runtime ::memcpy (to.Element <char >(toAt), fromAt, elementBytes);
151
151
}
152
152
}
153
153
154
154
RT_API_ATTRS void ShallowCopy (const Descriptor &to, const Descriptor &from,
155
155
bool toIsContiguous, bool fromIsContiguous) {
156
156
if (toIsContiguous) {
157
157
if (fromIsContiguous) {
158
- std ::memcpy (to.OffsetElement (), from.OffsetElement (),
158
+ Fortran::runtime ::memcpy (to.OffsetElement (), from.OffsetElement (),
159
159
to.Elements () * to.ElementBytes ());
160
160
} else {
161
161
ShallowCopyDiscontiguousToContiguous (to, from);
@@ -177,7 +177,7 @@ RT_API_ATTRS char *EnsureNullTerminated(
177
177
char *str, std::size_t length, Terminator &terminator) {
178
178
if (runtime::memchr (str, ' \0 ' , length) == nullptr ) {
179
179
char *newCmd{(char *)AllocateMemoryOrCrash (terminator, length + 1 )};
180
- std ::memcpy (newCmd, str, length);
180
+ Fortran::runtime ::memcpy (newCmd, str, length);
181
181
newCmd[length] = ' \0 ' ;
182
182
return newCmd;
183
183
} else {
@@ -209,7 +209,7 @@ RT_API_ATTRS std::int32_t CopyCharsToDescriptor(const Descriptor &value,
209
209
return ToErrmsg (errmsg, StatValueTooShort);
210
210
}
211
211
212
- std ::memcpy (value.OffsetElement (offset), rawValue, toCopy);
212
+ Fortran::runtime ::memcpy (value.OffsetElement (offset), rawValue, toCopy);
213
213
214
214
if (static_cast <std::int64_t >(rawValueLength) > toCopy) {
215
215
return ToErrmsg (errmsg, StatValueTooShort);
0 commit comments