Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
554a6fa7
Unverified
Commit
554a6fa7
authored
Mar 02, 2017
by
Mihai Moldovan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sunweaver-pr/constify-atom-name-strings' into 3.6.x
Attributes GH PR #363:
https://github.com/ArcticaProject/nx-libs/pull/363
parents
f42d36fb
9c3669c6
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
25 additions
and
26 deletions
+25
-26
security.c
nx-X11/programs/Xserver/Xext/security.c
+1
-1
atom.c
nx-X11/programs/Xserver/dix/atom.c
+6
-7
dispatch.c
nx-X11/programs/Xserver/dix/dispatch.c
+1
-1
Atoms.c
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+6
-6
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+1
-1
Font.c
nx-X11/programs/Xserver/hw/nxagent/Font.c
+3
-3
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+3
-3
dix.h
nx-X11/programs/Xserver/include/dix.h
+1
-1
xkb.c
nx-X11/programs/Xserver/xkb/xkb.c
+1
-1
xkbtext.c
nx-X11/programs/Xserver/xkb/xkbtext.c
+2
-2
No files found.
nx-X11/programs/Xserver/Xext/security.c
View file @
554a6fa7
...
...
@@ -1066,7 +1066,7 @@ SecurityAuditResourceIDAccess(
xChangePropertyReq
*
req
=
(
xChangePropertyReq
*
)
client
->
requestBuffer
;
int
propertyatom
=
req
->
property
;
char
*
propertyname
=
NameForAtom
(
propertyatom
);
c
onst
c
har
*
propertyname
=
NameForAtom
(
propertyatom
);
SecurityAudit
(
"client %d attempted request %d with window 0x%x property %s of client %d
\n
"
,
client
->
index
,
reqtype
,
id
,
propertyname
,
cid
);
...
...
nx-X11/programs/Xserver/dix/atom.c
View file @
554a6fa7
...
...
@@ -62,7 +62,7 @@ typedef struct _Node {
struct
_Node
*
left
,
*
right
;
Atom
a
;
unsigned
int
fingerPrint
;
char
*
string
;
c
onst
c
har
*
string
;
}
NodeRec
,
*
NodePtr
;
static
Atom
lastAtom
=
None
;
...
...
@@ -116,13 +116,11 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
}
else
{
nd
->
string
=
(
char
*
)
malloc
(
len
+
1
);
nd
->
string
=
strndup
(
string
,
len
);
if
(
!
nd
->
string
)
{
free
(
nd
);
return
BAD_RESOURCE
;
}
strncpy
(
nd
->
string
,
string
,
(
int
)
len
);
nd
->
string
[
len
]
=
0
;
}
if
((
lastAtom
+
1
)
>=
tableLength
)
{
NodePtr
*
table
;
...
...
@@ -131,7 +129,8 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
tableLength
*
(
2
*
sizeof
(
NodePtr
)));
if
(
!
table
)
{
if
(
nd
->
string
!=
string
)
free
(
nd
->
string
);
/* nd->string has been strdup'ed */
free
((
char
*
)
nd
->
string
);
free
(
nd
);
return
BAD_RESOURCE
;
}
...
...
@@ -155,7 +154,7 @@ ValidAtom(Atom atom)
return
(
atom
!=
None
)
&&
(
atom
<=
lastAtom
);
}
char
*
c
onst
c
har
*
NameForAtom
(
Atom
atom
)
{
NodePtr
node
;
...
...
@@ -178,7 +177,7 @@ FreeAtom(NodePtr patom)
if
(
patom
->
right
)
FreeAtom
(
patom
->
right
);
if
(
patom
->
a
>
XA_LAST_PREDEFINED
)
free
(
patom
->
string
);
free
(
(
char
*
)
patom
->
string
);
free
(
patom
);
}
...
...
nx-X11/programs/Xserver/dix/dispatch.c
View file @
554a6fa7
...
...
@@ -886,7 +886,7 @@ ProcInternAtom(register ClientPtr client)
int
ProcGetAtomName
(
register
ClientPtr
client
)
{
char
*
str
;
c
onst
c
har
*
str
;
xGetAtomNameReply
reply
;
int
len
;
REQUEST
(
xResourceReq
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
View file @
554a6fa7
...
...
@@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen)
typedef
struct
{
Atom
local
;
Atom
remote
;
char
*
string
;
c
onst
c
har
*
string
;
int
length
;
}
AtomMap
;
...
...
@@ -345,7 +345,7 @@ static unsigned int privAtomMapSize = 0;
static
unsigned
int
privLastAtom
=
0
;
static
void
nxagentExpandCache
(
void
);
static
void
nxagentWriteAtom
(
Atom
,
Atom
,
char
*
,
Bool
);
static
void
nxagentWriteAtom
(
Atom
,
Atom
,
c
onst
c
har
*
,
Bool
);
static
AtomMap
*
nxagentFindAtomByRemoteValue
(
Atom
);
static
AtomMap
*
nxagentFindAtomByLocalValue
(
Atom
);
static
AtomMap
*
nxagentFindAtomByName
(
char
*
,
unsigned
);
...
...
@@ -368,9 +368,9 @@ static void nxagentExpandCache(void)
* then cache the atom-couple.
*/
static
void
nxagentWriteAtom
(
Atom
local
,
Atom
remote
,
char
*
string
,
Bool
duplicate
)
static
void
nxagentWriteAtom
(
Atom
local
,
Atom
remote
,
c
onst
c
har
*
string
,
Bool
duplicate
)
{
char
*
s
;
c
onst
c
har
*
s
;
/*
* We could remove this string duplication if
...
...
@@ -460,7 +460,7 @@ static int nxagentInitAtomMap(char **atomNameList, int count, Atom *atomsRet)
for
(
i
=
0
;
i
<
privLastAtom
;
i
++
)
{
name_list
[
count
+
i
]
=
privAtomMap
[
i
].
string
;
name_list
[
count
+
i
]
=
(
char
*
)
privAtomMap
[
i
].
string
;
atom_list
[
count
+
i
]
=
None
;
}
...
...
@@ -670,7 +670,7 @@ Atom nxagentMakeAtom(char *string, unsigned int length, Bool Makeit)
Atom
nxagentLocalToRemoteAtom
(
Atom
local
)
{
AtomMap
*
current
;
char
*
string
;
c
onst
c
har
*
string
;
Atom
remote
;
if
(
!
ValidAtom
(
local
))
...
...
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
554a6fa7
...
...
@@ -1164,7 +1164,7 @@ FIXME: Why this pointer can be not a valid
int
nxagentConvertSelection
(
ClientPtr
client
,
WindowPtr
pWin
,
Atom
selection
,
Window
requestor
,
Atom
property
,
Atom
target
,
Time
time
)
{
char
*
strTarget
;
c
onst
c
har
*
strTarget
;
int
i
;
if
(
agentClipboardStatus
!=
1
||
...
...
nx-X11/programs/Xserver/hw/nxagent/Font.c
View file @
554a6fa7
...
...
@@ -491,7 +491,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
int
nprops
;
FontPropPtr
props
;
int
i
;
char
*
name
;
c
onst
c
har
*
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
)
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
554a6fa7
...
...
@@ -455,7 +455,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
unsigned
long
nUnits
;
void
*
value
;
{
char
*
propertyS
,
*
typeS
;
c
onst
c
har
*
propertyS
,
*
typeS
;
Atom
propertyX
,
typeX
;
char
*
output
=
NULL
;
nxagentWMHints
wmHints
;
...
...
@@ -634,7 +634,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
{
XlibAtom
*
atoms
=
malloc
(
nUnits
*
sizeof
(
*
atoms
));
Atom
*
input
=
value
;
char
*
atomName
=
NULL
;
c
onst
c
har
*
atomName
=
NULL
;
int
i
;
int
j
=
0
;
...
...
@@ -834,7 +834,7 @@ void nxagentImportProperty(Window window,
WMState
wmState
;
char
*
output
=
NULL
;
char
*
typeS
;
c
onst
c
har
*
typeS
;
pWin
=
nxagentWindowPtr
(
window
);
...
...
nx-X11/programs/Xserver/include/dix.h
View file @
554a6fa7
...
...
@@ -480,7 +480,7 @@ extern Atom MakeAtom(
extern
Bool
ValidAtom
(
Atom
/*atom*/
);
extern
char
*
NameForAtom
(
extern
c
onst
c
har
*
NameForAtom
(
Atom
/*atom*/
);
extern
void
AtomError
(
void
);
...
...
nx-X11/programs/Xserver/xkb/xkb.c
View file @
554a6fa7
...
...
@@ -3529,7 +3529,7 @@ register int i,bit;
static
Bool
_XkbCheckTypeName
(
Atom
name
,
int
typeNdx
)
{
char
*
str
;
c
onst
c
har
*
str
;
str
=
NameForAtom
(
name
);
if
((
strcmp
(
str
,
"ONE_LEVEL"
)
==
0
)
||
(
strcmp
(
str
,
"TWO_LEVEL"
)
==
0
)
||
...
...
nx-X11/programs/Xserver/xkb/xkbtext.c
View file @
554a6fa7
...
...
@@ -75,7 +75,7 @@ XkbAtomText(Display *dpy,Atom atm,unsigned format)
{
char
*
rtrn
,
*
tmp
;
tmp
=
XkbAtomGetString
(
dpy
,
atm
);
tmp
=
(
char
*
)
XkbAtomGetString
(
dpy
,
atm
);
if
(
tmp
!=
NULL
)
{
int
len
;
len
=
strlen
(
tmp
)
+
1
;
...
...
@@ -118,7 +118,7 @@ char numBuf[20];
if
(
ndx
>=
XkbNumVirtualMods
)
tmp
=
"illegal"
;
else
if
(
vmodNames
&&
(
vmodNames
[
ndx
]
!=
None
))
tmp
=
XkbAtomGetString
(
dpy
,
vmodNames
[
ndx
]);
tmp
=
(
char
*
)
XkbAtomGetString
(
dpy
,
vmodNames
[
ndx
]);
if
(
tmp
==
NULL
)
sprintf
(
tmp
=
numBuf
,
"%d"
,
ndx
);
...
...
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