Skip to content

fix indentation #48

@229c9cf0

Description

@229c9cf0

Indentation is completely broken right now. There's a weird mix of tabs and spaces, indentation depths differs, … It's bad enough that gcc is confused and (wrongly) complains about unguarded statements all over the place:

src/m_input.c:622:6: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
src/d_code.c:357:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/d_code.c:414:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/m_maths.c:232:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/m_maths.c:284:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/m_maths.c:310:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/i_display.c:3536:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/i_display.c:4015:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/i_display.c:4298:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/i_display.c:7282:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/i_display.c:13572:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/t_template.c:188:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/v_interp.c:1740:1: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/h_story.c:1279:11: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/h_story.c:1284:11: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/g_method_std.c:273:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/e_files.c:596:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/v_draw_panel.c:376:1: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_fix.c:540:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_fix.c:940:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/g_game.c:503:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/g_world_map_2.c:1675:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/t_files.c:195:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_compile.c:1305:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_compile.c:1367:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_compile.c:1425:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_compile.c:1464:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_compile.c:1536:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_compile.c:1631:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_compile.c:1638:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
src/c_compile.c:1659:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]

It's also really hard to read…

Could you fix this?

Alternatively, I could try to set up and run a code formatter on this and make a pull request – in which case, what should the indentation be?

  • Tabs or spaces? Currently, there's a pretty even mix of both… (I personally prefer tabs, as everyone can just set the tab width in their editor and then have whatever indentation depth they prefer. But spaces are also fine, just make it tabs XOR spaces.)
  • If using spaces, how many spaces per indentation level? Lots of places use one character, some two, and then there's also larger gaps (3, 5, 9?!, …) when looking at the output of a quick grep|sed|sort|uniq chain. (For me, single-space indentation is hard to read – with spaces, I'd suggest at least two per indentation level.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions