Skip to content

Small fixes around format specifier flags and .gitignore #58

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

Merged
merged 2 commits into from
Aug 25, 2018
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
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ regression.out
regression.diffs
results

hll--?.?.sql
hll--?.?-*.sql
!hll--?.?-*--?.?-*.sql
hll--*.*.sql
!hll--*.*--*.*.sql
26 changes: 13 additions & 13 deletions src/hll.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ check_metadata(multiset_t const * i_omp, multiset_t const * i_imp)
ereport(ERROR,
(errcode(ERRCODE_DATA_EXCEPTION),
errmsg("register width does not match: "
"source uses %ld and dest uses %ld",
"source uses %zu and dest uses %zu",
i_imp->ms_nbits, i_omp->ms_nbits)));
}

Expand All @@ -549,7 +549,7 @@ check_metadata(multiset_t const * i_omp, multiset_t const * i_imp)
ereport(ERROR,
(errcode(ERRCODE_DATA_EXCEPTION),
errmsg("register count does not match: "
"source uses %ld and dest uses %ld",
"source uses %zu and dest uses %zu",
i_imp->ms_nregs, i_omp->ms_nregs)));
}

Expand Down Expand Up @@ -680,7 +680,7 @@ multiset_tostring(multiset_t const * i_msp)
// with the automatically determined value.
//
if (expthresh == -1)
snprintf(expbuf, sizeof(expbuf), INT64_FORMAT "(%ld)", expthresh, expval);
snprintf(expbuf, sizeof(expbuf), INT64_FORMAT "(%zu)", expthresh, expval);
else
snprintf(expbuf, sizeof(expbuf), INT64_FORMAT, expthresh);

Expand All @@ -697,7 +697,7 @@ multiset_tostring(multiset_t const * i_msp)
{
case MST_EMPTY:
used += snprintf(retstr, len, "EMPTY, "
"nregs=%ld, nbits=%ld, expthresh=%s, sparseon=%ld",
"nregs=%zu, nbits=%zu, expthresh=%s, sparseon=%zu",
nregs, nbits, expbuf, sparseon);
break;
case MST_EXPLICIT:
Expand All @@ -707,15 +707,15 @@ multiset_tostring(multiset_t const * i_msp)
char linebuf[1024];
ssize_t rv;

used += snprintf(retstr, len, "EXPLICIT, %ld elements, "
"nregs=%ld, nbits=%ld, "
"expthresh=%s, sparseon=%ld:",
used += snprintf(retstr, len, "EXPLICIT, %zu elements, "
"nregs=%zu, nbits=%zu, "
"expthresh=%s, sparseon=%zu:",
size, nregs, nbits, expbuf, sparseon);
for (size_t ii = 0; ii < size; ++ii)
{
int64_t val = * (int64_t const *) & msep->mse_elems[ii];
rv = snprintf(linebuf, sizeof(linebuf),
"\n%ld: %20" PRIi64 " ",
"\n%zu: %20" PRIi64 " ",
ii, val);
// Do we need to reallocate the return buffer?
if (rv + used > len - 1)
Expand All @@ -739,16 +739,16 @@ multiset_tostring(multiset_t const * i_msp)
size_t ndx = 0;

used += snprintf(retstr, len,
"COMPRESSED, %ld filled "
"nregs=%ld, nbits=%ld, expthresh=%s, "
"sparseon=%ld:",
"COMPRESSED, %zu filled "
"nregs=%zu, nbits=%zu, expthresh=%s, "
"sparseon=%zu:",
numfilled(i_msp),
nregs, nbits, expbuf, sparseon);

for (size_t rr = 0; rr < nrows; ++rr)
{
size_t pos = 0;
pos = snprintf(linebuf, sizeof(linebuf), "\n%4ld: ", ndx);
pos = snprintf(linebuf, sizeof(linebuf), "\n%4zu: ", ndx);
for (size_t cc = 0; cc < rowsz; ++cc)
{
pos += snprintf(&linebuf[pos], sizeof(linebuf) - pos,
Expand All @@ -769,7 +769,7 @@ multiset_tostring(multiset_t const * i_msp)
break;
case MST_UNDEFINED:
used += snprintf(retstr, len, "UNDEFINED "
"nregs=%ld, nbits=%ld, expthresh=%s, sparseon=%ld",
"nregs=%zu, nbits=%zu, expthresh=%s, sparseon=%zu",
nregs, nbits, expbuf, sparseon);
break;
default:
Expand Down