Commit c539e0ca authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXproperty.c: reformat GetWindowProperty to increase readability

parent 7fa6c880
...@@ -549,6 +549,9 @@ ProcGetProperty(ClientPtr client) ...@@ -549,6 +549,9 @@ ProcGetProperty(ClientPtr client)
#ifdef NXAGENT_CLIPBOARD #ifdef NXAGENT_CLIPBOARD
/* GetWindowProperty clipboard use only */ /* GetWindowProperty clipboard use only */
/* FIXME: that's wrong, it is also called in Window.c and Events. */
/* FIXME: should be moved to a different file, is not derived from
dix */
int int
GetWindowProperty(pWin, property, longOffset, longLength, delete, GetWindowProperty(pWin, property, longOffset, longLength, delete,
type, actualType, format, nItems, bytesAfter, propData ) type, actualType, format, nItems, bytesAfter, propData )
...@@ -569,24 +572,24 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -569,24 +572,24 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (!pWin) if (!pWin)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: invalid window\n", __func__); fprintf(stderr, "%s: invalid window\n", __func__);
#endif #endif
return BadWindow; return BadWindow;
} }
if (!ValidAtom(property)) if (!ValidAtom(property))
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: invalid atom [%d]\n", __func__, property); fprintf(stderr, "%s: invalid atom [%d]\n", __func__, property);
#endif #endif
return(BadAtom); return(BadAtom);
} }
if ((type != AnyPropertyType) && !ValidAtom(type)) if ((type != AnyPropertyType) && !ValidAtom(type))
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: invalid type [%d]\n", __func__, type); fprintf(stderr, "%s: invalid type [%d]\n", __func__, type);
#endif #endif
return(BadAtom); return(BadAtom);
} }
...@@ -604,9 +607,9 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -604,9 +607,9 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (!pProp) if (!pProp)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: property not found [%d]\n", __func__, property); fprintf(stderr, "%s: property not found [%d]\n", __func__, property);
#endif #endif
return (BadAtom); return (BadAtom);
} }
...@@ -624,7 +627,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -624,7 +627,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
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 */ n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */
...@@ -635,9 +638,9 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -635,9 +638,9 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (n < ind) if (n < ind)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: negative property len\n", __func__); fprintf(stderr, "%s: negative property len\n", __func__);
#endif #endif
return BadValue; return BadValue;
} }
...@@ -650,9 +653,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -650,9 +653,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (delete && (*bytesAfter == 0)) if (delete && (*bytesAfter == 0))
{ /* send the event */ { /* send the event */
xEvent event; xEvent event = {0};
memset(&event, 0, sizeof(xEvent));
event.u.u.type = PropertyNotify; event.u.u.type = PropertyNotify;
event.u.property.window = pWin->drawable.id; event.u.property.window = pWin->drawable.id;
event.u.property.state = PropertyDelete; event.u.property.state = PropertyDelete;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment