@matheusbsbs / matheus-bagliano / commits / d2543b8ee3
Fork 0

Clean up diff.c

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Timo Hirvonen committed Jun 24, 2006 at 20:20 UTC d2543b8ee3abeb611c352f17a9177732bfde7e36
1 file changed +6 -12
diff.c
+6 -12
@@ -203,7 +203,7 @@ static void emit_rewrite_diff(const char *name_a,
203 static int fill_mmfile(mmfile_t *mf, struct diff_filespec *one)
204 {
205 if (!DIFF_FILE_VALID(one)) {
206 - mf->ptr = ""; /* does not matter */
206 + mf->ptr = (char *)""; /* does not matter */
207 mf->size = 0;
208 return 0;
209 }
@@ -395,7 +395,7 @@ static void show_stats(struct diffstat_t* data)
395 }
396
397 for (i = 0; i < data->nr; i++) {
398 - char *prefix = "";
398 + const char *prefix = "";
399 char *name = data->files[i]->name;
400 int added = data->files[i]->added;
401 int deleted = data->files[i]->deleted;
@@ -917,7 +917,7 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
917 err_empty:
918 err = -1;
919 empty:
920 - s->data = "";
920 + s->data = (char *)"";
921 s->size = 0;
922 return err;
923 }
@@ -1408,7 +1408,7 @@ int diff_setup_done(struct diff_options *options)
1408 return 0;
1409 }
1410
1411 -int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)
1411 +static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)
1412 {
1413 char c, *eq;
1414 int len;
@@ -1720,16 +1720,12 @@ static void diff_flush_raw(struct diff_filepair *p,
1720 free((void*)path_two);
1721 }
1722
1723 -static void diff_flush_name(struct diff_filepair *p,
1724 - int inter_name_termination,
1725 - int line_termination)
1723 +static void diff_flush_name(struct diff_filepair *p, int line_termination)
1724 {
1725 char *path = p->two->path;
1726
1727 if (line_termination)
1728 path = quote_one(p->two->path);
1731 - else
1732 - path = p->two->path;
1729 printf("%s%c", path, line_termination);
1730 if (p->two->path != path)
1731 free(path);
@@ -1950,9 +1946,7 @@ static void flush_one_pair(struct diff_filepair *p,
1946 options, diff_output_format);
1947 break;
1948 case DIFF_FORMAT_NAME:
1953 - diff_flush_name(p,
1954 - inter_name_termination,
1955 - line_termination);
1949 + diff_flush_name(p, line_termination);
1950 break;
1951 case DIFF_FORMAT_NO_OUTPUT:
1952 break;