diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-01-03 20:50:32 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-01-08 17:46:29 -0800 |
commit | 37772516acb95b3c9934252994b7dfdc147dfd23 (patch) | |
tree | 0f433bebf0e2c1e70158f2633a9aa1cc76c7d83d | |
parent | ac1eb6e3ea54724cf3ab3ad1ccf0595df9e34786 (diff) |
Remove unused internal helper _FSAllocScratch
Since we build with -export-symbols-regex '^FS.*', it wasn't available
to callers outside libFS, and was never called by anything inside libFS.
Seems to have been imported from XlibInt.c without ever being used.
The _FSserver fields that it used (and nothing else did) are replaced
with "unused" placeholders to maintain struct layout/size.
Flagged by cppcheck 1.62:
[FSlibInt.c:973]: (style) The function '_FSAllocScratch' is never used.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
-rw-r--r-- | include/X11/fonts/FSlib.h | 4 | ||||
-rw-r--r-- | src/FSlibInt.c | 19 | ||||
-rw-r--r-- | src/FSlibint.h | 1 |
3 files changed, 2 insertions, 22 deletions
diff --git a/include/X11/fonts/FSlib.h b/include/X11/fonts/FSlib.h index 11b3ba6..1cd7f13 100644 --- a/include/X11/fonts/FSlib.h +++ b/include/X11/fonts/FSlib.h @@ -148,8 +148,8 @@ struct _FSServer { int ext_number; Bool (*event_vec[132]) (FSServer *, FSEvent *, fsEvent *); Status (*wire_vec[132]) (FSServer *, FSEvent *, fsEvent *); - char *scratch_buffer; - unsigned long scratch_length; + void *unused_1; /* previously scratch_buffer */ + unsigned long unused_2; /* previously scratch_length */ FSSyncHandler synchandler; unsigned long flags; struct _XtransConnInfo *trans_conn; /* transport connection object */ diff --git a/src/FSlibInt.c b/src/FSlibInt.c index cd996d1..48091cf 100644 --- a/src/FSlibInt.c +++ b/src/FSlibInt.c @@ -964,25 +964,6 @@ _FSDefaultError( FSIOErrorHandler _FSIOErrorFunction = _FSDefaultIOError; FSErrorHandler _FSErrorFunction = _FSDefaultError; -/* - * This routine can be used to (cheaply) get some memory within a single - * Xlib routine for scratch space. It is reallocated from the same place - * each time, unless the library needs a large scratch space. - */ -char * -_FSAllocScratch( - register FSServer *svr, - unsigned long nbytes) -{ - if (nbytes > svr->scratch_length) { - if (svr->scratch_buffer != NULL) - FSfree(svr->scratch_buffer); - return (svr->scratch_length = nbytes, - svr->scratch_buffer = FSmalloc(nbytes)); - } - return (svr->scratch_buffer); -} - int FSFree(char *data) { diff --git a/src/FSlibint.h b/src/FSlibint.h index 7669778..b50509b 100644 --- a/src/FSlibint.h +++ b/src/FSlibint.h @@ -93,7 +93,6 @@ extern int _FSDefaultIOError ( FSServer *svr ) _X_NORETURN; extern int _FSPrintDefaultError ( FSServer *svr, FSErrorEvent *event, FILE *fp ); extern int _FSDefaultError ( FSServer *svr, FSErrorEvent *event ); -extern char * _FSAllocScratch ( FSServer *svr, unsigned long nbytes ); extern void _FSFreeQ ( void ); extern FSErrorHandler FSSetErrorHandler ( FSErrorHandler handler ); |