QNX changes from Mike Gorchak
authorSam Lantinga <slouken@libsdl.org>
Wed, 08 Mar 2006 01:55:32 +0000
changeset 1482 141528317f4f
parent 1481 deb22b9fe970
child 1483 52a61c7b323b
QNX changes from Mike Gorchak
src/cdrom/qnx/SDL_syscdrom.c
src/video/photon/SDL_ph_events.c
src/video/photon/SDL_ph_video.c
src/video/photon/SDL_ph_video.h
src/video/photon/SDL_ph_wm.c
--- a/src/cdrom/qnx/SDL_syscdrom.c	Tue Mar 07 16:02:59 2006 +0000
+++ b/src/cdrom/qnx/SDL_syscdrom.c	Wed Mar 08 01:55:32 2006 +0000
@@ -170,7 +170,7 @@
     {
         char *cdpath, *delim;
 	size_t len = SDL_strlen(SDLcdrom)+1;
-        cdpath = SDL_stack_alloc(len);
+        cdpath = SDL_stack_alloc(char, len);
         if (cdpath != NULL)
         {
             SDL_strlcpy(cdpath, SDLcdrom, len);
--- a/src/video/photon/SDL_ph_events.c	Tue Mar 07 16:02:59 2006 +0000
+++ b/src/video/photon/SDL_ph_events.c	Wed Mar 08 01:55:32 2006 +0000
@@ -119,15 +119,15 @@
 	
     posted = 0;
 	
-    switch (event->type)
+    switch (phevent->type)
     {
         case Ph_EV_BOUNDARY:
         {
-            if (event->subtype == Ph_EV_PTR_ENTER)
+            if (phevent->subtype == Ph_EV_PTR_ENTER)
             {
                 posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
             }
-            else if (event->subtype ==Ph_EV_PTR_LEAVE)
+            else if (phevent->subtype ==Ph_EV_PTR_LEAVE)
             {
                 posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);	
             }
@@ -139,12 +139,12 @@
         {
             if (SDL_VideoSurface)
             {
-                pointerEvent = PhGetData(event);
-                rect = PhGetRects(event);
+                pointerEvent = PhGetData(phevent);
+                rect = PhGetRects(phevent);
 
                 if (mouse_relative)
                 {
-                    posted = ph_WarpedMotion(this, event);
+                    posted = ph_WarpedMotion(this, phevent);
                 }
                 else
                 {
@@ -156,8 +156,8 @@
 
         case Ph_EV_BUT_PRESS:
         {
-            pointerEvent = PhGetData( event );
-            buttons = ph2sdl_mousebutton( pointerEvent->buttons );
+            pointerEvent = PhGetData(phevent);
+            buttons = ph2sdl_mousebutton(pointerEvent->buttons);
             if (buttons != 0)
             {
                 posted = SDL_PrivateMouseButton(SDL_PRESSED, buttons, 0, 0);
@@ -167,13 +167,13 @@
 
         case Ph_EV_BUT_RELEASE:
         {
-            pointerEvent = PhGetData(event);
+            pointerEvent = PhGetData(phevent);
             buttons = ph2sdl_mousebutton(pointerEvent->buttons);
-            if (event->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
+            if (phevent->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
             {
                 posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
             }
-            else if(event->subtype == Ph_EV_RELEASE_PHANTOM)
+            else if(phevent->subtype == Ph_EV_RELEASE_PHANTOM)
             {
                 /* If the mouse is outside the window,
                  * only a phantom release event is sent, so
@@ -191,7 +191,7 @@
 
         case Ph_EV_WM:
         {
-            winEvent = PhGetData(event);
+            winEvent = PhGetData(phevent);
 
             /* losing focus */
             if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUSLOST))
@@ -279,20 +279,20 @@
         /* window has been resized, moved or removed */
         case Ph_EV_EXPOSE:
         {
-            if (event->num_rects!=0)
+            if (phevent->num_rects!=0)
             {
                 int numrects;
 
                 if (SDL_VideoSurface)
                 {
-                    rect = PhGetRects(event);
-                    if (event->num_rects>PH_SDL_MAX_RECTS)
+                    rect = PhGetRects(phevent);
+                    if (phevent->num_rects>PH_SDL_MAX_RECTS)
                     {
                        /* sorry, buffers underrun, we'll update only first PH_SDL_MAX_RECTS rects */
                        numrects=PH_SDL_MAX_RECTS;
                     }
 
-                    for(i=0; i<event->num_rects; i++)
+                    for(i=0; i<phevent->num_rects; i++)
                     {
                         sdlrects[i].x = rect[i].ul.x;
                         sdlrects[i].y = rect[i].ul.y;
@@ -300,7 +300,7 @@
                         sdlrects[i].h = rect[i].lr.y - rect[i].ul.y + 1;
                     }
 
-                    this->UpdateRects(this, event->num_rects, sdlrects);
+                    this->UpdateRects(this, phevent->num_rects, sdlrects);
 
                     if (current_overlay!=NULL)
                     {
@@ -332,7 +332,7 @@
 
             posted = 0;
 
-            keyEvent = PhGetData( event );
+            keyEvent = PhGetData(phevent);
 
             if (Pk_KF_Key_Down & keyEvent->key_flags)
             {
@@ -369,11 +369,11 @@
         
         case Ph_EV_INFO:
         {
-           if (event->subtype==Ph_OFFSCREEN_INVALID)
+           if (phevent->subtype==Ph_OFFSCREEN_INVALID)
            {
               unsigned long* EvInfoData;
 
-              EvInfoData=(unsigned long*)PhGetData(event);
+              EvInfoData=(unsigned long*)PhGetData(phevent);
 
               switch (*EvInfoData)
               {
@@ -410,7 +410,7 @@
 
     while (1)
     {
-        switch(PhEventPeek(event, EVENT_SIZE))
+        switch(PhEventPeek(phevent, EVENT_SIZE))
         {
             case Ph_EVENT_MSG:
                  return 1;
@@ -433,7 +433,7 @@
 
     while (ph_Pending(this))
     {
-        PtEventHandler(event);
+        PtEventHandler(phevent);
         ph_DispatchEvent(this);
     }
 }
--- a/src/video/photon/SDL_ph_video.c	Tue Mar 07 16:02:59 2006 +0000
+++ b/src/video/photon/SDL_ph_video.c	Wed Mar 08 01:55:32 2006 +0000
@@ -362,12 +362,12 @@
     old_video_mode=-1;
     old_refresh_rate=-1;
 	
-    if (NULL == (event = SDL_malloc(EVENT_SIZE)))
+    if (NULL == (phevent = SDL_malloc(EVENT_SIZE)))
     {
         SDL_OutOfMemory();
         return -1;
     }
-    SDL_memset(event, 0x00, EVENT_SIZE);
+    SDL_memset(phevent, 0x00, EVENT_SIZE);
 
     window = ph_CreateWindow(this);
     if (window == NULL)
@@ -580,10 +580,10 @@
         window=NULL;
     }
 
-    if (event!=NULL)
+    if (phevent!=NULL)
     {
-        SDL_free(event);
-        event=NULL;
+        SDL_free(phevent);
+        phevent=NULL;
     }
 }
 
--- a/src/video/photon/SDL_ph_video.h	Tue Mar 07 16:02:59 2006 +0000
+++ b/src/video/photon/SDL_ph_video.h	Wed Mar 08 01:55:32 2006 +0000
@@ -140,7 +140,7 @@
 #define currently_fullscreen  (this->hidden->currently_fullscreen)
 #define currently_hided       (this->hidden->currently_hided)
 #define currently_maximized   (this->hidden->currently_maximized)
-#define event                 (this->hidden->event)
+#define phevent               (this->hidden->event)
 #define current_overlay       (this->hidden->overlay)
 #define desktop_mode          (this->hidden->desktop_mode)
 #define mouse_relative        (this->hidden->mouse_relative)
--- a/src/video/photon/SDL_ph_wm.c	Tue Mar 07 16:02:59 2006 +0000
+++ b/src/video/photon/SDL_ph_wm.c	Wed Mar 08 01:55:32 2006 +0000
@@ -61,7 +61,7 @@
 
     SDL_Lock_EventThread();
 
-    SDL_memset( &windowevent, 0, sizeof (event) );
+    SDL_memset(&windowevent, 0, sizeof(windowevent));
     windowevent.event_f = Ph_WM_HIDE;
     windowevent.event_state = Ph_WM_EVSTATE_HIDE;
     windowevent.rid = PtWidgetRid(window);