> Even so, I don't know what would be hard for anyone to understand about
> my patches (and no-one has asked me in the past). If you think there
> simply too many of them, most of them are probably whitespace
> disagreements between what you committed and what the PHP style appears
> to be. The basis of all my streams patches is like this (from the old
> streams.c):

James - speaking for myself - I had no problems with your patch, size,
whitespace or otherwise.

As I mentioned before, I like to understand that which I commit before I do
so. Sometimes seeming illogical code can be correct, and so I try to
understand what is proposed - and sometimes I even learn something new :-)
In the case shown below, I had a hard time tracing the call stack back by
code inspection 'cause I did not understand the mechanisms involved (I do
love these indirect methods of calling things, they make debuging so fun :-)
Now that I understand the semi-tortuous means to arrive at the line in
question, I wholeheartedly endore the following change. All 28 calls that
arrive at this line do indeed pass an int - and that was the real reason I
was holding off - I wanted to check that was the case.

Wez, as streams is your baby - can you commit this ? (How is that for
coordination :-)
Jani, as 4.3.2 is your baby - will you approve it ?

Dave

>
> Index: main/streams.c
> ===================================================================
> RCS file: /repository/php4/main/Attic/streams.c,v
> retrieving revision 1.125.2.37
> diff -u -u -r1.125.2.37 streams.c
> --- main/streams.c 6 Mar 2003 20:58:19 -0000 1.125.2.37
> +++ main/streams.c 8 Mar 2003 10:48:16 -0000
> @@ -1532,7 +1532,7 @@
>   }
>   if (ret) {
>   fflush(data->file);
> - *ret = (void*)fd;
> + *(int*)ret = fd;
>   }
>   return SUCCESS;
>   default:
>
> What have I done? Well, someone's taking fd (declared as an 'int', which
> may be 32 bits on some systems), casting it a void* (a 64-bit value on
> some systems) and then stuffing that into storage space which, although
> it might not be obvious, happens to be only 32 bits wide. My patch takes
> fd (the 'int') and stuffs it into 'int' storage. Now that's not to say
> that the destination IS actually an 'int' but merely that I am keeping
> the int at its original width rather than casting it up. It's not a
> 'perfect solution', but it's not a 'perfect problem', either.
>
>
>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to