Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: third_party/libc++/src/valarray.cpp

Issue 75213003: Add libc++ and libc++abi to third-party. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libc++/src/utility.cpp ('k') | third_party/libc++abi/CREDITS.TXT » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 //===------------------------ valarray.cpp --------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
11
12 #include "valarray"
13
14 _LIBCPP_BEGIN_NAMESPACE_STD
15
16 template valarray<size_t>::valarray(size_t);
17 template valarray<size_t>::~valarray();
18 template void valarray<size_t>::resize(size_t, size_t);
19
20 void
21 gslice::__init(size_t __start)
22 {
23 valarray<size_t> __indices(__size_.size());
24 size_t __k = __size_.size() != 0;
25 for (size_t __i = 0; __i < __size_.size(); ++__i)
26 __k *= __size_[__i];
27 __1d_.resize(__k);
28 if (__1d_.size())
29 {
30 __k = 0;
31 __1d_[__k] = __start;
32 while (true)
33 {
34 size_t __i = __indices.size() - 1;
35 while (true)
36 {
37 if (++__indices[__i] < __size_[__i])
38 {
39 ++__k;
40 __1d_[__k] = __1d_[__k-1] + __stride_[__i];
41 for (size_t __j = __i + 1; __j != __indices.size(); ++__j)
42 __1d_[__k] -= __stride_[__j] * (__size_[__j] - 1);
43 break;
44 }
45 else
46 {
47 if (__i == 0)
48 return;
49 __indices[__i--] = 0;
50 }
51 }
52 }
53 }
54 }
55
56 _LIBCPP_END_NAMESPACE_STD
OLDNEW
« no previous file with comments | « third_party/libc++/src/utility.cpp ('k') | third_party/libc++abi/CREDITS.TXT » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698