summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-06-18add a dependency on makestrs to help with parallel buildslibXt-1.2.0Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-06-14remove dead codeWalter Harms
Signed-off-by: Walter Harms <wharms@bfs.de>
2019-06-14make _XtWaitForSomething accept always the same number of argumentsWalter Harms
to reduce the #ifdef forrest make _XtWaitForSomething accept all arguments. Also add a dummy use for drop_lock to avoid unused warnings Signed-off-by: Walter Harms <wharms@bfs.de>
2019-06-13reduce ifdef/ifndef inconsistency for USE_POLLThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-06-10remove useles elseWalter Harms
Signed-off-by: Walter Harms <wharms@bfs.de>
2019-06-10no need to check arument for XtFree()Walter Harms
Signed-off-by: Walter Harms <wharms@bfs.de>
2019-06-10use strdup in two places; remove a bogus "else" from X11R6.4 changesThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-06-10fix a syntax mess introduced by R6.6 ifdef'ingThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-06-09no need to check argument for X(t)FreeWalter Harms
Signed-off-by: Walter Harms <wharms@bfs.de>
2019-06-05Merge branch 'master' of ssh://gitlab.freedesktop.org/xorg/lib/libxtWalter Harms
2019-05-29fix compiler warnings when WHITEFILL is definedThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-29fix compiler warnings when _TRACE_HEAP is definedThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-29build- and compiler-warning fixes when XTTRACEMEMORY is definedThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-29build-fix and compiler-warnings when TRACE_TM is definedThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-18Merge branch 'master' of ssh://gitlab.freedesktop.org/xorg/lib/libxtWalter Harms
2019-05-18save one indent levelWalter Harms
2019-05-18trim obsolete ifdef for ISC, and correct nonstandard "NaNS" to "NaN"Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-18use _X_NORETURN, works for gcc and clangThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-18use explicit pointer check to eliminate a clang --analyze warning in VarGet.cThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-18fix most clang --analyze warnings about null-pointersThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-18fix unused-assignment warnings (clang --analyze)Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-18ensure XWindowChanges value is initialized before updating it (clang --analyze)Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-18fixes cppcheck "style" warnings (mostly variable-scope)Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-18add casts to quiet compiler warnings with Solaris 11.4 / gcc 7.3.0Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-07remove an #include used in debuggingThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-07Proposed revision of XtAppMainLoop() inThomas E. Dickey
https://gitlab.freedesktop.org/xorg/lib/libxt/issues/7 caused applications such as xclock to hang, because it did first not check if there was an available event corresponding to the mask parameter before calling XtAppProcessEvent(). For instance, if the mask was XtIMXEvent, it would ignore timer events until an X event occurred. Fix this by checking with XtAppPending() when the mask is not XtIMAll. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-06add casts to fix compiler warningsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-06eliminate an unnecessary cast which gave a gcc warning and add a ↵Thomas E. Dickey
null-pointer check Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-06if Xalloca.h is corrected to use size_t param, one change is still needed inThomas E. Dickey
libXt to fix compiler warnings - done here.
2019-05-06fixes for gcc warnings, no object-changeThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-06XtAppProcessEvent expects XtInputMask parameter, which is unsigned-longThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-06use "const void *" rather than "char *" for memcmp, etcThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-06fix 5 more simple gcc warningsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-06fix gcc warnings when assigning into a bit-field by first masking the valueThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-05-04Provide suseconds_t typedef on Win32Jon Turney
Fix compilation on Win32 after cf9e8c73, where timeval is not defined in terms of that type, but a plain long.
2019-05-04Fix WHITEFILL after const fixesJon Turney
Fix compilation of ExtractLocaleName() when WHITEFILL is defined (when built for Win32) after const fixes in ffeb733d.
2019-04-28Merge branch 'master' of ssh://gitlab.freedesktop.org/xorg/lib/libxtWalter Harms
2019-04-28Fix input starvation in XtMainLoop() closes bug #7Walter Harms
the function XtAppProcessEvent() can handle only one of XtIMXEvent | XtIMTimer | XtIMAlternateInput | XtIMSignal propperly. It returns after processing one type of input others are left unprocessed. putting enought input of one type, the later once will never processed.
2019-04-22Fix covscan complainBenjamin Tissoires
covscan gets confused by the test before the XtFree. Error: RESOURCE_LEAK (CWE-772): libXt-20190411/src/Event.c:743: alloc_fn: Storage is returned from allocation function "__XtMalloc". libXt-20190411/src/Event.c:743: var_assign: Assigning: "proc" = storage returned from "__XtMalloc((Cardinal)((size_t)numprocs * 16UL))". libXt-20190411/src/Event.c:745: var_assign: Assigning: "closure" = "proc". libXt-20190411/src/Event.c:776: leaked_storage: Variable "closure" going out of scope leaks the storage it points to. libXt-20190411/src/Event.c:776: leaked_storage: Variable "proc" going out of scope leaks the storage it points to. Mixing static arrays and dynamic ones was a good idea in the 90s when malloc was expensive, but now, we should probably make the code clearer by just allocating the memory when needed. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-22dummy fix for covscanBenjamin Tissoires
covscan seems lost here: Error: RESOURCE_LEAK (CWE-772): libXt-20190411/src/Intrinsic.c:1074: alloc_fn: Storage is returned from allocation function "__XtMalloc". libXt-20190411/src/Intrinsic.c:1074: var_assign: Assigning: "buf2" = storage returned from "__XtMalloc(4096U)". libXt-20190411/src/Intrinsic.c:1110: leaked_storage: Variable "buf2" going out of scope leaks the storage it points to. Error: USE_AFTER_FREE (CWE-416): libXt-20190411/src/Intrinsic.c:1113: alias: Assigning: "buf" = "buf2". Now both point to the same storage. libXt-20190411/src/Intrinsic.c:1108: freed_arg: "XtFree" frees "buf2". libXt-20190411/src/Intrinsic.c:1110: use_after_free: Using freed pointer "buf". Both are false positive, but we can make it understand where it is wrong. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-22Fix leaks detected by covscanBenjamin Tissoires
The following leaks are reported by covscan: Error: RESOURCE_LEAK (CWE-772): libXt-20190411/src/ResConfig.c:542: alloc_arg: "_get_part" allocates memory that is stored into "part". libXt-20190411/src/ResConfig.c:544: noescape: Resource "part" is not freed or pointed-to in "_match_resource_to_widget". libXt-20190411/src/ResConfig.c:560: leaked_storage: Variable "part" going out of scope leaks the storage it points to. Error: RESOURCE_LEAK (CWE-772): libXt-20190411/src/TMgrab.c:108: alloc_arg: "XtKeysymToKeycodeList" allocates memory that is stored into "keycodes". libXt-20190411/src/TMgrab.c:115: var_assign: Assigning: "keycodeP" = "keycodes". libXt-20190411/src/TMgrab.c:124: leaked_storage: Variable "keycodeP" going out of scope leaks the storage it points to. libXt-20190411/src/TMgrab.c:124: leaked_storage: Variable "keycodes" going out of scope leaks the storage it points to. Error: RESOURCE_LEAK (CWE-772): libXt-20190411/src/TMparse.c:1544: alloc_fn: Storage is returned from allocation function "XtMalloc". libXt-20190411/src/TMparse.c:1544: var_assign: Assigning: "event" = storage returned from "XtMalloc(88U)". libXt-20190411/src/TMparse.c:1549: noescape: Resource "event" is not freed or pointed-to in "ParseQuotedStringEvent". libXt-20190411/src/TMparse.c:1555: leaked_storage: Variable "event" going out of scope leaks the storage it points to. Error: RESOURCE_LEAK (CWE-772): libXt-20190411/src/TMparse.c:1779: alloc_fn: Storage is returned from allocation function "XtMalloc". libXt-20190411/src/TMparse.c:1779: var_assign: Assigning: "action" = storage returned from "XtMalloc(32U)". libXt-20190411/src/TMparse.c:1784: noescape: Resource "action" is not freed or pointed-to in "ParseAction". libXt-20190411/src/TMparse.c:1785: leaked_storage: Variable "action" going out of scope leaks the storage it points to. In addition to this legitimate leaks, covscan can get confused by the allocated memory in XtKeysymToKeycodeList: Error: RESOURCE_LEAK (CWE-772): libXt-20190411/src/TMgrab.c:108: alloc_arg: "XtKeysymToKeycodeList" allocates memory that is stored into "keycodes". libXt-20190411/src/TMgrab.c:114: leaked_storage: Variable "keycodes" going out of scope leaks the storage it points to. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-16remove some debris...Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-04-16change return-type to avoid const-mismatchesThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-04-16fix const-mismatches in Tmstate.cThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-04-16fix const-mismatches in TMprint.cThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-04-16fix const-mismatches in TMparse.cThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-04-16fix shadowing warning for widgetClass parameter; no binary-changeThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-04-16fix gcc warnings in Display.cThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-04-16resolve const-mismatches in Shell.cThomas E. Dickey
some of those fixes use casts which elicit stricter warnings, but that's a tradeoff needed to work with Xt's assumption that certain strings are allocated (or const) in the calling application. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2019-04-16resolve const-mismatches in internal functions of Intrinsic.cThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>