Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
salvoilmiosi committed Jul 31, 2022
1 parent 0bddea8 commit 6d6942c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
16 changes: 6 additions & 10 deletions include/boost/locale/numpunct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@
#ifndef BOOST_LOCALE_NUMPUNCT_HPP_INCLUDED
#define BOOST_LOCALE_NUMPUNCT_HPP_INCLUDED
#include <boost/locale/config.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4275 4251 4231 4660)
#endif
#include <locale>
#include <string>

namespace boost {
namespace locale {

template<typename CharType>
class BOOST_LOCALE_DECL numpunct_base : public std::numpunct<CharType>
class numpunct_base : public std::numpunct<CharType>
{
typedef std::basic_string<CharType> string_type;
public:
Expand All @@ -35,7 +31,7 @@ namespace boost {
}

protected:
virtual CharType do_decimal_point() const {
CharType do_decimal_point() const BOOST_OVERRIDE {
string_type dec = do_decimal_point_str();
if (dec.size() > 1) {
return '.';
Expand All @@ -49,7 +45,7 @@ namespace boost {
return string_type(t, t + sizeof(t) - 1);
}

virtual CharType do_thousands_sep() const {
CharType do_thousands_sep() const BOOST_OVERRIDE {
string_type thous = do_thousands_sep_str();
if (thous.size() > 1) {
return ',';
Expand All @@ -63,18 +59,18 @@ namespace boost {
return string_type(t, t + sizeof(t) - 1);
}

virtual string_type do_truename() const {
virtual string_type do_truename() const BOOST_OVERRIDE {
static const char t[] = "true";
return string_type(t, t + sizeof(t) - 1);
}

virtual string_type do_falsename() const {
virtual string_type do_falsename() const BOOST_OVERRIDE {
static const char t[] = "false";
return string_type(t, t + sizeof(t) - 1);
}
};

template<typename CharType> struct numpunct {};
template<typename CharType> struct numpunct;

template<> struct numpunct<char> : numpunct_base<char> {
numpunct (size_t refs = 0) : numpunct_base<char>(refs) {}
Expand Down
6 changes: 3 additions & 3 deletions src/boost/locale/icu/numeric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,13 @@ struct icu_numpunct : public numpunct<CharType> {
}
}
protected:
virtual string_type do_decimal_point_str() const {
string_type do_decimal_point_str() const BOOST_OVERRIDE {
return decimal_point_;
}
virtual string_type do_thousands_sep_str() const {
string_type do_thousands_sep_str() const BOOST_OVERRIDE {
return thousands_sep_;
}
virtual std::string do_grouping() const {
std::string do_grouping() const BOOST_OVERRIDE {
return grouping_;
}

Expand Down
14 changes: 2 additions & 12 deletions src/boost/locale/posix/numeric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,28 +423,18 @@ class num_punct_posix : public numpunct<CharType> {
{
s2=conv::to_utf<wchar_t>(s1,nl_langinfo_l(CODESET,lc));
}
virtual string_type do_decimal_point_str() const
string_type do_decimal_point_str() const BOOST_OVERRIDE
{
return decimal_point_;
}
virtual string_type do_thousands_sep_str() const
string_type do_thousands_sep_str() const BOOST_OVERRIDE
{
return thousands_sep_;
}
std::string do_grouping() const BOOST_OVERRIDE
{
return grouping_;
}
string_type do_truename() const BOOST_OVERRIDE
{
static const char t[]="true";
return string_type(t,t+sizeof(t)-1);
}
string_type do_falsename() const BOOST_OVERRIDE
{
static const char t[]="false";
return string_type(t,t+sizeof(t)-1);
}
private:
string_type decimal_point_;
string_type thousands_sep_;
Expand Down
4 changes: 2 additions & 2 deletions src/boost/locale/win32/numeric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ BOOST_LOCALE_END_CONST_CONDITION
{
s2=conv::from_utf(s1,"UTF-8");
}
virtual string_type do_decimal_point_str() const
string_type do_decimal_point_str() const BOOST_OVERRIDE
{
return decimal_point_;
}
virtual string_type do_thousands_sep_str() const
string_type do_thousands_sep_str() const BOOST_OVERRIDE
{
return thousands_sep_;
}
Expand Down

0 comments on commit 6d6942c

Please sign in to comment.