From: Klaus R. <kre...@us...> - 2007-06-27 21:48:53
|
Update of /cvsroot/ming/ming/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31052/src Modified Files: ming.h.in movie.c Log Message: typesafe SWFMovie_add() for newer GCCs Index: ming.h.in =================================================================== RCS file: /cvsroot/ming/ming/src/ming.h.in,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ming.h.in 23 May 2007 15:59:35 -0000 1.36 --- ming.h.in 27 Jun 2007 21:48:48 -0000 1.37 *************** *** 963,967 **** void SWFMovie_stopSound(SWFMovie movie, SWFSound sound); ! SWFDisplayItem SWFMovie_add(SWFMovie movie, SWFBlock block); int SWFMovie_replace(SWFMovie movie, SWFDisplayItem item, SWFBlock block); void SWFMovie_remove(SWFMovie movie, SWFDisplayItem item); --- 963,1002 ---- void SWFMovie_stopSound(SWFMovie movie, SWFSound sound); ! union SWFMovieBlockType_u { ! SWFBlock block; ! SWFCharacter character; ! SWFDBLBitmap dblbmp; ! SWFDBLBitmapData dblbmp_data; ! SWFJpegBitmap jpegbmp; ! SWFJpegWithAlpha jpegbmp_alpha; ! SWFShape shape; ! SWFMorph morph; ! SWFText text; ! SWFTextField textfield; ! SWFSound sound; ! SWFSoundInstance sound_instance; ! SWFAction action; ! SWFButton button; ! SWFSprite sprite; ! SWFMovieClip mc; ! SWFVideoStream stream; ! SWFPrebuiltClip prebuild; ! }; ! ! typedef union SWFMovieBlockType_u SWFMovieBlockType; ! ! #if __GNUC__ > 3 || \ ! (__GNUC__ == 3 && (__GNUC_MINOR__ > 3 || \ ! (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ > 0))) ! #define __to_union(x) (union SWFMovieBlockType_u)x ! #else ! #define __to_union(x) (union SWFMovieBlockType_u) { x } ! #endif ! ! SWFDisplayItem SWFMovie__add(SWFMovie movie, SWFMovieBlockType ublock); ! ! #define SWFMovie_add(__movie, __block) \ ! SWFMovie__add((__movie), __to_union((__block))) ! int SWFMovie_replace(SWFMovie movie, SWFDisplayItem item, SWFBlock block); void SWFMovie_remove(SWFMovie movie, SWFDisplayItem item); Index: movie.c =================================================================== RCS file: /cvsroot/ming/ming/src/movie.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** movie.c 24 Jun 2007 11:35:10 -0000 1.61 --- movie.c 27 Jun 2007 21:48:49 -0000 1.62 *************** *** 498,504 **** */ SWFDisplayItem ! SWFMovie_add(SWFMovie movie /* movie to which the block will be added */, ! SWFBlock block /* block to add to the movie */) { if ( block == NULL ) return NULL; --- 498,505 ---- */ SWFDisplayItem ! SWFMovie__add(SWFMovie movie /* movie to which the block will be added */, ! SWFMovieBlockType ublock /* block to add to the movie */) { + SWFBlock block = ublock.block; if ( block == NULL ) return NULL; |