James Berry wrote:
> When compiling with default warnings on gcc, we get lots of warnings
> about passing a negative value into an unsigned parameter. These seem
> all to be generated from a set of defines in Grammer.hpp
>
> enum {
> UNKNOWN_SCOPE = -2
> , TOP_LEVEL_SCOPE = -1
> };
>
> And use of these in functions such as this:
>
> virtual const XMLElementDecl* getElemDecl
> (
> const unsigned int uriId
> , const XMLCh* const baseName
> , const XMLCh* const qName
> , unsigned int scope
> ) const = 0;
>
>
> How would people feel if we redefined those enums to be large
> positive integers such as UINT_MAX-1, UINT_MAX-2 or something? Or
> changing the scope parameter to be signed?
What speaks against using a named enum type for scope?
enum Scope{
UNKNOWN_SCOPE = -2
, TOP_LEVEL_SCOPE = -1
};
virtual const XMLElementDecl* getElemDecl
(
const unsigned int uriId
, const XMLCh* const baseName
, const XMLCh* const qName
, enum Scope scope
) const = 0;
Axel
--
Humboldt-Universit�t zu Berlin
Institut f�r Informatik
Signalverarbeitung und Mustererkennung
Dipl.-Inf. Axel Wei�
Rudower Chaussee 25
12489 Berlin-Adlershof
+49-30-2093-3050
** www.freesp.de **
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]