reafactor ... <> 0 with not ... equals(0)

This commit is contained in:
Basile Burg 2020-07-05 14:48:19 +02:00
parent b3da921d63
commit 87c8ca3cd1
12 changed files with 18 additions and 18 deletions

View File

@ -957,7 +957,7 @@ begin
getprocInputHandler.removeProcess(TProcess(sender));
if proc is TDexedProcess then
dproc := TDexedProcess(proc);
if (proc.ExitStatus <> 0) then
if not proc.ExitStatus.equals(0) then
begin
fMsgs.message(format('error: the process (%s) has returned the status %s',
[proc.Executable, prettyReturnStatus(proc)]), fAsProjectItf, amcProj, amkErr);

View File

@ -151,7 +151,7 @@ const
begin
result := inherited Compare(range);
assert(range <> nil);
if result <> 0 then
if not result.equals(0) then
exit;
if range is TSynD2SynRange then

View File

@ -914,7 +914,7 @@ begin
begin
if fDebugConditions then
list.Add('-debug');
if fDbgLevel <> 0 then
if not fDbgLevel.equals(0) then
list.Add('-debug=' + intToStr(fDbgLevel));
for idt in fDbgIdents do
list.Add('-debug=' + idt);

View File

@ -283,7 +283,7 @@ begin
if not o.findAny('path', d) then
continue;
p := d.AsString;
if (p.length <> 0) and (p[p.length] <> DirectorySeparator) then
if not p.length.equals(0) and (p[p.length] <> DirectorySeparator) then
p += DirectorySeparator;
if DirectoryExistsUTF8(p) then
loc.Add(p);
@ -1143,7 +1143,7 @@ begin
begin
fDubProc.Options := fDubProc.Options + [poWaitOnExit, poNewConsole];
end;
if fMetaEnv.Count <> 0 then
if not fMetaEnv.Count.equals(0) then
begin
for i := 0 to fMetaEnv.Count-1 do
begin

View File

@ -2050,7 +2050,7 @@ begin
cpuViewer.TIObject := fInspState;
cpuViewer.RefreshPropertyValues;
// inferior options
if o.environmentPaths.Count <> 0 then
if not o.environmentPaths.Count.equals(0) then
begin
str := '';
for i:= 0 to o.environmentPaths.Count-1 do
@ -2060,7 +2060,7 @@ begin
end;
if DirectoryExists(fSyms.expand(o.workingDirectory)) then
gdbCommand('-environment-cd ' + fSyms.expand(o.workingDirectory));
if (o.arguments.Count <> 0) or (o.queryArguments) then
if not o.arguments.Count.equals(0) or o.queryArguments then
begin
str := '';
if o.queryArguments and not InputQuery('Command line arguments', 'GDB commander', str) then
@ -2462,7 +2462,7 @@ begin
sigmean := 'unknown meaning';
if fJson.findAny('signal-name', val) then
signame := val.AsString;
if (fOptions.ignoredSignals.Count <> 0) and
if not fOptions.ignoredSignals.Count.equals(0) and
(fOptions.ignoredSignals.IndexOf(signame) <> -1) then
begin
continueDebugging;

View File

@ -488,7 +488,7 @@ begin
finally
dub.Free;
end;
if err <> 0 then
if not err.equals(0) then
begin
itf.message('error, failed to fetch the package', nil, amcMisc, amkErr);
exit;
@ -539,7 +539,7 @@ begin
finally
dub.Free;
end;
if err <> 0 then
if not err.equals(0) then
begin
// allow "sourceLibrary"
EntitiesConnector.beginUpdate;

View File

@ -2963,7 +2963,7 @@ begin
inph := EntitiesConnector.getSingleService('IProcInputHandler');
if inph.isNotNil then
(inph as IProcInputHandler).removeProcess(proc);
if (proc.ExitStatus <> 0) then
if not proc.ExitStatus.equals(0) then
begin
fMsgs.message(format('error: the process (%s) has returned the status %s',
[proc.Executable, prettyReturnStatus(proc)]), fDoc, amcEdit, amkErr);
@ -3095,7 +3095,7 @@ begin
dmdproc.Parameters.Add('-of' + fname + objExt);
dmdproc.Parameters.Add('-J' + fDoc.fileName.extractFilePath);
dmdproc.Parameters.AddStrings(fRunnablesOptions.staticSwitches);
if lst.isNotNil and (lst.Count <> 0) then
if lst.isNotNil and not lst.Count.equals(0) then
dmdproc.Parameters.AddStrings(lst);
{$ifdef WINDOWS}
{$ifdef CPUX86_64}

View File

@ -539,7 +539,7 @@ begin
begin
Compare := AnsiCompareStr(item1.SubItems[3], item2.SubItems[3]);
end
else if col <> 0 then
else if not col.equals(0) then
begin
i1 := item1.SubItems[col-1].ToInt64;
i2 := item2.SubItems[col-1].ToInt64;

View File

@ -371,7 +371,7 @@ procedure TShortcutEditor.btnClearClick(Sender: TObject);
begin
if not anItemIsSelected then
exit;
if TShortcutItem(tree.Selected.Data).data <> 0 then
if not TShortcutItem(tree.Selected.Data).data <> 0 then
begin
TShortcutItem(tree.Selected.Data).data := 0;
fHasChanged := true;

View File

@ -224,7 +224,7 @@ begin
fSymbols[CPO] := fProjInterface.outputFilename;
fSymbols[CPOP]:= fSymbols[CPO].extractFileDir;
fSymbols[CPR] := fSymbols[CPP];
if fProjInterface.sourcesCount <> 0 then
if not fProjInterface.sourcesCount.equals(0) then
begin
str := TStringList.Create;
try

View File

@ -1040,7 +1040,7 @@ end;
procedure TScrollMemo.goToLine(value: integer);
begin
if fMemo.PaintLock <> 0 then
if not fMemo.PaintLock.equals(0) then
exit;
if value > fMemo.Lines.Count then
value := fMemo.Lines.Count
@ -1702,7 +1702,7 @@ begin
t += byte(result = imTabs);
s += byte(result = imSpaces);
end;
if (t <> 0) and (s <> 0) then
if not t.equals(0) and not s.equals(0) then
result := imMixed
else if t.equals(0) then
result := imSpaces

View File

@ -292,7 +292,7 @@ begin
if fTerminatedFlag then
exit;
fTerminatedFlag := true;
if fProcess.ExitStatus <> 0 then
if not fProcess.ExitStatus.equals(0) then
begin
fMsgs.message(format('error: the tool (%s) has returned the status %s',
[fProcess.Executable, prettyReturnStatus(fProcess)]), nil, amcMisc, amkErr);