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

Clipboard.c: scope improvements

parent cb3e44a1
...@@ -805,8 +805,6 @@ static void endTransfer(Bool success) ...@@ -805,8 +805,6 @@ static void endTransfer(Bool success)
void nxagentTransferSelection(int resource) void nxagentTransferSelection(int resource)
{ {
int result;
if (lastClientClientPtr -> index != resource) if (lastClientClientPtr -> index != resource)
{ {
#ifdef DEBUG #ifdef DEBUG
...@@ -823,6 +821,8 @@ void nxagentTransferSelection(int resource) ...@@ -823,6 +821,8 @@ void nxagentTransferSelection(int resource)
{ {
case SelectionStageQuerySize: case SelectionStageQuerySize:
{ {
int result;
PrintClientSelectionStage(); PrintClientSelectionStage();
/* /*
* Don't get data yet, just get size. We skip * Don't get data yet, just get size. We skip
...@@ -870,6 +870,8 @@ void nxagentTransferSelection(int resource) ...@@ -870,6 +870,8 @@ void nxagentTransferSelection(int resource)
} }
case SelectionStageQueryData: case SelectionStageQueryData:
{ {
int result;
PrintClientSelectionStage(); PrintClientSelectionStage();
/* /*
...@@ -1210,8 +1212,6 @@ void nxagentNotifySelection(XEvent *X) ...@@ -1210,8 +1212,6 @@ void nxagentNotifySelection(XEvent *X)
void nxagentResetSelectionOwner(void) void nxagentResetSelectionOwner(void)
{ {
int i;
if (lastServerRequestor != None) if (lastServerRequestor != None)
{ {
#ifdef TEST #ifdef TEST
...@@ -1226,7 +1226,7 @@ void nxagentResetSelectionOwner(void) ...@@ -1226,7 +1226,7 @@ void nxagentResetSelectionOwner(void)
* Only for PRIMARY and CLIPBOARD selections. * Only for PRIMARY and CLIPBOARD selections.
*/ */
for (i = 0; i < nxagentMaxSelections; i++) for (int i = 0; i < nxagentMaxSelections; i++)
{ {
XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].selection, serverWindow, CurrentTime); XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].selection, serverWindow, CurrentTime);
...@@ -1415,8 +1415,6 @@ FIXME: Why this pointer can be not a valid ...@@ -1415,8 +1415,6 @@ FIXME: Why this pointer can be not a valid
int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
Window requestor, Atom property, Atom target, Time time) Window requestor, Atom property, Atom target, Time time)
{ {
const char *strTarget;
if (agentClipboardStatus != 1 || if (agentClipboardStatus != 1 ||
nxagentOption(Clipboard) == ClipboardServer) nxagentOption(Clipboard) == ClipboardServer)
{ {
...@@ -1479,7 +1477,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1479,7 +1477,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
validateString(NameForAtom(property)), validateString(NameForAtom(target))); validateString(NameForAtom(property)), validateString(NameForAtom(target)));
#endif #endif
strTarget = NameForAtom(target); const char *strTarget = NameForAtom(target);
if (strTarget == NULL) if (strTarget == NULL)
{ {
...@@ -1682,7 +1680,6 @@ WindowPtr nxagentGetClipboardWindow(Atom property) ...@@ -1682,7 +1680,6 @@ WindowPtr nxagentGetClipboardWindow(Atom property)
int nxagentInitClipboard(WindowPtr pWin) int nxagentInitClipboard(WindowPtr pWin)
{ {
int i;
Window iWindow = nxagentWindow(pWin); Window iWindow = nxagentWindow(pWin);
#ifdef DEBUG #ifdef DEBUG
...@@ -1763,7 +1760,7 @@ int nxagentInitClipboard(WindowPtr pWin) ...@@ -1763,7 +1760,7 @@ int nxagentInitClipboard(WindowPtr pWin)
fprintf(stderr, "%s: Registering for XFixesSelectionNotify events.\n", __func__); fprintf(stderr, "%s: Registering for XFixesSelectionNotify events.\n", __func__);
#endif #endif
for (i = 0; i < nxagentMaxSelections; i++) for (int i = 0; i < nxagentMaxSelections; i++)
{ {
XFixesSelectSelectionInput(nxagentDisplay, iWindow, XFixesSelectSelectionInput(nxagentDisplay, iWindow,
lastSelectionOwner[i].selection, lastSelectionOwner[i].selection,
...@@ -1803,7 +1800,7 @@ int nxagentInitClipboard(WindowPtr pWin) ...@@ -1803,7 +1800,7 @@ int nxagentInitClipboard(WindowPtr pWin)
* Only for PRIMARY and CLIPBOARD selections. * Only for PRIMARY and CLIPBOARD selections.
*/ */
for (i = 0; i < nxagentMaxSelections; i++) for (int i = 0; i < nxagentMaxSelections; i++)
{ {
if (lastSelectionOwner[i].client && lastSelectionOwner[i].window) if (lastSelectionOwner[i].client && lastSelectionOwner[i].window)
{ {
......
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