summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-03-16Fix read from uninitialized dataHEADmasterTim Wiederhake
Syscall param writev(vector[0]) points to uninitialised byte(s) at 0x4B836C0: writev (writev.c:26) by 0x4C74FBF: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0) by 0x4C753B0: xcb_writev (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0) by 0x48B2A24: _XSend (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) by 0x48B3088: _XReply (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) by 0x48AE6FE: XSync (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) by 0x11C523: HandleEnterNotify (events.c:2112) by 0x117847: DispatchEvent (events.c:335) by 0x117921: HandleEvents (events.c:363) by 0x12FCBD: main (twm.c:648) Address 0x5036874 is 148 bytes inside a block of size 16,384 alloc'd at 0x48459F3: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x48A23AA: XOpenDisplay (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) by 0x49E5A12: XtOpenDisplay (in /usr/lib/x86_64-linux-gnu/libXt.so.6.0.0) by 0x12EB45: main (twm.c:319) Uninitialised value was created by a stack allocation at 0x12828E: send_clientmessage (menus.c:2861) Signed-off-by: Tim Wiederhake <twied@gmx.net> Part-of: <https://gitlab.freedesktop.org/xorg/app/twm/-/merge_requests/29>
2024-03-16Fix memory leak in FindFontSetTim Wiederhake
Valgrind results before: definitely lost: 800 bytes in 23 blocks indirectly lost: 872 bytes in 6 blocks possibly lost: 0 bytes in 0 blocks still reachable: 991,316 bytes in 1,795 blocks suppressed: 0 bytes in 0 blocks Valgrind results after: definitely lost: 200 bytes in 17 blocks indirectly lost: 0 bytes in 0 blocks possibly lost: 0 bytes in 0 blocks still reachable: 918,812 bytes in 994 blocks suppressed: 0 bytes in 0 blocks Signed-off-by: Tim Wiederhake <twied@gmx.net> Part-of: <https://gitlab.freedesktop.org/xorg/app/twm/-/merge_requests/29>
2024-03-16Fix memory leak in SaveYourselfPhase2CBTim Wiederhake
Valgrind results before: definitely lost: 981 bytes in 37 blocks indirectly lost: 872 bytes in 6 blocks possibly lost: 0 bytes in 0 blocks still reachable: 991,316 bytes in 1,795 blocks suppressed: 0 bytes in 0 blocks Valgrind results after: definitely lost: 800 bytes in 23 blocks indirectly lost: 872 bytes in 6 blocks possibly lost: 0 bytes in 0 blocks still reachable: 991,316 bytes in 1,795 blocks suppressed: 0 bytes in 0 blocks Signed-off-by: Tim Wiederhake <twied@gmx.net> Part-of: <https://gitlab.freedesktop.org/xorg/app/twm/-/merge_requests/29>
2024-03-10Add meson builds to CITim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-03-07Add meson as alternative build systemTim Wiederhake
Add a note to the readme file to clarify that the default build system is still automake. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-03-07Provide defaults for externally defined symbolsTim Wiederhake
AM_CPPFLAGS defines several symbols that do not have to be there. By providing default values in twm.h, this list can be reduced in size while still allowing to override these values. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-03-07Remove version.c and version.hTim Wiederhake
These files define only a single variable that is used in only one place. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-03-07Simplify default twmrc generationTim Wiederhake
The logic to generate deftwmrc.c is currently split between Makefile.am and deftwmrc.sed. Consolidate into a single script. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-03-05improve portability for bison/byaccThomas E. Dickey
Provide declaration of yyparse(), and alternate declaration of yylex(). This works with bison and byacc, as well as different versions of flex. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2024-03-05improve declaration of yylex()Thomas E. Dickey
Replace the extern declaration of yylex() in gram.y with a definition/use in parse.h, improving portability. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2024-03-05amend yylineno changeThomas E. Dickey
A recent change removed the declaration of yylineno from lex.l, making the program depend on the version of flex. Restore the declaration with an ifdef. Also, remove unused declaration in parse.c Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2024-03-05include "gram.h" only from "parse.h"Thomas E. Dickey
all of the users of (generated) gram.h rely upon (custom) parse.h, and the order of those headers affects portability. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2024-01-21Add explicit cast after memory allocationTim Wiederhake
Still valid c, but now also valid c++. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-21Accomodate different field names when compiling with c++Tim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-21Rename variable 'new' to 'entry' in splitEntryTim Wiederhake
'new' is a keyword in c++. Its usage confuses some tools that work with c and c++ source code. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-21Rename argument 'class' to 'xclass' in GetColorFromListTim Wiederhake
'class' is a keyword in c++. Its usage confuses some tools that work with c and c++ source code. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-21Rename argument 'class' to 'xclass' in LookInListTim Wiederhake
'class' is a keyword in c++. Its usage confuses some tools that work with c and c++ source code. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-21Rename field 'class' to 'xclass' in TwmWindowTim Wiederhake
'class' is a keyword in c++. Its usage confuses some tools that work with c and c++ source code. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-21Rename field 'class' to 'xclass' in TWMWinConfigEntryTim Wiederhake
'class' is a keyword in c++. Its usage confuses some tools that work with c and c++ source code. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-21Rename field 'delete' to 'remove' in TitlebarPixmapsTim Wiederhake
'delete' is a keyword in c++. Its usage confuses some tools that work with c and c++ source code. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-21Remove storage specifier 'register'Tim Wiederhake
'register' is an optimization hint to the compiler that is generally not necessary and needlessly prevents using a c++ compiler to compile twm. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Remove global variables JunkWidth, JunkHeight, JunkBW, JunkDepth, JunkMaskTim Wiederhake
Replace with a local variable following the naming scheme from Identify() in src/menus.c. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Remove global variables JunkX, JunkYTim Wiederhake
Replace with a local variable following the naming scheme from Identify() in src/menus.c. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Remove global variables JunkRoot, JunkChildTim Wiederhake
Replace with a local variable following the naming scheme from Identify() in src/menus.c. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Rework dummy variable usage in ExecuteFunctionTim Wiederhake
twm defines several "junk" variables to use with functions like XQueryPointer or XGetGeometry. In some instances, the returned values are actually used, which makes the code confusing and hard to reason about. Use dedicated variables in those cases. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Rework dummy variable usage in IconUpTim Wiederhake
twm defines several "junk" variables to use with functions like XQueryPointer or XGetGeometry. In some instances, the returned values are actually used, which makes the code confusing and hard to reason about. Use dedicated variables in those cases. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Rework dummy variable usage in do_string_keywordTim Wiederhake
twm defines several "junk" variables to use with functions like XQueryPointer or XGetGeometry. In some instances, the returned values are actually used, which makes the code confusing and hard to reason about. Use dedicated variables in those cases. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Rework dummy variable usage in CreateIconManagersTim Wiederhake
twm defines several "junk" variables to use with functions like XQueryPointer or XGetGeometry. In some instances, the returned values are actually used, which makes the code confusing and hard to reason about. Use dedicated variables in those cases. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Rework dummy variable usage in HandleButtonPressTim Wiederhake
twm defines several "junk" variables to use with functions like XQueryPointer or XGetGeometry. In some instances, the returned values are actually used, which makes the code confusing and hard to reason about. Use dedicated variables in those cases. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Rework dummy variable usage in SetHighlightPixmapTim Wiederhake
twm defines several "junk" variables to use with functions like XQueryPointer or XGetGeometry. In some instances, the returned values are actually used, which makes the code confusing and hard to reason about. Use dedicated variables in those cases. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Rework dummy variable usage in AddWindowTim Wiederhake
twm defines several "junk" variables to use with functions like XQueryPointer or XGetGeometry. In some instances, the returned values are actually used, which makes the code confusing and hard to reason about. Use dedicated variables in those cases. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Make XtSignalId si staticTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Make FirstScreen a local variableTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Make appContext a local variableTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Make InitFile a local variableTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Make MultiScreen a local variableTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Split up InitMenusTim Wiederhake
Preparation for the removal of FirstScreen: Separate code that is executed for all screens from code that is executed for only the first screen. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-20Remove now unused NoPrintscreens variableTim Wiederhake
Support for xprint was removed in commit 0ce52bc9ed. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Replace GCC_NORETURN with _X_NORETURNTim Wiederhake
This silences all "function might be candidate for attribute 'noreturn'" warnings. Add to HandleEvent as well, as that function never returns. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Replace GCC_PRINTFLIKE with _X_ATTRIBUTE_PRINTFTim Wiederhake
This silences all "function '...' might be a candidate for 'gnu_printf' format attribute" warnings. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Remove redundant declaration of yylexTim Wiederhake
yylex is already declared in (the generated) lex.c. This silences a "redundant redeclaration of 'yylex'" warning. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Remove redundant declaration of yyparseTim Wiederhake
yyparse is already declared in (the generated) gram.h. This silences a "redundant redeclaration of 'yyparse'" warning. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Remove redundant declaration of yylinenoTim Wiederhake
yylineno is already declared in (the generated) gram.h. This silences a "redundant redeclaration of 'yylineno'" warning. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Make atom_names const correctTim Wiederhake
Silence some "initialization discards 'const' qualifier from pointer target type" warnings. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Silence old-style function definition warning in yywrapTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Silence uninitialized variable warningTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Enable compiler warningsTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Remove write to never-read variable in InstallWindowColormapsTim Wiederhake
The variable `n` is written to every iteration of the loop, but never read. It is overwritten (and read) in the next loop though. Remove the dead store. Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Remove unused typedef SigProcTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Remove support for xprintTim Wiederhake
xprint is deprecated and was removed from xorg in 2008. Signed-off-by: Tim Wiederhake <twied@gmx.net>