Changeset d13b67a in mainline


Ignore:
Timestamp:
2018-07-05T21:41:18Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9400dbe
Parents:
00d9778
git-author:
Jaroslav Jindrak <dzejrou@…> (2017-11-08 23:49:39)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:18)
Message:

cpp: fixed minor bugs that prevented ios from compilation

Location:
uspace/lib/cpp
Files:
3 edited

Legend:

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

    r00d9778 rd13b67a  
    6868
    6969            using fmtflags = uint16_t;
    70             static constexpr fmtflags boolalpha   = 0b'0000'0000'0000'0001;
    71             static constexpr fmtflags dec         = 0b'0000'0000'0000'0010;
    72             static constexpr fmtflags fixed       = 0b'0000'0000'0000'0100;
    73             static constexpr fmtflags hex         = 0b'0000'0000'0000'1000;
    74             static constexpr fmtflags internal    = 0b'0000'0000'0001'0000;
    75             static constexpr fmtflags left        = 0b'0000'0000'0010'0000;
    76             static constexpr fmtflags oct         = 0b'0000'0000'0100'0000;
    77             static constexpr fmtflags right       = 0b'0000'0000'1000'0000;
    78             static constexpr fmtflags scientific  = 0b'0000'0001'0000'0000;
    79             static constexpr fmtflags showbase    = 0b'0000'0010'0000'0000;
    80             static constexpr fmtflags showpoint   = 0b'0000'0100'0000'0000;
    81             static constexpr fmtflags showpos     = 0b'0000'1000'0000'0000;
    82             static constexpr fmtflags skipws      = 0b'0001'0000'0000'0000;
    83             static constexpr fmtflags unitbuf     = 0b'0010'0000'0000'0000;
    84             static constexpr fmtflags uppercase   = 0b'0100'0000'0000'0000;
     70            static constexpr fmtflags boolalpha   = 0b0000'0000'0000'0001;
     71            static constexpr fmtflags dec         = 0b0000'0000'0000'0010;
     72            static constexpr fmtflags fixed       = 0b0000'0000'0000'0100;
     73            static constexpr fmtflags hex         = 0b0000'0000'0000'1000;
     74            static constexpr fmtflags internal    = 0b0000'0000'0001'0000;
     75            static constexpr fmtflags left        = 0b0000'0000'0010'0000;
     76            static constexpr fmtflags oct         = 0b0000'0000'0100'0000;
     77            static constexpr fmtflags right       = 0b0000'0000'1000'0000;
     78            static constexpr fmtflags scientific  = 0b0000'0001'0000'0000;
     79            static constexpr fmtflags showbase    = 0b0000'0010'0000'0000;
     80            static constexpr fmtflags showpoint   = 0b0000'0100'0000'0000;
     81            static constexpr fmtflags showpos     = 0b0000'1000'0000'0000;
     82            static constexpr fmtflags skipws      = 0b0001'0000'0000'0000;
     83            static constexpr fmtflags unitbuf     = 0b0010'0000'0000'0000;
     84            static constexpr fmtflags uppercase   = 0b0100'0000'0000'0000;
    8585            static constexpr fmtflags adjustfield = left | right | internal;
    8686            static constexpr fmtflags basefield   = dec  | oct   | hex;
     
    129129
    130130                private:
    131                     static int init_cnt{};
     131                    static int init_cnt;
    132132            };
    133133
     
    195195
    196196        private:
    197             static int index_{};
    198             static bool sync_{true};
    199 
    200             static long ierror_{0};
    201             static long perror_{nullptr};
     197            static int index_;
     198            static bool sync_;
     199
     200            static long ierror_;
     201            static void* perror_;
    202202            static constexpr size_t initial_size_{10};
    203203
     
    282282                    rdstate_ = state | badbit;
    283283
    284                 if (((state | (rdbuf_ ? goodbit | badbit)) & exceptions_) == 0)
     284                if (((state | (rdbuf_ ? goodbit : badbit)) & exceptions_) == 0)
    285285                    return;
    286286                // TODO: Else throw failure.
     
    380380                width_      = rhs.width_;
    381381                precision_  = rhs.precision_;
    382                 fille_      = rhs.fill_;
     382                fill_      = rhs.fill_;
    383383                locale_     = rhs.locale_;
    384384
    385                 delete[] iarray;
     385                delete[] iarray_;
    386386                iarray_size_ = rhs.iarray_size_;
    387387                iarray_ = new long[iarray_size_];
    388388
    389389                for (size_t i = 0; i < iarray_size_; ++i)
    390                     iarrai_[i] = rhs.iarray_[i];
    391 
    392                 delete[] parray;
     390                    iarray_[i] = rhs.iarray_[i];
     391
     392                delete[] parray_;
    393393                parray_size_ = rhs.parray_size_;
    394394                parray_ = new long[parray_size_];
    395395
    396396                for (size_t i = 0; i < parray_size_; ++i)
    397                     iarrai_[i] = rhs.parray_[i];
     397                    parray_[i] = rhs.parray_[i];
    398398
    399399                for (auto& callback: callbacks_)
     
    456456                locale_ = locale();
    457457
    458                 iarray = nullptr;
    459                 parray = nullptr
     458                iarray_ = nullptr;
     459                parray_ = nullptr;
    460460            }
    461461
     
    527527                swap(iarray_size_);
    528528                swap(parray_);
    529                 swap(parray_size_)
     529                swap(parray_size_);
    530530            }
    531531
  • uspace/lib/cpp/include/impl/vector.hpp

    r00d9778 rd13b67a  
    364364                    resize_with_copy_(size_, next_capacity_());
    365365
    366                 allocator_traits<Allocator>::construct(begin() + size_, forward<Args>(args)...);
     366                allocator_traits<Allocator>::construct(allocator_,
     367                                                       begin() + size_, forward<Args>(args)...);
    367368
    368369                return back();
  • uspace/lib/cpp/src/ios.cpp

    r00d9778 rd13b67a  
    3131namespace std
    3232{
     33    int ios_base::index_{};
     34    bool ios_base::sync_{true};
     35    long ios_base::ierror_{0};
     36    void* ios_base::perror_{nullptr};
     37
    3338    ios_base::ios_base()
    3439        : iarray_{}, parray_{}, iarray_size_{}, parray_size_{},
     
    3742    { /* DUMMY BODY */ }
    3843
    39     ~ios_base::ios_base()
     44    ios_base::~ios_base()
    4045    {
    4146        for (auto& callback: callbacks_)
     
    4348    }
    4449
    45     auto ios_base::flags() -> fmtflags const
     50    auto ios_base::flags() const -> fmtflags
    4651    {
    4752        return flags_;
     
    7580    void ios_base::unsetf(fmtflags fmtfl)
    7681    {
    77         flags_ &= ~fmtflags;
     82        flags_ &= ~fmtfl;
    7883    }
    7984
     
    115120    }
    116121
    117     locale ios_base::get_loc() const
     122    locale ios_base::getloc() const
    118123    {
    119124        return locale_;
     
    156161        if (!parray_)
    157162        {
    158             parray_ = new long[initial_size_];
     163            parray_ = new void*[initial_size_];
    159164            parray_size_ = initial_size_;
    160165        }
     
    165170          //       and return perror_.
    166171            size_t new_size = max(parray_size_ * 2, idx + 1);
    167             auto tmp = new long[new_size];
     172            auto tmp = new void*[new_size];
    168173
    169174            for (size_t i = 0; i < parray_size_; ++i)
     
    186191    void ios_base::register_callback(event_callback fn, int index)
    187192    {
    188         callbacks.emplace_back(fn, index);
     193        callbacks_.emplace_back(fn, index);
    189194    }
    190195
Note: See TracChangeset for help on using the changeset viewer.