summaryrefslogtreecommitdiff
path: root/fc-list
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-11-07 15:33:12 -0500
committerMike Frysinger <vapier@gentoo.org>2012-02-21 14:15:58 -0500
commit01c833379e19d8f8752ac7cec15b179c71242e2c (patch)
treeb2edfa877e390e5b8ebc1197bab671c6afd8562c /fc-list
parent123d344f4590c45c5ccced8c46d157edb2b9efd2 (diff)
fc-{list,match}: constify format string
We don't free this string anywhere, so mark it const to avoid gcc warnings and possible bugs in the future (if people did try freeing it). fc-list.c: In function 'main': fc-list.c:161:16: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] fc-match.c: In function 'main': fc-match.c:201:13: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] fc-match.c:203:13: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'fc-list')
-rw-r--r--fc-list/fc-list.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fc-list/fc-list.c b/fc-list/fc-list.c
index ad383328..0149b0c5 100644
--- a/fc-list/fc-list.c
+++ b/fc-list/fc-list.c
@@ -94,16 +94,16 @@ usage (char *program, int error)
int
main (int argc, char **argv)
{
- int verbose = 0;
- int quiet = 0;
- FcChar8 *format = NULL;
- int nfont = 0;
- int i;
- FcObjectSet *os = 0;
- FcFontSet *fs;
- FcPattern *pat;
+ int verbose = 0;
+ int quiet = 0;
+ const FcChar8 *format = NULL;
+ int nfont = 0;
+ int i;
+ FcObjectSet *os = 0;
+ FcFontSet *fs;
+ FcPattern *pat;
#if HAVE_GETOPT_LONG || HAVE_GETOPT
- int c;
+ int c;
#if HAVE_GETOPT_LONG
while ((c = getopt_long (argc, argv, "vf:qVh", longopts, NULL)) != -1)
@@ -158,7 +158,7 @@ main (int argc, char **argv)
if (!verbose && !format && !os)
os = FcObjectSetBuild (FC_FAMILY, FC_STYLE, FC_FILE, (char *) 0);
if (!format)
- format = "%{=fclist}\n";
+ format = (const FcChar8 *) "%{=fclist}\n";
fs = FcFontList (0, pat, os);
if (os)
FcObjectSetDestroy (os);