Skip to content

Commit

Permalink
Bindings: Fixed a potentially dangerous assumption about cbdevtype_t
Browse files Browse the repository at this point in the history
The enumeration cbdevtype_e is now explicitly defined to match the
values of the ddevent types, as that how it is expected to be used.
  • Loading branch information
skyjake committed Jul 13, 2012
1 parent 6562102 commit 22bc606
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions doomsday/engine/portable/include/b_device.h
Expand Up @@ -32,9 +32,9 @@
#include "b_util.h"

typedef enum cbdevtype_e {
CBD_TOGGLE,
CBD_AXIS,
CBD_ANGLE,
CBD_TOGGLE = E_TOGGLE,
CBD_AXIS = E_AXIS,
CBD_ANGLE = E_ANGLE,
NUM_CBD_TYPES
} cbdevtype_t;

Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/b_context.c
Expand Up @@ -768,7 +768,7 @@ boolean B_FindMatchingBinding(bcontext_t* bc, evbinding_t* match1,
{
if(B_AreConditionsEqual(match2->numConds, match2->conds, e->numConds, e->conds) &&
match2->device == e->device && match2->id == e->id &&
match2->type == e->type)
match2->type == (cbdevtype_t) e->type)
{
*evResult = e;
return true;
Expand All @@ -786,7 +786,7 @@ boolean B_FindMatchingBinding(bcontext_t* bc, evbinding_t* match1,
{
if(B_AreConditionsEqual(match1->numConds, match1->conds, d->numConds, d->conds) &&
match1->device == d->device && match1->id == d->id &&
match1->type == d->type)
match1->type == (ddeventtype_t) d->type)
{
*dResult = d;
return true;
Expand Down

0 comments on commit 22bc606

Please sign in to comment.