Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make project compile with clang 11.0.1-2 in Mac #3795

Merged
merged 3 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
lgritz marked this conversation as resolved.
Show resolved Hide resolved
}


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);
}