Changeset cbf9099 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:21Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cec6360
Parents:
5d235bf0
git-author:
Dzejrou <dzejrou@…> (2018-04-24 22:50:33)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:21)
Message:

cpp: added hel:: where needed and moved string literals to the proper namespace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/src/string.cpp

    r5d235bf0 rcbf9099  
    4040    {
    4141        char* end;
    42         long result = strtol(str.c_str(), &end, base);
     42        long result = hel::strtol(str.c_str(), &end, base);
    4343
    4444        if (end != str.c_str())
     
    5656    {
    5757        char* end;
    58         unsigned long result = strtoul(str.c_str(), &end, base);
     58        unsigned long result = hel::strtoul(str.c_str(), &end, base);
    5959
    6060        if (end != str.c_str())
     
    102102    {
    103103        char* tmp;
    104         asprintf(&tmp, "%d", val);
     104        hel::asprintf(&tmp, "%d", val);
    105105
    106106        std::string res{tmp};
     
    113113    {
    114114        char* tmp;
    115         asprintf(&tmp, "%u", val);
     115        hel::asprintf(&tmp, "%u", val);
    116116
    117117        std::string res{tmp};
     
    124124    {
    125125        char* tmp;
    126         asprintf(&tmp, "%ld", val);
     126        hel::asprintf(&tmp, "%ld", val);
    127127
    128128        std::string res{tmp};
     
    135135    {
    136136        char* tmp;
    137         asprintf(&tmp, "%lu", val);
     137        hel::asprintf(&tmp, "%lu", val);
    138138
    139139        std::string res{tmp};
     
    146146    {
    147147        char* tmp;
    148         asprintf(&tmp, "%lld", val);
     148        hel::asprintf(&tmp, "%lld", val);
    149149
    150150        std::string res{tmp};
     
    157157    {
    158158        char* tmp;
    159         asprintf(&tmp, "%llu", val);
     159        hel::asprintf(&tmp, "%llu", val);
    160160
    161161        std::string res{tmp};
     
    168168    {
    169169        char* tmp;
    170         asprintf(&tmp, "%f", val);
     170        hel::asprintf(&tmp, "%f", val);
    171171
    172172        std::string res{tmp};
     
    179179    {
    180180        char* tmp;
    181         asprintf(&tmp, "%f", val);
     181        hel::asprintf(&tmp, "%f", val);
    182182
    183183        std::string res{tmp};
     
    190190    {
    191191        char* tmp;
    192         asprintf(&tmp, "%Lf", val);
     192        hel::asprintf(&tmp, "%Lf", val);
    193193
    194194        std::string res{tmp};
     
    299299        return wstring{};
    300300    }
    301 
    302     /**
    303      * 21.6, hash support:
    304      */
    305 
    306     // TODO: implement
    307301
    308302    /**
     
    319313#pragma GCC diagnostic push
    320314#pragma GCC diagnostic ignored "-Wliteral-suffix"
     315inline namespace literals {
     316inline namespace string_literals
     317{
    321318    string operator "" s(const char* str, size_t len)
    322319    {
     
    340337    }
    341338    */
     339}}
    342340#pragma GCC diagnostic pop
    343341}
Note: See TracChangeset for help on using the changeset viewer.