diff options
32 files changed, 59 insertions, 58 deletions
diff --git a/.clang-tidy b/.clang-tidy index 203c6393c..59e5956ea 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,6 +2,7 @@ Checks: '-*, cppcoreguidelines-init-variables, modernize-avoid-bind, modernize-concat-nested-namespaces, + modernize-deprecated-headers, modernize-deprecated-ios-base-aliases, modernize-make-*, modernize-raw-string-literal, diff --git a/src/3rdparty/qtlockedfile/qtlockedfile_unix.cpp b/src/3rdparty/qtlockedfile/qtlockedfile_unix.cpp index 171178b5f..d7460374f 100644 --- a/src/3rdparty/qtlockedfile/qtlockedfile_unix.cpp +++ b/src/3rdparty/qtlockedfile/qtlockedfile_unix.cpp @@ -29,8 +29,8 @@ #include "qtlockedfile.h" -#include <string.h> -#include <errno.h> +#include <cstring> +#include <cerrno> #include <unistd.h> #include <fcntl.h> diff --git a/src/3rdparty/qtsingleapplication/qtlocalpeer.cpp b/src/3rdparty/qtsingleapplication/qtlocalpeer.cpp index c563e2f28..8e652612b 100644 --- a/src/3rdparty/qtsingleapplication/qtlocalpeer.cpp +++ b/src/3rdparty/qtsingleapplication/qtlocalpeer.cpp @@ -41,7 +41,7 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0; #endif #if defined(Q_OS_UNIX) -#include <time.h> +#include <ctime> #include <unistd.h> #endif diff --git a/src/common/c_jhash.h b/src/common/c_jhash.h index e765a3767..47c9e64c7 100644 --- a/src/common/c_jhash.h +++ b/src/common/c_jhash.h @@ -24,7 +24,7 @@ #ifndef _C_JHASH_H #define _C_JHASH_H -#include <stdint.h> +#include <cstdint> #define c_hashsize(n) ((uint8_t) 1 << (n)) #define c_hashmask(n) (xhashsize(n) - 1) diff --git a/src/common/utility.cpp b/src/common/utility.cpp index 519bfc022..29b43cb59 100644 --- a/src/common/utility.cpp +++ b/src/common/utility.cpp @@ -44,8 +44,8 @@ #include <unistd.h> #endif -#include <math.h> -#include <stdarg.h> +#include <cmath> +#include <cstdarg> #include <cstring> #if defined(Q_OS_WIN) diff --git a/src/csync/csync.cpp b/src/csync/csync.cpp index ea2dcc69b..05fe05217 100644 --- a/src/csync/csync.cpp +++ b/src/csync/csync.cpp @@ -25,13 +25,13 @@ #define _GNU_SOURCE #endif -#include <assert.h> -#include <errno.h> -#include <stdio.h> -#include <string.h> -#include <time.h> +#include <cassert> +#include <cerrno> +#include <cstdio> +#include <cstring> +#include <ctime> #include <sys/types.h> -#include <stdbool.h> + #include "c_lib.h" #include "csync_private.h" diff --git a/src/csync/csync.h b/src/csync/csync.h index 3e2158348..fb9f4682d 100644 --- a/src/csync/csync.h +++ b/src/csync/csync.h @@ -36,8 +36,8 @@ #include "ocsynclib.h" #include <sys/stat.h> -#include <stdbool.h> -#include <stdint.h> + +#include <cstdint> #include <sys/types.h> #include <config_csync.h> #include <functional> diff --git a/src/csync/csync_macros.h b/src/csync/csync_macros.h index 8bb3ae707..0f505ec42 100644 --- a/src/csync/csync_macros.h +++ b/src/csync/csync_macros.h @@ -22,8 +22,8 @@ #ifndef _CSYNC_MACROS_H #define _CSYNC_MACROS_H -#include <stdlib.h> -#include <string.h> +#include <cstdlib> +#include <cstring> /* How many elements there are in a static array */ #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) diff --git a/src/csync/csync_misc.cpp b/src/csync/csync_misc.cpp index 5bdb4ba29..1f4f1cc75 100644 --- a/src/csync/csync_misc.cpp +++ b/src/csync/csync_misc.cpp @@ -25,12 +25,12 @@ #define _GNU_SOURCE #endif -#include <limits.h> -#include <string.h> -#include <stdlib.h> -#include <stdio.h> +#include <climits> +#include <cstring> +#include <cstdlib> +#include <cstdio> #include <sys/types.h> -#include <errno.h> +#include <cerrno> #if _WIN32 # ifndef _WIN32_IE diff --git a/src/csync/csync_private.h b/src/csync/csync_private.h index d62031ed5..2345025d2 100644 --- a/src/csync/csync_private.h +++ b/src/csync/csync_private.h @@ -34,8 +34,8 @@ #include <unordered_map> #include <QHash> -#include <stdint.h> -#include <stdbool.h> +#include <cstdint> + #include <map> #include <set> #include <functional> diff --git a/src/csync/csync_reconcile.cpp b/src/csync/csync_reconcile.cpp index 7b664addd..3ea1efb64 100644 --- a/src/csync/csync_reconcile.cpp +++ b/src/csync/csync_reconcile.cpp @@ -20,7 +20,7 @@ #include "config_csync.h" -#include <assert.h> +#include <cassert> #include "csync_private.h" #include "csync_reconcile.h" #include "csync_util.h" @@ -34,7 +34,7 @@ Q_LOGGING_CATEGORY(lcReconcile, "nextcloud.sync.csync.reconciler", QtInfoMsg) // Needed for PRIu64 on MinGW in C++ mode. #define __STDC_FORMAT_MACROS -#include "inttypes.h" +#include <cinttypes> /* Check if a file is ignored because one parent is ignored. * return the node of the ignored directoy if it's the case, or \c nullptr if it is not ignored */ diff --git a/src/csync/csync_update.cpp b/src/csync/csync_update.cpp index f6f029ca6..d90a1059a 100644 --- a/src/csync/csync_update.cpp +++ b/src/csync/csync_update.cpp @@ -25,11 +25,11 @@ #define _GNU_SOURCE #endif -#include <errno.h> -#include <stdio.h> -#include <string.h> -#include <time.h> -#include <math.h> +#include <cerrno> +#include <cstdio> +#include <cstring> +#include <ctime> +#include <cmath> #include "c_lib.h" @@ -50,7 +50,7 @@ // Needed for PRIu64 on MinGW in C++ mode. #define __STDC_FORMAT_MACROS -#include <inttypes.h> +#include <cinttypes> Q_LOGGING_CATEGORY(lcUpdate, "nextcloud.sync.csync.updater", QtInfoMsg) diff --git a/src/csync/csync_util.cpp b/src/csync/csync_util.cpp index d697070dc..1daedafce 100644 --- a/src/csync/csync_util.cpp +++ b/src/csync/csync_util.cpp @@ -25,10 +25,10 @@ #define _GNU_SOURCE #endif -#include <errno.h> -#include <limits.h> -#include <stdio.h> -#include <time.h> +#include <cerrno> +#include <climits> +#include <cstdio> +#include <ctime> #include "common/c_jhash.h" #include "csync_util.h" diff --git a/src/csync/csync_util.h b/src/csync/csync_util.h index 187ecf7f8..bef83b54d 100644 --- a/src/csync/csync_util.h +++ b/src/csync/csync_util.h @@ -22,7 +22,7 @@ #ifndef _CSYNC_UTIL_H #define _CSYNC_UTIL_H -#include <stdint.h> +#include <cstdint> #include "csync_private.h" diff --git a/src/csync/std/c_alloc.h b/src/csync/std/c_alloc.h index 8ff2eb08b..166c5c8cd 100644 --- a/src/csync/std/c_alloc.h +++ b/src/csync/std/c_alloc.h @@ -38,7 +38,7 @@ extern "C" { #endif -#include <stdlib.h> +#include <stdlib.h> // NOLINT this is sometimes compiled in C mode #include "c_macro.h" diff --git a/src/csync/std/c_lib.h b/src/csync/std/c_lib.h index 2f0135ede..e277f4e95 100644 --- a/src/csync/std/c_lib.h +++ b/src/csync/std/c_lib.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <stdlib.h> -#include <string.h> +#include <stdlib.h> // NOLINT this is sometimes compiled in C mode +#include <string.h> // NOLINT this is sometimes compiled in C mode #include "c_macro.h" #include "c_alloc.h" diff --git a/src/csync/std/c_macro.h b/src/csync/std/c_macro.h index a4a0e1c1c..e65c2c780 100644 --- a/src/csync/std/c_macro.h +++ b/src/csync/std/c_macro.h @@ -31,8 +31,8 @@ #ifndef _C_MACRO_H #define _C_MACRO_H -#include <stdint.h> -#include <string.h> +#include <stdint.h> // NOLINT this is sometimes compiled in C mode +#include <string.h> // NOLINT this is sometimes compiled in C mode #define INT_TO_POINTER(i) (void *) i #define POINTER_TO_INT(p) *((int *) (p)) diff --git a/src/csync/std/c_private.h b/src/csync/std/c_private.h index ba4f986e1..1802c2f38 100644 --- a/src/csync/std/c_private.h +++ b/src/csync/std/c_private.h @@ -39,7 +39,7 @@ #include <unistd.h> #endif -#include <errno.h> +#include <errno.h> // NOLINT this is sometimes compiled in C mode #ifdef __MINGW32__ #define EDQUOT 0 diff --git a/src/csync/std/c_string.h b/src/csync/std/c_string.h index 3066ee2b3..9c8b557d4 100644 --- a/src/csync/std/c_string.h +++ b/src/csync/std/c_string.h @@ -39,7 +39,7 @@ extern "C" { #include "c_private.h" #include "c_macro.h" -#include <stdlib.h> +#include <stdlib.h> // NOLINT this is sometimes compiled in C mode /** * @brief Compare to strings case insensitively. diff --git a/src/csync/vio/csync_vio.cpp b/src/csync/vio/csync_vio.cpp index 9d2ec5b91..c5485a9e6 100644 --- a/src/csync/vio/csync_vio.cpp +++ b/src/csync/vio/csync_vio.cpp @@ -22,8 +22,8 @@ #define _GNU_SOURCE #endif -#include <errno.h> -#include <stdio.h> +#include <cerrno> +#include <cstdio> #include "common/asserts.h" #include "csync_private.h" diff --git a/src/csync/vio/csync_vio_local_unix.cpp b/src/csync/vio/csync_vio_local_unix.cpp index 1f58623d5..d1ecf9978 100644 --- a/src/csync/vio/csync_vio_local_unix.cpp +++ b/src/csync/vio/csync_vio_local_unix.cpp @@ -19,12 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <errno.h> +#include <cerrno> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <dirent.h> -#include <stdio.h> +#include <cstdio> #include <memory> diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 2caf63b50..c70096730 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -37,7 +37,7 @@ #include "syncresult.h" #include "ignorelisttablewidget.h" -#include <math.h> +#include <cmath> #include <QDesktopServices> #include <QDialogButtonBox> diff --git a/src/gui/folderwatcher.cpp b/src/gui/folderwatcher.cpp index d73e913f5..b86f55cf6 100644 --- a/src/gui/folderwatcher.cpp +++ b/src/gui/folderwatcher.cpp @@ -15,7 +15,7 @@ // event masks #include "folderwatcher.h" -#include <stdint.h> +#include <cstdint> #include <QFileInfo> #include <QFlags> diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index ee315d82e..d22cae462 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -37,7 +37,7 @@ #include <QVBoxLayout> #include <QEvent> -#include <stdlib.h> +#include <cstdlib> namespace OCC { diff --git a/src/gui/logbrowser.cpp b/src/gui/logbrowser.cpp index 52119b754..34dc8891c 100644 --- a/src/gui/logbrowser.cpp +++ b/src/gui/logbrowser.cpp @@ -14,7 +14,7 @@ #include "logbrowser.h" -#include "stdio.h" +#include <cstdio> #include <iostream> #include <QDialogButtonBox> diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 060cc7ef7..f4cac4b9c 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -14,7 +14,7 @@ */ #include <QtGlobal> -#include <signal.h> +#include <csignal> #ifdef Q_OS_UNIX #include <sys/time.h> diff --git a/src/gui/shareusergroupwidget.cpp b/src/gui/shareusergroupwidget.cpp index 8627d3f32..dc61f4977 100644 --- a/src/gui/shareusergroupwidget.cpp +++ b/src/gui/shareusergroupwidget.cpp @@ -46,7 +46,7 @@ #include <QPainter> #include <QListWidget> -#include <string.h> +#include <cstring> namespace OCC { diff --git a/src/gui/updater/ocupdater.cpp b/src/gui/updater/ocupdater.cpp index 4d3a0d3de..66528f8dc 100644 --- a/src/gui/updater/ocupdater.cpp +++ b/src/gui/updater/ocupdater.cpp @@ -25,7 +25,7 @@ #include <QtGui> #include <QtWidgets> -#include <stdio.h> +#include <cstdio> namespace OCC { diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp index aa7f0aaa4..912222dca 100644 --- a/src/gui/wizard/owncloudwizard.cpp +++ b/src/gui/wizard/owncloudwizard.cpp @@ -35,7 +35,7 @@ #include <QtCore> #include <QtGui> -#include <stdlib.h> +#include <cstdlib> namespace OCC { diff --git a/src/libsync/propagatorjobs.cpp b/src/libsync/propagatorjobs.cpp index b6e1948d1..a1d9b58cf 100644 --- a/src/libsync/propagatorjobs.cpp +++ b/src/libsync/propagatorjobs.cpp @@ -32,7 +32,7 @@ #include <qstack.h> #include <QCoreApplication> -#include <time.h> +#include <ctime> namespace OCC { diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 5fdd070c7..7c79272b8 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -36,7 +36,7 @@ #endif #include <climits> -#include <assert.h> +#include <cassert> #include <QCoreApplication> #include <QSslSocket> diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h index d186bc627..5409d46c4 100644 --- a/src/libsync/syncengine.h +++ b/src/libsync/syncengine.h @@ -16,7 +16,7 @@ #ifndef CSYNCTHREAD_H #define CSYNCTHREAD_H -#include <stdint.h> +#include <cstdint> #include <QMutex> #include <QThread> |