[Cmake-commits] CMake branch, next, updated. v2.8.11-2132-g00a86e0

Rolf Eike Beer eike at sf-mail.de
Tue May 21 17:38:31 EDT 2013


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  00a86e0c4f0169a3b564f0ca5e579d7b9eed1ed7 (commit)
       via  d5fa327711f2759f90a21898a34d3dcd66a28a77 (commit)
       via  f1d27bf667a8548121ed849cbb211eccf386f1bd (commit)
      from  4b4e553181e238964ec15ad74a0f43f99ee93160 (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=00a86e0c4f0169a3b564f0ca5e579d7b9eed1ed7
commit 00a86e0c4f0169a3b564f0ca5e579d7b9eed1ed7
Merge: 4b4e553 d5fa327
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Tue May 21 17:38:29 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 21 17:38:29 2013 -0400

    Merge topic 'wizard-cleanup' into next
    
    d5fa327 simplify control flow
    f1d27bf wizard: fix warnings


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5fa327711f2759f90a21898a34d3dcd66a28a77
commit d5fa327711f2759f90a21898a34d3dcd66a28a77
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Tue May 21 23:36:37 2013 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Tue May 21 23:36:37 2013 +0200

    simplify control flow
    
    Checking if a byte is 0 before checking it for something else doesn't do
    anything useful. Also one can be sure that it can't be anything wanted if the
    value was set to 0 immediately before.

diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx
index 8ac55d9..bac403a 100644
--- a/Source/cmakewizard.cxx
+++ b/Source/cmakewizard.cxx
@@ -71,12 +71,9 @@ bool cmakewizard::AskAdvanced()
     {
     buffer[0] = 0;
     }
-  if(buffer[0])
+  else if(buffer[0] == 'y' || buffer[0] == 'Y')
     {
-    if(buffer[0] == 'y' || buffer[0] == 'Y')
-      {
-      return true;
-      }
+    return true;
     }
   return false;
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1d27bf667a8548121ed849cbb211eccf386f1bd
commit f1d27bf667a8548121ed849cbb211eccf386f1bd
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Tue May 21 23:33:54 2013 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Tue May 21 23:33:54 2013 +0200

    wizard: fix warnings
    
    .../Source/cmakewizard.cxx: In member function ‘virtual void cmakewizard::AskUser(const char*, cmCacheManager::CacheIterator&)’:
    .../Source/cmakewizard.cxx:31:35: warning: conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Wconversion]
       if(!fgets(buffer, sizeof(buffer)-1, stdin))
                                       ^
    .../Source/cmakewizard.cxx: In member function ‘virtual bool cmakewizard::AskAdvanced()’:
    .../Source/cmakewizard.cxx:70:35: warning: conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Wconversion]
       if(!fgets(buffer, sizeof(buffer)-1, stdin))
    
    The compiler is (partly) right here: sizeof() returns a size_t, which often is
    bigger as as int as it is unsigned long or something similar. Add an explicit
    cast to get rid of that warning here, the buffer has a size of 4KiB, so the
    value will fit into an int on all sane platforms.

diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx
index 749f669..8ac55d9 100644
--- a/Source/cmakewizard.cxx
+++ b/Source/cmakewizard.cxx
@@ -28,7 +28,7 @@ void cmakewizard::AskUser(const char* key,
   printf("Current Value: %s\n", iter.GetValue());
   printf("New Value (Enter to keep current value): ");
   char buffer[4096];
-  if(!fgets(buffer, sizeof(buffer)-1, stdin))
+  if(!fgets(buffer, static_cast<int>(sizeof(buffer) - 1), stdin))
     {
     buffer[0] = 0;
     }
@@ -67,7 +67,7 @@ bool cmakewizard::AskAdvanced()
 {
   printf("Would you like to see advanced options? [No]:");
   char buffer[4096];
-  if(!fgets(buffer, sizeof(buffer)-1, stdin))
+  if(!fgets(buffer, static_cast<int>(sizeof(buffer) - 1), stdin))
     {
     buffer[0] = 0;
     }

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

Summary of changes:
 Source/cmakewizard.cxx |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list