mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
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.
This commit is contained in:
@@ -271,25 +271,28 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
|
||||
set(NEEDED_COMPILER_FLAGS
|
||||
-Wall
|
||||
-W
|
||||
-Wcast-align
|
||||
-Wextra
|
||||
-Wfloat-equal
|
||||
-Wformat
|
||||
-Wformat-security
|
||||
-Winit-self
|
||||
-Winline
|
||||
-Wmissing-declarations
|
||||
-Wmissing-format-attribute
|
||||
-Wpointer-arith
|
||||
-Wredundant-decls
|
||||
-Wundef
|
||||
-Wunused-parameter
|
||||
-Wvariadic-macros
|
||||
-Wwrite-strings)
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_VERSION VERSION_GREATER "3.3")
|
||||
list(APPEND NEEDED_COMPILER_FLAGS
|
||||
-Wextra
|
||||
-Winit-self)
|
||||
endif()
|
||||
|
||||
set(NEEDED_C_COMPILER_FLAGS
|
||||
${NEEDED_COMPILER_FLAGS}
|
||||
-Wdeclaration-after-statement
|
||||
-Wmissing-declarations
|
||||
-Wnested-externs
|
||||
-Wstrict-prototypes)
|
||||
string(REPLACE ";" " " NEEDED_C_COMPILER_FLAGS_STRING "${NEEDED_C_COMPILER_FLAGS}")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* This file Copyright (C) Mnemosyne LLC
|
||||
* This file Copyright (C) 2014 Mnemosyne LLC
|
||||
*
|
||||
* It may be used under the GNU GPL versions 2 or 3
|
||||
* or any future license endorsed by Mnemosyne LLC.
|
||||
|
||||
@@ -46,8 +46,12 @@
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define HAVE_SYS_STATVFS_H
|
||||
#define HAVE_STATVFS
|
||||
#ifndef HAVE_SYS_STATVFS_H
|
||||
#define HAVE_SYS_STATVFS_H
|
||||
#endif
|
||||
#ifndef HAVE_STATVFS
|
||||
#define HAVE_STATVFS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STATVFS_H
|
||||
|
||||
@@ -117,8 +117,8 @@ test_utf8 (void)
|
||||
check_streq ("hello", out);
|
||||
tr_free (out);
|
||||
|
||||
/* this version is not utf-8 */
|
||||
in = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>";
|
||||
/* this version is not utf-8 (but cp866) */
|
||||
in = "\x92\xE0\xE3\xA4\xAD\xAE \xA1\xEB\xE2\xEC \x81\xAE\xA3\xAE\xAC";
|
||||
out = tr_utf8clean (in, 17);
|
||||
check (out != NULL);
|
||||
check ((strlen (out) == 17) || (strlen (out) == 32));
|
||||
@@ -126,7 +126,7 @@ test_utf8 (void)
|
||||
tr_free (out);
|
||||
|
||||
/* same string, but utf-8 clean */
|
||||
in = "Òðóäíî áûòü Áîãîì";
|
||||
in = "Трудно быть Богом";
|
||||
out = tr_utf8clean (in, -1);
|
||||
check (out != NULL);
|
||||
check (tr_utf8_validate (out, -1, NULL));
|
||||
|
||||
@@ -84,12 +84,12 @@ namespace
|
||||
|
||||
MyApp :: MyApp (int& argc, char ** argv):
|
||||
QApplication (argc, argv),
|
||||
myLastFullUpdateTime (0),
|
||||
myPrefs(nullptr),
|
||||
mySession(nullptr),
|
||||
myModel(nullptr),
|
||||
myWindow(nullptr),
|
||||
myWatchDir(nullptr)
|
||||
myWatchDir(nullptr),
|
||||
myLastFullUpdateTime (0)
|
||||
{
|
||||
const QString MY_CONFIG_NAME = QString::fromUtf8 ("transmission");
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class QUrl;
|
||||
|
||||
class Favicons: public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class QStyle;
|
||||
|
||||
class FileTreeItem: public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
Q_OBJECT
|
||||
|
||||
enum { LOW=(1<<0), NORMAL=(1<<1), HIGH=(1<<2) };
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ extern "C"
|
||||
|
||||
class Prefs: public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ Q_DECLARE_METATYPE(FileList)
|
||||
|
||||
class Torrent: public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user