Skip to content

Commit 6cfbedd

Browse files
committed
fix: address fmt exceptions for left justification (#4510)
I don't understand why, but for certain combinations of gcc, fmt, etc., we were getting exceptions from fmt. I finally caught it in the act! It seems related to formatting specs that looks like `{:-20s}`. Maybe this used to be allowed but isn't officially supported? Anyway, left justification is default anyway, so there's no point to the `-`. Removing it makes fmt happy, no more exceptions. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 1cbed65 commit 6cfbedd

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/libOpenImageIO/maketexture.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ write_mipmap(ImageBufAlgo::MakeTextureMode mode, std::shared_ptr<ImageBuf>& img,
719719
if (verbose) {
720720
size_t mem = Sysutil::memory_used(true);
721721
peak_mem = std::max(peak_mem, mem);
722-
print(outstream, " {:-15s} ({}) write {}\n", formatres(outspec),
722+
print(outstream, " {:15s} ({}) write {}\n", formatres(outspec),
723723
Strutil::memformat(mem), Strutil::timeintervalformat(wtime, 2));
724724
}
725725

@@ -884,7 +884,7 @@ write_mipmap(ImageBufAlgo::MakeTextureMode mode, std::shared_ptr<ImageBuf>& img,
884884
if (verbose) {
885885
size_t mem = Sysutil::memory_used(true);
886886
peak_mem = std::max(peak_mem, mem);
887-
print(outstream, " {:-15s} ({}) downres {} write {}\n",
887+
print(outstream, " {:15s} ({}) downres {} write {}\n",
888888
formatres(smallspec), Strutil::memformat(mem),
889889
Strutil::timeintervalformat(this_miptime, 2),
890890
Strutil::timeintervalformat(wtime, 2));
@@ -992,14 +992,14 @@ make_texture_impl(ImageBufAlgo::MakeTextureMode mode, const ImageBuf* input,
992992
size_t peak_mem = 0;
993993
Timer alltime;
994994

995-
#define STATUS(task, timer) \
996-
{ \
997-
size_t mem = Sysutil::memory_used(true); \
998-
peak_mem = std::max(peak_mem, mem); \
999-
if (verbose) \
1000-
print(outstream, " {:-25s} {} ({})\n", task, \
1001-
Strutil::timeintervalformat(timer, 2), \
1002-
Strutil::memformat(mem)); \
995+
#define STATUS(task, timer) \
996+
{ \
997+
size_t mem = Sysutil::memory_used(true); \
998+
peak_mem = std::max(peak_mem, mem); \
999+
if (verbose) \
1000+
print(outstream, " {:25s} {} ({})\n", task, \
1001+
Strutil::timeintervalformat(timer, 2), \
1002+
Strutil::memformat(mem)); \
10031003
}
10041004

10051005
ImageSpec configspec = _configspec;

0 commit comments

Comments
 (0)