diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-02-27 13:52:29 +0000 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-03-02 10:49:15 +0100 |
commit | 9c3669c6b7ff19013b3684bb74d98ec3d121e329 (patch) | |
tree | f59b0c8ddd14dc414c952710b2010477107cde06 /nx-X11/programs/Xserver/hw/nxagent/Font.c | |
parent | f42d36fb73e096113a948a04279b752689f157bc (diff) | |
download | nx-libs-9c3669c6b7ff19013b3684bb74d98ec3d121e329.tar.gz nx-libs-9c3669c6b7ff19013b3684bb74d98ec3d121e329.tar.bz2 nx-libs-9c3669c6b7ff19013b3684bb74d98ec3d121e329.zip |
Xserver/dix/atom.c (et al.): Constify atom name strings.
Inspired by X.org commits:
commit 08093c25a91c07ab8af7cece9bba738b827cfd1b
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Oct 24 23:16:30 2011 -0700
Convert some malloc + strncpy pairs into strndup calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
commit 816b79dd061e9839cec94a4986a7820b70ca8a7f
Author: Mikhail Gusarov <dottedmag@dottedmag.net>
Date: Thu May 13 03:45:21 2010 +0700
Remove useless casts
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
This PR ships a tiny change in MakeAtom, that we adopted.
We did not adopt the full commit.
commit 5623c27700b7b23a8dbbd8c8f45e5d4fa0c667e3
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Mon Feb 2 19:25:14 2009 -0800
Constify atom name strings
Changes MakeAtom to take a const char * and NameForAtom to return them,
since many callers pass pointers to constant strings stored in read-only
ELF sections. Updates in-tree callers as necessary to clear const
mismatch warnings introduced by this change.
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Backported-to-NX-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Font.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Font.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index c9b9e3f75..97a90e176 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -491,7 +491,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) int nprops; FontPropPtr props; int i; - char *name; + const char *name; char *origName = (char*) pScreen; FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL); @@ -513,7 +513,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) if (!value_atom) return False; - name = (char *)NameForAtom(value_atom); + name = NameForAtom(value_atom); #ifdef NXAGENT_FONTCACHE_DEBUG fprintf(stderr, "Font: nxagentRealizeFont, realizing font: %s\n", validateString(name)); @@ -602,7 +602,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) nxagentListRemoteFonts("*", nxagentMaxFontNames); } - nxagentFontPriv(pFont)->font_struct = nxagentLoadQueryFont(nxagentDisplay, name, pFont); + nxagentFontPriv(pFont)->font_struct = nxagentLoadQueryFont(nxagentDisplay, (char *)name, pFont); strcpy(nxagentFontPriv(pFont)->fontName, name); if (nxagentFontPriv(pFont)->font_struct != NULL) { |