Commented out broken code with ? operations.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@183 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-02-02 16:39:16 +00:00
commit 4216fb8a40

View file

@ -513,11 +513,14 @@ static int Swig_Type_tag_hash(DOH *o)
tag->hashkey = tag->hashkey =
Hashval(tag->name); Hashval(tag->name);
break; break;
#ifdef THIS_IS_BROKEN
/* Please do not use the ternary ? operator. It's too error prone, no one can read
it, and I don't like it. Plus, with it nested like this, I have no idea
what this code is supposed be doing. -- Dave */
case Swig_Type_Enum: case Swig_Type_Enum:
tag->hashkey = tag->hashkey =
(tag->name) ? Hashval(tag->name) : 0 + (tag->name) ? Hashval(tag->name) : 0 +
(tag->attributes) ? Hashval(tag->attributes) : 0 + (tag->attributes) ? Hashval(tag->attributes) : 0 + 5 << 10;
5 << 10;
break; break;
case Swig_Type_Struct: case Swig_Type_Struct:
tag->hashkey = tag->hashkey =
@ -541,13 +544,14 @@ static int Swig_Type_tag_hash(DOH *o)
(tag->attributes) ? Hashval(tag->attributes) : 0 + (tag->attributes) ? Hashval(tag->attributes) : 0 +
9 << 10; 9 << 10;
break; break;
#endif
case Swig_Type_Pointer: case Swig_Type_Pointer:
tag->hashkey = tag->hashkey =
(tag->is_const << 8) + (tag->is_const << 8) +
(tag->is_volatile << 9) + (tag->is_volatile << 9) +
10 << 10; 10 << 10;
break; break;
default: default:
tag->hashkey = tag->hashkey =
tag->type; tag->type;