Skip to content

Commit

Permalink
Make project compile with clang 11.0.1-2 in Mac (#3795)
Browse files Browse the repository at this point in the history
Co-authored-by: Tuomas Tonteri <[email protected]>
  • Loading branch information
johnfea and johnfea authored Mar 31, 2023
1 parent cb0db7c commit d1a11a9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/libOpenImageIO/imagebuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ ImageBufImpl::error(string_view message) const
// a single newline.
if (m_err.size() && m_err.back() != '\n')
m_err += '\n';
m_err += message;
m_err += std::string(message);
}


Expand Down
2 changes: 1 addition & 1 deletion src/libOpenImageIO/imageinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ ImageInput::append_error(string_view message) const
if (errptr->size() < 1024 * 1024 * 16) {
if (errptr->size() && errptr->back() != '\n')
*errptr += '\n';
*errptr += message;
*errptr += std::string(message);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/libOpenImageIO/imageio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ pvt::append_error(string_view message)
// a single newline.
if (error_msg.size() && error_msg.back() != '\n')
error_msg += '\n';
error_msg += message;
error_msg += std::string(message);

// Remove a single trailing newline
if (message.size() && message.back() == '\n')
message.remove_suffix(1);
error_msg = message;
error_msg = std::string(message);
}


Expand Down
2 changes: 1 addition & 1 deletion src/libOpenImageIO/imageoutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ ImageOutput::append_error(string_view message) const
&& "Accumulated error messages > 16MB. Try checking return codes!");
if (errptr->size() && errptr->back() != '\n')
*errptr += '\n';
*errptr += message;
*errptr += std::string(message);
}


Expand Down
2 changes: 1 addition & 1 deletion src/libtexture/imagecache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3942,7 +3942,7 @@ ImageCacheImpl::append_error(string_view message) const
&& "Accumulated error messages > 16MB. Try checking return codes!");
if (errptr->size() && errptr->back() != '\n')
*errptr += '\n';
*errptr += message;
*errptr += std::string(message);
}


Expand Down
2 changes: 1 addition & 1 deletion src/libtexture/texturesys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ TextureSystemImpl::append_error(string_view message) const
&& "Accumulated error messages > 16MB. Try checking return codes!");
if (errptr->size() && errptr->back() != '\n')
*errptr += '\n';
*errptr += message;
*errptr += std::string(message);
}


Expand Down
11 changes: 5 additions & 6 deletions src/libutil/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# include <sys/stat.h>
# include <sys/types.h>
# include <unistd.h>
# include <utime.h>
#endif

#if defined(USE_STD_FILESYSTEM)
Expand Down Expand Up @@ -778,12 +779,10 @@ Filesystem::last_write_time(string_view path, std::time_t time) noexcept
times.modtime = time;
_wutime(u8path(path).c_str(), &times);
#else
struct timespec times[2];
times[0].tv_sec = 0;
times[0].tv_nsec = UTIME_OMIT;
times[1].tv_sec = time;
times[1].tv_nsec = 0;
utimensat((int)AT_FDCWD, u8path(path).c_str(), times, AT_SYMLINK_NOFOLLOW);
struct utimbuf times;
times.actime = time;
times.modtime = time;
utime(u8path(path).c_str(), &times);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/oiiotool/imagerec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,5 +413,5 @@ ImageRec::append_error(string_view message) const
&& "Accumulated error messages > 16MB. Try checking return codes!");
if (m_err.size() && m_err[m_err.size() - 1] != '\n')
m_err += '\n';
m_err += message;
m_err += std::string(message);
}

0 comments on commit d1a11a9

Please sign in to comment.