vendor/libgit2/src/xdiff/xmerge.c in rugged-0.27.10.1 vs vendor/libgit2/src/xdiff/xmerge.c in rugged-0.28.0
- old
+ new
@@ -123,26 +123,26 @@
for (i = 0; i < count; ) {
if (dest)
memcpy(dest + size, recs[i]->ptr, recs[i]->size);
- GITERR_CHECK_ALLOC_ADD(&size, size, recs[i++]->size);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, recs[i++]->size);
}
if (add_nl) {
i = recs[count - 1]->size;
if (i == 0 || recs[count - 1]->ptr[i - 1] != '\n') {
if (needs_cr) {
if (dest)
dest[size] = '\r';
- GITERR_CHECK_ALLOC_ADD(&size, size, 1);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, 1);
}
if (dest)
dest[size] = '\n';
- GITERR_CHECK_ALLOC_ADD(&size, size, 1);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, 1);
}
}
*out = size;
return 0;
@@ -222,14 +222,14 @@
/* Before conflicting part */
if (xdl_recs_copy(&copied, xe1, i, m->i1 - i, 0, 0,
dest ? dest + size : NULL) < 0)
return -1;
- GITERR_CHECK_ALLOC_ADD(&size, size, copied);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, copied);
if (!dest) {
- GITERR_CHECK_ALLOC_ADD5(&size, size, marker_size, 1, needs_cr, marker1_size);
+ GIT_ERROR_CHECK_ALLOC_ADD5(&size, size, marker_size, 1, needs_cr, marker1_size);
} else {
memset(dest + size, '<', marker_size);
size += marker_size;
if (marker1_size) {
dest[size] = ' ';
@@ -244,16 +244,16 @@
/* Postimage from side #1 */
if (xdl_recs_copy(&copied, xe1, m->i1, m->chg1, needs_cr, 1,
dest ? dest + size : NULL) < 0)
return -1;
- GITERR_CHECK_ALLOC_ADD(&size, size, copied);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, copied);
if (style == XDL_MERGE_DIFF3) {
/* Shared preimage */
if (!dest) {
- GITERR_CHECK_ALLOC_ADD5(&size, size, marker_size, 1, needs_cr, marker3_size);
+ GIT_ERROR_CHECK_ALLOC_ADD5(&size, size, marker_size, 1, needs_cr, marker3_size);
} else {
memset(dest + size, '|', marker_size);
size += marker_size;
if (marker3_size) {
dest[size] = ' ';
@@ -266,15 +266,15 @@
}
if (xdl_orig_copy(&copied, xe1, m->i0, m->chg0, needs_cr, 1,
dest ? dest + size : NULL) < 0)
return -1;
- GITERR_CHECK_ALLOC_ADD(&size, size, copied);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, copied);
}
if (!dest) {
- GITERR_CHECK_ALLOC_ADD4(&size, size, marker_size, 1, needs_cr);
+ GIT_ERROR_CHECK_ALLOC_ADD4(&size, size, marker_size, 1, needs_cr);
} else {
memset(dest + size, '=', marker_size);
size += marker_size;
if (needs_cr)
dest[size++] = '\r';
@@ -284,14 +284,14 @@
/* Postimage from side #2 */
if (xdl_recs_copy(&copied, xe2, m->i2, m->chg2, needs_cr, 1,
dest ? dest + size : NULL) < 0)
return -1;
- GITERR_CHECK_ALLOC_ADD(&size, size, copied);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, copied);
if (!dest) {
- GITERR_CHECK_ALLOC_ADD5(&size, size, marker_size, 1, needs_cr, marker2_size);
+ GIT_ERROR_CHECK_ALLOC_ADD5(&size, size, marker_size, 1, needs_cr, marker2_size);
} else {
memset(dest + size, '>', marker_size);
size += marker_size;
if (marker2_size) {
dest[size] = ' ';
@@ -334,37 +334,37 @@
else if (m->mode & 3) {
/* Before conflicting part */
if (xdl_recs_copy(&copied, xe1, i, m->i1 - i, 0, 0,
dest ? dest + size : NULL) < 0)
return -1;
- GITERR_CHECK_ALLOC_ADD(&size, size, copied);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, copied);
/* Postimage from side #1 */
if (m->mode & 1) {
int needs_cr = is_cr_needed(xe1, xe2, m);
if (xdl_recs_copy(&copied, xe1, m->i1, m->chg1, needs_cr, (m->mode & 2),
dest ? dest + size : NULL) < 0)
return -1;
- GITERR_CHECK_ALLOC_ADD(&size, size, copied);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, copied);
}
/* Postimage from side #2 */
if (m->mode & 2) {
if (xdl_recs_copy(&copied, xe2, m->i2, m->chg2, 0, 0,
dest ? dest + size : NULL) < 0)
return -1;
- GITERR_CHECK_ALLOC_ADD(&size, size, copied);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, copied);
}
} else
continue;
i = m->i1 + m->chg1;
}
if (xdl_recs_copy(&copied, xe1, i, xe1->xdf2.nrec - i, 0, 0,
dest ? dest + size : NULL) < 0)
return -1;
- GITERR_CHECK_ALLOC_ADD(&size, size, copied);
+ GIT_ERROR_CHECK_ALLOC_ADD(&size, size, copied);
*out = size;
return 0;
}