Reduce warnings for yaml-cpp

- Use only utils/YamlUtils.h to pull in yaml-cpp and supporting code.
 - When compiling with clang, turn off warnings that the system header
   for yaml-cpp would generate.
This commit is contained in:
Adriaan de Groot 2019-04-17 11:43:21 +02:00
parent 27140ff5bb
commit c83395ff6d
14 changed files with 21 additions and 31 deletions

View File

@ -27,8 +27,6 @@
#include <QFile>
#include <QPair>
#include <yaml-cpp/yaml.h>
static bool
hasValue( const YAML::Node& v )
{

View File

@ -20,8 +20,6 @@
#include "utils/Logger.h"
#include <yaml-cpp/yaml.h>
#include <QByteArray>
#include <QFile>
#include <QFileInfo>

View File

@ -26,11 +26,21 @@
class QByteArray;
class QFileInfo;
namespace YAML
{
class Node;
class Exception;
}
// The yaml-cpp headers are not C++11 warning-proof, especially
// with picky compilers like Clang 8. Since we use Clang for the
// find-all-the-warnings case, switch those warnings off for
// the we-can't-change-them system headers.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#pragma clang diagnostic ignored "-Wshadow"
#endif
#include <yaml-cpp/yaml.h>
#ifdef __clang__
#pragma clang diagnostic pop
#endif
/// @brief Appends all te elements of @p node to the string list @p v
void operator>>( const YAML::Node& node, QStringList& v );

View File

@ -32,9 +32,6 @@
#include <QPixmap>
#include <QVariantMap>
#include <yaml-cpp/yaml.h>
namespace Calamares
{

View File

@ -36,8 +36,6 @@
#include "PythonQtViewModule.h"
#endif
#include <yaml-cpp/yaml.h>
#include <QDir>
#include <QFile>
#include <QFileInfo>

View File

@ -28,8 +28,6 @@
#include "utils/Logger.h"
#include "utils/YamlUtils.h"
#include <yaml-cpp/yaml.h>
#include <QApplication>
#include <QDir>
#include <QTimer>

View File

@ -22,8 +22,6 @@
#include "utils/CommandList.h"
#include "utils/YamlUtils.h"
#include <yaml-cpp/yaml.h>
#include <QtTest/QtTest>
#include <QFileInfo>

View File

@ -25,8 +25,6 @@
#include "utils/Logger.h"
#include "utils/YamlUtils.h"
#include <yaml-cpp/yaml.h>
#include <QtTest/QtTest>
#include <QFileInfo>

View File

@ -25,8 +25,6 @@
#include <QByteArray>
#include <yaml-cpp/yaml.h>
GeoIPJSON::GeoIPJSON(const QString& attribute)
: GeoIP( attribute.isEmpty() ? QStringLiteral( "time_zone" ) : attribute )
{

View File

@ -42,8 +42,6 @@
#include <QNetworkReply>
#include <QtConcurrent/QtConcurrentRun>
#include <yaml-cpp/yaml.h>
CALAMARES_PLUGIN_FACTORY_DEFINITION( LocaleViewStepFactory, registerPlugin<LocaleViewStep>(); )

View File

@ -36,8 +36,6 @@
#include <QHeaderView>
#include <yaml-cpp/yaml.h>
using CalamaresUtils::yamlToVariant;
NetInstallPage::NetInstallPage( QWidget* parent )

View File

@ -27,7 +27,10 @@
#include <QObject>
#include <QString>
#include <yaml-cpp/yaml.h>
namespace YAML
{
class Node;
}
class PackageModel : public QAbstractItemModel
{

View File

@ -26,8 +26,6 @@
#include "utils/Logger.h"
#include "utils/YamlUtils.h"
#include <yaml-cpp/yaml.h>
#include <QtTest/QtTest>
#include <QFileInfo>

View File

@ -21,13 +21,13 @@
* shipped with each module for correctness -- well, for parseability.
*/
#include "utils/YamlUtils.h"
#include <unistd.h>
#include <stdlib.h>
#include <iostream>
#include <yaml-cpp/yaml.h>
#include <QFile>
#include <QByteArray>