Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
checked_math_impl.h File Reference

(08e24b2ba6847221abd35e9b994206b764d6b322)

#include <stddef.h>
#include <stdint.h>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <limits>
#include <type_traits>
#include "core/fxcrt/numerics/safe_conversions.h"
#include "core/fxcrt/numerics/safe_math_shared_impl.h"
Include dependency graph for checked_math_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pdfium::internal::CheckedAddOp< T, U, Enable >
struct  pdfium::internal::CheckedAddOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedSubOp< T, U, Enable >
struct  pdfium::internal::CheckedSubOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedMulOp< T, U, Enable >
struct  pdfium::internal::CheckedMulOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedDivOp< T, U, Enable >
struct  pdfium::internal::CheckedDivOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedModOp< T, U, Enable >
struct  pdfium::internal::CheckedModOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedLshOp< T, U, Enable >
struct  pdfium::internal::CheckedLshOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedRshOp< T, U, Enable >
struct  pdfium::internal::CheckedRshOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedAndOp< T, U, Enable >
struct  pdfium::internal::CheckedAndOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedOrOp< T, U, Enable >
struct  pdfium::internal::CheckedOrOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedXorOp< T, U, Enable >
struct  pdfium::internal::CheckedXorOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
struct  pdfium::internal::CheckedMaxOp< T, U, Enable >
struct  pdfium::internal::CheckedMaxOp< T, U, typename std::enable_if< std::is_arithmetic< T >::value &&std::is_arithmetic< U >::value >::type >
struct  pdfium::internal::CheckedMinOp< T, U, Enable >
struct  pdfium::internal::CheckedMinOp< T, U, typename std::enable_if< std::is_arithmetic< T >::value &&std::is_arithmetic< U >::value >::type >
struct  pdfium::internal::GetNumericRepresentation< NumericType >
class  pdfium::internal::CheckedNumericState< T, type >
class  pdfium::internal::CheckedNumericState< T, NUMERIC_INTEGER >
class  pdfium::internal::CheckedNumericState< T, NUMERIC_FLOATING >

Namespaces

namespace  pdfium
namespace  pdfium::internal

Macros

#define BASE_FLOAT_ARITHMETIC_OPS(NAME, OP)

Enumerations

enum  pdfium::internal::NumericRepresentation { pdfium::internal::NUMERIC_INTEGER , pdfium::internal::NUMERIC_FLOATING , pdfium::internal::NUMERIC_UNKNOWN }

Functions

template<typename T>
constexpr bool pdfium::internal::CheckedAddImpl (T x, T y, T *result)
template<typename T>
constexpr bool pdfium::internal::CheckedSubImpl (T x, T y, T *result)
template<typename T>
constexpr bool pdfium::internal::CheckedMulImpl (T x, T y, T *result)

Macro Definition Documentation

◆ BASE_FLOAT_ARITHMETIC_OPS

#define BASE_FLOAT_ARITHMETIC_OPS ( NAME,
OP )
Value:
template <typename T, typename U> \
struct Checked##NAME##Op< \
T, U, \
typename std::enable_if<std::is_floating_point<T>::value || \
std::is_floating_point<U>::value>::type> { \
using result_type = typename MaxExponentPromotion<T, U>::type; \
template <typename V> \
static constexpr bool Do(T x, U y, V* result) { \
using Promotion = typename MaxExponentPromotion<T, U>::type; \
const Promotion presult = x OP y; \
if (!IsValueInRangeForNumericType<V>(presult)) \
return false; \
*result = static_cast<V>(presult); \
return true; \
} \
};
#define OP(a, b)
GLint GLint GLint GLint GLint x
GLenum type
GLint y
GLuint64EXT * result
[6]

Definition at line 468 of file checked_math_impl.h.