summaryrefslogtreecommitdiff
path: root/ReqMach.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:03:47 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:03:47 +0000
commit3e9f89c7239ae0cf1599277cc879a03cdf33b7c8 (patch)
tree602d4a70b9731fe873a020e8adcdd0b7923a805c /ReqMach.c
parent0bd1f9d8ccaf46397745779f5964f3b843186896 (diff)
merge XFree86 4.3.0.1 to -CURRENT
Diffstat (limited to 'ReqMach.c')
-rw-r--r--ReqMach.c68
1 files changed, 26 insertions, 42 deletions
diff --git a/ReqMach.c b/ReqMach.c
index a048084..4713abc 100644
--- a/ReqMach.c
+++ b/ReqMach.c
@@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
+/* $XFree86: xc/programs/bitmap/ReqMach.c,v 1.5 2002/02/18 21:43:17 herrb Exp $ */
/*
* Author: Davor Matic, MIT X Consortium
@@ -40,13 +41,6 @@ from The Open Group.
#include <stdio.h>
#include <math.h>
-#ifndef abs
-#define abs(x) (((x) > 0) ? (x) : -(x))
-#endif
-#define min(x, y) (((x) < (y)) ? (x) : (y))
-#define max(x, y) (((x) > (y)) ? (x) : (y))
-
-
extern Boolean DEBUG;
/*****************************************************************************\
@@ -57,8 +51,8 @@ extern Boolean DEBUG;
* Searches for a request record of a request specified by its name.
* Returns a pointer to the record or NULL if the request was not found.
*/
-BWRequestRec *FindRequest(name)
- BWRequest name;
+static BWRequestRec *
+FindRequest(BWRequest name)
{
int i;
@@ -73,12 +67,9 @@ BWRequestRec *FindRequest(name)
* Adds a request to the request stack and does proper initializations.
* Returns TRUE if the request was found and FALSE otherwise.
*/
-Boolean BWAddRequest(w, name, trap, call_data, call_data_size)
- Widget w;
- BWRequest name;
- Boolean trap;
- XtPointer call_data;
- Cardinal call_data_size;
+Boolean
+BWAddRequest(Widget w, BWRequest name, Boolean trap,
+ XtPointer call_data, Cardinal call_data_size)
{
BitmapWidget BW = (BitmapWidget) w;
BWRequestRec *request;
@@ -114,9 +105,8 @@ Boolean BWAddRequest(w, name, trap, call_data, call_data_size)
* Engages the request designated by the current parameter.
* Returnes TRUE if the request has an engage function and FALSE otherwise.
*/
-Boolean Engage(BW, current)
- BitmapWidget BW;
- Cardinal current;
+static Boolean
+Engage(BitmapWidget BW, Cardinal current)
{
BW->bitmap.current = current;
@@ -136,15 +126,15 @@ Boolean Engage(BW, current)
return False;
}
-Boolean BWTerminateRequest();
-Boolean BWRemoveRequest();
+/* Boolean BWTerminateRequest();
+ Boolean BWRemoveRequest(); */
/*
* Scans down the request stack removing all requests untill it finds
* one to be trapped.
*/
-void TrappingLoop(BW)
- BitmapWidget BW;
+static void
+TrappingLoop(BitmapWidget BW)
{
if (DEBUG)
@@ -167,9 +157,8 @@ void TrappingLoop(BW)
* Terimantes the current request and continues with next request if con = TRUE
* Returnes TRUE if there is any number of requests left on the stack.
*/
-Boolean BWTerminateRequest(w, cont)
- Widget w;
- Boolean cont;
+Boolean
+BWTerminateRequest(Widget w, Boolean cont)
{
BitmapWidget BW = (BitmapWidget) w;
@@ -180,8 +169,7 @@ Boolean BWTerminateRequest(w, cont)
(*BW->bitmap.request_stack[BW->bitmap.current].request->terminate)
(w,
BW->bitmap.request_stack[BW->bitmap.current].status,
- BW->bitmap.request_stack[BW->bitmap.current].request->terminate_client_data,
- BW->bitmap.request_stack[BW->bitmap.current].call_data);
+ BW->bitmap.request_stack[BW->bitmap.current].request->terminate_client_data);
if (cont) {
if (BW->bitmap.current == BW->bitmap.cardinal)
@@ -203,8 +191,8 @@ Boolean BWTerminateRequest(w, cont)
/*
* Simple interface to BWTerminateRequest that takes only a widget.
*/
-void BWAbort(w)
- Widget w;
+void
+BWAbort(Widget w)
{
BWTerminateRequest(w, True);
}
@@ -214,8 +202,8 @@ void BWAbort(w)
* it will terminate it.
* Returns TRUE if the number of requests left on the stack != 0.
*/
-Boolean BWRemoveRequest(w)
- Widget w;
+Boolean
+BWRemoveRequest(Widget w)
{
BitmapWidget BW = (BitmapWidget) w;
@@ -229,8 +217,7 @@ Boolean BWRemoveRequest(w)
(*BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove)
(w,
BW->bitmap.request_stack[BW->bitmap.cardinal].status,
- BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove_client_data,
- BW->bitmap.request_stack[BW->bitmap.cardinal].call_data);
+ BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove_client_data);
XtFree(BW->bitmap.request_stack[BW->bitmap.cardinal].status);
XtFree(BW->bitmap.request_stack[BW->bitmap.cardinal].call_data);
@@ -244,9 +231,9 @@ Boolean BWRemoveRequest(w)
return False;
}
-void BWRemoveAllRequests(w)
- Widget w;
-{ /* SUPPRESS 530 */
+void
+BWRemoveAllRequests(Widget w)
+{
while (BWRemoveRequest(w)) {/* removes all requests from the stack */}
}
@@ -254,12 +241,9 @@ void BWRemoveAllRequests(w)
* Adds the request to the stack and performs engaging ritual.
* Returns TRUE if the request was found, FALSE otherwise.
*/
-Boolean BWEngageRequest(w, name, trap, call_data, call_data_size)
- Widget w;
- BWRequest name;
- Boolean trap;
- XtPointer call_data;
- Cardinal call_data_size;
+Boolean
+BWEngageRequest(Widget w, BWRequest name, Boolean trap,
+ XtPointer call_data, Cardinal call_data_size)
{
BitmapWidget BW = (BitmapWidget) w;