summaryrefslogtreecommitdiff
path: root/utils.h
AgeCommit message (Collapse)Author
2024-04-21Assume target platforms have strcasecmp, strncasecmp, & strdup nowAlan Coopersmith
All have been required since Unix98/SUSv2 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/merge_requests/23>
2023-01-03Mark more pointers as constAlan Coopersmith
Some suggested by cppcheck, others by manual code inspection Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03Only build debug infrastructure if DEBUG is definedAlan Coopersmith
It's only used when DEBUG is defined, so don't build it when we're not using it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03Remove unused "no indent" (NOI) debug functionsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-03Mark more functions and variables staticAlan Coopersmith
Stop exporting things that aren't used outside the file that defines them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace Opaque with direct usage of void *Alan Coopersmith
Only one use was left after deleting the *alloc/free() wrappers Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uFree() with direct free() callsAlan Coopersmith
All these wrappers did was mess with types and add a test for NULL pointers that isn't needed in C89 and later. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uTypedRecalloc() with direct recallocarray() callsAlan Coopersmith
Retains uRecalloc() as a fallback for platforms without recallocarray() Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uTypedRealloc() with direct reallocarray() callsAlan Coopersmith
Falls back to realloc() if platform doesn't offer reallocarray(). Also removes uRealloc() since it had no other uses. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uCalloc() and uTypedCalloc() with direct calloc() callsAlan Coopersmith
All these wrappers did was mess with types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Replace uAlloc() and uTypedAlloc() with direct malloc() callsAlan Coopersmith
All these wrappers did was mess with types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-11Delete unused uTmpAlloc/uTmpFree wrappers around alloca()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-01-21Replace WARN[1-9], ERROR[1-9], etc. with their unnumbered versionPeter Hutterer
Those macros date back to when varargs weren't a thing but they've been #defined to the same value for 17 years now. Patch generated with: for action in WARN INFO ERROR ACTION FATAL WSGO; do sed -i "s/${action}[1-9]/${action}/g" `git ls-files` done Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-21Remove trailing whitespacesPeter Hutterer
Let's clean this up so I don't have to fight vim and git in removing them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-11-01Remove unused uASSERT macroAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2013-11-01Remove unused function entry/exit tracking frameworkAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2013-06-04Protect config.h like usual.Thomas Klausner
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-09Use DEBUG, not DEBUG_ON to determine whether debugging is enabledPeter Hutterer
Nothing else looks at DEBUG_ON. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-11Add missing _X_NORETURN to uFatalErrorJeremy Huddleston
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-11Include strings.h for strcasecmp and string.h for strdupJeremy Huddleston
Our minimum requirement for X11 is currently Unix98. Unix98 provides strcasecmp in <strings.h>. This commit fixes implicit declarations of this function on systems that closely adhere to the standard. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08Replace repeated checks for gcc with _X_ATTRIBUTE_PRINTF from xprotoAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2009-01-21Correct make distcheck and most gcc and sparse warnings.Paulo Cesar Pereira de Andrade
Remaining warnings are due to macros that check address or vectors on the stack and auto generated yacc code. Compiled with default flags and also as: % make CFLAGS=-DENTRY_TRACKING_ON -DDEBUG_ON -DASSERTIONS_ON to ensure the "simplification" of code like: foo.c: <hash>define DEBUG_VAR foo_VAR <hash>include "foo.h" ... foo.h: <hash>ifdef DEBUG_VAR_NOT_LOCAL extern <hash>endif int DEBUG_VAR; ... did not change the author's "intended" logic.
2008-09-11Check for NULL strings before calling strdup.Peter Hutterer
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-09-05Remove #if 0'd typedef that appears nowhere else.Alan Coopersmith
2008-09-05Check for strdup & strcasecmp before assuming we need to provide our ownAlan Coopersmith
2008-08-12Indent fixes.Peter Hutterer
indent -cbi 0 -nprs -nut -npcs -i4 -bli 0 *.c *.h
2008-08-12Remove RCS tags.Peter Hutterer
2007-09-23Fixed a bunch of const correctness bugs.Tilman Sauerbeck
2004-04-23Merging XORG-CURRENT into trunkXORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1XACE-SELINUX-MERGEEgbert Eich
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0Egbert Eich
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich
2003-11-14XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1Kaleb Keithley
2003-11-14R6.6 is the Xorg base-lineXORG-MAINKaleb Keithley