summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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>
2024-01-01Remove always-true ifndef TOMTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Remove disabled codeTim Wiederhake
Signed-off-by: Tim Wiederhake <twied@gmx.net>
2024-01-01Fix include guard namesTim Wiederhake
Names that begin with an underscore ('_') are reserved. Follow the usual practice of naming the include guard of file "foo.h" "FOO_H", as is already done in "icons.h". Signed-off-by: Tim Wiederhake <twied@gmx.net>
2023-12-02configure: pass noyywrap to AC_PROG_LEX if using autoconf 2.70 or laterAlan Coopersmith
Raises minimum autoconf version from 2.60 to 2.64 for m4_version_prereq Clears autoconf warning: configure.ac:47: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete ./lib/autoconf/programs.m4:743: _AC_PROG_LEX is expanded from... ./lib/autoconf/programs.m4:736: AC_PROG_LEX is expanded from... configure.ac:47: the top level Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-25Remove "All rights reserved" from Oracle copyright noticesAlan Coopersmith
Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>