Skip to content

Commit

Permalink
fix: address fmt exceptions for left justification (AcademySoftwareFo…
Browse files Browse the repository at this point in the history
…undation#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>
  • Loading branch information
lgritz committed Oct 29, 2024
1 parent 5a89f3a commit 6c258a3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/libOpenImageIO/maketexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ write_mipmap(ImageBufAlgo::MakeTextureMode mode, std::shared_ptr<ImageBuf>& img,
if (verbose) {
size_t mem = Sysutil::memory_used(true);
peak_mem = std::max(peak_mem, mem);
print(outstream, " {:-15s} ({}) write {}\n", formatres(outspec),
print(outstream, " {:15s} ({}) write {}\n", formatres(outspec),
Strutil::memformat(mem), Strutil::timeintervalformat(wtime, 2));
}

Expand Down Expand Up @@ -881,7 +881,7 @@ write_mipmap(ImageBufAlgo::MakeTextureMode mode, std::shared_ptr<ImageBuf>& img,
if (verbose) {
size_t mem = Sysutil::memory_used(true);
peak_mem = std::max(peak_mem, mem);
print(outstream, " {:-15s} ({}) downres {} write {}\n",
print(outstream, " {:15s} ({}) downres {} write {}\n",
formatres(smallspec), Strutil::memformat(mem),
Strutil::timeintervalformat(this_miptime, 2),
Strutil::timeintervalformat(wtime, 2));
Expand Down Expand Up @@ -989,14 +989,14 @@ make_texture_impl(ImageBufAlgo::MakeTextureMode mode, const ImageBuf* input,
size_t peak_mem = 0;
Timer alltime;

#define STATUS(task, timer) \
{ \
size_t mem = Sysutil::memory_used(true); \
peak_mem = std::max(peak_mem, mem); \
if (verbose) \
print(outstream, " {:-25s} {} ({})\n", task, \
Strutil::timeintervalformat(timer, 2), \
Strutil::memformat(mem)); \
#define STATUS(task, timer) \
{ \
size_t mem = Sysutil::memory_used(true); \
peak_mem = std::max(peak_mem, mem); \
if (verbose) \
print(outstream, " {:25s} {} ({})\n", task, \
Strutil::timeintervalformat(timer, 2), \
Strutil::memformat(mem)); \
}

ImageSpec configspec = _configspec;
Expand Down

0 comments on commit 6c258a3

Please sign in to comment.