~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to system/include/libcxx/__bit_reference

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
        __storage_type __b = *__first.__seg_ & __m;
174
174
        if (__b)
175
175
            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
 
176
        if (__n == __dn)
 
177
            return _It(__first.__seg_, __first.__ctz_ + __n);
176
178
        __n -= __dn;
177
179
        ++__first.__seg_;
178
180
    }
207
209
        __storage_type __b = ~*__first.__seg_ & __m;
208
210
        if (__b)
209
211
            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
 
212
        if (__n == __dn)
 
213
            return _It(__first.__seg_, __first.__ctz_ + __n);
210
214
        __n -= __dn;
211
215
        ++__first.__seg_;
212
216
    }
333
337
    }
334
338
    // do middle whole words
335
339
    __storage_type __nw = __n / __bits_per_word;
336
 
    _VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
 
340
    _VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), 0, __nw * sizeof(__storage_type));
337
341
    __n -= __nw * __bits_per_word;
338
342
    // do last partial word
339
343
    if (__n > 0)
363
367
    }
364
368
    // do middle whole words
365
369
    __storage_type __nw = __n / __bits_per_word;
366
 
    _VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
 
370
    _VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), -1, __nw * sizeof(__storage_type));
367
371
    __n -= __nw * __bits_per_word;
368
372
    // do last partial word
369
373
    if (__n > 0)
430
434
        // __first.__ctz_ == 0;
431
435
        // do middle words
432
436
        __storage_type __nw = __n / __bits_per_word;
433
 
        _VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
 
437
        _VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
 
438
                       _VSTD::__to_raw_pointer(__first.__seg_),
 
439
                       __nw * sizeof(__storage_type));
434
440
        __n -= __nw * __bits_per_word;
435
441
        __result.__seg_ += __nw;
436
442
        // do last word
569
575
        __storage_type __nw = __n / __bits_per_word;
570
576
        __result.__seg_ -= __nw;
571
577
        __last.__seg_ -= __nw;
572
 
        _VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
 
578
        _VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
 
579
                       _VSTD::__to_raw_pointer(__last.__seg_),
 
580
                       __nw * sizeof(__storage_type));
573
581
        __n -= __nw * __bits_per_word;
574
582
        // do last word
575
583
        if (__n > 0)
870
878
{
871
879
    typedef typename _Cp::difference_type difference_type;
872
880
    typedef typename _Cp::__storage_type  __storage_type;
 
881
    typedef typename _Cp::__storage_pointer __storage_pointer;
873
882
    typedef typename _Cp::iterator        iterator;
874
883
    static const unsigned __bits_per_word = _Cp::__bits_per_word;
875
884
    static const unsigned _Np = 4;
880
889
    _LIBCPP_INLINE_VISIBILITY static difference_type capacity()
881
890
        {return static_cast<difference_type>(_Np * __bits_per_word);}
882
891
    _LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {}
883
 
    _LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);}
884
 
    _LIBCPP_INLINE_VISIBILITY iterator end()   {return iterator(__word_ + __size_ / __bits_per_word,
885
 
                                                  static_cast<unsigned>(__size_ % __bits_per_word));}
 
892
    _LIBCPP_INLINE_VISIBILITY iterator begin()
 
893
    {
 
894
        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
 
895
    }
 
896
    _LIBCPP_INLINE_VISIBILITY iterator end()
 
897
    {
 
898
        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
 
899
                                                  static_cast<unsigned>(__size_ % __bits_per_word));
 
900
    }
886
901
};
887
902
 
888
903
template <class _Cp>
1093
1108
    unsigned          __ctz_;
1094
1109
 
1095
1110
public:
1096
 
    _LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT {}
 
1111
    _LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT
 
1112
#if _LIBCPP_STD_VER > 11
 
1113
    : __seg_(nullptr), __ctz_(0)
 
1114
#endif
 
1115
    {}
1097
1116
 
1098
1117
    _LIBCPP_INLINE_VISIBILITY
1099
1118
    __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT