diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-16 15:23:36 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-16 15:41:07 -0700 |
commit | 746899671c4d6f9d8b7fb25bb17109b331a1b2ed (patch) | |
tree | e9edaabb83c86a6e15dab496ae6978a520dba6a4 | |
parent | 6d526c90729d1b66da6c2546ad3ae794ff0f7751 (diff) |
Delete functions identified as unused by cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | atom.c | 11 | ||||
-rw-r--r-- | bdfint.h | 1 | ||||
-rw-r--r-- | bdfread.c | 19 | ||||
-rw-r--r-- | bufio.c | 14 | ||||
-rw-r--r-- | bufio.h | 1 | ||||
-rw-r--r-- | fntfilio.h | 1 | ||||
-rw-r--r-- | fontmisc.h | 2 | ||||
-rw-r--r-- | private.c | 63 | ||||
-rw-r--r-- | stubs.h | 1 | ||||
-rw-r--r-- | utilbitmap.c | 63 |
10 files changed, 0 insertions, 176 deletions
@@ -213,17 +213,6 @@ MakeAtom(const char *string, unsigned len, int makeit) } #ifdef __SUNPRO_C -#pragma weak ValidAtom -#endif - -weak int -ValidAtom(Atom atom) -{ - OVERRIDE_SYMBOL(ValidAtom, atom); - return (atom != None) && (atom <= lastAtom); -} - -#ifdef __SUNPRO_C #pragma weak NameForAtom #endif @@ -76,7 +76,6 @@ extern Bool bdfSpecialProperty(FontPtr pFont, FontPropPtr prop, char isString, bdfFileState *bdfState); extern int bdfReadFont(FontPtr pFont, FontFilePtr file, int bit, int byte, int glyph, int scan); -extern int bdfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file); extern void FontCharInkMetrics(FontPtr pFont, CharInfoPtr pCI, xCharInfo *pInk); extern void FontCharReshape(FontPtr pFont, CharInfoPtr pSrc, CharInfoPtr pDst); @@ -925,25 +925,6 @@ bdfReadFont(FontPtr pFont, FontFilePtr file, return AllocError; } -int -bdfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file) -{ - FontRec font; - int ret; - - bzero(&font, sizeof(FontRec)); - - ret = bdfReadFont(&font, file, MSBFirst, LSBFirst, 1, 1); - if (ret == Successful) { - *pFontInfo = font.info; - font.info.props = 0; - font.info.isStringProp = 0; - font.info.nprops = 0; - bdfFreeFontBits(&font); - } - return ret; -} - static Bool bdfPadToTerminal(FontPtr pFont) { @@ -170,20 +170,6 @@ BufFileOpenWrite(int fd) } int -BufFileRead(BufFilePtr f, char *b, int n) -{ - int cnt = n; - - while (cnt--) { - int c = BufFileGet(f); - if (c == BUFFILEEOF) - break; - *b++ = c; - } - return n - cnt - 1; -} - -int BufFileWrite(BufFilePtr f, char *b, int n) { int cnt = n; @@ -65,7 +65,6 @@ extern BufFilePtr BufFilePushZIP(BufFilePtr); extern BufFilePtr BufFilePushBZIP2(BufFilePtr); #endif extern int BufFileClose(BufFilePtr, int); -extern int BufFileRead(BufFilePtr, char *, int); extern int BufFileWrite(BufFilePtr, char *, int); #define BufFileGet(f) \ @@ -37,7 +37,6 @@ typedef BufFilePtr FontFilePtr; #define FontFileGetc(f) BufFileGet(f) #define FontFilePutc(c,f) BufFilePut(c,f) -#define FontFileRead(f,b,n) BufFileRead(f,b,n) #define FontFileWrite(f,b,n) BufFileWrite(f,b,n) #define FontFileSkip(f,n) (BufFileSkip (f, n) != BUFFILEEOF) #define FontFileSeek(f,n) (BufFileSeek (f,n,0) != BUFFILEEOF) @@ -53,7 +53,6 @@ in this Software without prior written authorization from The Open Group. #endif extern Atom MakeAtom(const char *string, unsigned len, int makeit); -extern int ValidAtom(Atom atom); extern char *NameForAtom(Atom atom); #define lowbit(x) ((x) & (~(x) + 1)) @@ -64,7 +63,6 @@ extern char *NameForAtom(Atom atom); extern void BitOrderInvert(register unsigned char *, register int); extern void TwoByteSwap(register unsigned char *, register int); extern void FourByteSwap(register unsigned char *, register int); -extern int RepadBitmap(char *, char *, unsigned, unsigned, int, int); extern void CopyISOLatin1Lowered( char * /* dest */, @@ -34,34 +34,6 @@ in this Software without prior written authorization from The Open Group. #include "fontmisc.h" #include <X11/fonts/fontstruct.h> -static int _FontPrivateAllocateIndex = 0; - -int -AllocateFontPrivateIndex(void) -{ - return _FontPrivateAllocateIndex++; -} - -FontPtr -CreateFontRec(void) -{ - FontPtr pFont; - int size; - - size = sizeof(FontRec) + (sizeof(pointer) * _FontPrivateAllocateIndex); - - pFont = malloc(size); - - if (pFont) { - bzero((char *) pFont, size); - pFont->maxPrivate = _FontPrivateAllocateIndex - 1; - if (_FontPrivateAllocateIndex) - pFont->devPrivates = (pointer) (&pFont[1]); - } - - return pFont; -} - void DestroyFontRec(FontPtr pFont) { @@ -69,38 +41,3 @@ DestroyFontRec(FontPtr pFont) free(pFont->devPrivates); free(pFont); } - -void -ResetFontPrivateIndex(void) -{ - _FontPrivateAllocateIndex = 0; -} - -Bool -_FontSetNewPrivate(FontPtr pFont, int n, pointer ptr) -{ - if (n > pFont->maxPrivate) { - pointer *new; - - if (pFont->devPrivates && pFont->devPrivates != (pointer) (&pFont[1])) { - new = realloc(pFont->devPrivates, (n + 1) * sizeof(pointer)); - if (!new) - return FALSE; - } - else { - /* omg realloc */ - new = malloc((n + 1) * sizeof(pointer)); - if (!new) - return FALSE; - if (pFont->devPrivates) - memcpy(new, pFont->devPrivates, - (pFont->maxPrivate + 1) * sizeof(pointer)); - } - pFont->devPrivates = new; - /* zero out new, uninitialized privates */ - while (++pFont->maxPrivate < n) - pFont->devPrivates[pFont->maxPrivate] = (pointer) 0; - } - pFont->devPrivates[n] = ptr; - return TRUE; -} @@ -61,7 +61,6 @@ extern void **__ptr_serverClient; extern int (*__set_font_authorizations)(char **, int *, ClientPtr); extern int (*__StoreFontClientFont)(FontPtr, Font); extern Atom (*__MakeAtom)(const char *, unsigned, int); -extern int (*__ValidAtom)(Atom); extern char *(*__NameForAtom)(Atom); extern unsigned long *__ptr_serverGeneration; extern void (*__register_fpe_functions)(void); diff --git a/utilbitmap.c b/utilbitmap.c index b0c0249..d63c2b6 100644 --- a/utilbitmap.c +++ b/utilbitmap.c @@ -115,66 +115,3 @@ FourByteSwap(unsigned char *buf, int nbytes) buf[2] = c; } } - -/* - * Repad a bitmap - */ - -int -RepadBitmap(char *pSrc, char *pDst, - unsigned int srcPad, unsigned int dstPad, int width, int height) -{ - int srcWidthBytes, dstWidthBytes; - char *pTmpSrc, *pTmpDst; - - switch (srcPad) { - case 1: - srcWidthBytes = (width + 7) >> 3; - break; - case 2: - srcWidthBytes = ((width + 15) >> 4) << 1; - break; - case 4: - srcWidthBytes = ((width + 31) >> 5) << 2; - break; - case 8: - srcWidthBytes = ((width + 63) >> 6) << 3; - break; - default: - return 0; - } - switch (dstPad) { - case 1: - dstWidthBytes = (width + 7) >> 3; - break; - case 2: - dstWidthBytes = ((width + 15) >> 4) << 1; - break; - case 4: - dstWidthBytes = ((width + 31) >> 5) << 2; - break; - case 8: - dstWidthBytes = ((width + 63) >> 6) << 3; - break; - default: - return 0; - } - - width = srcWidthBytes; - if (width > dstWidthBytes) - width = dstWidthBytes; - pTmpSrc = pSrc; - pTmpDst = pDst; - for (int row = 0; row < height; row++) { - int col; - - for (col = 0; col < width; col++) - *pTmpDst++ = *pTmpSrc++; - while (col < dstWidthBytes) { - *pTmpDst++ = '\0'; - col++; - } - pTmpSrc += srcWidthBytes - width; - } - return dstWidthBytes * height; -} |