summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/input/c/casts.c
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2021-11-21 17:04:21 +0900
committerMichele Calgaro <[email protected]>2021-11-21 17:09:35 +0900
commite6ba08c3b21cdb14ee3a97b5d584759a4597b54b (patch)
treee8b4121323f2f448aeaa15bf3bddb465f36aea8b /debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/input/c/casts.c
parentf312c235ea5f9971066f3808997d20f89c25f33b (diff)
downloadextra-dependencies-e6ba08c3b21cdb14ee3a97b5d584759a4597b54b.tar.gz
extra-dependencies-e6ba08c3b21cdb14ee3a97b5d584759a4597b54b.zip
uncrustify-trinity: updated based on upstream version 0.74.0
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/input/c/casts.c')
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/input/c/casts.c89
1 files changed, 89 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/input/c/casts.c b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/input/c/casts.c
new file mode 100644
index 00000000..f09f5c5e
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/input/c/casts.c
@@ -0,0 +1,89 @@
+
+#define SOME_VAL1 ((MYINT)-1)
+#define SOME_VAL2 (-2)
+#define SOME_VAL3 -3
+#define MULT(X,Y) (X) * (Y)
+#define SOME_JUNK /*lint -e123 */(const mytype *)-1
+
+typedef (*my_fcn_ptr_t)(char *, int);
+typedef (my_fcn_t)(char *, int);
+
+void foo(void)
+{
+ uint crc = crc32_calc_full((const UINT8 *)"String", 6);
+
+ crc = crc32_calc_full((const UINT8 *)&crc, sizeof(crc));
+
+ a = (b) - 4;
+
+ a = (UINT) - 4;
+ a = (UINT) + 4;
+ a = (UINT) * 4;
+ a = (UINT) & 4;
+
+ a = (uint32_t) - pb;
+ a = (uint32_t) + pb;
+ a = (uint32_t) * pb;
+ a = (uint32_t) & pb;
+
+ a = (Uint) - 4;
+ a = (Uint) + 4;
+ a = (Uint) * 4;
+ a = (Uint) & 4;
+
+ a = b * (int)flt;
+ a = b * ((int)flt);
+
+ a = b * (int)flt;
+ a = b * (INT8)flt;
+ a = b * (Uint)flt;
+
+ a = *(int)&b;
+ a = *(CHAR)&b;
+ a = *(Uint)&b;
+
+ a = (int)*pb;
+ a = (CHAR)*pb;
+ a = (Uint)*pb;
+
+ a = (int)'a';
+ a = (UINT8)'a';
+ a = (Uint)'a';
+
+ a = (int)*'a';
+ a = (UINT8)*'a';
+ a = (Uint)*'a';
+
+ a = (int)*5;
+ a = (UINT)*5;
+ a = (Uint)*5;
+
+ a = (int)*ape;
+ a = (UINT)*ape;
+ a = (Uint)*ape;
+
+ a = (int)ape;
+ a = (UINT)ape;
+ a = (Uint)ape;
+
+ a = (int)sizeof(x);
+ a = (INT16)sizeof(x);
+ a = (Uint)sizeof(x);
+
+ a = (int)foo(x);
+ a = (CHAR)foo(x);
+ a = (Uint)foo(x);
+
+ a = (int)(x);
+ a = (CHAR)(x);
+ a = (Uint)(x);
+
+ a = (int)*(x);
+ a = (CHAR)*(x);
+ a = (Uint)*(x);
+
+ a = (unsigned int)(1 + 4);
+ a = (int)(1 + 1);
+ a = (void *)(&str);
+}
+