[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] PATCH: Readability fix for "make chunk a power of 2" (src/mixer.c)



The replacement should be functionally identical to the old version,
so if you extract each to an individual function, you can just check
to see that they're equal.  chunk is both input and output.

A good set of values to test:
-1, 0, 42, 255, 256, 257, 1023, 1024, 1025, 1024 * 3, 4095, 4096, 4097

Incidentally, 1024 * 3 is a strange value to use for the default
buffer size.  It'll always get bumped to 1024 * 4 when it hits this
chunk of code.  (or dropped to 256, in the bugged code)

I'd do it myself, but given my level of C knowledge, it'd take an
inordinate amount of time.  Modifying existing code is a whole lot
easier than creating it from whole cloth.

-FM

On 6/10/08, René Dudfield <renesd@xxxxxxxxx> wrote:
> hi,
>
> thanks for the patch, sorry I haven't got around to applying it yet.
>
> Since I think the existing code works, I thought I'd just leave it for
> now - and do other 1.8.1 things.
>
> If you can give me a test function to prove your patch also works,
> then I'll add it - but otherwise I won't apply it until pygame 1.9
> since the existing code *seems* to work.
>
>
> cheers,
>
>
> On Tue, Jun 10, 2008 at 6:05 PM, Charlie Nolan <funnyman3595@xxxxxxxxx>
> wrote:
>> So is the patch ever going to get applied to SVN, or are people just
>> smiling and ignoring me?  :)
>>
>> -FunnyMan3595 (Charlie Nolan)
>>
>> On 5/22/08, René Dudfield <renesd@xxxxxxxxx> wrote:
>>> Thanks Charlie.
>>>
>>> Yeah, I hope to finish off most of the 1.8.1 things this weekend - and
>>> then do some RC releases for about a week.
>>>
>>> If you feel like doing some more patches here are the things to do ...
>>> http://www.pygame.org/wiki/todo#Open%20Issues
>>>
>>> cheers,
>>>
>>>
>>>
>>> On Thu, May 22, 2008 at 6:10 PM, Charlie Nolan <funnyman3595@xxxxxxxxx>
>>> wrote:
>>>> Hopefully this simplifies that section enough that we don't get
>>>> another mixup like the one 1222 fixed:
>>>> http://www.seul.org/viewcvs/viewcvs.cgi/trunk/src/mixer.c?root=PyGame&rev=1222&r1=1158&r2=1222
>>>>
>>>> Applies to revision 1236.
>>>>
>>>> The bug's in 1.8.0, and it does ugly things to the sound.  Might want
>>>> to get a bugfix release out soon.
>>>>
>>>> -Charlie Nolan
>>>>
>>>
>>
>