You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
3.3 KiB

10 years ago
9 years ago
10 years ago
  1. #
  2. # based on uncrustify config file for the linux kernel
  3. #
  4. code_width = 120
  5. indent_case_brace = 4
  6. indent_columns = 4
  7. indent_label = 2 # pos: absolute col, neg: relative column
  8. indent_with_tabs = 0
  9. #
  10. # inter-symbol newlines
  11. #
  12. nl_brace_else = remove # "} else" vs "} \n else" - cuddle else
  13. nl_brace_while = remove # "} while" vs "} \n while" - cuddle while
  14. nl_do_brace = remove # "do {" vs "do \n {"
  15. nl_else_brace = remove # "else {" vs "else \n {"
  16. nl_enum_brace = remove # "enum {" vs "enum \n {"
  17. nl_fcall_brace = remove # "list_for_each() {" vs "list_for_each()\n{"
  18. nl_fdef_brace = force # "int foo() {" vs "int foo()\n{"
  19. nl_for_brace = remove # "for () {" vs "for () \n {"
  20. nl_func_var_def_blk = 0 # don't add newlines after a block of var declarations
  21. nl_if_brace = remove # "if () {" vs "if () \n {"
  22. nl_multi_line_define = true
  23. nl_struct_brace = remove # "struct {" vs "struct \n {"
  24. nl_switch_brace = remove # "switch () {" vs "switch () \n {"
  25. nl_union_brace = remove # "union {" vs "union \n {"
  26. nl_while_brace = remove # "while () {" vs "while () \n {"
  27. #
  28. # Source code modifications
  29. #
  30. mod_full_brace_do = force # "do a--; while ();" vs "do { a--; } while ();"
  31. mod_full_brace_for = force # "for () a--;" vs "for () { a--; }"
  32. mod_full_brace_if = force # "if (a) a--;" vs "if (a) { a--; }"
  33. mod_full_brace_nl = 3 # don't remove if more than 3 newlines
  34. mod_full_brace_while = force # "while (a) a--;" vs "while (a) { a--; }"
  35. mod_paren_on_return = remove # "return 1;" vs "return (1);"
  36. #
  37. # inter-character spacing options
  38. #
  39. sp_after_cast = remove # "(int) a" vs "(int)a"
  40. sp_after_comma = force
  41. sp_after_sparen = force # "if () {" vs "if (){"
  42. sp_arith = force
  43. sp_assign = force
  44. sp_assign = force
  45. sp_before_comma = remove
  46. sp_before_ptr_star = force # "char *foo" vs "char* foo
  47. sp_before_sparen = force # "if (" vs "if("
  48. sp_between_ptr_star = remove # "char * *foo" vs "char **foo"
  49. sp_bool = force
  50. sp_compare = force
  51. sp_func_call_paren = remove # "foo (" vs "foo("
  52. sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
  53. sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
  54. sp_inside_braces = force # "{ 1 }" vs "{1}"
  55. sp_inside_braces_enum = force # "{ 1 }" vs "{1}"
  56. sp_inside_braces_struct = force # "{ 1 }" vs "{1}"
  57. sp_inside_sparen = remove
  58. sp_paren_brace = force
  59. sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
  60. sp_else_brace = force
  61. sp_brace_else = force
  62. #
  63. # Aligning stuff
  64. #
  65. align_enum_equ_span = 4 # '=' in enum definition
  66. align_nl_cont = true
  67. align_on_tabstop = FALSE # align on tabstops
  68. align_right_cmt_span = 3
  69. align_struct_init_span = 1
  70. align_struct_init_span = 3 # align stuff in a structure init '= { }'
  71. align_var_def_star_style = 2 # void *foo;
  72. align_var_struct_span = 0
  73. align_with_tabs = FALSE # use tabs to align