messagetrans_error_lookup : wrong type

John Tytgat John.Tytgat at aaug.net
Mon Jun 4 01:22:29 BST 2001


In message <38b3c5844a.Tony at mk-net.demon.co.uk>
          Tony van der Hoff <tony at mk-net.demon.co.uk> wrote:

> However, even if we, for now, ignore backward compatibility issues, maybe it
> would be slightly presumptious to assume that the user will always want to
> pass a pointer to a 256-byte buffer. If we did, then we could default |size|
> to that number as well. The fact that RISC OS doesn't assume that suggests
> that we shouldn't.
> 
> On the other hand, I guess most users will want to do exactly what you're
> suggesting, so perhaps the best solution would be to provide a new veneer:
> 
> extern os_error *xmessagetrans_error_lookup_tobuffer 
>       (os_error const *error,
>        messagetrans_control_block const *cb,
>        os_error *buffer,
>        char const *arg0,
>        char const *arg1,
>        char const *arg2,
>        char const *arg3);
> 
> Has anyone any alternative/better suggestions (including name of new veneer)?

I would just change the 'char' into 'os_error'.  I don't think it is
somewhere specified that the error buffer passed to messagetrans may
not be longer or shorter than 256 bytes.  In most cases the users will
want to pass 'sizeof(os_error)' as 'size' but they don't have to.  E.g.
when they want to add some text afterwards and still want to stay into
the 256 byte limit.

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven



More information about the oslib-user mailing list