Home | History | Annotate | Download | only in source

Lines Matching defs:result

37 // If the result of adding arg1 and arg2 will fit in an int32_t (without
38 // under-/overflow), stores this result in *result and returns true. Otherwise,
39 // returns false and leaves *result unchanged.
40 bool SafeInt32Add(std::int32_t arg1, std::int32_t arg2, std::int32_t *result);
42 // Returns the result of adding arg1 and arg2 if it will fit in the result type
48 // If the result of adding arg1 and arg2 will fit in a uint32_t (without
49 // wraparound), stores this result in *result and returns true. Otherwise,
50 // returns false and leaves *result unchanged.
52 std::uint32_t *result);
54 // Returns the result of adding arg1 and arg2 if it will fit in the result type
60 // If the subtraction of arg2 from arg1 will not result in an int32_t under- or
61 // overflow, stores this result in *result and returns true. Otherwise,
62 // returns false and leaves *result unchanged.
63 bool SafeInt32Sub(std::int32_t arg1, std::int32_t arg2, std::int32_t *result);
65 // Returns the result of subtracting arg2 from arg1 if this operation will not
66 // result in an int32_t under- or overflow. Otherwise, throws a dng_exception
70 // Returns the result of subtracting arg2 from arg1 if this operation will not
71 // result in wraparound. Otherwise, throws a dng_exception with error code
75 // Returns the result of multiplying arg1 and arg2 if it will fit in a int32_t
80 // If the result of multiplying arg1, ..., argn will fit in a uint32_t (without
81 // wraparound), stores this result in *result and returns true. Otherwise,
82 // returns false and leaves *result unchanged.
84 std::uint32_t *result);
86 std::uint32_t *result);
88 std::uint32_t arg4, std::uint32_t *result);
90 // Returns the result of multiplying arg1, ..., argn if it will fit in a
99 // Returns the result of multiplying arg1 and arg2 if it will fit in a size_t
114 std::int64_t result;
116 if (__builtin_smull_overflow(arg1, arg2, &result)) {
118 if (__builtin_smulll_overflow(arg1, arg2, &result)) {
123 return result;
136 __int128 result = static_cast<__int128>(arg1) * static_cast<__int128>(arg2);
137 if (result > kInt64Max || result < kInt64Min) {
140 return static_cast<std::int64_t>(result);
146 // Returns the result of multiplying arg1 and arg2 if it will fit in an int64_t
159 // Returns the result of dividing arg1 by arg2; if the result is not an integer,
162 // The function is safe against wraparound and will return the correct result
167 // equal to 'val'. If this value will fit in a uint32_t, stores it in *result
169 // leaves *result unchanged.
171 std::uint32_t *result);
174 // or equal to 'val'. If the result will not fit in a std::uint32_t or if
181 // stores it in *result. Otherwise, returns false and leaves *result unchanged.
182 bool ConvertUint32ToInt32(std::uint32_t val, std::int32_t *result);
184 // Returns the result of converting val to an int32_t if it can be converted
219 // Returns the result of converting val to the result type using truncation if
220 // val is in range of the result type values. Otherwise, throws a dng_exception
225 // Returns the result of converting val to float. If val is outside of