mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix coding-stype
This commit is contained in:
parent
2012838899
commit
df3023db30
196 changed files with 2510 additions and 3945 deletions
|
@ -7,14 +7,16 @@
|
|||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t const* wcschr(wchar_t const* s, int c) {
|
||||
inline SPROUT_CONSTEXPR wchar_t const*
|
||||
wcschr(wchar_t const* s, int c) {
|
||||
return *s == static_cast<wchar_t>(c) ? s
|
||||
: !*s ? nullptr
|
||||
: sprout::wcschr(s + 1, c)
|
||||
;
|
||||
}
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t* wcschr(wchar_t* s, int c) {
|
||||
inline SPROUT_CONSTEXPR wchar_t*
|
||||
wcschr(wchar_t* s, int c) {
|
||||
return const_cast<wchar_t*>(sprout::wcschr(const_cast<wchar_t const*>(s), c));
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
inline SPROUT_CONSTEXPR int wcscmp(wchar_t const* s1, wchar_t const* s2) {
|
||||
inline SPROUT_CONSTEXPR int
|
||||
wcscmp(wchar_t const* s1, wchar_t const* s2) {
|
||||
return !*s1 && !*s2 ? 0
|
||||
: !*s1 ? -1
|
||||
: !*s2 ? 1
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
inline SPROUT_CONSTEXPR int wcscoll(wchar_t const* s1, wchar_t const* s2) {
|
||||
inline SPROUT_CONSTEXPR int
|
||||
wcscoll(wchar_t const* s1, wchar_t const* s2) {
|
||||
return sprout::wcscmp(s1, s2);
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
|
@ -9,14 +9,16 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
namespace detail {
|
||||
inline SPROUT_CONSTEXPR std::size_t wcscspn_impl(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
inline SPROUT_CONSTEXPR std::size_t
|
||||
wcscspn_impl(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
return !*s1 || sprout::wcschr(s2, *s1) ? n
|
||||
: sprout::detail::wcscspn_impl(s1 + 1, s2, n + 1)
|
||||
;
|
||||
}
|
||||
} // amespace detail
|
||||
|
||||
inline SPROUT_CONSTEXPR std::size_t wcscspn(wchar_t const* s1, wchar_t const* s2) {
|
||||
inline SPROUT_CONSTEXPR std::size_t
|
||||
wcscspn(wchar_t const* s1, wchar_t const* s2) {
|
||||
return sprout::detail::wcscspn_impl(s1, s2, 0);
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
|
@ -8,14 +8,16 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
namespace detail {
|
||||
inline SPROUT_CONSTEXPR std::size_t wcslen_impl(wchar_t const* s, std::size_t n) {
|
||||
inline SPROUT_CONSTEXPR std::size_t
|
||||
wcslen_impl(wchar_t const* s, std::size_t n) {
|
||||
return !*s ? n :
|
||||
sprout::detail::wcslen_impl(s + 1, n + 1)
|
||||
;
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
inline SPROUT_CONSTEXPR std::size_t wcslen(wchar_t const* s) {
|
||||
inline SPROUT_CONSTEXPR std::size_t
|
||||
wcslen(wchar_t const* s) {
|
||||
return sprout::detail::wcslen_impl(s, 0);
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
inline SPROUT_CONSTEXPR int wcsncmp(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
inline SPROUT_CONSTEXPR int
|
||||
wcsncmp(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
return !n || (!*s1 && !*s2) ? 0
|
||||
: !*s1 ? -1
|
||||
: !*s2 ? 1
|
||||
|
|
|
@ -8,14 +8,16 @@
|
|||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t const* wcspbrk(wchar_t const* s1, wchar_t const* s2) {
|
||||
inline SPROUT_CONSTEXPR wchar_t const*
|
||||
wcspbrk(wchar_t const* s1, wchar_t const* s2) {
|
||||
return !*s1 ? nullptr
|
||||
: sprout::wcschr(s2, *s1) ? s1
|
||||
: sprout::wcspbrk(s1 + 1, s2)
|
||||
;
|
||||
}
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t* wcspbrk(wchar_t* s1, wchar_t const* s2) {
|
||||
inline SPROUT_CONSTEXPR wchar_t*
|
||||
wcspbrk(wchar_t* s1, wchar_t const* s2) {
|
||||
return const_cast<wchar_t*>(sprout::wcspbrk(const_cast<wchar_t const*>(s1), s2));
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
|
@ -7,14 +7,16 @@
|
|||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t const* wcsrchr(wchar_t const* s, int c) {
|
||||
inline SPROUT_CONSTEXPR wchar_t const*
|
||||
wcsrchr(wchar_t const* s, int c) {
|
||||
return *s == static_cast<wchar_t>(c) && (!*s || !sprout::wcsrchr(s + 1, c))? s
|
||||
: !*s ? nullptr
|
||||
: sprout::wcsrchr(s + 1, c)
|
||||
;
|
||||
}
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t* wcsrchr(wchar_t* s, int c) {
|
||||
inline SPROUT_CONSTEXPR wchar_t*
|
||||
wcsrchr(wchar_t* s, int c) {
|
||||
return const_cast<wchar_t*>(sprout::wcsrchr(const_cast<wchar_t const*>(s), c));
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
|
@ -9,14 +9,16 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
namespace detail {
|
||||
inline SPROUT_CONSTEXPR std::size_t wcsspn_impl(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
inline SPROUT_CONSTEXPR std::size_t
|
||||
wcsspn_impl(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
return !*s1 || !sprout::wcschr(s2, *s1) ? n
|
||||
: sprout::detail::wcsspn_impl(s1 + 1, s2, n + 1)
|
||||
;
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
inline SPROUT_CONSTEXPR std::size_t wcsspn(wchar_t const* s1, wchar_t const* s2) {
|
||||
inline SPROUT_CONSTEXPR std::size_t
|
||||
wcsspn(wchar_t const* s1, wchar_t const* s2) {
|
||||
return sprout::detail::wcsspn_impl(s1, s2, 0);
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t const* wcsstr(wchar_t const* s1, wchar_t const* s2) {
|
||||
inline SPROUT_CONSTEXPR wchar_t const*
|
||||
wcsstr(wchar_t const* s1, wchar_t const* s2) {
|
||||
return !*s2 ? s1
|
||||
: !*s1 ? nullptr
|
||||
: *s1 == *s2 && sprout::wcsstr(s1 + 1, s2 + 1) ? s1
|
||||
|
@ -14,7 +15,8 @@ namespace sprout {
|
|||
;
|
||||
}
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t* wcsstr(wchar_t* s1, wchar_t const* s2) {
|
||||
inline SPROUT_CONSTEXPR wchar_t*
|
||||
wcsstr(wchar_t* s1, wchar_t const* s2) {
|
||||
return const_cast<wchar_t*>(sprout::wcsstr(const_cast<wchar_t const*>(s1), s2));
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
|
@ -8,7 +8,8 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
namespace detail {
|
||||
inline SPROUT_CONSTEXPR wchar_t const* wmemchr_impl(wchar_t const* s, wchar_t c, std::size_t n) {
|
||||
inline SPROUT_CONSTEXPR wchar_t const*
|
||||
wmemchr_impl(wchar_t const* s, wchar_t c, std::size_t n) {
|
||||
return !n ? 0
|
||||
: *s == c ? s
|
||||
: sprout::detail::wmemchr_impl(s + 1, c, n - 1)
|
||||
|
@ -16,14 +17,14 @@ namespace sprout {
|
|||
}
|
||||
} // namespace detail
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t const* wmemchr(wchar_t const* s, wchar_t c, size_t n) {
|
||||
inline SPROUT_CONSTEXPR wchar_t const*
|
||||
wmemchr(wchar_t const* s, wchar_t c, size_t n) {
|
||||
return sprout::detail::wmemchr_impl(s, c, n);
|
||||
}
|
||||
|
||||
inline SPROUT_CONSTEXPR wchar_t* wmemchr(wchar_t* s, wchar_t c, size_t n) {
|
||||
return const_cast<wchar_t*>(
|
||||
sprout::detail::wmemchr_impl(s, c, n)
|
||||
);
|
||||
inline SPROUT_CONSTEXPR wchar_t*
|
||||
wmemchr(wchar_t* s, wchar_t c, size_t n) {
|
||||
return const_cast<wchar_t*>(sprout::detail::wmemchr_impl(s, c, n));
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
namespace detail {
|
||||
inline SPROUT_CONSTEXPR int wmemcmp_impl(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
inline SPROUT_CONSTEXPR int
|
||||
wmemcmp_impl(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
return !n ? 0
|
||||
: *s1 == *s2 ? sprout::detail::wmemcmp_impl(s1 + 1, s2 + 1, n - 1)
|
||||
: *s1 - *s2
|
||||
|
@ -16,12 +17,9 @@ namespace sprout {
|
|||
}
|
||||
} // namespace detail
|
||||
|
||||
inline SPROUT_CONSTEXPR int wmemcmp(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
return sprout::detail::wmemcmp_impl(
|
||||
s1,
|
||||
s2,
|
||||
n
|
||||
);
|
||||
inline SPROUT_CONSTEXPR int
|
||||
wmemcmp(wchar_t const* s1, wchar_t const* s2, std::size_t n) {
|
||||
return sprout::detail::wmemcmp_impl(s1, s2, n);
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue