Commits

Anonymous committed 3aef378

Compile fixes for 64bit on Fedora from Chris Stone

Comments (0)

Files changed (5)

 # BREAK = change breaks existing code
 # BUG	= fixed a bug that was (or could have been) crashing
 
+Jun 10, 2006
+    64bit compile fixes for Fedora from Christopher Stone
+
 Jun 8, 2006
     Documentation changes.
     Move to subversion instead of cvs.
 	    channeldata[channel].queue = NULL;
 	    channelnum = Mix_PlayChannelTimed(channel, sound, 0, -1);
 	    if(channelnum != -1)
-	    	Mix_GroupChannel(channelnum, (int)sound);
+	    	Mix_GroupChannel(channelnum, (intptr_t)sound);
 	}
 	else
 	{
 	//make sure volume on this arbitrary channel is set to full
 	Mix_Volume(channelnum, 128);
 
-	Mix_GroupChannel(channelnum, (int)chunk);
+	Mix_GroupChannel(channelnum, (intptr_t)chunk);
 	return PyChannel_New(channelnum);
 }
 
 
 	MIXER_INIT_CHECK();
 
-	return PyInt_FromLong(Mix_GroupCount((int)chunk));
+	return PyInt_FromLong(Mix_GroupCount((intptr_t)chunk));
 }
 
 
 
 	MIXER_INIT_CHECK();
 
-	Mix_FadeOutGroup((int)chunk, time);
+	Mix_FadeOutGroup((intptr_t)chunk, time);
 	RETURN_NONE
 }
 
 
 	MIXER_INIT_CHECK();
 
-	Mix_HaltGroup((int)chunk);
+	Mix_HaltGroup((intptr_t)chunk);
 	RETURN_NONE
 }
 
 
 	channelnum = Mix_PlayChannelTimed(channelnum, chunk, loops, playtime);
 	if(channelnum != -1)
-		Mix_GroupChannel(channelnum, (int)chunk);
+		Mix_GroupChannel(channelnum, (intptr_t)chunk);
 
         Py_XDECREF(channeldata[channelnum].sound);
 	Py_XDECREF(channeldata[channelnum].queue);
 	{
 	    channelnum = Mix_PlayChannelTimed(channelnum, chunk, 0, -1);
 	    if(channelnum != -1)
-		    Mix_GroupChannel(channelnum, (int)chunk);
+		    Mix_GroupChannel(channelnum, (intptr_t)chunk);
 
             channeldata[channelnum].sound = sound;
             Py_INCREF(sound);
 
     if(src_y)
 	{
-		unsigned char *dst_y=0, *dst_u=0, *dst_v=0;
+		void *dst_y=0, *dst_u=0, *dst_v=0;
 		SDL_LockYUVOverlay( self->cOverlay );
 
 		// No clipping at this time( only support for YUV420 )
-		dst_y = (unsigned char*)self->cOverlay->pixels[ 0 ];
-		dst_v = (unsigned char*)self->cOverlay->pixels[ 1 ];
-		dst_u = (unsigned char*)self->cOverlay->pixels[ 2 ];
+		dst_y = (void*)self->cOverlay->pixels[ 0 ];
+		dst_v = (void*)self->cOverlay->pixels[ 1 ];
+		dst_u = (void*)self->cOverlay->pixels[ 2 ];
 		for (y=0; y< self->cOverlay->h; y++)
 		{
 			memcpy( dst_y, src_y, self->cOverlay->w );
                         SDL_Surface *dst, SDL_Rect *dstrect, int the_args);
 
 static PyObject* surface_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
-static int surface_init(PySurfaceObject *self, PyObject *args, PyObject *kwds);
+static intptr_t surface_init(PySurfaceObject *self, PyObject *args, PyObject *kwds);
 
 
 /* surface object methods */
     return (PyObject *)self;
 }
 
-static int surface_init(PySurfaceObject *self, PyObject *args, PyObject *kwds)
+static intptr_t surface_init(PySurfaceObject *self, PyObject *args, PyObject *kwds)
 {
 	Uint32 flags = 0;
 	int width, height;
 	if(depth && masks) /*all info supplied, most errorchecking needed*/
 	{
 		if(PySurface_Check(depth))
-			return (int)RAISE(PyExc_ValueError, "cannot pass surface for depth and color masks");
+			return (intptr_t)RAISE(PyExc_ValueError, "cannot pass surface for depth and color masks");
 		if(!IntFromObj(depth, &bpp))
-			return (int)RAISE(PyExc_ValueError, "invalid bits per pixel depth argument");
+			return (intptr_t)RAISE(PyExc_ValueError, "invalid bits per pixel depth argument");
 		if(!PySequence_Check(masks) || PySequence_Length(masks)!=4)
-			return (int)RAISE(PyExc_ValueError, "masks argument must be sequence of four numbers");
+			return (intptr_t)RAISE(PyExc_ValueError, "masks argument must be sequence of four numbers");
 		if(!UintFromObjIndex(masks, 0, &Rmask) || !UintFromObjIndex(masks, 1, &Gmask) ||
 					!UintFromObjIndex(masks, 2, &Bmask) || !UintFromObjIndex(masks, 3, &Amask))
-			return (int)RAISE(PyExc_ValueError, "invalid mask values in masks sequence");
+			return (intptr_t)RAISE(PyExc_ValueError, "invalid mask values in masks sequence");
 	}
 	else if(depth && PyNumber_Check(depth))/*use default masks*/
 	{
 		if(!IntFromObj(depth, &bpp))
-			return (int)RAISE(PyExc_ValueError, "invalid bits per pixel depth argument");
+			return (intptr_t)RAISE(PyExc_ValueError, "invalid bits per pixel depth argument");
 		if(flags & SDL_SRCALPHA)
 		{
 			switch(bpp)
 			case 32:
 				Rmask = 0xFF<<16; Gmask = 0xFF<<8; Bmask = 0xFF; Amask = 0xFF<<24; break;
 			default:
-				return (int)RAISE(PyExc_ValueError, "no standard masks exist for given bitdepth with alpha");
+				return (intptr_t)RAISE(PyExc_ValueError, "no standard masks exist for given bitdepth with alpha");
 			}
 		}
 		else
 			case 32:
 				Rmask = 0xFF<<16; Gmask = 0xFF<<8; Bmask = 0xFF; break;
 			default:
-				return (int)RAISE(PyExc_ValueError, "nonstandard bit depth given");
+				return (intptr_t)RAISE(PyExc_ValueError, "nonstandard bit depth given");
 			}
 		}
 	}
 	{
 		SDL_Event event;
 		memset(&event, 0, sizeof(event));
-		event.type = (int)param;
+		event.type = (intptr_t)param;
 		SDL_PushEvent(&event);
 	}
 	return interval;
 static PyObject* time_set_timer(PyObject* self, PyObject* arg)
 {
 	SDL_TimerID newtimer;
-	int ticks = 0, event = SDL_NOEVENT;
+	int ticks = 0;
+	intptr_t event = SDL_NOEVENT;
 	if(!PyArg_ParseTuple(arg, "ii", &event, &ticks))
 		return NULL;