Skip to content

Commit

Permalink
Incorporate feedback by @klausler
Browse files Browse the repository at this point in the history
  • Loading branch information
mjklemm committed Jul 12, 2024
1 parent fa5e899 commit 9cb68e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion flang/lib/Evaluate/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2622,7 +2622,8 @@ bool IntrinsicProcTable::Implementation::IsDualIntrinsic(
const std::string &name) const {
// Collection for some intrinsics with function and subroutine form,
// in order to pass the semantic check.
static const std::string dualIntrinsic[]{{"etime"}, {"getcwd"}, {"rename"}};
static const std::string dualIntrinsic[]{
{"etime"s}, {"getcwd"s}, {"rename"s}};

return std::find_if(std::begin(dualIntrinsic), std::end(dualIntrinsic),
[&name](const std::string &dualName) {
Expand Down
6 changes: 3 additions & 3 deletions flang/runtime/misc-intrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "flang/Common/optional.h"
#include "flang/Runtime/descriptor.h"
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cstring>

namespace Fortran::runtime {

Expand Down Expand Up @@ -66,10 +66,10 @@ void RTDECL(Rename)(const Descriptor &path1, const Descriptor &path2,
path2.OffsetElement(), path2.ElementBytes(), terminator)};

// We simply call rename(2) from POSIX
int result = rename(pathSrc, pathDst);
int result{rename(pathSrc, pathDst)};
if (status) {
// When an error has happened,
int errorCode = 0; // Assume success
int errorCode{0}; // Assume success
if (result != 0) {
// The rename operation has failed, so return the error code as status.
errorCode = errno;
Expand Down

0 comments on commit 9cb68e3

Please sign in to comment.