Classes | Namespaces | Macros | Functions
protobuf/python/google/protobuf/pyext/safe_numerics.h File Reference
#include <limits>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
Include dependency graph for protobuf/python/google/protobuf/pyext/safe_numerics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  google::protobuf::python::IsValidNumericCastImpl< SameSize, DestLarger, DestIsSigned, SourceIsSigned >
 

Namespaces

 google
 
 google::protobuf
 
 google::protobuf::python
 

Macros

#define BASE_NUMERIC_CAST_CASE_DEST_LARGER(DestSigned, SourceSigned, Code)
 
#define BASE_NUMERIC_CAST_CASE_SAME_SIZE(DestSigned, SourceSigned, Code)
 
#define BASE_NUMERIC_CAST_CASE_SOURCE_LARGER(DestSigned, SourceSigned, Code)
 
#define BASE_NUMERIC_CAST_CASE_SPECIALIZATION(A, B, C, D, Code)
 

Functions

 google::protobuf::python::BASE_NUMERIC_CAST_CASE_DEST_LARGER (false, false, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_DEST_LARGER (false, true, source >=0)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_DEST_LARGER (true, false, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_DEST_LARGER (true, true, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SAME_SIZE (false, false, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SAME_SIZE (false, true, source >=0)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SAME_SIZE (true, false, source<=static_cast< Source >(max))
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SAME_SIZE (true, true, true)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (false, false, source<=max)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (false, true, source >=0 &&source<=max)
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (true, false, source<=static_cast< Source >(max))
 
 google::protobuf::python::BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (true, true, source >=min &&source<=max)
 
template<class Dest , class Source >
Dest google::protobuf::python::checked_numeric_cast (Source source)
 
template<class Dest , class Source >
bool google::protobuf::python::IsValidNumericCast (Source source)
 

Macro Definition Documentation

◆ BASE_NUMERIC_CAST_CASE_DEST_LARGER

#define BASE_NUMERIC_CAST_CASE_DEST_LARGER (   DestSigned,
  SourceSigned,
  Code 
)
Value:
false, true, DestSigned, SourceSigned, Code); \

Definition at line 66 of file protobuf/python/google/protobuf/pyext/safe_numerics.h.

◆ BASE_NUMERIC_CAST_CASE_SAME_SIZE

#define BASE_NUMERIC_CAST_CASE_SAME_SIZE (   DestSigned,
  SourceSigned,
  Code 
)
Value:
true, true, DestSigned, SourceSigned, Code); \
BASE_NUMERIC_CAST_CASE_SPECIALIZATION( \
true, false, DestSigned, SourceSigned, Code)

Definition at line 56 of file protobuf/python/google/protobuf/pyext/safe_numerics.h.

◆ BASE_NUMERIC_CAST_CASE_SOURCE_LARGER

#define BASE_NUMERIC_CAST_CASE_SOURCE_LARGER (   DestSigned,
  SourceSigned,
  Code 
)
Value:
false, false, DestSigned, SourceSigned, Code); \

Definition at line 62 of file protobuf/python/google/protobuf/pyext/safe_numerics.h.

◆ BASE_NUMERIC_CAST_CASE_SPECIALIZATION

#define BASE_NUMERIC_CAST_CASE_SPECIALIZATION (   A,
  B,
  C,
  D,
  Code 
)
Value:
template <> struct IsValidNumericCastImpl<A, B, C, D> { \
template <class Source, class DestBounds> static inline bool Test( \
Source source, DestBounds min, DestBounds max) { \
return Code; \
} \
}

Definition at line 48 of file protobuf/python/google/protobuf/pyext/safe_numerics.h.

Test
void Test(StringPiece pattern, const RE2::Options &options, StringPiece text)
Definition: bloaty/third_party/re2/re2/fuzzing/re2_fuzzer.cc:20
C
#define C(x)
Definition: abseil-cpp/absl/hash/internal/city_test.cc:49
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
BASE_NUMERIC_CAST_CASE_SPECIALIZATION
#define BASE_NUMERIC_CAST_CASE_SPECIALIZATION(A, B, C, D, Code)
Definition: protobuf/python/google/protobuf/pyext/safe_numerics.h:48
min
#define min(a, b)
Definition: qsort.h:83
A
Definition: miscompile_with_no_unique_address_test.cc:23
Source
Definition: digest.cc:50
Code
#define Code
Definition: bloaty/third_party/zlib/deflate.h:80


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:30