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
3cabdfa2
Commit
3cabdfa2
authored
Jan 30, 2021
by
Ulrich Sibiller
Committed by
Mike Gabriel
Feb 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NXproperty.c: simplify and reformat GetWindowProperty()
parent
513418ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
NXproperty.c
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+8
-10
No files found.
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
View file @
3cabdfa2
...
@@ -466,9 +466,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
...
@@ -466,9 +466,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
unsigned
long
*
bytesAfter
;
unsigned
long
*
bytesAfter
;
unsigned
char
**
propData
;
unsigned
char
**
propData
;
{
{
PropertyPtr
pProp
,
prevProp
;
unsigned
long
n
,
len
,
ind
;
if
(
!
pWin
)
if
(
!
pWin
)
{
{
#ifdef DEBUG
#ifdef DEBUG
...
@@ -484,6 +481,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
...
@@ -484,6 +481,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
#endif
#endif
return
BadAtom
;
return
BadAtom
;
}
}
if
((
type
!=
AnyPropertyType
)
&&
!
ValidAtom
(
type
))
if
((
type
!=
AnyPropertyType
)
&&
!
ValidAtom
(
type
))
{
{
#ifdef DEBUG
#ifdef DEBUG
...
@@ -492,8 +490,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
...
@@ -492,8 +490,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return
BadAtom
;
return
BadAtom
;
}
}
pProp
=
wUserProps
(
pWin
);
PropertyPtr
pProp
=
wUserProps
(
pWin
);
prevProp
=
(
PropertyPtr
)
NULL
;
PropertyPtr
prevProp
=
(
PropertyPtr
)
NULL
;
while
(
pProp
)
while
(
pProp
)
{
{
...
@@ -522,14 +520,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
...
@@ -522,14 +520,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
*
format
=
pProp
->
format
;
*
format
=
pProp
->
format
;
*
nItems
=
0
;
*
nItems
=
0
;
*
actualType
=
pProp
->
type
;
*
actualType
=
pProp
->
type
;
return
(
Success
)
;
return
Success
;
}
}
/*
/*
* Return type, format, value to client
* Return type, format, value to client
*/
*/
n
=
(
pProp
->
format
/
8
)
*
pProp
->
size
;
/* size (bytes) of prop */
unsigned
long
n
=
(
pProp
->
format
/
8
)
*
pProp
->
size
;
/* size (bytes) of prop */
ind
=
longOffset
<<
2
;
unsigned
long
ind
=
longOffset
<<
2
;
/* If longOffset is invalid such that it causes "len" to
/* If longOffset is invalid such that it causes "len" to
be negative, it's a value error. */
be negative, it's a value error. */
...
@@ -542,7 +540,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
...
@@ -542,7 +540,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return
BadValue
;
return
BadValue
;
}
}
len
=
min
(
n
-
ind
,
4
*
longLength
);
unsigned
long
len
=
min
(
n
-
ind
,
4
*
longLength
);
*
bytesAfter
=
n
-
(
ind
+
len
);
*
bytesAfter
=
n
-
(
ind
+
len
);
*
format
=
pProp
->
format
;
*
format
=
pProp
->
format
;
...
@@ -566,7 +564,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
...
@@ -566,7 +564,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
}
}
if
(
delete
&&
(
*
bytesAfter
==
0
))
if
(
delete
&&
(
*
bytesAfter
==
0
))
{
/* delete the
P
roperty */
{
/* delete the
p
roperty */
if
(
prevProp
==
(
PropertyPtr
)
NULL
)
/* takes care of head */
if
(
prevProp
==
(
PropertyPtr
)
NULL
)
/* takes care of head */
{
{
if
(
!
(
pWin
->
optional
->
userProps
=
pProp
->
next
))
if
(
!
(
pWin
->
optional
->
userProps
=
pProp
->
next
))
...
...
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