fix some compiler warnings

This commit is contained in:
Dirk-Jan C. Binnema
2020-11-01 14:20:12 +02:00
parent 6b8ccff572
commit 2135844e1b
3 changed files with 14 additions and 12 deletions

View File

@ -140,8 +140,8 @@ Indexer::Private::handler (const std::string& fullpath, struct stat *statbuf,
case Scanner::HandleType::File: { case Scanner::HandleType::File: {
if ((size_t)statbuf->st_size > max_message_size_) { if ((size_t)statbuf->st_size > max_message_size_) {
g_debug ("skip %s (too big: %zu bytes)", g_debug ("skip %s (too big: %" G_GINT64_FORMAT " bytes)",
fullpath.c_str(), statbuf->st_size); fullpath.c_str(), (gint64)statbuf->st_size);
return false; return false;
} }

View File

@ -32,22 +32,22 @@ test_mu_contacts_01()
g_assert_true (contacts.empty()); g_assert_true (contacts.empty());
g_assert_cmpuint (contacts.size(), ==, 0); g_assert_cmpuint (contacts.size(), ==, 0);
contacts.add(std::move(Mu::ContactInfo ("Foo <foo.bar@example.com>", contacts.add(Mu::ContactInfo ("Foo <foo.bar@example.com>",
"foo.bar@example.com", "Foo", false, 12345))); "foo.bar@example.com", "Foo", false, 12345));
g_assert_false (contacts.empty()); g_assert_false (contacts.empty());
g_assert_cmpuint (contacts.size(), ==, 1); g_assert_cmpuint (contacts.size(), ==, 1);
contacts.add(std::move(Mu::ContactInfo ("Cuux <cuux.fnorb@example.com>", contacts.add(Mu::ContactInfo ("Cuux <cuux.fnorb@example.com>",
"cuux@example.com", "Cuux", false, 54321))); "cuux@example.com", "Cuux", false, 54321));
g_assert_cmpuint (contacts.size(), ==, 2); g_assert_cmpuint (contacts.size(), ==, 2);
contacts.add(std::move(Mu::ContactInfo ("foo.bar@example.com", contacts.add(Mu::ContactInfo ("foo.bar@example.com",
"foo.bar@example.com", "Foo", false, 77777))); "foo.bar@example.com", "Foo", false, 77777));
g_assert_cmpuint (contacts.size(), ==, 2); g_assert_cmpuint (contacts.size(), ==, 2);
contacts.add(std::move(Mu::ContactInfo ("Foo.Bar@Example.Com", contacts.add(Mu::ContactInfo ("Foo.Bar@Example.Com",
"Foo.Bar@Example.Com", "Foo", false, 88888))); "Foo.Bar@Example.Com", "Foo", false, 88888));
g_assert_cmpuint (contacts.size(), ==, 2); g_assert_cmpuint (contacts.size(), ==, 2);
// note: replaces first. // note: replaces first.

View File

@ -66,10 +66,12 @@ install_sig_handler (void)
static void static void
cookie(size_t n) cookie(size_t n)
{ {
const auto num{static_cast<unsigned>(n)};
if (tty) // for testing. if (tty) // for testing.
::printf ("[%x]", n); ::printf ("[%x]", num);
else else
::printf (COOKIE_PRE "%x" COOKIE_POST, n); ::printf (COOKIE_PRE "%x" COOKIE_POST, num);
} }
static void static void