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

Dev fix compiler warning #3455

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions pxr/base/arch/testenv/testArchPRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ int main(int argc, char** argv)
}

const int64_t fileSize = ArchGetFileLength(f.get());
printf("Reading %s (%zu bytes)...\n", filename.c_str(), fileSize);
printf("Reading %s (%lld bytes)...\n", filename.c_str(), fileSize);

std::unique_ptr<char[]> fileContents(new char[fileSize]);
const int64_t numRead = ArchPRead(f.get(), fileContents.get(), fileSize, 0);
if (numRead != fileSize) {
printf("ERROR: Read %zu bytes, expected %zu\n", numRead, fileSize);
printf("ERROR: Read %lld bytes, expected %lld\n", numRead, fileSize);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions pxr/base/tf/testenv/hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ _TestStatsOne(Hasher const &h, char const *label)
TestOne(h, num, counts);
}

printf("%s One: %zu tests.\n", label, NTESTS * 64);
printf("%s One: %llu tests.\n", label, NTESTS * 64);
for (int i = 0; i != 64; ++i) {
printf("bit %d flipped %d times (%.2f%%)\n", i, counts[i],
100.0 * double(counts[i]) / (double(NTESTS) * 64.0));
Expand Down Expand Up @@ -128,7 +128,7 @@ _TestStatsTwo(Hasher const &h, char const *label)
TestTwo(h, t, counts);
}

printf("%s Two: %zu tests.\n", label, NTESTS * 64);
printf("%s Two: %llu tests.\n", label, NTESTS * 64);
for (int i = 0; i != 64; ++i) {
printf("bit %d flipped %d times (%.2f%%)\n", i, counts[i],
100.0 * double(counts[i]) / (double(NTESTS) * 64.0));
Expand Down
2 changes: 1 addition & 1 deletion pxr/base/trace/wrapCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static double
GetElapsedSeconds(TraceEvent::TimeStamp begin, TraceEvent::TimeStamp end)
{
if (begin > end) {
TF_CODING_ERROR("Invalid interval: begin=%zu, end=%zu", begin, end);
TF_CODING_ERROR("Invalid interval: begin=%llu, end=%llu", begin, end);
return 0.0;
}
return ArchTicksToSeconds(end-begin);
Expand Down
4 changes: 2 additions & 2 deletions pxr/imaging/hd/testenv/testHdSortedIdsPerf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ int main()
FILE *statsFile = fopen("perfstats.raw", "w");
for (const auto &[metricName, ns]: metrics) {
fprintf(statsFile,
"{'profile':'%s','metric':'time','value':%zd,'samples':1}\n",
"{'profile':'%s','metric':'time','value':%lld,'samples':1}\n",
metricName.c_str(), ns);
printf("%s : %zd ns\n", metricName.c_str(), ns);
printf("%s : %lld ns\n", metricName.c_str(), ns);
}
fclose(statsFile);

Expand Down
2 changes: 1 addition & 1 deletion pxr/usd/usd/crateFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3593,7 +3593,7 @@ CrateFile::_ReadTokens(Reader reader)
}
wd.Wait();
if (i != numTokens) {
TF_RUNTIME_ERROR("Crate file claims %zu tokens, found %zu",
TF_RUNTIME_ERROR("Crate file claims %llu tokens, found %zu",
numTokens, i);
}

Expand Down