aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2021-01-30 16:10:19 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-02-03 14:52:53 +0100
commit3cabdfa2a0f799d7c9278da1b6f333961e670428 (patch)
treec40c78073c5539ee1de44fccd4159707bdf0b29c
parent513418ace94fa4e57917d5145381d05050e3e160 (diff)
downloadnx-libs-3cabdfa2a0f799d7c9278da1b6f333961e670428.tar.gz
nx-libs-3cabdfa2a0f799d7c9278da1b6f333961e670428.tar.bz2
nx-libs-3cabdfa2a0f799d7c9278da1b6f333961e670428.zip
NXproperty.c: simplify and reformat GetWindowProperty()
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXproperty.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
index 3ca79cea7..9e14a3cca 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
@@ -466,9 +466,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
unsigned long *bytesAfter;
unsigned char **propData;
{
- PropertyPtr pProp, prevProp;
- unsigned long n, len, ind;
-
if (!pWin)
{
#ifdef DEBUG
@@ -484,6 +481,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
#endif
return BadAtom;
}
+
if ((type != AnyPropertyType) && !ValidAtom(type))
{
#ifdef DEBUG
@@ -492,8 +490,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return BadAtom;
}
- pProp = wUserProps (pWin);
- prevProp = (PropertyPtr)NULL;
+ PropertyPtr pProp = wUserProps (pWin);
+ PropertyPtr prevProp = (PropertyPtr)NULL;
while (pProp)
{
@@ -522,14 +520,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
*format = pProp->format;
*nItems = 0;
*actualType = pProp->type;
- return(Success);
+ return Success;
}
/*
* Return type, format, value to client
*/
- n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */
- ind = longOffset << 2;
+ unsigned long n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */
+ unsigned long ind = longOffset << 2;
/* If longOffset is invalid such that it causes "len" to
be negative, it's a value error. */
@@ -542,7 +540,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return BadValue;
}
- len = min(n - ind, 4 * longLength);
+ unsigned long len = min(n - ind, 4 * longLength);
*bytesAfter = n - (ind + len);
*format = pProp->format;
@@ -566,7 +564,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
}
if (delete && (*bytesAfter == 0))
- { /* delete the Property */
+ { /* delete the property */
if (prevProp == (PropertyPtr)NULL) /* takes care of head */
{
if (!(pWin->optional->userProps = pProp->next))