[Cmake-commits] CMake branch, next, updated. v2.8.2-806-g00473f8

Brad King brad.king at kitware.com
Thu Sep 16 17:47:05 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  00473f893fdec3d688c1d0c589e4dc3bce2d3844 (commit)
       via  5d7c3c0a594a57705f42ad6e1fa454234bfe7b56 (commit)
      from  bab72e1b6d70d09aecb101b52f69ef595459a50e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00473f893fdec3d688c1d0c589e4dc3bce2d3844
commit 00473f893fdec3d688c1d0c589e4dc3bce2d3844
Merge: bab72e1 5d7c3c0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 16 17:47:03 2010 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Sep 16 17:47:03 2010 -0400

    Merge topic 'fix-ccmake-search' into next
    
    5d7c3c0 ccmake: Fix search with '/'


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d7c3c0a594a57705f42ad6e1fa454234bfe7b56
commit 5d7c3c0a594a57705f42ad6e1fa454234bfe7b56
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 16 17:45:27 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 16 17:45:27 2010 -0400

    ccmake: Fix search with '/'
    
    Commit 7a18dd8e (Add searching of variables, 2003-03-07) added method
    cmCursesMainForm::JumpToCacheEntry to search for cache entries whose
    names match a given search string.  The method also had a useless
    argument "int idx" probably left from earlier development iterations and
    hard-coded in all calls to the value '-1'.  The method compared this
    argument to the "NumberOfVisibleEntries" member which at the time was of
    type "int" also.
    
    Commit ff1f8d0b (Fix or cast more integer conversions in cmake,
    2010-06-29) changed the type of "NumberOfVisibleEntries" to size_t to
    fix other integer conversion warnings.  An unsigned type makes sense
    given the purpose of the member.  However, this caused the '-1' signed
    value to be converted to a large unsigned value in the above-mentioned
    comparison, leading to incorrect behavior.
    
    Fix the problem by removing the useless argument and the comparison.

diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 389ec7f..7f3e360 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -902,7 +902,7 @@ void cmCursesMainForm::HandleInput()
         this->SearchMode = false;
         if ( this->SearchString.size() > 0 )
           {
-          this->JumpToCacheEntry(-1, this->SearchString.c_str());
+          this->JumpToCacheEntry(this->SearchString.c_str());
           this->OldSearchString = this->SearchString;
           }
         this->SearchString = "";
@@ -1076,7 +1076,7 @@ void cmCursesMainForm::HandleInput()
         {
         if ( this->OldSearchString.size() > 0 )
           {
-          this->JumpToCacheEntry(-1, this->OldSearchString.c_str());
+          this->JumpToCacheEntry(this->OldSearchString.c_str());
           }
         }
       // switch advanced on/off
@@ -1191,7 +1191,7 @@ int cmCursesMainForm::LoadCache(const char *)
   return r;
 }
   
-void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
+void cmCursesMainForm::JumpToCacheEntry(const char* astr)
 {
   std::string str;
   if ( astr )
@@ -1199,18 +1199,14 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
     str = cmSystemTools::LowerCase(astr);
     }
 
-  if ( size_t(idx) > this->NumberOfVisibleEntries )
-    {
-    return;
-    }
-  if ( idx < 0 && str.size() == 0)
+  if(str.empty())
     {
     return;
     }
   FIELD* cur = current_field(this->Form);
   int start_index = field_index(cur);
   int findex = start_index;
-  while ( (findex / 3) != idx ) 
+  for(;;)
     {
     if ( str.size() > 0 )
       {
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 4084415..3e191b4 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -122,9 +122,8 @@ protected:
   // Remove an entry from the interface and the cache.
   void RemoveEntry(const char* value);
 
-  // Jump to the cache value with index idx. If string str is
-  // specified, it will stop on widget that contain that string.
-  void JumpToCacheEntry(int idx, const char* str);
+  // Jump to the cache entry whose name matches the string.
+  void JumpToCacheEntry(const char* str);
 
   // Copies of cache entries stored in the user interface
   std::vector<cmCursesCacheEntryComposite*>* Entries;

-----------------------------------------------------------------------

Summary of changes:
 Source/CursesDialog/cmCursesMainForm.cxx |   14 +++++---------
 Source/CursesDialog/cmCursesMainForm.h   |    5 ++---
 2 files changed, 7 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list