[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Problem with Pygame c api (bad crashes)



Ok, I tried to change (void*) to (void**) and everything worked well.
I installed the new pygame 1.5.2 and I noticed that Pete fixed almost 
everything: some (void**) is (still) missing in pygame.h.
They are at lines 147,288, 363.

Now I've almost finished everything, I should be able to post soon (let 
me write comments, docs and prepare the distro) a win32 module that 
allows to extract frames from movies (AVI, QuickTime, or AVS (served by 
avysinth)) and from a webcam, an put them in pygame surfaces directly 
(no tostring-fromstring hell) allowing one to display them in realtime.. 
(just video, no audio by now).

Anyway thanks to Pete for this wonderful piece of software and his hard 
and good work.

Riccardo




Pete Shinners wrote:

> John Popplewell wrote:
>
>> this happens when 'pygame.h' is included into a '.cpp' file (or when
>> the VC++ /Tp or /TP switches are used).
>
>
> right, the pygame headers are _not_ C++ safe, you will need to wrap 
> them inside an extern "C" {} block.
>
>
>
>> This line *is* a bit strange:
>>     void** localptr = (void*)PyCObject_AsVoidPtr(c_api);
>>     ^^^^^^             ^^^^^
>> On general principle, shouldn't that be:
>>     void** localptr = (void**)PyCObject_AsVoidPtr(c_api);
>>     ^^^^^^             ^^^^^^
>
>
> absolutely correct, this should be stern warning, but i think you are 
> right, many compilers relax their warnings a bit on void pointers. in 
> any event, the code should be "safe", because on the other side of the 
> picture we are assigning the PyCObject a "void* c_api[]".
>
> i'm not exactly sure where i lost the extra "*", all the reference i'm 
> going back and looking at definitely has "**". i'm going back to patch 
> everything to the proper type-age.
>
>
>
>
>
>
> ____________________________________
> pygame mailing list
> pygame-users@seul.org
> http://pygame.seul.org
>




____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org