Changeset a1c35cc in mainline


Ignore:
Timestamp:
2018-07-05T21:41:23Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4fba7ad
Parents:
349b0f7
git-author:
Dzejrou <dzejrou@…> (2018-05-14 18:08:11)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: added missing return statements, changed the way facets work for the moment (we return by value instead of by reference which means we can avoid that ugly leaking hack

Location:
uspace/lib/cpp/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/impl/istream.hpp

    r349b0f7 ra1c35cc  
    571571                    }
    572572                }
     573
     574                return *this;
    573575            }
    574576
     
    605607                    s[gcount_++] = traits_type::to_char_type(c);
    606608                }
     609
     610                return *this;
    607611            }
    608612
  • uspace/lib/cpp/include/internal/locale.hpp

    r349b0f7 ra1c35cc  
    3535{
    3636    class locale;
    37 
    38     template<class Facet>
    39     const Facet& use_facet(const locale& loc);
    40 
    41     template<class Facet>
    42     bool has_facet(const locale& loc);
    4337
    4438    /**
     
    152146
    153147            template<class Facet>
    154             friend const Facet& use_facet(const locale&);
     148            /* friend const Facet& use_facet(const locale&); */
     149            friend Facet use_facet(const locale&);
    155150
    156151            template<class Facet>
    157             const Facet& get_() const
     152            /* const Facet& get_() const */
     153            Facet get_() const
    158154            {
    159                 // TODO: A VERY ugly hack, when we have map/shared ptr,
    160                 //       we should implement facets and store them in a map
    161                 //       and return them here by their IDs.
    162                 return *(new Facet{0u});
     155                return Facet{0U};
    163156            }
    164157    };
    165158
    166159    template<class Facet>
    167     const Facet& use_facet(const locale& loc)
     160    /* const Facet& use_facet(const locale& loc) */
     161    Facet use_facet(const locale& loc)
    168162    {
    169163        return loc.get_<Facet>();
  • uspace/lib/cpp/include/internal/locale/num_get.hpp

    r349b0f7 ra1c35cc  
    3030#define LIBCPP_INTERNAL_LOCALE_NUM_GET
    3131
     32#include <cerrno>
     33#include <cstring>
    3234#include <internal/locale.hpp>
    3335#include <internal/locale/numpunct.hpp>
     
    3537#include <iterator>
    3638#include <limits>
    37 
    38 extern "C" {
    39 #include <errno.h>
    40 }
    4139
    4240namespace std
     
    262260            {
    263261                // TODO: implement
     262                return in;
    264263            }
    265264
     
    268267            {
    269268                // TODO: implement
     269                return in;
    270270            }
    271271
     
    274274            {
    275275                // TODO: implement
     276                return in;
    276277            }
    277278
     
    280281            {
    281282                // TODO: implement
     283                return in;
    282284            }
    283285
     
    301303                    int ret{};
    302304                    if constexpr (is_signed<BaseType>::value)
    303                         ret = str_int64_t(base.buffer_, nullptr, num_base, false, &res);
    304                     else
    305                         ret = str_uint64_t(base.buffer_, nullptr, num_base, false, &res);
     305                        ret = std::hel::str_int64_t(base.buffer_, nullptr, num_base, false, &res);
     306                    else
     307                        ret = std::hel::str_uint64_t(base.buffer_, nullptr, num_base, false, &res);
    306308
    307309                    if (ret != EOK)
Note: See TracChangeset for help on using the changeset viewer.