mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-30 09:01:19 +00:00
[libc++] NFC: Fix return-by-const-value and pass-by-const-value typos
While we can debate on the value of passing by const value, there is no arguing that it's confusing to do so in some circumstances, such as when marking a pointer parameter as being const (did you mean a pointer-to-const?). This commit fixes a few issues along those lines.
This commit is contained in:
parent
3999dcae5e
commit
a562853a51
@ -144,7 +144,7 @@ public:
|
||||
public:
|
||||
reference(const reference&) noexcept;
|
||||
operator bool() const noexcept;
|
||||
reference& operator=(const bool x) noexcept;
|
||||
reference& operator=(bool x) noexcept;
|
||||
reference& operator=(const reference& x) noexcept;
|
||||
iterator operator&() const noexcept;
|
||||
void flip() noexcept;
|
||||
|
@ -423,7 +423,7 @@ get_swprintf()
|
||||
}
|
||||
|
||||
template <typename S, typename V>
|
||||
S i_to_string(const V v)
|
||||
S i_to_string(V v)
|
||||
{
|
||||
// numeric_limits::digits10 returns value less on 1 than desired for unsigned numbers.
|
||||
// For example, for 1-byte unsigned value digits10 is 2 (999 can not be represented),
|
||||
|
@ -40,12 +40,12 @@ public:
|
||||
template <class U> bool operator==(const counting_allocatorT<U>& other) const noexcept { return foo == other.foo; }
|
||||
template <class U> bool operator!=(const counting_allocatorT<U>& other) const noexcept { return foo != other.foo; }
|
||||
|
||||
T * allocate(const size_t n) const {
|
||||
T* allocate(size_t n) const {
|
||||
ca_allocs.push_back(foo);
|
||||
void * const pv = ::malloc(n * sizeof(T));
|
||||
return static_cast<T *>(pv);
|
||||
}
|
||||
void deallocate(T * const p, size_t) const noexcept {
|
||||
void deallocate(T* p, size_t) const noexcept {
|
||||
ca_deallocs.push_back(foo);
|
||||
free(p);
|
||||
}
|
||||
@ -63,12 +63,12 @@ public:
|
||||
template <class U> bool operator==(const counting_allocatorF<U>& other) const noexcept { return foo == other.foo; }
|
||||
template <class U> bool operator!=(const counting_allocatorF<U>& other) const noexcept { return foo != other.foo; }
|
||||
|
||||
T * allocate(const size_t n) const {
|
||||
T* allocate(size_t n) const {
|
||||
ca_allocs.push_back(foo);
|
||||
void * const pv = ::malloc(n * sizeof(T));
|
||||
return static_cast<T *>(pv);
|
||||
}
|
||||
void deallocate(T * const p, size_t) const noexcept {
|
||||
void deallocate(T* p, size_t) const noexcept {
|
||||
ca_deallocs.push_back(foo);
|
||||
free(p);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
// <string_view>
|
||||
|
||||
// const size_type find_last_not_of(charT c, size_type pos = npos) const;
|
||||
// size_type find_last_not_of(charT c, size_type pos = npos) const;
|
||||
|
||||
#include <string_view>
|
||||
#include <cassert>
|
||||
|
Loading…
Reference in New Issue
Block a user