qmake: Apply modernize-use-nullptr
Use nullptr instead of 0. Change-Id: Ib3120b9c424a274a2d4dd4c42ec5d7cd5bdead65 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
182aca8487
commit
a959a0e206
@ -829,7 +829,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES
|
||||
ProStringList &libdirs = project->values("QMAKE_PBX_LIBPATHS"),
|
||||
&frameworkdirs = project->values("QMAKE_FRAMEWORKPATH");
|
||||
static const char * const libs[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
|
||||
static const char * const libs[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
|
||||
for (int i = 0; libs[i]; i++) {
|
||||
tmp = project->values(libs[i]);
|
||||
for(int x = 0; x < tmp.count();) {
|
||||
@ -1422,7 +1422,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
testHost.append("Contents/MacOS/");
|
||||
testHost.append(targetName);
|
||||
|
||||
static const char * const configs[] = { "Debug", "Release", 0 };
|
||||
static const char * const configs[] = { "Debug", "Release", nullptr };
|
||||
for (int i = 0; configs[i]; i++) {
|
||||
QString testBundleBuildConfig = keyFor(pbx_dir + "QMAKE_PBX_TEST_BUNDLE_BUILDCONFIG_" + configs[i]);
|
||||
t << "\t\t" << testBundleBuildConfig << " = {\n"
|
||||
|
@ -96,7 +96,7 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
|
||||
|
||||
// ** base makefile generator
|
||||
MakefileGenerator::MakefileGenerator() :
|
||||
no_io(false), project(0)
|
||||
no_io(false), project(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ MakefileGenerator::initOutPaths()
|
||||
v["PRECOMPILED_DIR"] = v["OBJECTS_DIR"];
|
||||
static const char * const dirs[] = { "OBJECTS_DIR", "DESTDIR",
|
||||
"SUBLIBS_DIR", "DLLDESTDIR",
|
||||
"PRECOMPILED_DIR", 0 };
|
||||
"PRECOMPILED_DIR", nullptr };
|
||||
for (int x = 0; dirs[x]; x++) {
|
||||
const ProKey dkey(dirs[x]);
|
||||
if (v[dkey].isEmpty())
|
||||
@ -424,7 +424,7 @@ MakefileGenerator::init()
|
||||
}
|
||||
incs.append(project->specDir());
|
||||
|
||||
const char * const cacheKeys[] = { "_QMAKE_STASH_", "_QMAKE_SUPER_CACHE_", 0 };
|
||||
const char * const cacheKeys[] = { "_QMAKE_STASH_", "_QMAKE_SUPER_CACHE_", nullptr };
|
||||
for (int i = 0; cacheKeys[i]; ++i) {
|
||||
if (v[cacheKeys[i]].isEmpty())
|
||||
continue;
|
||||
@ -614,7 +614,7 @@ MakefileGenerator::init()
|
||||
//build up a list of compilers
|
||||
QVector<Compiler> compilers;
|
||||
{
|
||||
const char *builtins[] = { "OBJECTS", "SOURCES", "PRECOMPILED_HEADER", 0 };
|
||||
const char *builtins[] = { "OBJECTS", "SOURCES", "PRECOMPILED_HEADER", nullptr };
|
||||
for(x = 0; builtins[x]; ++x) {
|
||||
Compiler compiler;
|
||||
compiler.variable_in = builtins[x];
|
||||
@ -829,7 +829,7 @@ MakefileGenerator::init()
|
||||
}
|
||||
|
||||
//fix up the target deps
|
||||
static const char * const fixpaths[] = { "PRE_TARGETDEPS", "POST_TARGETDEPS", 0 };
|
||||
static const char * const fixpaths[] = { "PRE_TARGETDEPS", "POST_TARGETDEPS", nullptr };
|
||||
for (int path = 0; fixpaths[path]; path++) {
|
||||
ProStringList &l = v[fixpaths[path]];
|
||||
for (ProStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) {
|
||||
@ -2790,7 +2790,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
|
||||
QFileInfo
|
||||
MakefileGenerator::fileInfo(QString file) const
|
||||
{
|
||||
static QHash<FileInfoCacheKey, QFileInfo> *cache = 0;
|
||||
static QHash<FileInfoCacheKey, QFileInfo> *cache = nullptr;
|
||||
static QFileInfo noInfo = QFileInfo();
|
||||
if(!cache) {
|
||||
cache = new QHash<FileInfoCacheKey, QFileInfo>;
|
||||
|
@ -172,7 +172,7 @@ protected:
|
||||
{ int ret; canExecute(cmdline, &ret); return ret; }
|
||||
bool canExecute(const QStringList &cmdline, int *argv0) const;
|
||||
inline bool canExecute(const QString &cmdline) const
|
||||
{ return canExecute(cmdline.split(' '), 0); }
|
||||
{ return canExecute(cmdline.split(' '), nullptr); }
|
||||
|
||||
bool mkdir(const QString &dir) const;
|
||||
QString mkdir_p_asstring(const QString &dir, bool escape=true) const;
|
||||
|
@ -81,7 +81,7 @@ const QString
|
||||
|
||||
struct SourceDependChildren;
|
||||
struct SourceFile {
|
||||
SourceFile() : deps(0), type(QMakeSourceFileInfo::TYPE_UNKNOWN),
|
||||
SourceFile() : deps(nullptr), type(QMakeSourceFileInfo::TYPE_UNKNOWN),
|
||||
mocable(0), traversed(0), exists(1),
|
||||
moc_checked(0), dep_checked(0), included_count(0) { }
|
||||
~SourceFile();
|
||||
@ -95,8 +95,8 @@ struct SourceFile {
|
||||
struct SourceDependChildren {
|
||||
SourceFile **children;
|
||||
int num_nodes, used_nodes;
|
||||
SourceDependChildren() : children(0), num_nodes(0), used_nodes(0) { }
|
||||
~SourceDependChildren() { if(children) free(children); children = 0; }
|
||||
SourceDependChildren() : children(nullptr), num_nodes(0), used_nodes(0) { }
|
||||
~SourceDependChildren() { if (children) free(children); children = nullptr; }
|
||||
void addChild(SourceFile *s) {
|
||||
if(num_nodes <= used_nodes) {
|
||||
num_nodes += 200;
|
||||
@ -115,10 +115,10 @@ public:
|
||||
SourceFile *lookupFile(const char *);
|
||||
inline SourceFile *lookupFile(const QString &f) { return lookupFile(f.toLatin1().constData()); }
|
||||
inline SourceFile *lookupFile(const QMakeLocalFileName &f) { return lookupFile(f.local().toLatin1().constData()); }
|
||||
void addFile(SourceFile *, const char *k=0, bool own=true);
|
||||
void addFile(SourceFile *, const char *k = nullptr, bool own = true);
|
||||
|
||||
struct SourceFileNode {
|
||||
SourceFileNode() : key(0), next(0), file(0), own_file(1) { }
|
||||
SourceFileNode() : key(nullptr), next(nullptr), file(nullptr), own_file(1) { }
|
||||
~SourceFileNode() {
|
||||
delete [] key;
|
||||
if(own_file)
|
||||
@ -135,7 +135,7 @@ SourceFiles::SourceFiles()
|
||||
{
|
||||
nodes = (SourceFileNode**)malloc(sizeof(SourceFileNode*)*(num_nodes=3037));
|
||||
for(int n = 0; n < num_nodes; n++)
|
||||
nodes[n] = 0;
|
||||
nodes[n] = nullptr;
|
||||
}
|
||||
|
||||
SourceFiles::~SourceFiles()
|
||||
@ -170,7 +170,7 @@ SourceFile *SourceFiles::lookupFile(const char *file)
|
||||
if(!strcmp(p->key, file))
|
||||
return p->file;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SourceFiles::addFile(SourceFile *p, const char *k, bool own_file)
|
||||
@ -259,11 +259,11 @@ QMakeSourceFileInfo::QMakeSourceFileInfo(const QString &cf)
|
||||
dep_mode = Recursive;
|
||||
|
||||
//quick project lookups
|
||||
includes = files = 0;
|
||||
includes = files = nullptr;
|
||||
files_changed = false;
|
||||
|
||||
//buffer
|
||||
spare_buffer = 0;
|
||||
spare_buffer = nullptr;
|
||||
spare_buffer_size = 0;
|
||||
|
||||
//cache
|
||||
@ -281,7 +281,7 @@ QMakeSourceFileInfo::~QMakeSourceFileInfo()
|
||||
//buffer
|
||||
if(spare_buffer) {
|
||||
free(spare_buffer);
|
||||
spare_buffer = 0;
|
||||
spare_buffer = nullptr;
|
||||
spare_buffer_size = 0;
|
||||
}
|
||||
|
||||
@ -538,7 +538,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
|
||||
const QMakeLocalFileName sourceFile = fixPathForFile(file->file, true);
|
||||
|
||||
struct stat fst;
|
||||
char *buffer = 0;
|
||||
char *buffer = nullptr;
|
||||
int buffer_len = 0;
|
||||
{
|
||||
int fd;
|
||||
@ -588,7 +588,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
|
||||
}
|
||||
for (; x < buffer_len; ++x) {
|
||||
bool try_local = true;
|
||||
char *inc = 0;
|
||||
char *inc = nullptr;
|
||||
if(file->type == QMakeSourceFileInfo::TYPE_UI) {
|
||||
// skip whitespaces
|
||||
while (x < buffer_len && (buffer[x] == ' ' || buffer[x] == '\t'))
|
||||
@ -802,7 +802,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
|
||||
if (cpp_state == WantName)
|
||||
buffer[clean] = '\0';
|
||||
else // i.e. malformed
|
||||
inc = 0;
|
||||
inc = nullptr;
|
||||
|
||||
cpp_state = InCode; // hereafter
|
||||
break;
|
||||
@ -915,7 +915,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
|
||||
file->moc_checked = true;
|
||||
|
||||
int buffer_len = 0;
|
||||
char *buffer = 0;
|
||||
char *buffer = nullptr;
|
||||
{
|
||||
struct stat fst;
|
||||
int fd;
|
||||
|
@ -138,7 +138,7 @@ BuildsMetaMakefileGenerator::init()
|
||||
bool
|
||||
BuildsMetaMakefileGenerator::write()
|
||||
{
|
||||
Build *glue = 0;
|
||||
Build *glue = nullptr;
|
||||
if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()) {
|
||||
glue = new Build;
|
||||
glue->name = name;
|
||||
@ -228,7 +228,7 @@ MakefileGenerator
|
||||
if (build_proj->read(project->projectFile()))
|
||||
return createMakefileGenerator(build_proj);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
|
||||
@ -236,7 +236,7 @@ class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
|
||||
protected:
|
||||
bool init_flag;
|
||||
struct Subdir {
|
||||
Subdir() : makefile(0), indent(0) { }
|
||||
Subdir() : makefile(nullptr), indent(0) { }
|
||||
~Subdir() { delete makefile; }
|
||||
QString input_dir;
|
||||
QString output_dir, output_file;
|
||||
@ -336,7 +336,7 @@ SubdirsMetaMakefileGenerator::init()
|
||||
hasError |= !sub->makefile->write();
|
||||
delete sub;
|
||||
qmakeClearCaches();
|
||||
sub = 0;
|
||||
sub = nullptr;
|
||||
Option::output.setFileName(output_name);
|
||||
}
|
||||
Option::output_dir = old_output_dir;
|
||||
@ -412,7 +412,7 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
|
||||
{
|
||||
Option::postProcessProject(proj);
|
||||
|
||||
MakefileGenerator *mkfile = NULL;
|
||||
MakefileGenerator *mkfile = nullptr;
|
||||
if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) {
|
||||
mkfile = new ProjectGenerator;
|
||||
mkfile->setProjectFile(proj);
|
||||
@ -459,7 +459,7 @@ MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &na
|
||||
{
|
||||
Option::postProcessProject(proj);
|
||||
|
||||
MetaMakefileGenerator *ret = 0;
|
||||
MetaMakefileGenerator *ret = nullptr;
|
||||
if ((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
|
||||
Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) {
|
||||
if (proj->first("TEMPLATE").endsWith("subdirs"))
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
|
||||
virtual ~MetaMakefileGenerator();
|
||||
|
||||
static MetaMakefileGenerator *createMetaGenerator(QMakeProject *proj, const QString &name, bool op=true, bool *success = 0);
|
||||
static MetaMakefileGenerator *createMetaGenerator(QMakeProject *proj, const QString &name, bool op=true, bool *success = nullptr);
|
||||
static MakefileGenerator *createMakefileGenerator(QMakeProject *proj, bool noIO = false);
|
||||
|
||||
inline QMakeProject *projectFile() const { return project; }
|
||||
|
@ -229,7 +229,7 @@ ProjectGenerator::init()
|
||||
|
||||
ProStringList &h = v["HEADERS"];
|
||||
bool no_qt_files = true;
|
||||
static const char *srcs[] = { "SOURCES", "YACCSOURCES", "LEXSOURCES", "FORMS", 0 };
|
||||
static const char *srcs[] = { "SOURCES", "YACCSOURCES", "LEXSOURCES", "FORMS", nullptr };
|
||||
for (int i = 0; srcs[i]; i++) {
|
||||
const ProStringList &l = v[srcs[i]];
|
||||
QMakeSourceFileInfo::SourceFileType type = QMakeSourceFileInfo::TYPE_C;
|
||||
|
@ -420,7 +420,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||
libdirs.append(QMakeLocalFileName(dlib.toQString()));
|
||||
frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks"));
|
||||
frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks"));
|
||||
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
|
||||
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
|
||||
for (int i = 0; lflags[i]; i++) {
|
||||
ProStringList &l = project->values(lflags[i]);
|
||||
for (ProStringList::Iterator it = l.begin(); it != l.end(); ) {
|
||||
|
@ -346,7 +346,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << mkdir_p_asstring("$(@D)", false) << "\n\t"
|
||||
<< "@$(CC) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
|
||||
|
||||
static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", 0 };
|
||||
static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", nullptr };
|
||||
for (int x = 0; src[x]; x++) {
|
||||
const ProStringList &l = project->values(src[x]);
|
||||
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
||||
|
@ -499,7 +499,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
|
||||
QSet<QString> source_directories;
|
||||
if (useInferenceRules) {
|
||||
source_directories.insert(".");
|
||||
static const char * const directories[] = { "UI_SOURCES_DIR", "UI_DIR", 0 };
|
||||
static const char * const directories[] = { "UI_SOURCES_DIR", "UI_DIR", nullptr };
|
||||
for (int y = 0; directories[y]; y++) {
|
||||
QString dirTemp = project->first(directories[y]).toQString();
|
||||
if (dirTemp.endsWith("\\"))
|
||||
@ -507,7 +507,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
|
||||
if(!dirTemp.isEmpty())
|
||||
source_directories.insert(dirTemp);
|
||||
}
|
||||
static const char * const srcs[] = { "SOURCES", "GENERATED_SOURCES", 0 };
|
||||
static const char * const srcs[] = { "SOURCES", "GENERATED_SOURCES", nullptr };
|
||||
for (int x = 0; srcs[x]; x++) {
|
||||
const ProStringList &l = project->values(srcs[x]);
|
||||
for (ProStringList::ConstIterator sit = l.begin(); sit != l.end(); ++sit) {
|
||||
|
@ -2185,7 +2185,7 @@ VCConfiguration::VCConfiguration()
|
||||
// VCFilter ---------------------------------------------------------
|
||||
VCFilter::VCFilter()
|
||||
: ParseFiles(unset),
|
||||
Config(0)
|
||||
Config(nullptr)
|
||||
{
|
||||
useCustomBuildTool = false;
|
||||
useCompilerTool = false;
|
||||
|
@ -112,7 +112,7 @@ VcprojGenerator::VcprojGenerator()
|
||||
: Win32MakefileGenerator(),
|
||||
is64Bit(false),
|
||||
customBuildToolFilterFileSuffix(QStringLiteral(".cbt")),
|
||||
projectWriter(0)
|
||||
projectWriter(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1100,7 +1100,7 @@ void VcprojGenerator::initLinkerTool()
|
||||
if (!project->values("DEF_FILE").isEmpty())
|
||||
conf.linker.ModuleDefinitionFile = project->first("DEF_FILE").toQString();
|
||||
|
||||
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
|
||||
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
|
||||
for (int i = 0; lflags[i]; i++) {
|
||||
const auto libs = fixLibFlags(lflags[i]);
|
||||
for (const ProString &lib : libs) {
|
||||
|
@ -77,7 +77,7 @@ QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned l
|
||||
QString rSubkeyName = keyName(rSubkey);
|
||||
QString rSubkeyPath = keyPath(rSubkey);
|
||||
|
||||
HKEY handle = 0;
|
||||
HKEY handle = nullptr;
|
||||
LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0,
|
||||
KEY_READ | options, &handle);
|
||||
|
||||
@ -87,7 +87,7 @@ QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned l
|
||||
// get the size and type of the value
|
||||
DWORD dataType;
|
||||
DWORD dataSize;
|
||||
res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);
|
||||
res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), nullptr, &dataType, nullptr, &dataSize);
|
||||
if (res != ERROR_SUCCESS) {
|
||||
RegCloseKey(handle);
|
||||
return QString();
|
||||
@ -95,7 +95,7 @@ QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned l
|
||||
|
||||
// get the value
|
||||
QByteArray data(dataSize, 0);
|
||||
res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0,
|
||||
res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), nullptr, nullptr,
|
||||
reinterpret_cast<unsigned char*>(data.data()), &dataSize);
|
||||
if (res != ERROR_SUCCESS) {
|
||||
RegCloseKey(handle);
|
||||
|
@ -84,7 +84,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||
if (impexts.isEmpty())
|
||||
impexts = project->values("QMAKE_EXTENSION_STATICLIB");
|
||||
QList<QMakeLocalFileName> dirs;
|
||||
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
|
||||
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
|
||||
for (int i = 0; lflags[i]; i++) {
|
||||
ProStringList &l = project->values(lflags[i]);
|
||||
for (ProStringList::Iterator it = l.begin(); it != l.end();) {
|
||||
@ -439,7 +439,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
|
||||
{
|
||||
t << "clean: compiler_clean " << depVar("CLEAN_DEPS");
|
||||
{
|
||||
const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", 0 };
|
||||
const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", nullptr };
|
||||
for(int i = 0; clean_targets[i]; ++i) {
|
||||
const ProStringList &list = project->values(clean_targets[i]);
|
||||
const QString del_statement("-$(DEL_FILE)");
|
||||
@ -468,7 +468,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
|
||||
|
||||
t << "distclean: clean " << depVar("DISTCLEAN_DEPS");
|
||||
{
|
||||
const char *clean_targets[] = { "QMAKE_DISTCLEAN", 0 };
|
||||
const char *clean_targets[] = { "QMAKE_DISTCLEAN", nullptr };
|
||||
for(int i = 0; clean_targets[i]; ++i) {
|
||||
const ProStringList &list = project->values(clean_targets[i]);
|
||||
const QString del_statement("-$(DEL_FILE)");
|
||||
|
@ -200,7 +200,7 @@ QString IoUtils::shellQuoteWin(const QString &arg)
|
||||
# if defined(Q_OS_WIN)
|
||||
static QString windowsErrorCode()
|
||||
{
|
||||
wchar_t *string = 0;
|
||||
wchar_t *string = nullptr;
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
@ -244,7 +244,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF
|
||||
return false;
|
||||
}
|
||||
FILETIME ft;
|
||||
GetFileTime(rHand, 0, 0, &ft);
|
||||
GetFileTime(rHand, NULL, NULL, &ft);
|
||||
CloseHandle(rHand);
|
||||
HANDLE wHand = CreateFile((wchar_t*)targetFileName.utf16(),
|
||||
GENERIC_WRITE, FILE_SHARE_READ,
|
||||
@ -253,7 +253,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF
|
||||
*errorString = fL1S("Cannot open %1: %2").arg(targetFileName, windowsErrorCode());
|
||||
return false;
|
||||
}
|
||||
SetFileTime(wHand, 0, 0, &ft);
|
||||
SetFileTime(wHand, NULL, NULL, &ft);
|
||||
CloseHandle(wHand);
|
||||
# endif
|
||||
return true;
|
||||
|
@ -78,12 +78,12 @@ public:
|
||||
int sourceFile() const { return m_file; }
|
||||
|
||||
ProString &prepend(const ProString &other);
|
||||
ProString &append(const ProString &other, bool *pending = 0);
|
||||
ProString &append(const ProString &other, bool *pending = nullptr);
|
||||
ProString &append(const QString &other) { return append(ProString(other)); }
|
||||
ProString &append(const QLatin1String other);
|
||||
ProString &append(const char *other) { return append(QLatin1String(other)); }
|
||||
ProString &append(QChar other);
|
||||
ProString &append(const ProStringList &other, bool *pending = 0, bool skipEmpty1st = false);
|
||||
ProString &append(const ProStringList &other, bool *pending = nullptr, bool skipEmpty1st = false);
|
||||
ProString &operator+=(const ProString &other) { return append(other); }
|
||||
ProString &operator+=(const QString &other) { return append(other); }
|
||||
ProString &operator+=(const QLatin1String other) { return append(other); }
|
||||
@ -133,9 +133,9 @@ public:
|
||||
bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; }
|
||||
bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; }
|
||||
bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; }
|
||||
int toLongLong(bool *ok = 0, int base = 10) const { return toQStringRef().toLongLong(ok, base); }
|
||||
int toInt(bool *ok = 0, int base = 10) const { return toQStringRef().toInt(ok, base); }
|
||||
short toShort(bool *ok = 0, int base = 10) const { return toQStringRef().toShort(ok, base); }
|
||||
int toLongLong(bool *ok = nullptr, int base = 10) const { return toQStringRef().toLongLong(ok, base); }
|
||||
int toInt(bool *ok = nullptr, int base = 10) const { return toQStringRef().toInt(ok, base); }
|
||||
short toShort(bool *ok = nullptr, int base = 10) const { return toQStringRef().toShort(ok, base); }
|
||||
|
||||
uint hash() const { return m_hash; }
|
||||
static uint hash(const QChar *p, int n);
|
||||
@ -261,7 +261,7 @@ class ProStringRwUser : public ProStringRoUser
|
||||
{
|
||||
public:
|
||||
ProStringRwUser(QString &rs)
|
||||
: ProStringRoUser(rs), m_ps(0) {}
|
||||
: ProStringRoUser(rs), m_ps(nullptr) {}
|
||||
ProStringRwUser(const ProString &ps, QString &rs)
|
||||
: ProStringRoUser(ps, rs), m_ps(&ps) {}
|
||||
QString &set(const ProString &ps) { m_ps = &ps; return ProStringRoUser::set(ps); }
|
||||
|
@ -1680,7 +1680,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
||||
#endif
|
||||
case T_INCLUDE: {
|
||||
QString parseInto;
|
||||
LoadFlags flags = 0;
|
||||
LoadFlags flags;
|
||||
if (m_cumulative)
|
||||
flags = LoadSilent;
|
||||
if (args.count() >= 2) {
|
||||
|
@ -118,7 +118,7 @@ bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two)
|
||||
}
|
||||
|
||||
QMakeBaseEnv::QMakeBaseEnv()
|
||||
: evaluator(0)
|
||||
: evaluator(nullptr)
|
||||
{
|
||||
#ifdef PROEVALUATOR_THREAD_SAFE
|
||||
inProgress = false;
|
||||
@ -215,7 +215,7 @@ QMakeEvaluator::QMakeEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeV
|
||||
initStatics();
|
||||
|
||||
// Configuration, more or less
|
||||
m_caller = 0;
|
||||
m_caller = nullptr;
|
||||
#ifdef PROEVALUATOR_CUMULATIVE
|
||||
m_cumulative = false;
|
||||
#endif
|
||||
@ -941,7 +941,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable(
|
||||
if (varName == statics.strTEMPLATE)
|
||||
setTemplate();
|
||||
else if (varName == statics.strQMAKE_PLATFORM)
|
||||
m_featureRoots = 0;
|
||||
m_featureRoots = nullptr;
|
||||
else if (varName == statics.strQMAKE_DIR_SEP)
|
||||
m_dirSep = first(varName);
|
||||
else if (varName == statics.strQMAKESPEC) {
|
||||
@ -950,7 +950,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable(
|
||||
if (IoUtils::isAbsolutePath(spec)) {
|
||||
m_qmakespec = spec;
|
||||
m_qmakespecName = IoUtils::fileName(m_qmakespec).toString();
|
||||
m_featureRoots = 0;
|
||||
m_featureRoots = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1594,7 +1594,7 @@ ProFile *QMakeEvaluator::currentProFile() const
|
||||
{
|
||||
if (m_profileStack.count() > 0)
|
||||
return m_profileStack.top();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int QMakeEvaluator::currentFileId() const
|
||||
@ -1874,7 +1874,7 @@ ProValueMap *QMakeEvaluator::findValues(const ProKey &variableName, ProValueMap:
|
||||
if (first && isFunctParam(variableName))
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ProStringList &QMakeEvaluator::valuesRef(const ProKey &variableName)
|
||||
|
@ -282,9 +282,9 @@ public:
|
||||
#endif
|
||||
|
||||
struct Location {
|
||||
Location() : pro(0), line(0) {}
|
||||
Location() : pro(nullptr), line(0) {}
|
||||
Location(ProFile *_pro, ushort _line) : pro(_pro), line(_line) {}
|
||||
void clear() { pro = 0; line = 0; }
|
||||
void clear() { pro = nullptr; line = 0; }
|
||||
ProFile *pro;
|
||||
ushort line;
|
||||
};
|
||||
|
@ -215,7 +215,7 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
|
||||
pro->itemsRef()->squeeze();
|
||||
pro->ref();
|
||||
} else {
|
||||
pro = 0;
|
||||
pro = nullptr;
|
||||
}
|
||||
ent->pro = pro;
|
||||
#ifdef PROPARSER_THREAD_SAFE
|
||||
@ -234,7 +234,7 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
|
||||
if (readFile(id, flags, &contents))
|
||||
pro = parsedProBlock(QStringRef(&contents), id, fileName, 1, FullGrammar);
|
||||
else
|
||||
pro = 0;
|
||||
pro = nullptr;
|
||||
}
|
||||
return pro;
|
||||
}
|
||||
@ -437,7 +437,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar
|
||||
|
||||
if (context == CtxPureValue) {
|
||||
end = inend;
|
||||
cptr = 0;
|
||||
cptr = nullptr;
|
||||
lineCont = false;
|
||||
indent = 0; // just gcc being stupid
|
||||
goto nextChr;
|
||||
@ -449,7 +449,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar
|
||||
// First, skip leading whitespace
|
||||
for (indent = 0; ; ++cur, ++indent) {
|
||||
if (cur == inend) {
|
||||
cur = 0;
|
||||
cur = nullptr;
|
||||
goto flushLine;
|
||||
}
|
||||
c = *cur;
|
||||
@ -1112,7 +1112,7 @@ void QMakeParser::finalizeCall(ushort *&tokPtr, ushort *uc, ushort *ptr, int arg
|
||||
if (uc == ptr) {
|
||||
// for(literal) (only "ever" would be legal if qmake was sane)
|
||||
putTok(tokPtr, TokForLoop);
|
||||
putHashStr(tokPtr, (ushort *)0, (uint)0);
|
||||
putHashStr(tokPtr, nullptr, (uint)0);
|
||||
putBlockLen(tokPtr, 1 + 3 + nlen + 1);
|
||||
putTok(tokPtr, TokHashLiteral);
|
||||
putHashStr(tokPtr, uce + 2, nlen);
|
||||
@ -1135,7 +1135,7 @@ void QMakeParser::finalizeCall(ushort *&tokPtr, ushort *uc, ushort *ptr, int arg
|
||||
} else if (argc == 1) {
|
||||
// for(non-literal) (this wouldn't be here if qmake was sane)
|
||||
putTok(tokPtr, TokForLoop);
|
||||
putHashStr(tokPtr, (ushort *)0, (uint)0);
|
||||
putHashStr(tokPtr, nullptr, (uint)0);
|
||||
uc = uce;
|
||||
goto doFor;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ private:
|
||||
};
|
||||
|
||||
struct BlockScope {
|
||||
BlockScope() : start(0), braceLevel(0), special(false), inBranch(false), nest(NestNone) {}
|
||||
BlockScope() : start(nullptr), braceLevel(0), special(false), inBranch(false), nest(NestNone) {}
|
||||
BlockScope(const BlockScope &other) { *this = other; }
|
||||
ushort *start; // Where this block started; store length here
|
||||
int braceLevel; // Nesting of braces in scope
|
||||
|
@ -546,7 +546,7 @@ int runQMake(int argc, char **argv)
|
||||
exit_val = 5;
|
||||
}
|
||||
delete mkfile;
|
||||
mkfile = NULL;
|
||||
mkfile = nullptr;
|
||||
}
|
||||
qmakeClearCaches();
|
||||
return exit_val;
|
||||
|
@ -507,7 +507,7 @@ QString
|
||||
Option::fixString(QString string, uchar flags)
|
||||
{
|
||||
//const QString orig_string = string;
|
||||
static QHash<FixStringCacheKey, QString> *cache = 0;
|
||||
static QHash<FixStringCacheKey, QString> *cache = nullptr;
|
||||
if(!cache) {
|
||||
cache = new QHash<FixStringCacheKey, QString>;
|
||||
qmakeAddCacheClear(qmakeDeleteCacheClear<QHash<FixStringCacheKey, QString> >, (void**)&cache);
|
||||
@ -635,7 +635,7 @@ public:
|
||||
QMakeCacheClearItem(qmakeCacheClearFunc f, void **d) : func(f), data(d) { }
|
||||
~QMakeCacheClearItem() {
|
||||
(*func)(*data);
|
||||
*data = 0;
|
||||
*data = nullptr;
|
||||
}
|
||||
};
|
||||
static QList<QMakeCacheClearItem*> cache_items;
|
||||
|
@ -108,7 +108,7 @@ struct Option
|
||||
};
|
||||
|
||||
//both of these must be called..
|
||||
static int init(int argc=0, char **argv=0); //parse cmdline
|
||||
static int init(int argc = 0, char **argv = nullptr); //parse cmdline
|
||||
static void prepareProject(const QString &pfile);
|
||||
static bool postProcessProject(QMakeProject *);
|
||||
|
||||
|
@ -68,7 +68,7 @@ static const struct {
|
||||
{ "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true, true },
|
||||
};
|
||||
|
||||
QMakeProperty::QMakeProperty() : settings(0)
|
||||
QMakeProperty::QMakeProperty() : settings(nullptr)
|
||||
{
|
||||
reload();
|
||||
}
|
||||
@ -99,7 +99,7 @@ void QMakeProperty::reload()
|
||||
QMakeProperty::~QMakeProperty()
|
||||
{
|
||||
delete settings;
|
||||
settings = 0;
|
||||
settings = nullptr;
|
||||
}
|
||||
|
||||
void QMakeProperty::initSettings()
|
||||
|
Loading…
Reference in New Issue
Block a user