jsonapi-generator Fix warning that cause errors on mageia

This commit is contained in:
Gioacchino Mazzurco 2018-10-03 18:17:29 +02:00
parent 8f3f2cd7cb
commit f26a0c793e
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051

View File

@ -45,7 +45,7 @@ int main(int argc, char *argv[])
if(argc != 3)
{
qDebug() << "Usage: jsonapi-generator SOURCE_PATH OUTPUT_PATH";
return EINVAL;
return -EINVAL;
}
QString sourcePath(argv[1]);
@ -56,17 +56,23 @@ int main(int argc, char *argv[])
QFile wrappersDefFile(wrappersDefFilePath);
wrappersDefFile.remove();
if(!wrappersDefFile.open(QIODevice::WriteOnly|QIODevice::Append|QIODevice::Text))
qFatal(QString("Can't open: " + wrappersDefFilePath).toLatin1().data());
{
qDebug() << "Can't open: " << wrappersDefFilePath;
return -errno;
}
QString cppApiIncludesFilePath(outputPath + "/jsonapi-includes.inl");
QFile cppApiIncludesFile(cppApiIncludesFilePath);
cppApiIncludesFile.remove();
if(!cppApiIncludesFile.open(QIODevice::WriteOnly|QIODevice::Append|QIODevice::Text))
qFatal(QString("Can't open: " + cppApiIncludesFilePath).toLatin1().data());
{
qDebug() << "Can't open: " << cppApiIncludesFilePath;
return -errno;
}
QSet<QString> cppApiIncludesSet;
auto fatalError = [&](
std::initializer_list<QVariant> errors, int ernum = EINVAL )
std::initializer_list<QVariant> errors, int ernum = -EINVAL )
{
QString errorMsg;
for(const QVariant& error: errors)