From: Mike Frysinger Date: Mon, 7 Nov 2011 20:26:52 +0000 (-0500) Subject: FcName{,Get}Constant: constify string input X-Git-Tag: root-2~6 X-Git-Url: https://git.wh0rd.org/?p=fontconfig.git;a=commitdiff_plain;h=4d93d3a0d0f5d9b6a0a1cc27cad63f67ce085b3b FcName{,Get}Constant: constify string input These funcs don't modify the incoming string, so add const markings. This is the "right thing", shouldn't change the ABI, and fixes some gcc warnings: fccfg.c: In function 'FcConfigEvaluate': fccfg.c:916:2: warning: passing argument 1 of 'IA__FcNameConstant' discards 'const' qualifier from pointer target type [enabled by default] fcalias.h:253:34: note: expected 'FcChar8 *' but argument is of type 'const FcChar8 *' fcxml.c: In function 'FcTypecheckExpr': fcxml.c:604:2: warning: passing argument 1 of 'IA__FcNameGetConstant' discards 'const' qualifier from pointer target type [enabled by default] fcalias.h:251:37: note: expected 'FcChar8 *' but argument is of type 'const FcChar8 *' Signed-off-by: Mike Frysinger --- diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index db26b97..23ea222 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -739,10 +739,10 @@ FcPublic FcBool FcNameUnregisterConstants (const FcConstant *consts, int nconsts); FcPublic const FcConstant * -FcNameGetConstant (FcChar8 *string); +FcNameGetConstant (const FcChar8 *string); FcPublic FcBool -FcNameConstant (FcChar8 *string, int *result); +FcNameConstant (const FcChar8 *string, int *result); FcPublic FcPattern * FcNameParse (const FcChar8 *name); diff --git a/src/fcname.c b/src/fcname.c index d77eff6..864ad40 100644 --- a/src/fcname.c +++ b/src/fcname.c @@ -511,7 +511,7 @@ FcNameUnregisterConstants (const FcConstant *consts, int nconsts) } const FcConstant * -FcNameGetConstant (FcChar8 *string) +FcNameGetConstant (const FcChar8 *string) { const FcConstantList *l; int i; @@ -526,7 +526,7 @@ FcNameGetConstant (FcChar8 *string) } FcBool -FcNameConstant (FcChar8 *string, int *result) +FcNameConstant (const FcChar8 *string, int *result) { const FcConstant *c;