QNX changes from Mike Gorchak
authorSam Lantinga <slouken@libsdl.org>
Wed, 08 Mar 2006 01:55:32 +0000
changeset 1482141528317f4f
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
     1.1 --- a/src/cdrom/qnx/SDL_syscdrom.c	Tue Mar 07 16:02:59 2006 +0000
     1.2 +++ b/src/cdrom/qnx/SDL_syscdrom.c	Wed Mar 08 01:55:32 2006 +0000
     1.3 @@ -170,7 +170,7 @@
     1.4      {
     1.5          char *cdpath, *delim;
     1.6  	size_t len = SDL_strlen(SDLcdrom)+1;
     1.7 -        cdpath = SDL_stack_alloc(len);
     1.8 +        cdpath = SDL_stack_alloc(char, len);
     1.9          if (cdpath != NULL)
    1.10          {
    1.11              SDL_strlcpy(cdpath, SDLcdrom, len);
     2.1 --- a/src/video/photon/SDL_ph_events.c	Tue Mar 07 16:02:59 2006 +0000
     2.2 +++ b/src/video/photon/SDL_ph_events.c	Wed Mar 08 01:55:32 2006 +0000
     2.3 @@ -119,15 +119,15 @@
     2.4  	
     2.5      posted = 0;
     2.6  	
     2.7 -    switch (event->type)
     2.8 +    switch (phevent->type)
     2.9      {
    2.10          case Ph_EV_BOUNDARY:
    2.11          {
    2.12 -            if (event->subtype == Ph_EV_PTR_ENTER)
    2.13 +            if (phevent->subtype == Ph_EV_PTR_ENTER)
    2.14              {
    2.15                  posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
    2.16              }
    2.17 -            else if (event->subtype ==Ph_EV_PTR_LEAVE)
    2.18 +            else if (phevent->subtype ==Ph_EV_PTR_LEAVE)
    2.19              {
    2.20                  posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);	
    2.21              }
    2.22 @@ -139,12 +139,12 @@
    2.23          {
    2.24              if (SDL_VideoSurface)
    2.25              {
    2.26 -                pointerEvent = PhGetData(event);
    2.27 -                rect = PhGetRects(event);
    2.28 +                pointerEvent = PhGetData(phevent);
    2.29 +                rect = PhGetRects(phevent);
    2.30  
    2.31                  if (mouse_relative)
    2.32                  {
    2.33 -                    posted = ph_WarpedMotion(this, event);
    2.34 +                    posted = ph_WarpedMotion(this, phevent);
    2.35                  }
    2.36                  else
    2.37                  {
    2.38 @@ -156,8 +156,8 @@
    2.39  
    2.40          case Ph_EV_BUT_PRESS:
    2.41          {
    2.42 -            pointerEvent = PhGetData( event );
    2.43 -            buttons = ph2sdl_mousebutton( pointerEvent->buttons );
    2.44 +            pointerEvent = PhGetData(phevent);
    2.45 +            buttons = ph2sdl_mousebutton(pointerEvent->buttons);
    2.46              if (buttons != 0)
    2.47              {
    2.48                  posted = SDL_PrivateMouseButton(SDL_PRESSED, buttons, 0, 0);
    2.49 @@ -167,13 +167,13 @@
    2.50  
    2.51          case Ph_EV_BUT_RELEASE:
    2.52          {
    2.53 -            pointerEvent = PhGetData(event);
    2.54 +            pointerEvent = PhGetData(phevent);
    2.55              buttons = ph2sdl_mousebutton(pointerEvent->buttons);
    2.56 -            if (event->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
    2.57 +            if (phevent->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
    2.58              {
    2.59                  posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
    2.60              }
    2.61 -            else if(event->subtype == Ph_EV_RELEASE_PHANTOM)
    2.62 +            else if(phevent->subtype == Ph_EV_RELEASE_PHANTOM)
    2.63              {
    2.64                  /* If the mouse is outside the window,
    2.65                   * only a phantom release event is sent, so
    2.66 @@ -191,7 +191,7 @@
    2.67  
    2.68          case Ph_EV_WM:
    2.69          {
    2.70 -            winEvent = PhGetData(event);
    2.71 +            winEvent = PhGetData(phevent);
    2.72  
    2.73              /* losing focus */
    2.74              if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUSLOST))
    2.75 @@ -279,20 +279,20 @@
    2.76          /* window has been resized, moved or removed */
    2.77          case Ph_EV_EXPOSE:
    2.78          {
    2.79 -            if (event->num_rects!=0)
    2.80 +            if (phevent->num_rects!=0)
    2.81              {
    2.82                  int numrects;
    2.83  
    2.84                  if (SDL_VideoSurface)
    2.85                  {
    2.86 -                    rect = PhGetRects(event);
    2.87 -                    if (event->num_rects>PH_SDL_MAX_RECTS)
    2.88 +                    rect = PhGetRects(phevent);
    2.89 +                    if (phevent->num_rects>PH_SDL_MAX_RECTS)
    2.90                      {
    2.91                         /* sorry, buffers underrun, we'll update only first PH_SDL_MAX_RECTS rects */
    2.92                         numrects=PH_SDL_MAX_RECTS;
    2.93                      }
    2.94  
    2.95 -                    for(i=0; i<event->num_rects; i++)
    2.96 +                    for(i=0; i<phevent->num_rects; i++)
    2.97                      {
    2.98                          sdlrects[i].x = rect[i].ul.x;
    2.99                          sdlrects[i].y = rect[i].ul.y;
   2.100 @@ -300,7 +300,7 @@
   2.101                          sdlrects[i].h = rect[i].lr.y - rect[i].ul.y + 1;
   2.102                      }
   2.103  
   2.104 -                    this->UpdateRects(this, event->num_rects, sdlrects);
   2.105 +                    this->UpdateRects(this, phevent->num_rects, sdlrects);
   2.106  
   2.107                      if (current_overlay!=NULL)
   2.108                      {
   2.109 @@ -332,7 +332,7 @@
   2.110  
   2.111              posted = 0;
   2.112  
   2.113 -            keyEvent = PhGetData( event );
   2.114 +            keyEvent = PhGetData(phevent);
   2.115  
   2.116              if (Pk_KF_Key_Down & keyEvent->key_flags)
   2.117              {
   2.118 @@ -369,11 +369,11 @@
   2.119          
   2.120          case Ph_EV_INFO:
   2.121          {
   2.122 -           if (event->subtype==Ph_OFFSCREEN_INVALID)
   2.123 +           if (phevent->subtype==Ph_OFFSCREEN_INVALID)
   2.124             {
   2.125                unsigned long* EvInfoData;
   2.126  
   2.127 -              EvInfoData=(unsigned long*)PhGetData(event);
   2.128 +              EvInfoData=(unsigned long*)PhGetData(phevent);
   2.129  
   2.130                switch (*EvInfoData)
   2.131                {
   2.132 @@ -410,7 +410,7 @@
   2.133  
   2.134      while (1)
   2.135      {
   2.136 -        switch(PhEventPeek(event, EVENT_SIZE))
   2.137 +        switch(PhEventPeek(phevent, EVENT_SIZE))
   2.138          {
   2.139              case Ph_EVENT_MSG:
   2.140                   return 1;
   2.141 @@ -433,7 +433,7 @@
   2.142  
   2.143      while (ph_Pending(this))
   2.144      {
   2.145 -        PtEventHandler(event);
   2.146 +        PtEventHandler(phevent);
   2.147          ph_DispatchEvent(this);
   2.148      }
   2.149  }
     3.1 --- a/src/video/photon/SDL_ph_video.c	Tue Mar 07 16:02:59 2006 +0000
     3.2 +++ b/src/video/photon/SDL_ph_video.c	Wed Mar 08 01:55:32 2006 +0000
     3.3 @@ -362,12 +362,12 @@
     3.4      old_video_mode=-1;
     3.5      old_refresh_rate=-1;
     3.6  	
     3.7 -    if (NULL == (event = SDL_malloc(EVENT_SIZE)))
     3.8 +    if (NULL == (phevent = SDL_malloc(EVENT_SIZE)))
     3.9      {
    3.10          SDL_OutOfMemory();
    3.11          return -1;
    3.12      }
    3.13 -    SDL_memset(event, 0x00, EVENT_SIZE);
    3.14 +    SDL_memset(phevent, 0x00, EVENT_SIZE);
    3.15  
    3.16      window = ph_CreateWindow(this);
    3.17      if (window == NULL)
    3.18 @@ -580,10 +580,10 @@
    3.19          window=NULL;
    3.20      }
    3.21  
    3.22 -    if (event!=NULL)
    3.23 +    if (phevent!=NULL)
    3.24      {
    3.25 -        SDL_free(event);
    3.26 -        event=NULL;
    3.27 +        SDL_free(phevent);
    3.28 +        phevent=NULL;
    3.29      }
    3.30  }
    3.31  
     4.1 --- a/src/video/photon/SDL_ph_video.h	Tue Mar 07 16:02:59 2006 +0000
     4.2 +++ b/src/video/photon/SDL_ph_video.h	Wed Mar 08 01:55:32 2006 +0000
     4.3 @@ -140,7 +140,7 @@
     4.4  #define currently_fullscreen  (this->hidden->currently_fullscreen)
     4.5  #define currently_hided       (this->hidden->currently_hided)
     4.6  #define currently_maximized   (this->hidden->currently_maximized)
     4.7 -#define event                 (this->hidden->event)
     4.8 +#define phevent               (this->hidden->event)
     4.9  #define current_overlay       (this->hidden->overlay)
    4.10  #define desktop_mode          (this->hidden->desktop_mode)
    4.11  #define mouse_relative        (this->hidden->mouse_relative)
     5.1 --- a/src/video/photon/SDL_ph_wm.c	Tue Mar 07 16:02:59 2006 +0000
     5.2 +++ b/src/video/photon/SDL_ph_wm.c	Wed Mar 08 01:55:32 2006 +0000
     5.3 @@ -61,7 +61,7 @@
     5.4  
     5.5      SDL_Lock_EventThread();
     5.6  
     5.7 -    SDL_memset( &windowevent, 0, sizeof (event) );
     5.8 +    SDL_memset(&windowevent, 0, sizeof(windowevent));
     5.9      windowevent.event_f = Ph_WM_HIDE;
    5.10      windowevent.event_state = Ph_WM_EVSTATE_HIDE;
    5.11      windowevent.rid = PtWidgetRid(window);