Port away from deprecated headers

Summary: Headers like stdio.h are deprecated in C++.

Test Plan:
Compiles.

clangd no longer spews these warnings

{F6997789, size=full}

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22351
This commit is contained in:
Vlad Zagorodniy 2019-07-09 22:19:26 +03:00
parent b18351669a
commit c7639fd7ed
55 changed files with 101 additions and 91 deletions

View file

@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#pragma once
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include <xf86drmMode.h>
#include <QVector>

View file

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QWidget>
#include <unistd.h>
#include <signal.h>
#include <csignal>
int main(int argc, char *argv[])
{

View file

@ -55,7 +55,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <signal.h>
#include <csignal>
using namespace KWin;
using namespace KWayland::Client;

View file

@ -59,7 +59,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <xcb/xcb_icccm.h>
// system
#include <unistd.h>
#include <signal.h>
// c++
#include <csignal>
// Put all externs before the namespace statement to allow the linker
// to resolve them properly

View file

@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "constants.h"
#include <QDateTime>
#include <qmath.h>
#include <QtMath>
namespace KWin {
namespace ColorCorrect {

View file

@ -51,7 +51,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <Plasma/Theme>
#include <assert.h>
#include "composite.h"
#include "xcbutils.h"
#include "platform.h"
@ -61,6 +60,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "decorations/decorationbridge.h"
#include <KDecoration2/DecorationSettings>
#include <cassert>
namespace KWin
{
//---------------------

View file

@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QVector2D>
#include <QVector3D>
#include <math.h>
#include <cmath>
#include <kwinglutils.h>
#include <kwinglplatform.h>

View file

@ -23,11 +23,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "cubeslideconfig.h"
#include <kwinconfig.h>
#include <kwinglutils.h>
#include <QVector3D>
#include <math.h>
#include <kwinglutils.h>
#include <cmath>
namespace KWin
{

View file

@ -27,8 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../presentwindows/presentwindows_proxy.h"
#include "../effect_builtins.h"
#include <math.h>
#include <QAction>
#include <QApplication>
#include <KGlobalAccel>
@ -44,6 +42,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Server/surface_interface.h>
#include <cmath>
namespace KWin
{

View file

@ -21,8 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "fallapart.h"
// KConfigSkeleton
#include "fallapartconfig.h"
#include <assert.h>
#include <math.h>
#include <cassert>
#include <cmath>
namespace KWin
{

View file

@ -36,7 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QPainter>
#include <math.h>
#include <cmath>
namespace KWin
{

View file

@ -33,7 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QPainter>
#include <math.h>
#include <cmath>
#ifdef KWIN_HAVE_XRENDER_COMPOSITING
#include <xcb/render.h>

View file

@ -31,9 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QMouseEvent>
#include <netwm_def.h>
#include <math.h>
#include <assert.h>
#include <limits.h>
#include <QApplication>
#include <QQmlContext>
#include <QQmlEngine>
@ -45,6 +42,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QVector2D>
#include <QVector4D>
#include <cassert>
#include <climits>
#include <cmath>
namespace KWin
{

View file

@ -32,11 +32,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#include <KLocalizedString>
#include <math.h>
#include <QPainter>
#include <QVector2D>
#include <QPalette>
#include <cmath>
namespace KWin
{

View file

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kwineffects.h>
#include <qhash.h>
#include <QHash>
namespace KWin
{

View file

@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QPainter>
#include <math.h>
#include <cmath>
namespace KWin
{

View file

@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KGlobalAccel>
#include <KLocalizedString>
#include <math.h>
#include <cmath>
namespace KWin
{

View file

@ -12,7 +12,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include "wobblywindows.h"
#include "wobblywindowsconfig.h"
#include <math.h>
#include <cmath>
//#define COMPUTE_STATS

View file

@ -33,11 +33,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "client.h"
#include "effects.h"
#include <assert.h>
#include <kstartupinfo.h>
#include <KWindowSystem>
#include <QDebug>
#include <cassert>
/*
TODO

View file

@ -26,14 +26,15 @@ DEALINGS IN THE SOFTWARE.
#include <KLocalizedString>
#include <KAuth/KAuthAction>
#include <QApplication>
#include <qcommandlineparser.h>
#include <QCommandLineParser>
#include <QDebug>
#include <QProcess>
#include <QtX11Extras/QX11Info>
#include <signal.h>
#include <errno.h>
#include <xcb/xcb.h>
#include <cerrno>
#include <csignal>
int main(int argc, char* argv[])
{
KLocalizedString::setApplicationDomain("kwin");

View file

@ -28,8 +28,6 @@
#include <KDecoration2/Decoration>
#include <KDecoration2/DecorationShadow>
#include <qqml.h>
namespace KDecoration2
{
namespace Preview

View file

@ -43,7 +43,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdlib.h>
#include <cstdlib>
namespace

View file

@ -18,13 +18,14 @@
#include "ruleslist.h"
#include <assert.h>
#include <QDebug>
#include <kconfig.h>
#include <QFileDialog>
#include "ruleswidget.h"
#include <cassert>
namespace KWin
{

View file

@ -31,7 +31,6 @@
#include <kactivities/consumer.h>
#endif
#include <assert.h>
#include <kmessagebox.h>
#include <QTabWidget>
#include <QTimer>
@ -40,6 +39,8 @@
#include "detectwidget.h"
#include <cassert>
Q_DECLARE_METATYPE(NET::WindowType)
namespace KWin

View file

@ -21,16 +21,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "monitor.h"
#include <QDebug>
#include <KLocalizedString>
#include <qgraphicsitem.h>
#include <qgraphicsview.h>
#include <qgraphicsscene.h>
#include <qgraphicssceneevent.h>
#include <qmenu.h>
#include <qdesktopwidget.h>
#include <qapplication.h>
#include <plasma/framesvg.h>
#include <Plasma/FrameSvg>
#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsSceneEvent>
#include <QMenu>
namespace KWin
{

View file

@ -24,9 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "screenpreviewwidget.h"
#include <qactiongroup.h>
#include <qgraphicsitem.h>
#include <qvector.h>
#include <QActionGroup>
#include <QGraphicsItem>
#include <QVector>
class QAction;
class QGraphicsView;

View file

@ -79,8 +79,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include "utils.h"
#include "client.h"
#include "focuschain.h"
@ -100,6 +98,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDebug>
#include <cassert>
namespace KWin
{

View file

@ -24,9 +24,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../udev.h"
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <cerrno>
namespace KWin
{
namespace LibInput

View file

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QEasingCurve>
#include <QElapsedTimer>
#include <qmath.h>
#include <QtMath>
#include <kwineffects.h>
#include <kwineffects_export.h>

View file

@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwinxrenderutils.h"
#endif
#include <qmath.h>
#include <QVariant>
#include <QList>
#include <QTimeLine>
@ -37,11 +36,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QVector2D>
#include <QGraphicsRotation>
#include <QGraphicsScale>
#include <QtMath>
#include <ksharedconfig.h>
#include <kconfiggroup.h>
#include <assert.h>
#include <cassert>
#include <KWayland/Server/surface_interface.h>

View file

@ -47,10 +47,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KPluginFactory>
#include <KSharedConfig>
#include <assert.h>
#include <limits.h>
#include <netwm.h>
#include <cassert>
#include <climits>
#include <functional>
class KConfigGroup;

View file

@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kwinglplatform.h"
#include "logging_p.h"
#include <QPixmap>
#include <QImage>
#include <QHash>
@ -40,10 +39,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QVarLengthArray>
#include <array>
#include <cmath>
#include <deque>
#include <math.h>
#define DEBUG_GLRENDERTARGET 0
#ifdef __GNUC__

View file

@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Server/surface_interface.h>
// Qt
#include <qplatformdefs.h>
#include <qcommandlineparser.h>
#include <QCommandLineParser>
#include <QQuickWindow>
#include <QStandardPaths>
#include <QtDBus>

View file

@ -22,11 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "placement.h"
#include <QRect>
#include <assert.h>
#include <QTextStream>
#ifndef KCMRULES
#include "workspace.h"
#include "client.h"
@ -36,6 +31,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "screens.h"
#endif
#include <QRect>
#include <QTextStream>
#include <cassert>
namespace KWin
{

View file

@ -23,7 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// system
#include <sys/mman.h>
#include <errno.h>
// c++
#include <cerrno>
// drm
#include <xf86drm.h>
#include <xf86drmMode.h>

View file

@ -25,7 +25,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// system
#include <sys/mman.h>
#include <errno.h>
// c++
#include <cerrno>
// drm
#include <xf86drm.h>
#include <xf86drmMode.h>

View file

@ -23,8 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "drm_object_crtc.h"
#include "drm_object_connector.h"
#include <errno.h>
#include "composite.h"
#include "logind.h"
#include "logging.h"
@ -42,6 +40,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QMatrix4x4>
#include <QCryptographicHash>
#include <QPainter>
// c++
#include <cerrno>
// drm
#include <xf86drm.h>
#include <xf86drmMode.h>

View file

@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KWIN_DRM_GBM_SURFACE_H
#define KWIN_DRM_GBM_SURFACE_H
#include <stdint.h>
#include <cstdint>
struct gbm_bo;
struct gbm_device;

View file

@ -28,7 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Server/output_interface.h>
#include <unistd.h>
#include <gbm.h>
#include <errno.h>
#include <cerrno>
namespace KWin
{

View file

@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <xcb/xcb.h>
#include <string.h>
#include <cstring>
namespace KWin
{

View file

@ -51,7 +51,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#if HAVE_DL_LIBRARY
#include <dlfcn.h>
#endif
#include <assert.h>
#include <cassert>
#ifndef XCB_GLX_BUFFER_SWAP_COMPLETE
#define XCB_GLX_BUFFER_SWAP_COMPLETE 1

View file

@ -26,10 +26,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "utils.h"
#include "xcbutils.h"
#include "assert.h"
#include <QVector>
#include <cassert>
#include <xcb/composite.h>
#include <xcb/shape.h>
#if XCB_COMPOSITE_MAJOR_VERSION > 0 || XCB_COMPOSITE_MINOR_VERSION >= 3

View file

@ -36,8 +36,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kwineffects.h>
#include <QFile>
#include <QtMath>
#include <qmath.h>
#include <cmath>
namespace KWin

View file

@ -53,14 +53,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <array>
#include <cmath>
#include <cstddef>
#include <unistd.h>
#include <stddef.h>
#include <qpainter.h>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusInterface>
#include <QGraphicsScale>
#include <QPainter>
#include <QStringList>
#include <QVector2D>
#include <QVector4D>

View file

@ -43,7 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDebug>
#include <QPainter>
#include <qmath.h>
#include <QtMath>
namespace KWin
{

View file

@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QObject>
#include <QPixmap>
#include <kwineffects.h>
#include <qvarlengtharray.h>
namespace KDecoration2
{

View file

@ -58,7 +58,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <csignal>
Q_DECLARE_METATYPE(NET::WindowType)

2
sm.cpp
View file

@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "sm.h"
#include <unistd.h>
#include <stdlib.h>
#include <cstdlib>
#include <pwd.h>
#include <fixx11h.h>
#include <kconfig.h>

View file

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QTextDocument>
#include <QTextStream>
// other
#include <math.h>
#include <cmath>
namespace KWin
{

View file

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "tabboxconfig.h"
#include "tabboxhandler.h"
#include <math.h>
#include <cmath>
namespace KWin
{

View file

@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <cstdlib>
#include <iostream>
#include <xcb/xcb.h>
#include <xcb/xcb_icccm.h>

View file

@ -38,9 +38,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// XLib
#include <X11/Xlib.h>
#include <fixx11h.h>
// system
#include <assert.h>
// c++
#include <cassert>
#include <functional>
class QOpenGLFramebufferObject;

View file

@ -31,19 +31,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kkeyserver.h>
#ifndef KCMRULES
#include <assert.h>
#include <QApplication>
#include <QDebug>
#include <X11/Xlib.h>
#include <stdio.h>
#include "atoms.h"
#include "platform.h"
#include "workspace.h"
#include <signal.h>
#include <cassert>
#include <csignal>
#include <cstdio>
#endif

View file

@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QScopedPointer>
#include <QProcess>
// system
#include <limits.h>
#include <climits>
Q_DECLARE_LOGGING_CATEGORY(KWIN_CORE)
Q_DECLARE_LOGGING_CATEGORY(KWIN_VIRTUALKEYBOARD)
namespace KWin

View file

@ -32,11 +32,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// system
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/signalfd.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
// c++
#include <csignal>
#define RELEASE_SIGNAL SIGUSR1
#define ACQUISITION_SIGNAL SIGUSR2