ide: Fixed improper casts to 'bool' type
authorJerome St-Louis <jerome@ecere.com>
Wed, 23 Apr 2014 16:56:12 +0000 (12:56 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 23 Apr 2014 16:56:12 +0000 (12:56 -0400)
ide/src/dialogs/FindInFilesDialog.ec
ide/src/panels/CallStackView.ec
ide/src/panels/OutputView.ec
ide/src/panels/ThreadsView.ec
ide/src/project/ProjectView.ec

index 85f9ef3..30c39f3 100644 (file)
@@ -447,7 +447,7 @@ private:
    bool OnPostCreate()
    {
       bool disabled;
-      bool withWorkspace = (bool)ide.workspace;
+      bool withWorkspace = ide.workspace != null;
       DataRow row;
       if(!inDirectoryRow)
          inDirectoryRow = findIn.AddString($"Directory");
@@ -725,7 +725,7 @@ private:
                {
                   char name[MAX_LOCATION];
                   GetLastDirectory(stack[frame].fileList.path, name);
-                  if(!(bool)SearchString(name, 0, nameCriteria, false, false))
+                  if(SearchString(name, 0, nameCriteria, false, false) == null)
                      match = false;
                }
                if(!stack[frame].fileList.stats.attribs.isDirectory)
@@ -876,7 +876,7 @@ private:
                      if(filter.ValidateFileName(stack[frame].name))
                      {
                         filesSearchedCount++;
-                        if(!nameCriteria[0] || (bool)SearchString(stack[frame].name, 0, nameCriteria, false, false))
+                        if(!nameCriteria[0] || SearchString(stack[frame].name, 0, nameCriteria, false, false) != null)
                         {
                            if(contentCriteria[0])
                            {
@@ -927,7 +927,7 @@ private:
                         sprintf(special, "(%s)%s", prj.name, fileRelative);
                         strcpy(fileRelative, special);
                      }
-                     if(nameCriteria[0] && (bool)SearchString(stack[frame].name, 0, nameCriteria, false, false))
+                     if(nameCriteria[0] && SearchString(stack[frame].name, 0, nameCriteria, false, false) != null)
                      {
                         dirsMatchedCount++;
                         app.Lock();
index 2302420..3962303 100644 (file)
@@ -91,7 +91,7 @@ class CallStackView : Window
       char * searchString = findDialog.searchString;
       if(id != 2 && searchString[0])
       {
-         editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, (bool)id);
+         editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, id != 0);
          return true;
       }
       findDialog.Create();
index 6575f76..324a6e0 100644 (file)
@@ -233,7 +233,7 @@ class OutputView : Window
       char * searchString = findDialog.searchString;
       if(id != 2 && searchString[0])
       {
-         activeBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, (bool)id);
+         activeBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, id != 0);
          return true;
       }
       findDialog.Create();
index 527b2ed..406f41e 100644 (file)
@@ -115,7 +115,7 @@ class ThreadsView : Window
       char * searchString = findDialog.searchString;
       if(id != 2 && searchString[0])
       {
-         editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, (bool)id);
+         editBox.Find(searchString, findDialog.wholeWord, findDialog.matchCase, id != 0);
          return true;
       }
       findDialog.Create();
index 17a52fa..8cd85a9 100644 (file)
@@ -1243,7 +1243,7 @@ class ProjectView : Window
          MakePathRelative(filePath, parentNode.project.topNode.path, filePath);
          for(n = parentNode; n && n != parentNode.project.resNode; n = n.parent);
          sprintf(fileName, $"Untitled %d", documentID);
-         fileNode = AddFile(parentNode, fileName, (bool)n, true);
+         fileNode = AddFile(parentNode, fileName, n != null, true);
          fileNode.path = CopyUnixPath(filePath);
          if(fileNode)
          {