[PATCH 01/16] xf86bigfont: Silence compiler warning by initializing pDesc.

Alex Deucher alexdeucher at gmail.com
Tue May 25 22:15:32 PDT 2010


On Tue, May 25, 2010 at 7:53 PM, Jamey Sharp <jamey at minilop.net> wrote:
> Access to pDesc was always guarded by (nCharInfos > 0), so the code
> wasn't actually buggy, but this makes it clear that it's correct.
>
> Signed-off-by: Jamey Sharp <jamey at minilop.net>
> ---
>  Xext/xf86bigfont.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
> index 8c4a7eb..8b3913d 100644
> --- a/Xext/xf86bigfont.c
> +++ b/Xext/xf86bigfont.c
> @@ -404,7 +404,7 @@ ProcXF86BigfontQueryFont(
>     int nCharInfos;
>     int shmid;
>  #ifdef HAS_SHM
> -    ShmDescPtr pDesc;
> +    ShmDescPtr pDesc = NULL;
>  #else
>  #define pDesc 0
>  #endif
> @@ -449,8 +449,6 @@ ProcXF86BigfontQueryFont(
>  #ifdef HAS_SHM
>        if (!badSysCall)
>            pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
> -       else
> -           pDesc = NULL;
>        if (pDesc) {
>            pCI = (xCharInfo *) pDesc->attach_addr;
>            if (stuff_flags & XF86Bigfont_FLAGS_Shm)
> --
> 1.7.0

Reviewed-by: Alex Deucher <alexdeucher at gmail.com>


More information about the xorg-devel mailing list