Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Ben Wagner
fontconfig
Commits
3a45b8ef
Commit
3a45b8ef
authored
Nov 30, 2018
by
Akira TAGOH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
covscan: fix compiler warnings
parent
c44fda28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
test/test-bz106632.c
test/test-bz106632.c
+13
-13
test/test-hash.c
test/test-hash.c
+2
-3
No files found.
test/test-bz106632.c
View file @
3a45b8ef
...
...
@@ -158,11 +158,11 @@ unlink_dirs (const char *dir)
int
main
(
void
)
{
FcChar8
*
fontdir
=
NULL
,
*
cachedir
=
NULL
,
*
fontname
;
FcChar8
*
fontdir
=
NULL
,
*
cachedir
=
NULL
;
char
*
basedir
,
template
[
512
]
=
"/tmp/bz106632-XXXXXX"
;
char
cmd
[
512
];
FcConfig
*
config
;
const
FcChar8
*
tconf
=
"<fontconfig>
\n
"
const
FcChar8
*
tconf
=
(
const
FcChar8
*
)
"<fontconfig>
\n
"
" <dir>%s</dir>
\n
"
" <cachedir>%s</cachedir>
\n
"
"</fontconfig>
\n
"
;
...
...
@@ -178,21 +178,21 @@ main (void)
fprintf
(
stderr
,
"%s: %s
\n
"
,
template
,
strerror
(
errno
));
goto
bail
;
}
fontdir
=
FcStrBuildFilename
(
basedir
,
"fonts"
,
NULL
);
cachedir
=
FcStrBuildFilename
(
basedir
,
"cache"
,
NULL
);
fontdir
=
FcStrBuildFilename
(
(
const
FcChar8
*
)
basedir
,
(
const
FcChar8
*
)
"fonts"
,
NULL
);
cachedir
=
FcStrBuildFilename
(
(
const
FcChar8
*
)
basedir
,
(
const
FcChar8
*
)
"cache"
,
NULL
);
fprintf
(
stderr
,
"D: Creating %s
\n
"
,
fontdir
);
mkdir_p
(
fontdir
);
mkdir_p
(
(
const
char
*
)
fontdir
);
fprintf
(
stderr
,
"D: Creating %s
\n
"
,
cachedir
);
mkdir_p
(
cachedir
);
mkdir_p
(
(
const
char
*
)
cachedir
);
fprintf
(
stderr
,
"D: Copying %s to %s
\n
"
,
FONTFILE
,
fontdir
);
snprintf
(
cmd
,
512
,
"cp -a %s %s"
,
FONTFILE
,
fontdir
);
system
(
cmd
);
(
void
)
system
(
cmd
);
fprintf
(
stderr
,
"D: Loading a config
\n
"
);
snprintf
(
conf
,
1024
,
tconf
,
fontdir
,
cachedir
);
snprintf
(
conf
,
1024
,
(
const
char
*
)
tconf
,
fontdir
,
cachedir
);
config
=
FcConfigCreate
();
if
(
!
FcConfigParseAndLoadFromMemory
(
config
,
conf
,
FcTrue
))
if
(
!
FcConfigParseAndLoadFromMemory
(
config
,
(
const
FcChar8
*
)
conf
,
FcTrue
))
{
printf
(
"E: Unable to load config
\n
"
);
ret
=
1
;
...
...
@@ -216,7 +216,7 @@ main (void)
}
fprintf
(
stderr
,
"D: Removing %s
\n
"
,
fontdir
);
snprintf
(
cmd
,
512
,
"rm -f %s%s*; sleep 1"
,
fontdir
,
FC_DIR_SEPARATOR_S
);
system
(
cmd
);
(
void
)
system
(
cmd
);
fprintf
(
stderr
,
"D: Reinitializing
\n
"
);
if
(
!
FcConfigUptoDate
(
config
)
||
!
FcInitReinitialize
())
{
...
...
@@ -231,7 +231,7 @@ main (void)
goto
bail
;
}
config
=
FcConfigCreate
();
if
(
!
FcConfigParseAndLoadFromMemory
(
config
,
conf
,
FcTrue
))
if
(
!
FcConfigParseAndLoadFromMemory
(
config
,
(
const
FcChar8
*
)
conf
,
FcTrue
))
{
printf
(
"E: Unable to load config again
\n
"
);
ret
=
4
;
...
...
@@ -255,7 +255,7 @@ main (void)
}
fprintf
(
stderr
,
"D: Copying %s to %s
\n
"
,
FONTFILE
,
fontdir
);
snprintf
(
cmd
,
512
,
"cp -a %s %s; sleep 1"
,
FONTFILE
,
fontdir
);
system
(
cmd
);
(
void
)
system
(
cmd
);
fprintf
(
stderr
,
"D: Reinitializing
\n
"
);
if
(
!
FcConfigUptoDate
(
config
)
||
!
FcInitReinitialize
())
{
...
...
@@ -270,7 +270,7 @@ main (void)
goto
bail
;
}
config
=
FcConfigCreate
();
if
(
!
FcConfigParseAndLoadFromMemory
(
config
,
conf
,
FcTrue
))
if
(
!
FcConfigParseAndLoadFromMemory
(
config
,
(
const
FcChar8
*
)
conf
,
FcTrue
))
{
printf
(
"E: Unable to load config again
\n
"
);
ret
=
4
;
...
...
test/test-hash.c
View file @
3a45b8ef
...
...
@@ -45,7 +45,7 @@ fini (Test *test)
}
static
FcBool
test_add
(
Test
*
test
,
FcC
har
8
*
key
,
FcBool
replace
)
test_add
(
Test
*
test
,
c
har
*
key
,
FcBool
replace
)
{
uuid_t
uuid
;
void
*
u
;
...
...
@@ -68,7 +68,7 @@ test_add (Test *test, FcChar8 *key, FcBool replace)
}
static
FcBool
test_remove
(
Test
*
test
,
FcC
har
8
*
key
)
test_remove
(
Test
*
test
,
c
har
*
key
)
{
void
*
u
;
...
...
@@ -87,7 +87,6 @@ int
main
(
void
)
{
Test
*
test
;
uuid_t
uuid
;
int
ret
=
0
;
test
=
init
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment