diff.c: pass sign_index to emit_line_ws_markup

Instead of passing the sign directly to emit_line_ws_markup, pass only the index to lookup the sign in diff_options->output_indicators. Signed-off-by: Stefan Beller <sbeller@google.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Oct 10, 2018 at 16:24 UTC bc9feb05a7027d9b795bc2bc35f26131b718fc08
1 file changed +5 -7
diff.c
+5 -7
@@ -1202,10 +1202,11 @@ static void dim_moved_lines(struct diff_options *o)
1202 static void emit_line_ws_markup(struct diff_options *o,
1203 const char *set_sign, const char *set,
1204 const char *reset,
1205 - char sign, const char *line, int len,
1205 + int sign_index, const char *line, int len,
1206 unsigned ws_rule, int blank_at_eof)
1207 {
1208 const char *ws = NULL;
1209 + int sign = o->output_indicators[sign_index];
1210
1211 if (o->ws_error_highlight & ws_rule) {
1212 ws = diff_get_color_opt(o, DIFF_WHITESPACE);
@@ -1285,8 +1286,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
1286 set = diff_get_color_opt(o, DIFF_FILE_OLD);
1287 }
1288 emit_line_ws_markup(o, set_sign, set, reset,
1288 - o->output_indicators[OUTPUT_INDICATOR_CONTEXT],
1289 - line, len,
1289 + OUTPUT_INDICATOR_CONTEXT, line, len,
1290 flags & (DIFF_SYMBOL_CONTENT_WS_MASK), 0);
1291 break;
1292 case DIFF_SYMBOL_PLUS:
@@ -1330,8 +1330,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
1330 flags &= ~DIFF_SYMBOL_CONTENT_WS_MASK;
1331 }
1332 emit_line_ws_markup(o, set_sign, set, reset,
1333 - o->output_indicators[OUTPUT_INDICATOR_NEW],
1334 - line, len,
1333 + OUTPUT_INDICATOR_NEW, line, len,
1334 flags & DIFF_SYMBOL_CONTENT_WS_MASK,
1335 flags & DIFF_SYMBOL_CONTENT_BLANK_LINE_EOF);
1336 break;
@@ -1375,8 +1374,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
1374 set = diff_get_color_opt(o, DIFF_CONTEXT_DIM);
1375 }
1376 emit_line_ws_markup(o, set_sign, set, reset,
1378 - o->output_indicators[OUTPUT_INDICATOR_OLD],
1379 - line, len,
1377 + OUTPUT_INDICATOR_OLD, line, len,
1378 flags & DIFF_SYMBOL_CONTENT_WS_MASK, 0);
1379 break;
1380 case DIFF_SYMBOL_WORDS_PORCELAIN: