On 02/05/2010 07:38 PM, Henri Verbeet wrote:
On 5 February 2010 19:10, Michael Stefaniuc wrote:
Henri Verbeet wrote:
min and max are already defined in windef.h. Note that they're not
safe for expressions with side-effects, but for simple expressions
like the one here they're ok.
We can lift
On 5 February 2010 19:10, Michael Stefaniuc wrote:
> Henri Verbeet wrote:
>> min and max are already defined in windef.h. Note that they're not
>> safe for expressions with side-effects, but for simple expressions
>> like the one here they're ok.
> We can lift the side-effects and type safe min/ma
Henri Verbeet wrote:
> On 5 February 2010 18:19, Matteo Bruni wrote:
>> Sure. Better to go with something like "len = len < (desc->size -
>> desc->pos) ? len : desc->size - desc->pos" or creating a "min"
>> function?
>>
> min and max are already defined in windef.h. Note that they're not
> safe fo
On 5 February 2010 18:19, Matteo Bruni wrote:
> Sure. Better to go with something like "len = len < (desc->size -
> desc->pos) ? len : desc->size - desc->pos" or creating a "min"
> function?
>
min and max are already defined in windef.h. Note that they're not
safe for expressions with side-effects
Seems like I'm unable to review my code...
>
>> + if(desc->pos + len > desc->size) len = desc->size - desc->pos;
> It's usually safer to write expressions like that as "if (len >
> desc->size - desc->pos)" because "desc->pos + len" can wrap around if
> len is large, while "desc->size - desc->po
On 4 February 2010 19:26, Matteo Bruni wrote:
> +void wpp_write_message_var(const char *fmt, ...) PRINTF_ATTR(1,2);
> +void wpp_write_message_var(const char *fmt, ...)
You can just do the following:
+void PRINTF_ATTR(1,2) wpp_write_message_var(const char *fmt, ...)
> +desc = HeapAlloc(Get