]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/bits/charconv.h
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / bits / charconv.h
index a5b6be567bcbb5c943afb9678c81c88065418b7c..a3149bddbaec7a02a14cbfd6e730a7711a7d58d0 100644 (file)
@@ -1,6 +1,6 @@
 // Numeric conversions (to_string, to_chars) -*- C++ -*-
 
-// Copyright (C) 2017-2019 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -50,16 +50,16 @@ namespace __detail
       static_assert(is_unsigned<_Tp>::value, "implementation bug");
 
       unsigned __n = 1;
-      const int __b2 = __base  * __base;
-      const int __b3 = __b2 * __base;
-      const int __b4 = __b3 * __base;
+      const unsigned __b2 = __base  * __base;
+      const unsigned __b3 = __b2 * __base;
+      const unsigned long __b4 = __b3 * __base;
       for (;;)
        {
-         if (__value < __base) return __n;
+         if (__value < (unsigned)__base) return __n;
          if (__value < __b2) return __n + 1;
          if (__value < __b3) return __n + 2;
          if (__value < __b4) return __n + 3;
-         __value /= (unsigned)__b4;
+         __value /= __b4;
          __n += 4;
        }
     }