summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremy@yuffie.local>2008-01-05 03:14:07 -0800
committerJeremy Huddleston <jeremy@yuffie.local>2008-01-05 03:17:27 -0800
commit7d226d6a251cb90765be2b50a1973986c5b7605b (patch)
tree13e5eb5ab41ea32dea1a9cc089d20d9eae08690b
parent11967dce11cd953d123d53bb3389aa257c5158e8 (diff)
XQuartz: Cleanup for strict-prototyping
Also fixed DarwinEQEnqueue to match changes to the callback And also use dpmsstubs.c rather than copying the code into darwin.c (cherry picked from commit 4c5c30a4beb7a427b00b18097f548876ad3c11d7)
-rw-r--r--hw/xquartz/Makefile.am1
-rw-r--r--hw/xquartz/X11Application.m2
-rw-r--r--hw/xquartz/applewm.c15
-rw-r--r--hw/xquartz/darwin.c18
-rw-r--r--hw/xquartz/darwinEvents.c7
-rw-r--r--hw/xquartz/darwinEvents.h5
-rw-r--r--hw/xquartz/darwinKeyboard.c6
-rw-r--r--hw/xquartz/darwinXinput.c9
-rw-r--r--hw/xquartz/quartzAudio.c2
-rw-r--r--hw/xquartz/quartzCocoa.m1
-rw-r--r--hw/xquartz/quartzForeground.c2
-rw-r--r--hw/xquartz/quartzForeground.h2
-rw-r--r--hw/xquartz/quartzPasteboard.h4
-rw-r--r--hw/xquartz/quartzStartup.c7
-rw-r--r--hw/xquartz/xpr/appledri.c1
15 files changed, 32 insertions, 50 deletions
diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index 9ac6e0a3e..99d23eb1f 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -19,6 +19,7 @@ DIST_SUBDIRS = xpr bundle
libXquartz_la_SOURCES = \
$(top_srcdir)/fb/fbcmap_mi.c \
$(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/Xext/dpmsstubs.c \
X11Application.m \
X11Controller.m \
applewm.c \
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 56db2c477..72537bb65 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -855,7 +855,7 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
NSWindow *window;
int pointer_x, pointer_y, ev_button, ev_type;
// int num_events=0, i=0, state;
- xEvent xe;
+ // xEvent xe;
/* convert location to global top-left coordinates */
location = [e locationInWindow];
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 72dca28e7..c460ec6ae 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -264,8 +264,7 @@ WMFreeEvents (data, id)
}
static int
-ProcAppleWMSelectInput (client)
- register ClientPtr client;
+ProcAppleWMSelectInput (register ClientPtr client)
{
REQUEST(xAppleWMSelectInputReq);
WMEventPtr pEvent, pNewEvent, *pHead;
@@ -479,13 +478,11 @@ ProcAppleWMSetFrontProcess(
}
static int
-ProcAppleWMSetWindowLevel(
- register ClientPtr client
-)
+ProcAppleWMSetWindowLevel(register ClientPtr client)
{
REQUEST(xAppleWMSetWindowLevelReq);
WindowPtr pWin;
- int errno;
+ int err;
REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
@@ -497,9 +494,9 @@ ProcAppleWMSetWindowLevel(
return BadValue;
}
- errno = appleWMProcs->SetWindowLevel(pWin, stuff->level);
- if (errno != Success) {
- return errno;
+ err = appleWMProcs->SetWindowLevel(pWin, stuff->level);
+ if (err != Success) {
+ return err;
}
return (client->noClientException);
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 3ad9e14d5..20bcee592 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -879,24 +879,6 @@ void AbortDDX( void )
ddxGiveUp();
}
-
-/*
- * DPMS extension stubs
- */
-Bool DPMSSupported(void)
-{
- return FALSE;
-}
-
-void DPMSSet(int level)
-{
-}
-
-int DPMSGet(int *level)
-{
- return -1;
-}
-
#include "mivalidate.h" // for union _Validate used by windowstr.h
#include "windowstr.h" // for struct _Window
#include "scrnintstr.h" // for struct _Screen
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 1760792c6..827fd81b8 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group.
#include "darwin.h"
#include "quartz.h"
#include "darwinKeyboard.h"
+#include "darwinEvents.h"
#include <sys/types.h>
#include <sys/uio.h>
@@ -213,9 +214,8 @@ Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) {
*
* This should be deprecated in favor of miEQEnqueue -- BB
*/
-void DarwinEQEnqueue(const xEvent *e) {
+void DarwinEQEnqueue(const xEventPtr e) {
HWEventQueueType oldtail, newtail;
- char byte = 0;
oldtail = darwinEventQueue.tail;
@@ -253,7 +253,7 @@ void DarwinEQEnqueue(const xEvent *e) {
* DarwinEQPointerPost
* Post a pointer event. Used by the mipointer.c routines.
*/
-void DarwinEQPointerPost(xEvent *e) {
+void DarwinEQPointerPost(DeviceIntPtr pdev, xEventPtr e) {
(*darwinEventQueue.pPtr->processInputProc)
(e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
}
@@ -274,7 +274,6 @@ void ProcessInputEvents(void) {
EventRec *e;
int x, y;
xEvent xe;
- static int old_flags = 0; // last known modifier state
// button number and modifier mask of currently pressed fake button
input_check_flag=0;
diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h
index d6cab2e6c..82cc26bc0 100644
--- a/hw/xquartz/darwinEvents.h
+++ b/hw/xquartz/darwinEvents.h
@@ -28,12 +28,13 @@
#define _DARWIN_EVENTS_H
Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
-void DarwinEQEnqueue(const xEvent *e);
-void DarwinEQPointerPost(xEvent *e);
+void DarwinEQEnqueue(const xEventPtr e);
+void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e);
void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
void DarwinPokeEQ(void);
void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
void DarwinSendKeyboardEvents(int ev_type, int keycode);
void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
+void DarwinUpdateModKeys(int flags);
#endif /* _DARWIN_EVENTS_H */
diff --git a/hw/xquartz/darwinKeyboard.c b/hw/xquartz/darwinKeyboard.c
index f1b90b76a..b368fe9d9 100644
--- a/hw/xquartz/darwinKeyboard.c
+++ b/hw/xquartz/darwinKeyboard.c
@@ -330,7 +330,7 @@ static void parse_next_char_code(DataStream *s, KeySym *k) {
* DarwinReadKeymapFile
* Read the appropriate keymapping from a keymapping file.
*/
-Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
+static Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
struct stat st;
NXEventSystemDevice info[20];
int interface = 0, handler_id = 0;
@@ -439,7 +439,7 @@ Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
/*
* DarwinParseNXKeyMapping
*/
-Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) {
+static Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) {
KeySym *k;
int i;
short numMods, numKeys, numPadKeys = 0;
@@ -933,7 +933,7 @@ int DarwinModifierNXMaskToNXKey(int mask) {
return -1;
}
-const char *DarwinModifierNXMaskTostring(int mask) {
+static const char *DarwinModifierNXMaskTostring(int mask) {
switch (mask) {
case NX_ALPHASHIFTMASK: return "NX_ALPHASHIFTMASK";
case NX_SHIFTMASK: return "NX_SHIFTMASK";
diff --git a/hw/xquartz/darwinXinput.c b/hw/xquartz/darwinXinput.c
index ee456a43a..e62ec0ab6 100644
--- a/hw/xquartz/darwinXinput.c
+++ b/hw/xquartz/darwinXinput.c
@@ -63,6 +63,7 @@ SOFTWARE.
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "XIstubs.h"
+#include "chgkbd.h"
/***********************************************************************
*
@@ -88,16 +89,12 @@ SOFTWARE.
*
*/
-int
-ChangeKeyboardDevice (old_dev, new_dev)
- DeviceIntPtr old_dev;
- DeviceIntPtr new_dev;
- {
+int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev) {
/***********************************************************************
DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
**********************************************************************/
return BadMatch;
- }
+}
/***********************************************************************
diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index 86bb20015..5dee32f54 100644
--- a/hw/xquartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -50,7 +50,7 @@
#include <X11/extensions/XI.h>
#include <assert.h>
-void NSBeep();
+void NSBeep(void);
typedef struct QuartzAudioRec {
double frequency;
diff --git a/hw/xquartz/quartzCocoa.m b/hw/xquartz/quartzCocoa.m
index 0086c5ca4..53e3f0897 100644
--- a/hw/xquartz/quartzCocoa.m
+++ b/hw/xquartz/quartzCocoa.m
@@ -37,6 +37,7 @@
#endif
#include "quartzCommon.h"
+#include "quartzPasteboard.h"
#define BOOL xBOOL
#include "darwin.h"
diff --git a/hw/xquartz/quartzForeground.c b/hw/xquartz/quartzForeground.c
index bfea642d1..0e724de76 100644
--- a/hw/xquartz/quartzForeground.c
+++ b/hw/xquartz/quartzForeground.c
@@ -32,6 +32,8 @@
#include <ApplicationServices/ApplicationServices.h>
#include <stdio.h>
+#include "quartzForeground.h"
+
int QuartzMoveToForeground() {
ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
diff --git a/hw/xquartz/quartzForeground.h b/hw/xquartz/quartzForeground.h
index 4fc21c72f..b5422ff9c 100644
--- a/hw/xquartz/quartzForeground.h
+++ b/hw/xquartz/quartzForeground.h
@@ -32,6 +32,6 @@
#ifndef _QUARTZ_FOREGROUND_H_
#define _QUARTZ_FOREGROUND_H_
-int QuartzMoveToForeground();
+int QuartzMoveToForeground(void);
#endif /* _QUARTZ_FOREGROUND_H_ */
diff --git a/hw/xquartz/quartzPasteboard.h b/hw/xquartz/quartzPasteboard.h
index afcb6e587..d6a8ee815 100644
--- a/hw/xquartz/quartzPasteboard.h
+++ b/hw/xquartz/quartzPasteboard.h
@@ -34,11 +34,11 @@
#define _QUARTZPASTEBOARD_H
// Aqua->X
-void QuartzReadPasteboard();
+void QuartzReadPasteboard(void);
char * QuartzReadCocoaPasteboard(void); // caller must free string
// X->Aqua
-void QuartzWritePasteboard();
+void QuartzWritePasteboard(void);
void QuartzWriteCocoaPasteboard(char *text);
#endif /* _QUARTZPASTEBOARD_H */
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index 1b2a22623..e25e15583 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -52,8 +52,11 @@
char **envpGlobal; // argcGlobal and argvGlobal
// are from dix/globals.c
+int main(int argc, char **argv, char **envp);
+void _InitHLTB(void);
+void DarwinHandleGUI(int argc, char **argv, char **envp);
+
static void server_thread (void *arg) {
- extern int main(int argc, char **argv, char **envp);
exit (main (argcGlobal, argvGlobal, envpGlobal));
}
@@ -103,8 +106,6 @@ void DarwinHandleGUI(int argc, char **argv, char **envp) {
before the main thread when we're _not_ prebound, things fail,
so initialize by hand. */
- extern void _InitHLTB(void);
-
_InitHLTB();
X11ControllerMain(argc, (const char **)argv, server_thread, NULL);
exit(0);
diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 95a443976..b4a4725e2 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -55,6 +55,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "swaprep.h"
#include "dri.h"
#include "dristruct.h"
+#include "xpr.h"
static int DRIErrorBase = 0;