[Cmake-commits] CMake branch, next, updated. v3.7.0-rc1-106-gf7f6ddb

Brad King brad.king at kitware.com
Thu Oct 6 10:55:13 EDT 2016


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  f7f6ddb5cbe58a594970b8700bef3ea2cabe8554 (commit)
       via  fb2b59432d9764694fb51dd9e80b73d8c87442f9 (commit)
      from  e5abe1865909ed63e14069fa418b01f20a6ca01e (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7f6ddb5cbe58a594970b8700bef3ea2cabe8554
commit f7f6ddb5cbe58a594970b8700bef3ea2cabe8554
Merge: e5abe18 fb2b594
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 6 10:55:11 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 6 10:55:11 2016 -0400

    Merge topic 'nmake-encoding' into next
    
    fb2b5943 fixup! codecvt: Add class for encoding conversion


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb2b59432d9764694fb51dd9e80b73d8c87442f9
commit fb2b59432d9764694fb51dd9e80b73d8c87442f9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 6 10:38:19 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 6 10:45:11 2016 -0400

    fixup! codecvt: Add class for encoding conversion

diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx
index 088f559..869dd32 100644
--- a/Source/cm_codecvt.cxx
+++ b/Source/cm_codecvt.cxx
@@ -10,8 +10,10 @@
 #endif
 
 codecvt::codecvt(Encoding e)
-  : m_codepage(0)
-  , m_lastState(0)
+  : m_lastState(0)
+#if defined(_WIN32)
+  , m_codepage(0)
+#endif
 {
   switch (e) {
     case codecvt::ANSI:
@@ -21,8 +23,7 @@ codecvt::codecvt(Encoding e)
       break;
 #endif
     // We don't know which ANSI encoding to use for other platforms than
-    // Windows
-    // so we don't do any conversion there
+    // Windows so we don't do any conversion there
     case codecvt::UTF8:
     // Assume internal encoding is UTF-8
     case codecvt::None:
@@ -47,7 +48,7 @@ std::codecvt_base::result codecvt::do_out(mbstate_t& state, const char* from,
   if (m_noconv) {
     return noconv;
   }
-  std::codecvt_base::result result = error;
+  std::codecvt_base::result res = error;
 #if defined(_WIN32)
   from_next = from;
   to_next = to;
@@ -106,10 +107,10 @@ std::codecvt_base::result codecvt::do_out(mbstate_t& state, const char* from,
       if (r > 0) {
         from_next = from_end;
         to_next = to + r;
-        result = ok;
+        res = ok;
       }
     } else {
-      result = partial;
+      res = partial;
       from_next = from_end;
       to_next = to;
     }
@@ -122,16 +123,16 @@ std::codecvt_base::result codecvt::do_out(mbstate_t& state, const char* from,
   static_cast<void>(to);
   static_cast<void>(to_end);
   static_cast<void>(to_next);
-  result = codecvt::noconv;
+  res = codecvt::noconv;
 #endif
-  return result;
+  return res;
 };
 
 std::codecvt_base::result codecvt::do_unshift(mbstate_t& state, char* to,
                                               char* to_end,
                                               char*& to_next) const
 {
-  std::codecvt_base::result result = error;
+  std::codecvt_base::result res = error;
   to_next = to;
 #if defined(_WIN32)
   unsigned int& stateId = reinterpret_cast<unsigned int&>(state);
@@ -149,17 +150,17 @@ std::codecvt_base::result codecvt::do_unshift(mbstate_t& state, char* to,
                                 NULL, NULL);
     if (r > 0) {
       to_next = to + r;
-      result = ok;
+      res = ok;
     }
   } else {
-    result = ok;
+    res = ok;
   }
 #else
   static_cast<void>(state);
   static_cast<void>(to_end);
-  result = ok;
+  res = ok;
 #endif
-  return result;
+  return res;
 };
 
 int codecvt::do_max_length() const throw()
@@ -174,7 +175,7 @@ int codecvt::do_encoding() const throw()
 
 unsigned int codecvt::findStateId() const
 {
-  unsigned int id = 0;
+  unsigned int stateId = 0;
   bool add = false;
   const unsigned int maxSize = std::numeric_limits<unsigned int>::max();
   if (m_lastState >= maxSize) {
@@ -189,7 +190,7 @@ unsigned int codecvt::findStateId() const
       i++;
       if (!s.used) {
         m_lastState = i;
-        id = m_lastState;
+        stateId = m_lastState;
         s.used = true;
         s.totalBytes = 0;
         s.bytesLeft = 0;
@@ -205,10 +206,10 @@ unsigned int codecvt::findStateId() const
     }
   };
   if (add) {
-    codecvt::State s = { true, 0, 0, 0, 0, 0, 0 };
+    codecvt::State s = { true, 0, 0, { 0, 0, 0, 0 } };
     m_states.push_back(s);
     m_lastState = (unsigned int)m_states.size();
-    id = m_lastState;
+    stateId = m_lastState;
   }
-  return id;
+  return stateId;
 };
diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx
index 6bd0a78..5f16bd8 100644
--- a/Source/cm_codecvt.hxx
+++ b/Source/cm_codecvt.hxx
@@ -3,6 +3,8 @@
 #ifndef cm_codecvt_hxx
 #define cm_codecvt_hxx
 
+#include <cmConfigure.h> // IWYU pragma: keep
+
 #include <locale>
 #include <vector>
 
@@ -21,15 +23,15 @@ public:
   codecvt(Encoding e);
 
 protected:
-  virtual ~codecvt();
-  virtual bool do_always_noconv() const throw();
-  virtual result do_out(mbstate_t& state, const char* from,
-                        const char* from_end, const char*& from_next, char* to,
-                        char* to_end, char*& to_next) const;
-  virtual result do_unshift(mbstate_t& state, char* to, char*,
-                            char*& to_next) const;
-  virtual int do_max_length() const throw();
-  virtual int do_encoding() const throw();
+  ~codecvt() CM_OVERRIDE;
+  bool do_always_noconv() const throw() CM_OVERRIDE;
+  result do_out(mbstate_t& state, const char* from, const char* from_end,
+                const char*& from_next, char* to, char* to_end,
+                char*& to_next) const CM_OVERRIDE;
+  result do_unshift(mbstate_t& state, char* to, char*,
+                    char*& to_next) const CM_OVERRIDE;
+  int do_max_length() const throw() CM_OVERRIDE;
+  int do_encoding() const throw() CM_OVERRIDE;
 
 private:
   typedef struct
@@ -43,9 +45,11 @@ private:
   unsigned int findStateId() const;
 
   bool m_noconv;
-  unsigned int m_codepage;
   mutable std::vector<State> m_states;
   mutable unsigned int m_lastState;
+#if defined(_WIN32)
+  unsigned int m_codepage;
+#endif
 
 #endif
 };

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

Summary of changes:
 Source/cm_codecvt.cxx |   39 ++++++++++++++++++++-------------------
 Source/cm_codecvt.hxx |   24 ++++++++++++++----------
 2 files changed, 34 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list