summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-09-16 15:23:36 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-09-16 15:41:07 -0700
commit746899671c4d6f9d8b7fb25bb17109b331a1b2ed (patch)
treee9edaabb83c86a6e15dab496ae6978a520dba6a4
parent6d526c90729d1b66da6c2546ad3ae794ff0f7751 (diff)
Delete functions identified as unused by cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--atom.c11
-rw-r--r--bdfint.h1
-rw-r--r--bdfread.c19
-rw-r--r--bufio.c14
-rw-r--r--bufio.h1
-rw-r--r--fntfilio.h1
-rw-r--r--fontmisc.h2
-rw-r--r--private.c63
-rw-r--r--stubs.h1
-rw-r--r--utilbitmap.c63
10 files changed, 0 insertions, 176 deletions
diff --git a/atom.c b/atom.c
index e37f322..4d2de11 100644
--- a/atom.c
+++ b/atom.c
@@ -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
diff --git a/bdfint.h b/bdfint.h
index f70c114..f4ac19d 100644
--- a/bdfint.h
+++ b/bdfint.h
@@ -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);
diff --git a/bdfread.c b/bdfread.c
index 3e5517f..c8c2ec9 100644
--- a/bdfread.c
+++ b/bdfread.c
@@ -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)
{
diff --git a/bufio.c b/bufio.c
index e0e74b5..c765706 100644
--- a/bufio.c
+++ b/bufio.c
@@ -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;
diff --git a/bufio.h b/bufio.h
index 4385d74..e65bc09 100644
--- a/bufio.h
+++ b/bufio.h
@@ -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) \
diff --git a/fntfilio.h b/fntfilio.h
index 0eb7693..97f2a62 100644
--- a/fntfilio.h
+++ b/fntfilio.h
@@ -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)
diff --git a/fontmisc.h b/fontmisc.h
index 9223889..cb1e831 100644
--- a/fontmisc.h
+++ b/fontmisc.h
@@ -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 */,
diff --git a/private.c b/private.c
index ef72740..957cc0f 100644
--- a/private.c
+++ b/private.c
@@ -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;
-}
diff --git a/stubs.h b/stubs.h
index 50d2dca..e88e459 100644
--- a/stubs.h
+++ b/stubs.h
@@ -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;
-}