Changeset 14370


Ignore:
Timestamp:
Dec 11, 2014, 5:11:02 AM (6 years ago)
Author:
mikedld
Message:

Fix a couple of ordinary and pedantic warnings

Add previously missing -Wall to warning flags in CMake. Remove -Wformat
and -Wvariadic-macros (enabled by default; latter is not meaningful in
C99 mode we use), -Wdeclaration-after-statement (again, not needed as
we use C99). Move -Wmissing-declarations to C-only flags (GCC man says
so).

Add copyrights year to crypto-utils-fallback.c.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r14364 r14370  
    272272
    273273    set(NEEDED_COMPILER_FLAGS
     274        -Wall
     275        -W
    274276        -Wcast-align
    275         -Wextra
    276277        -Wfloat-equal
    277         -Wformat
    278278        -Wformat-security
    279         -Winit-self
    280279        -Winline
    281         -Wmissing-declarations
    282280        -Wmissing-format-attribute
    283281        -Wpointer-arith
     
    285283        -Wundef
    286284        -Wunused-parameter
    287         -Wvariadic-macros
    288285        -Wwrite-strings)
     286
     287    if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_VERSION VERSION_GREATER "3.3")
     288        list(APPEND NEEDED_COMPILER_FLAGS
     289            -Wextra
     290            -Winit-self)
     291    endif()
    289292
    290293    set(NEEDED_C_COMPILER_FLAGS
    291294        ${NEEDED_COMPILER_FLAGS}
    292         -Wdeclaration-after-statement
     295        -Wmissing-declarations
    293296        -Wnested-externs
    294297        -Wstrict-prototypes)
  • trunk/libtransmission/crypto-utils-fallback.c

    r14369 r14370  
    11/*
    2  * This file Copyright (C) Mnemosyne LLC
     2 * This file Copyright (C) 2014 Mnemosyne LLC
    33 *
    44 * It may be used under the GNU GPL versions 2 or 3
  • trunk/libtransmission/platform-quota.c

    r14335 r14370  
    4747
    4848#ifdef __APPLE__
    49  #define HAVE_SYS_STATVFS_H
    50  #define HAVE_STATVFS
     49 #ifndef HAVE_SYS_STATVFS_H
     50  #define HAVE_SYS_STATVFS_H
     51 #endif
     52 #ifndef HAVE_STATVFS
     53  #define HAVE_STATVFS
     54 #endif
    5155#endif
    5256
  • trunk/libtransmission/utils-test.c

    r14361 r14370  
    118118  tr_free (out);
    119119
    120   /* this version is not utf-8 */
    121   in = "Òðóäíî áûòü Áîãîì";
     120  /* this version is not utf-8 (but cp866) */
     121  in = "\x92\xE0\xE3\xA4\xAD\xAE \xA1\xEB\xE2\xEC \x81\xAE\xA3\xAE\xAC";
    122122  out = tr_utf8clean (in, 17);
    123123  check (out != NULL);
     
    127127
    128128  /* same string, but utf-8 clean */
    129   in = "ÒðóÀíî áûòÌ Áîãîì";
     129  in = "ТруЎМП быть БПгПЌ";
    130130  out = tr_utf8clean (in, -1);
    131131  check (out != NULL);
  • trunk/qt/app.cc

    r14352 r14370  
    8585MyApp :: MyApp (int& argc, char ** argv):
    8686  QApplication (argc, argv),
    87   myLastFullUpdateTime (0),
    8887  myPrefs(nullptr),
    8988  mySession(nullptr),
    9089  myModel(nullptr),
    9190  myWindow(nullptr),
    92   myWatchDir(nullptr)
     91  myWatchDir(nullptr),
     92  myLastFullUpdateTime (0)
    9393{
    9494  const QString MY_CONFIG_NAME = QString::fromUtf8 ("transmission");
  • trunk/qt/favicon.h

    r14241 r14370  
    2222class Favicons: public QObject
    2323{
    24     Q_OBJECT;
     24    Q_OBJECT
    2525
    2626  public:
  • trunk/qt/file-tree.h

    r14345 r14370  
    3434class FileTreeItem: public QObject
    3535{
    36     Q_OBJECT;
     36    Q_OBJECT
    3737
    3838    enum { LOW=(1<<0), NORMAL=(1<<1), HIGH=(1<<2) };
  • trunk/qt/prefs.h

    r14241 r14370  
    2828class Prefs: public QObject
    2929{
    30     Q_OBJECT;
     30    Q_OBJECT
    3131
    3232  public:
  • trunk/qt/torrent.h

    r14241 r14370  
    116116class Torrent: public QObject
    117117{
    118     Q_OBJECT;
     118    Q_OBJECT
    119119
    120120  public:
Note: See TracChangeset for help on using the changeset viewer.