Skip to content

Commit b55bb5f

Browse files
committed
final nits
1 parent bad673a commit b55bb5f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

flang/include/flang/Runtime/time-intrinsic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
#include <cstddef>
1717

18-
void copyBufferAndPad(
19-
char *dest, std::size_t destChars, char *buffer, std::size_t len);
18+
void CopyBufferAndPad(
19+
char *dest, std::size_t destChars, const char *buffer, std::size_t len);
2020

2121
#endif // TIME_INTRINSIC_H
2222

flang/runtime/extensions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "flang/Runtime/command.h"
1515
#include "flang/Runtime/descriptor.h"
1616
#include "flang/Runtime/io-api.h"
17-
#include "flang/Runtime/time-intrinsic.h" // copyBufferAndPad
17+
#include "flang/Runtime/time-intrinsic.h" // CopyBufferAndPad
1818
#include <cstring>
1919

2020
#ifdef _WIN32
@@ -88,7 +88,7 @@ void FORTRAN_PROCEDURE_NAME(getlog)(std::int8_t *arg, std::int64_t length) {
8888
Terminator terminator{__FILE__, __LINE__};
8989
RUNTIME_CHECK(terminator, error == 0);
9090

91-
copyBufferAndPad(
91+
CopyBufferAndPad(
9292
reinterpret_cast<char *>(arg), length, str.data(), str.size());
9393
}
9494

flang/runtime/time-intrinsic.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
// default values provided.
4242

4343
// outside anonymous namespace, function reused
44-
void copyBufferAndPad(
45-
char *dest, std::size_t destChars, char *buffer, std::size_t len) {
44+
void CopyBufferAndPad(
45+
char *dest, std::size_t destChars, const char *buffer, std::size_t len) {
4646
auto copyLen{std::min(len, destChars)};
4747
std::memcpy(dest, buffer, copyLen);
4848
for (auto i{copyLen}; i < destChars; ++i) {
@@ -293,19 +293,19 @@ static void GetDateAndTime(Fortran::runtime::Terminator &terminator, char *date,
293293

294294
if (date) {
295295
auto len = std::strftime(buffer, buffSize, "%Y%m%d", &localTime);
296-
copyBufferAndPad(date, dateChars, buffer, len);
296+
CopyBufferAndPad(date, dateChars, buffer, len);
297297
}
298298
if (time) {
299299
auto len{std::snprintf(buffer, buffSize, "%02d%02d%02d.%03jd",
300300
localTime.tm_hour, localTime.tm_min, localTime.tm_sec, ms)};
301-
copyBufferAndPad(time, timeChars, buffer, len);
301+
CopyBufferAndPad(time, timeChars, buffer, len);
302302
}
303303
if (zone) {
304304
// Note: this may leave the buffer empty on many platforms. Classic flang
305305
// has a much more complex way of doing this (see __io_timezone in classic
306306
// flang).
307307
auto len{std::strftime(buffer, buffSize, "%z", &localTime)};
308-
copyBufferAndPad(zone, zoneChars, buffer, len);
308+
CopyBufferAndPad(zone, zoneChars, buffer, len);
309309
}
310310
if (values) {
311311
auto typeCode{values->type().GetCategoryAndKind()};

0 commit comments

Comments
 (0)