From 54d51e184ae54f93560c12a84b09f64c43acf82a Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 24 Mar 2024 16:25:51 +0800 Subject: [PATCH] update: fully qualified in std namespace --- src/impl/sine.inc | 6 +++--- src/impl/wrapper.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/impl/sine.inc b/src/impl/sine.inc index fbdaa62..617e04e 100644 --- a/src/impl/sine.inc +++ b/src/impl/sine.inc @@ -35,13 +35,13 @@ constexpr double sin_core(double x) { /// Calculate the sin(x) value in radians. constexpr double sin(double x) { - x = std::fmod(x, 2 * PI); // -2PI < x < 2PI + x = ::std::fmod(x, 2 * PI); // -2PI < x < 2PI - if (std::abs(x) > PI) { + if (::std::abs(x) > PI) { x -= ((x > 0) ? 2 : -2) * PI; // -PI < x < PI } - if (std::abs(x) > PI / 2) { + if (::std::abs(x) > PI / 2) { x = ((x > 0) ? 1 : -1) * PI - x; // -PI / 2 < x < PI / 2 } return sin_core(x); // closer to 0 for better accuracy diff --git a/src/impl/wrapper.cc b/src/impl/wrapper.cc index b04f330..e982f93 100644 --- a/src/impl/wrapper.cc +++ b/src/impl/wrapper.cc @@ -18,13 +18,13 @@ std::string MD5::Digest() const { MD5& MD5::Update(const void *data, uint64_t len) { if (buffer_size_ != 0) { if (buffer_size_ + len < 64) { // buffer not filled - std::memcpy(buffer_ + buffer_size_, data, len); + ::std::memcpy(buffer_ + buffer_size_, data, len); buffer_size_ += len; return *this; // save into buffer and return } auto size = 64 - buffer_size_; - std::memcpy(buffer_ + buffer_size_, data, size); + ::std::memcpy(buffer_ + buffer_size_, data, size); UpdateImpl(buffer_, 64); // fill and update with buffer data = static_cast(data) + size; buffer_size_ = 0; @@ -34,7 +34,7 @@ MD5& MD5::Update(const void *data, uint64_t len) { data = UpdateImpl(data, len); len &= 0b111111; // len -> [0, 64) if (len != 0) { - std::memcpy(buffer_, data, len); // save remain data into buffer + ::std::memcpy(buffer_, data, len); // save remain data into buffer buffer_size_ = len; } return *this;