##// END OF EJS Templates
mpatch: introduce a safesub() helper as well...
Augie Fackler -
r38249:b8b253ae stable
parent child Browse files
Show More
@@ -88,6 +88,17 b' static inline bool safeadd(int src, int '
88 return true;
88 return true;
89 }
89 }
90
90
91 /* subtract src from dest and store result in dest */
92 static inline bool safesub(int src, int *dest)
93 {
94 if (((src > 0) && (*dest < INT_MIN + src)) ||
95 ((src < 0) && (*dest > INT_MAX + src))) {
96 return false;
97 }
98 *dest -= src;
99 return true;
100 }
101
91 /* move hunks in source that are less cut to dest, compensating
102 /* move hunks in source that are less cut to dest, compensating
92 for changes in offset. the last hunk may be split if necessary.
103 for changes in offset. the last hunk may be split if necessary.
93 */
104 */
General Comments 0
You need to be logged in to leave comments. Login now