diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-12-20 23:01:54 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-12-22 11:50:09 +0900 |
commit | 112ca8677b9b024de5529712e559c968da40a67a (patch) | |
tree | a8e93a0b05d61aeaab1dab3288c5fc518cdd05c6 /debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/c/if_chain.c | |
parent | b37f44d6c7444ca20c48a07fdcaf7b2a812db5bd (diff) | |
download | extra-dependencies-112ca8677b9b024de5529712e559c968da40a67a.tar.gz extra-dependencies-112ca8677b9b024de5529712e559c968da40a67a.zip |
DEB uncrustify: added first version of uncrustify-trinity. This is basically the upstream 0.72.0 version of uncrustify, repackaged.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/c/if_chain.c')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/c/if_chain.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/c/if_chain.c b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/c/if_chain.c new file mode 100644 index 00000000..948492dd --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/c/if_chain.c @@ -0,0 +1,82 @@ +void foo(void) +{ + if (cond_a) { + fcn_a(); + fcn_b(); + } else { + fcn_c(); + } + + if (cond_b) { + fcn_d(); + } else { + fcn_e(); + } + + if (cond_c) { + fcn_f(); + fcn_g(); + } else + fcn_h(); + + if (cond_d) + fcn_i(); + else { + fcn_j(); + fcn_k(); + } + + if (cond_e) + fcn_l(); + else + fcn_m(); + + if (cond_f) + fcn_n(); + else if (cond_g) { + fcn_o(); + while (cond_g) { + fcn_p(); + } + } else if (cond_h) + while (cond_i) { + fcn_q(); + fcn_r(); + } + else + fcn_s(); +} + +/* this next bit test whether vbraces can be successfully converted + * when the closing brace is in an #ifdef. + * Note that the author should have braced the code to begin with. + */ +void bar(void) +{ + if (jiffies >= hw_priv->Counter[ port ].time) { + hw_priv->Counter[ port ].fRead = 1; + if (port == MAIN_PORT) { + hw_priv->Counter[ MAIN_PORT ].time = jiffies + HZ * 6; + } else + hw_priv->Counter[ port ].time = + +#ifdef SOME_DEFINE + hw_priv->Counter[ port - 1 ].time + HZ * 2; + +#else /* ifdef SOME_DEFINE */ + hw_priv->Counter[ MAIN_PORT ].time + HZ * 2; +#endif /* ifdef SOME_DEFINE */ + } +} + +void funct(int v1, int v2, int v3) +{ + if ( v1 ) + { + if ( v2 ) f1(); + } + else + { + if ( v3 ) f2(); + } +} |