Re: [PATCH v2 1/5] diff.c: Remove code redundancy in diff_words_show
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 3, 2008, 18:20 UTC
- Message-ID
- <7vr6cjtfjt.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1209815828-6548-2-git-send-email-pkufranky@gmail.com>
Ping Yin <pkufranky@gmail.com> writes:
> +static mmfile_copy_set_boundary(mmfile_t *dest, mmfile_t *src) {cc1: warnings being treated as errors diff.c:464: warning: return type defaults int
Show 15 quoted lines
> + int i;
> +
> + dest->size = src->size;
> + dest->ptr = xmalloc(dest->size);
> + memcpy(dest->ptr, src->ptr, dest->size);
> + for (i = 0; i < dest->size; i++)
> + if (isspace(dest->ptr[i]))
> + dest->ptr[i] = '\n';
> +}
> +
> /* this executes the word diff on the accumulated buffers */
> static void diff_words_show(struct diff_words_data *diff_words)
> {
> @@ -444,20 +455,9 @@ static void diff_words_show(struct diff_words_data *diff_words)
> int i;diff.c:482: warning: unused variable 'i'