clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test-fade.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -I .. -I . -I . -D CAFEMENU_I_KNOW_THIS_IS_UNSTABLE -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/cafe-desktop-2.0 -I /usr/include/startup-notification-1.0 -I /usr/include/dconf -I /usr/include/cafe-menus -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/cafe-desktop-2.0 -I /usr/include/startup-notification-1.0 -I /usr/include/dconf -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/cafe-desktop-2.0 -I /usr/include/startup-notification-1.0 -I /usr/include/dconf -I /usr/include/cafe-menus -D PREFIX="/usr" -D BINDIR="/usr/bin" -D LIBDIR="/usr/lib" -D LIBEXECDIR="/usr/libexec" -D DATADIR="/usr/share" -D SYSCONFDIR="/usr/etc" -D CAFELOCALEDIR="/usr/share/locale" -D SAVERDIR="/usr/libexec/cafe-screensaver" -D THEMESDIR="/usr/share/cafe-screensaver/themes" -D CTKBUILDERDIR="/usr/share/cafe-screensaver" -D PAM_SERVICE_NAME="cafe-screensaver" -D G_DISABLE_ASSERT -D G_DISABLE_CHECKS -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/libxml2 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/libpng16 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/libmount -I /usr/include/blkid -internal-isystem /usr/lib/llvm-16/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-09-01-000123-52284-1 -x c test-fade.c
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | #include "config.h" |
25 | |
26 | #include <stdlib.h> |
27 | #include <string.h> |
28 | #include <sys/time.h> |
29 | #include <sys/types.h> |
30 | #include <sys/wait.h> |
31 | #include <termios.h> |
32 | #include <unistd.h> |
33 | |
34 | #include <glib/gi18n.h> |
35 | #include <cdk/cdkx.h> |
36 | #include <ctk/ctk.h> |
37 | |
38 | #include "gs-fade.h" |
39 | #include "gs-debug.h" |
40 | |
41 | #ifdef HAVE_XF86VMODE_GAMMA |
42 | # include <X11/extensions/xf86vmode.h> |
43 | #endif |
44 | |
45 | #define XF86_VIDMODE_NAME "XFree86-VidModeExtension" |
46 | |
47 | static void |
48 | test_fade (void) |
49 | { |
50 | GSFade *fade; |
51 | int reps = 2; |
52 | int delay = 2; |
53 | |
54 | fade = gs_fade_new (); |
55 | |
56 | while (reps-- > 0) |
57 | { |
58 | |
59 | g_print ("fading out..."); |
60 | gs_fade_sync (fade, 1000); |
61 | g_print ("done.\n"); |
62 | |
63 | g_print ("fading in..."); |
64 | gs_fade_reset (fade); |
65 | g_print ("done.\n"); |
66 | |
67 | if (delay) |
68 | { |
69 | sleep (delay); |
70 | } |
71 | } |
72 | |
73 | g_object_unref (fade); |
74 | } |
75 | |
76 | int |
77 | main (int argc, |
78 | char **argv) |
79 | { |
80 | GError *error = NULL; |
81 | int op, event, err; |
82 | |
83 | #ifdef ENABLE_NLS |
84 | bindtextdomain (GETTEXT_PACKAGE, CAFELOCALEDIR); |
85 | # ifdef HAVE_BIND_TEXTDOMAIN_CODESET |
86 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); |
87 | # endif |
88 | textdomain (GETTEXT_PACKAGE); |
89 | #endif |
90 | |
91 | if (error) |
92 | { |
93 | fprintf (stderr, "%s\n", error->message); |
| This statement is never executed |
94 | exit (1); |
95 | } |
96 | |
97 | if (! ctk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) |
98 | { |
99 | fprintf (stderr, "%s", error->message); |
100 | g_error_free (error); |
101 | exit (1); |
102 | } |
103 | |
104 | if (! XQueryExtension (CDK_DISPLAY_XDISPLAY (cdk_display_get_default ()), XF86_VIDMODE_NAME, &op, &event, &err)) |
105 | { |
106 | g_message ("no " XF86_VIDMODE_NAME " extension"); |
107 | } |
108 | else |
109 | { |
110 | # ifdef HAVE_XF86VMODE_GAMMA |
111 | int major; |
112 | int minor; |
113 | |
114 | if (! XF86VidModeQueryVersion (CDK_DISPLAY_XDISPLAY (cdk_display_get_default ()), &major, &minor)) |
115 | { |
116 | g_message ("unable to get " XF86_VIDMODE_NAME " version"); |
117 | } |
118 | else |
119 | { |
120 | g_message (XF86_VIDMODE_NAME " version %d.%d", major, minor); |
121 | } |
122 | # else /* !HAVE_XF86VMODE_GAMMA */ |
123 | g_message ("no support for display's " XF86_VIDMODE_NAME " extension"); |
124 | # endif /* !HAVE_XF86VMODE_GAMMA */ |
125 | } |
126 | |
127 | gs_debug_init (TRUE, FALSE); |
128 | |
129 | test_fade (); |
130 | |
131 | gs_debug_shutdown (); |
132 | |
133 | return 0; |
134 | } |