Skip to content

Commit ca43f6a

Browse files
committed
responds to Clang Tidy feedback
Clang Tidy flagged the following as problematic when running tests locally.
1 parent 298e292 commit ca43f6a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

libcxx/include/__functional/function.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ class __func<_Rp1 (^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)> : public __base
754754
# ifdef _LIBCPP_HAS_OBJC_ARC
755755
: __f_(__f)
756756
# else
757-
: __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
757+
: __f_(reinterpret_cast<__block_type>(__f ? std::__function::_Block_copy(__f) : nullptr))
758758
# endif
759759
{
760760
}
@@ -765,7 +765,7 @@ class __func<_Rp1 (^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)> : public __base
765765
# ifdef _LIBCPP_HAS_OBJC_ARC
766766
: __f_(__f)
767767
# else
768-
: __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
768+
: __f_(reinterpret_cast<__block_type>(__f ? std::__function::_Block_copy(__f) : nullptr))
769769
# endif
770770
{
771771
}
@@ -786,7 +786,7 @@ class __func<_Rp1 (^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)> : public __base
786786
_LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy() _NOEXCEPT {
787787
# ifndef _LIBCPP_HAS_OBJC_ARC
788788
if (__f_)
789-
_Block_release(__f_);
789+
std::__function::_Block_release(__f_);
790790
# endif
791791
__f_ = 0;
792792
}

libcxx/include/__thread/id.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ class _LIBCPP_TEMPLATE_VIS __thread_id {
4242

4343
static _LIBCPP_HIDE_FROM_ABI bool
4444
__lt_impl(__thread_id __x, __thread_id __y) _NOEXCEPT { // id==0 is always less than any other thread_id
45-
if (__x.__id_ == 0)
46-
return __y.__id_ != 0;
47-
if (__y.__id_ == 0)
45+
if (__x.__id_ == nullptr)
46+
return __y.__id_ != nullptr;
47+
if (__y.__id_ == nullptr)
4848
return false;
4949
return __libcpp_thread_id_less(__x.__id_, __y.__id_);
5050
}
5151

5252
public:
53-
_LIBCPP_HIDE_FROM_ABI __thread_id() _NOEXCEPT : __id_(0) {}
53+
_LIBCPP_HIDE_FROM_ABI __thread_id() _NOEXCEPT : __id_(nullptr) {}
5454

55-
_LIBCPP_HIDE_FROM_ABI void __reset() { __id_ = 0; }
55+
_LIBCPP_HIDE_FROM_ABI void __reset() { __id_ = nullptr; }
5656

5757
friend _LIBCPP_HIDE_FROM_ABI bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT;
5858
# if _LIBCPP_STD_VER <= 17
@@ -77,9 +77,9 @@ class _LIBCPP_TEMPLATE_VIS __thread_id {
7777

7878
inline _LIBCPP_HIDE_FROM_ABI bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT {
7979
// Don't pass id==0 to underlying routines
80-
if (__x.__id_ == 0)
81-
return __y.__id_ == 0;
82-
if (__y.__id_ == 0)
80+
if (__x.__id_ == nullptr)
81+
return __y.__id_ == nullptr;
82+
if (__y.__id_ == nullptr)
8383
return false;
8484
return __libcpp_thread_id_equal(__x.__id_, __y.__id_);
8585
}

libcxx/include/__thread/support/pthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ inline _LIBCPP_HIDE_FROM_ABI __libcpp_thread_id __libcpp_thread_get_id(const __l
175175
}
176176

177177
inline _LIBCPP_HIDE_FROM_ABI bool __libcpp_thread_isnull(const __libcpp_thread_t* __t) {
178-
return __libcpp_thread_get_id(__t) == 0;
178+
return __libcpp_thread_get_id(__t) == nullptr;
179179
}
180180

181181
inline _LIBCPP_HIDE_FROM_ABI int __libcpp_thread_create(__libcpp_thread_t* __t, void* (*__func)(void*), void* __arg) {

0 commit comments

Comments
 (0)