If you want to fix it to a 32 bit unsigned, there is already a type defined
in the per-compiler files for that. But, I would argue that its best here
to just used unsigned int and be done with it. On the vast majority of
platforms it would be a 32 bit unsigned. But, on platforms where 64 bit is
the most efficacious size, it will adjust. Since none of this stuff is
binarily serialized, keeping it the same on all platforms (even when its
not natural to do so) doesn't relaly gain much as I far as I can tell.

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]



"Arnold, Curt" <[EMAIL PROTECTED]> on 02/02/2000 07:35:19 AM

Please respond to [EMAIL PROTECTED]

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject:  RE: Proposed Xerces-C API Changes



Dean Roddey wrote:

The only comment I would add is that I would have picked 'unsigned int'
instead of unsigned long. It would be the most natural value to use when a
particular site is not required. The rest of the code uses unsigned int in
such circumstances, so it would also insure the most interoperability
without casting and the best performance (since it will be the natural word
size and it won't require as many temp conversions from the compiler,
right?)

-------------------

On a related note, unsigned long, for instance, has a much more specific
definition in IDL than it does in C++.  On every platform, unsigned long in
IDL means a 32-bit integer.  However, unsigned long
in C++ only has to be the same or wider than short.  If we want to have
Xerces interfaces to synch with the IDL definitions on every platform, then
we need to use platform-specific typedef's.

One approach would be just to lift the Microsoft Windows platform typedef's
and have the methods have a signature like:

ULONG getLength();   //  by the way, why is NamedNodeMap getLength() not
const

In non-MS platforms, ULONG would be typedef'd to the appropriate 32-bit
type.

Otherwise, we would need to create our own typedef's (DOMULONG, for
example)




Reply via email to