Fix indentation (and clang warning) in c-lang.c

I see this warning when building with clang:

      CXX    c-lang.o
    /home/smarchi/src/binutils-gdb/gdb/c-lang.c:314:7: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
          *length = i * width;
          ^
    /home/smarchi/src/binutils-gdb/gdb/c-lang.c:308:4: note: previous statement is here
              if (extract_unsigned_integer (contents + i * width,
              ^

It took me a while to notice that some lines in that area have a
spurious space before the tabs, at the beginning of the ling.  I'm not
sure how clang translates that to misleading indentation, but making the
indentation correct gets rid of the error.

There are many more instances of this in the code base (`grep -P '^ \t'
*.c`), if others think it's a good idea, it would be pretty easy to fix
them all up in one shot.

gdb/ChangeLog:

	* c-lang.c (c_get_string, asm_language_defn): Remove space
	before tab.
This commit is contained in:
Simon Marchi 2019-12-18 13:27:18 -05:00
parent 28ce7b0747
commit e623f03502
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2019-12-18 Simon Marchi <simon.marchi@efficios.com>
* c-lang.c (c_get_string, asm_language_defn): Remove space
before tab.
2019-12-18 Tom Tromey <tromey@adacore.com> 2019-12-18 Tom Tromey <tromey@adacore.com>
PR build/25250: PR build/25250:

View File

@ -303,14 +303,14 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
if (*length >= 0) if (*length >= 0)
i = *length; i = *length;
else else
/* Otherwise, look for a null character. */ /* Otherwise, look for a null character. */
for (i = 0; i < fetchlimit; i++) for (i = 0; i < fetchlimit; i++)
if (extract_unsigned_integer (contents + i * width, if (extract_unsigned_integer (contents + i * width,
width, byte_order) == 0) width, byte_order) == 0)
break; break;
/* I is now either a user-defined length, the number of non-null /* I is now either a user-defined length, the number of non-null
characters, or FETCHLIMIT. */ characters, or FETCHLIMIT. */
*length = i * width; *length = i * width;
buffer->reset ((gdb_byte *) xmalloc (*length)); buffer->reset ((gdb_byte *) xmalloc (*length));
memcpy (buffer->get (), contents, *length); memcpy (buffer->get (), contents, *length);
@ -1119,7 +1119,7 @@ extern const struct language_defn asm_language_defn =
0, /* String lower bound */ 0, /* String lower bound */
default_word_break_characters, default_word_break_characters,
default_collect_symbol_completion_matches, default_collect_symbol_completion_matches,
c_language_arch_info, /* FIXME: la_language_arch_info. */ c_language_arch_info, /* FIXME: la_language_arch_info. */
default_print_array_index, default_print_array_index,
default_pass_by_reference, default_pass_by_reference,
c_watch_location_expression, c_watch_location_expression,