Fix unused-parameter warnings
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 30 Dec 2012 03:32:56 +0000 (22:32 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Sun, 30 Dec 2012 03:32:56 +0000 (22:32 -0500)
src/fcarch.c
src/fccache.c
src/fccfg.c
src/fccharset.c
src/fcdir.c
src/fcformat.c
src/fcint.h
src/fcmatch.c
src/fcxml.c

index 44548fc..8e6a8c4 100644 (file)
@@ -66,7 +66,7 @@ FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
 
 
 int
-main (int argc, char **argv)
+main (int argc FC_UNUSED, char **argv FC_UNUSED)
 {
     printf ("%s\n", FC_ARCHITECTURE);
     return 0;
index 81985df..3828b61 100644 (file)
@@ -666,7 +666,7 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
  * the magic number and the size field
  */
 static FcBool
-FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure)
+FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure FC_UNUSED)
 {
     FcBool  ret = FcTrue;
     FcCache    c;
index 038c010..f53be26 100644 (file)
@@ -510,7 +510,7 @@ FcConfigGetConfigFiles (FcConfig    *config)
 }
 
 FcChar8 *
-FcConfigGetCache (FcConfig  *config)
+FcConfigGetCache (FcConfig  *config FC_UNUSED)
 {
     return NULL;
 }
index 8c1d858..61489c4 100644 (file)
@@ -1190,7 +1190,7 @@ FcCharSetFreezeOrig (FcCharSetFreezer *freezer, const FcCharSet *orig, const FcC
 }
 
 static FcCharSet *
-FcCharSetFreezeBase (FcCharSetFreezer *freezer, FcCharSet *fcs, const FcCharSet *orig)
+FcCharSetFreezeBase (FcCharSetFreezer *freezer, FcCharSet *fcs)
 {
     FcChar32           hash = FcCharSetHash (fcs);
     FcCharSetEnt       **bucket = &freezer->set_hash_table[hash % FC_CHAR_SET_HASH_SIZE];
@@ -1289,7 +1289,7 @@ FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs)
        if (!FcCharSetInsertLeaf (b, FcCharSetNumbers(fcs)[i] << 8, l))
            goto bail1;
     }
-    n = FcCharSetFreezeBase (freezer, b, fcs);
+    n = FcCharSetFreezeBase (freezer, b);
     if (!FcCharSetFreezeOrig (freezer, fcs, n))
     {
        n = NULL;
index 6869ea1..dc580bb 100644 (file)
@@ -126,10 +126,10 @@ FcFileScanConfig (FcFontSet       *set,
 FcBool
 FcFileScan (FcFontSet      *set,
            FcStrSet        *dirs,
-           FcFileCache     *cache, /* XXX unused */
+           FcFileCache     *cache FC_UNUSED,
            FcBlanks        *blanks,
            const FcChar8   *file,
-           FcBool          force)
+           FcBool          force FC_UNUSED)
 {
     return FcFileScanConfig (set, dirs, blanks, file, FcConfigGetCurrent ());
 }
@@ -316,7 +316,7 @@ FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config)
 }
 
 FcBool
-FcDirSave (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir)
+FcDirSave (FcFontSet *set FC_UNUSED, FcStrSet * dirs FC_UNUSED, const FcChar8 *dir FC_UNUSED)
 {
     return FcFalse; /* XXX deprecated */
 }
index 72bf180..a4c72ae 100644 (file)
@@ -790,7 +790,7 @@ interpret_simple (FcFormatContext *c,
 }
 
 static FcBool
-cescape (FcFormatContext *c,
+cescape (FcFormatContext *c FC_UNUSED,
         const FcChar8   *str,
         FcStrBuf        *buf)
 {
@@ -811,7 +811,7 @@ cescape (FcFormatContext *c,
 }
 
 static FcBool
-shescape (FcFormatContext *c,
+shescape (FcFormatContext *c FC_UNUSED,
          const FcChar8   *str,
          FcStrBuf        *buf)
 {
@@ -829,7 +829,7 @@ shescape (FcFormatContext *c,
 }
 
 static FcBool
-xmlescape (FcFormatContext *c,
+xmlescape (FcFormatContext *c FC_UNUSED,
           const FcChar8   *str,
           FcStrBuf        *buf)
 {
index 9dc1aa7..2cb7805 100644 (file)
@@ -69,6 +69,12 @@ extern pfnSHGetFolderPathA pSHGetFolderPathA;
 #  define FC_DIR_SEPARATOR_S       "/"
 #endif
 
+#if __GNUC__ >= 4
+#define FC_UNUSED      __attribute__((unused))
+#else
+#define FC_UNUSED
+#endif
+
 #define FC_DBG_MATCH   1
 #define FC_DBG_MATCHV  2
 #define FC_DBG_EDIT    4
index caa8588..ed245c6 100644 (file)
@@ -563,8 +563,7 @@ FcFontRenderPrepare (FcConfig           *config,
 }
 
 static FcPattern *
-FcFontSetMatchInternal (FcConfig    *config,
-                       FcFontSet   **sets,
+FcFontSetMatchInternal (FcFontSet   **sets,
                        int         nsets,
                        FcPattern   *p,
                        FcResult    *result)
@@ -658,7 +657,7 @@ FcFontSetMatch (FcConfig    *config,
        if (!config)
            return 0;
     }
-    best = FcFontSetMatchInternal (config, sets, nsets, p, result);
+    best = FcFontSetMatchInternal (sets, nsets, p, result);
     if (best)
        return FcFontRenderPrepare (config, p, best);
     else
@@ -691,7 +690,7 @@ FcFontMatch (FcConfig       *config,
     if (config->fonts[FcSetApplication])
        sets[nsets++] = config->fonts[FcSetApplication];
 
-    best = FcFontSetMatchInternal (config, sets, nsets, p, result);
+    best = FcFontSetMatchInternal (sets, nsets, p, result);
     if (best)
        return FcFontRenderPrepare (config, p, best);
     else
@@ -794,7 +793,7 @@ FcFontSetSortDestroy (FcFontSet *fs)
 }
 
 FcFontSet *
-FcFontSetSort (FcConfig            *config,
+FcFontSetSort (FcConfig            *config FC_UNUSED,
               FcFontSet    **sets,
               int          nsets,
               FcPattern    *p,
index 34b4b36..cc62558 100644 (file)
@@ -2541,7 +2541,7 @@ FcParsePattern (FcConfigParse *parse)
 }
 
 static void
-FcEndElement(void *userData, const XML_Char *name)
+FcEndElement(void *userData, const XML_Char *name FC_UNUSED)
 {
     FcConfigParse   *parse = userData;
     FcChar8        *data;
@@ -2733,9 +2733,9 @@ FcCharacterData (void *userData, const XML_Char *s, int len)
 static void
 FcStartDoctypeDecl (void           *userData,
                    const XML_Char  *doctypeName,
-                   const XML_Char  *sysid,
-                   const XML_Char  *pubid,
-                   int             has_internal_subset)
+                   const XML_Char  *sysid FC_UNUSED,
+                   const XML_Char  *pubid FC_UNUSED,
+                   int             has_internal_subset FC_UNUSED)
 {
     FcConfigParse   *parse = userData;
 
@@ -2766,7 +2766,7 @@ FcExternalSubsetDecl (void            *userData,
 #else /* ENABLE_LIBXML2 */
 
 static void
-FcEndDoctypeDecl (void *userData)
+FcEndDoctypeDecl (void *userData FC_UNUSED)
 {
 }