1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Uncrustify: The align typedef options</title>
</head>
<body lang="en-US">
<h2>align_typedef</h2>
<h3>align_typedef_span</h3>
The span for aligning single-line typedefs (0=don't align)
<table border="border">
<tr>
<td valign="bottom">original<br>align_typedef_span=0</td>
<td valign="bottom">align_typedef_span=1</td>
<td valign="bottom">align_typedef_span=2</td>
</tr>
<tr>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
</pre>
<i>no alignment</i>
</td>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
</pre>
<i>The third line is not catch in the span</i>
</td>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
</pre>
<i>all the lines are catched</i>
</td>
</tr>
</table>
<p></p>
<h3>align_typedef_gap</h3>
The minimum space between the type and the synonym of a typedef<br>
Can be only used if align_typedef_span >= 1
<table border="border">
<tr>
<td valign="bottom">original<br>align_typedef_span=2</td>
<td valign="bottom">align_typedef_gap=1</td>
<td valign="bottom">align_typedef_gap=3</td>
</tr>
<tr>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
</pre>
<i>as above</i>
</td>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
</pre>
<i>no change</i>
</td>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
</pre>
<i>the gap has 3 spaces</i>
</td>
</tr>
</table>
<p></p>
<h3>align_typedef_star_style</h3>
Controls the positioning of the '*' in typedefs.<BR>
0: Align on typedef type, ignore '*'<BR>
1: The '*' is part of type name<BR>
2: The '*' is part of the type, but dangling
<table border="border">
<tr>
<td valign="bottom">original</td>
<td valign="bottom">align_typedef_gap=3<br>align_typedef_star_style=0</td>
<td valign="bottom">align_typedef_gap=3<br>align_typedef_star_style=1</td>
<td valign="bottom">align_typedef_gap=3<br>align_typedef_star_style=2</td>
</tr>
<tr>
<td><pre>
typedef int MY_INT;
int a;
typedef int * MY_INTP;
typedef float My_Float;
</pre>
<i>no alignment</i>
</td>
<td><pre>
typedef int MY_INT;
int a;
typedef int * MY_INTP;
typedef float My_Float;
</pre>
<i>the star is ignored</i>
</td>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
</pre>
<i>the star is part of type name</i>
</td>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
</pre>
<i>the star is part of type name, but dangling</i>
</td>
</tr>
</table>
<p></p>
<h3>align_typedef_func</h3>
How to align typedef'd functions with other typedefs<BR>
0: Don't mix them at all<BR>
1: align the open paren with the types
<table border="border">
<tr>
<td valign="bottom">original</td>
<td valign="bottom">align_typedef_gap=3<br>align_typedef_star_style=1<br>align_typedef_func=1</td>
</tr>
<tr>
<td><pre>
typedef int MY_INT;
int a;
typedef int * MY_INTP;
typedef float My_Float;
typedef int (*foo_t)(void *bar);
typedef int (*somefunc_t)(void *barstool);
</pre>
<i>no alignment</i>
</td>
<td><pre>
typedef int MY_INT;
int a;
typedef int *MY_INTP;
typedef float My_Float;
typedef int (*foo_t)(void *bar);
typedef int (*somefunc_t)(void *barstool);
</pre>
</td>
</tr>
</table>
</body>
</html>
|