Lines Matching defs:op1
85 bool AddInt(T op1, T op2, T minValue, T maxValue, T &res)
87 if (op1 >= 0) {
88 if (op2 > maxValue - op1) {
92 if (op2 < minValue - op1) {
96 res = op1 + op2;
100 inline bool AddInt32(int32_t op1, int32_t op2, int32_t &res)
102 return AddInt(op1, op2, std::numeric_limits<int32_t>::min(), std::numeric_limits<int32_t>::max(), res);
105 inline bool AddInt64(int64_t op1, int64_t op2, int64_t &res)
107 return AddInt(op1, op2, std::numeric_limits<int64_t>::min(), std::numeric_limits<int64_t>::max(), res);
111 bool MultiplyInt(T op1, T op2, T minVal, T maxVal, T &res)
113 if (op1 > 0) {
115 if (op1 > maxVal / op2) {
119 if (op2 < minVal / op1) {
125 if (op1 < minVal / op2) {
129 if (op1 != 0 && op2 < maxVal / op1) {
134 res = op1 * op2;
138 inline bool MultiplyInt32(int32_t op1, int32_t op2, int32_t& res)
140 return MultiplyInt(op1, op2, std::numeric_limits<int32_t>::min(), std::numeric_limits<int32_t>::max(), res);
143 inline bool MultiplyInt64(int64_t op1, int64_t op2, int64_t& res)
145 return MultiplyInt(op1, op2, std::numeric_limits<int64_t>::min(), std::numeric_limits<int64_t>::max(), res);