mercurial/mpatch.c
branchstable
changeset 38191 b8b253aec953
parent 38190 1ec4cb8cbc87
child 38192 0b208c13781c
equal deleted inserted replaced
38190:1ec4cb8cbc87 38191:b8b253aec953
    83 				return false;
    83 				return false;
    84 			}
    84 			}
    85 		}
    85 		}
    86 	}
    86 	}
    87 	*dest += src;
    87 	*dest += src;
       
    88 	return true;
       
    89 }
       
    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;
    88 	return true;
    99 	return true;
    89 }
   100 }
    90 
   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.