A couple of Questions
Tony van der Hoff
tony at mk-net.demon.co.uk
Wed Jul 25 00:43:18 BST 2001
On 24 Jul 2001, in message <E15P7mh-0005IB-00 at bfg.reinhouse.freeserve.co.uk>,
Timothy Baldwin <tim at reinhouse.freeserve.co.uk> wrote:
> In swi.Wimp there is:
>
> Message_Prequit = .Bits: 8,
> Message_PreQuit = .Bits: 8, // V6.21 TV
>
> As DefMod stands, on RISC OS 3+, it will ignore the first line,
> due to a case insensitive [1] comparison in Lookup().
> What is actually intended?
>
No, that was not what was intended. The correct form is Message_PreQuit, and
prior to V6.21 it had been misspelled. When I corrected it, I left the
previous definition, with the intention of providing backwards compatibility.
It seems like my good intentions were in vain. Then again, I've not seen any
complaints, so I guess there's not much point in restoring the old version...
> Also in swi.Wimp:
>
> // Generic Wimp Message Header
> TYPE Wimp_MessageHeader =
> .Struct
> (
> .Int: size "Message size",
> Wimp_T: sender "Sender of message - set by the Wimp",
> .Int: my_ref "My reference - set by the Wimp",
> .Int: your_ref "Your reference - 0 if not a reply",
> .Bits: action,
> .Byte: data ...
> );
>
> Why does Wimp_MessageHeader have a variable size data member?
>
This is for historical reasons, and provides bacward compatibility with
earlier versions of the library. It allows clients to set up their own
message structures, but is now largely superseded by the new forms introduced
in 6.00.
The base message header structure is defined for C by
wimp_message_header_base, or as a macro in wimp_HEADER_MESSAGE_MEMBERS which
is used in the wimp_full_message_* group of structures.
> This is both illogical, and causes difficulties with C++ inheritance.
I have been using OSLib for some considerable time now without problems wit
C++.
> I intend to improve C++ support.
>
However, it would be nice to see a proper set of C++ classes defined by
DefMod. I look forward to your efforts.
> [1] If you make it case sensitive you will need this patch:
>
> Index: Source/User/oslib/MimeMap.swi
[snip]
Hmm, I don't think you picked the right patch there...
I guess it ought to be case sensitive, but I'm a bit hesitant about doing
this, in case it upsets something else, and I really don't think it's
worth spending much time on right now...
However, seeing as you seem to have time on your hands, something that really
does need sorting out is the amendments to DefMod to generate the post 6.0
structures from the variable length definitions for the Assembler headers.
Now that really *would* be helpful. (Especially for Philip Ludlam :-)
--
Tony van der Hoff | MailTo:tony at mk-net.demon.co.uk
| MailTo:avanderhoff at iee.org
Buckinghamshire, England | http:www.mk-net.demon.co.uk
More information about the oslib-user
mailing list