Skip to content

Commit

Permalink
Fix clang warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtv committed Jan 28, 2019
1 parent d2f0918 commit ac8d50e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/sql_cursor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ std::string::size_type find_query_end(
[text, &end](const char *gbegin, const char *gend)
{
if (gend - gbegin > 1 or not useless_trail(*gbegin))
end = gend - text;
end = std::string::size_type(gend - text);
},
text, size);
}
Expand Down Expand Up @@ -124,7 +124,7 @@ pqxx::internal::sql_cursor::sql_cursor(
if (hold) cq << "WITH HOLD ";

cq << "FOR ";
cq.write(query.c_str(), qend);
cq.write(query.c_str(), std::streamsize(qend));
cq << ' ';

if (up != cursor_base::update) cq << "FOR READ ONLY ";
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_encodings.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void test_for_glyphs_empty()
void test_for_glyphs_ascii()
{
const std::string text{"hi"};
std::vector<std::size_t> points;
std::vector<std::ptrdiff_t> points;

pqxx::internal::for_glyphs(
pqxx::internal::encoding_group::UTF8,
Expand All @@ -66,7 +66,7 @@ void test_for_glyphs_ascii()
text.c_str(),
text.size());

PQXX_CHECK_EQUAL(points.size(), 2ul, "Wrong number of ASCII iterations.");
PQXX_CHECK_EQUAL(points.size(), 2u, "Wrong number of ASCII iterations.");
PQXX_CHECK_EQUAL(points[0], 1u, "ASCII iteration started off wrong.");
PQXX_CHECK_EQUAL(points[1], 1u, "ASCII iteration was inconsistent.");
}
Expand All @@ -76,7 +76,7 @@ void test_for_glyphs_utf8()
{
// Greek: alpha omega.
const std::string text{"\xce\x91\xce\xa9"};
std::vector<std::size_t> points;
std::vector<std::ptrdiff_t> points;

pqxx::internal::for_glyphs(
pqxx::internal::encoding_group::UTF8,
Expand Down

0 comments on commit ac8d50e

Please sign in to comment.