Commit Graph

8 Commits

Author SHA1 Message Date
djcb 688507f193 lib: fix a few compiler warnings
WARN_C(XX)FLAGS is really strict.
2017-01-03 00:37:19 +02:00
Ævar Arnfjörð Bjarmason f7245d2372 mu-store: Silence confusing code that's throwing a clang warning
Doing:

    !access(...) == 0

Is equivalent to:

    (!access(...)) == 0

Not:

    !(access(...) == 0)

And throws this warning under clang:

    mu-store.cc:77:6: warning: logical not is only applied to the left hand
    side of this comparison [-Wlogical-not-parentheses]
            if (!access(xpath, F_OK) == 0) {
                ^                    ~~
    mu-store.cc:77:6: note: add parentheses after the '!' to evaluate the
    comparison first
            if (!access(xpath, F_OK) == 0) {
                ^
                 (                       )
    mu-store.cc:77:6: note: add parentheses around left hand side expression
    to silence this warning
            if (!access(xpath, F_OK) == 0) {
                ^
                (                   )

It ends up doing what the author intended anyway since access() returns
-1 on error, and !-1 == 0, but just do the more obvious check and check
that we don't get 0 here with !=.
2015-12-15 12:40:40 +01:00
djcb 7eb244b3b0 mu: don't use __FUNCTION__, use __func__
__FUNCTION__ is deprecated and gives compilation warnings. __func__ is
standardized in c99.
2015-04-22 21:06:31 +03:00
djcb 3c7061338d Rework getting database version (#469)
It seems we don't get the correct database version in some case with
some compilers, optimization flags. Suspecting some stale ->c_str().
2014-09-23 07:32:39 +03:00
djcb 855e81db99 * update copyright years 2013-03-30 11:32:07 +02:00
djcb 11ecc65109 * update (C) years 2012-10-24 11:42:57 +03:00
djcb 39ff643e48 * store: allow setting my-addresses 2012-06-19 17:59:16 +03:00
djcb 46f10cfde9 * refactoring: split src/ into mu/ and lib/ 2012-05-21 09:25:53 +03:00