Permalink
Browse files

oops, fixed bad error checking code

  • Loading branch information...
1 parent 3a5b64b commit b95715f80f03f4591de5b860bfa8271e90e51240 @banister committed Feb 13, 2009
Showing with 2 additions and 4 deletions.
  1. +2 −4 mixology.c
View
@@ -1,7 +1,5 @@
#include "ruby.h"
-/* common macros */
-
/* cannot use ordinary CLASS_OF as it does not return an lvalue */
#define KLASS_OF(c) (RBASIC(c)->klass)
@@ -43,7 +41,7 @@ static VALUE rb_unmix(VALUE self, VALUE module) {
VALUE klass;
/* check that module is valid */
- if (!TYPE(module) == T_MODULE)
+ if (TYPE(module) != T_MODULE)
rb_raise(rb_eArgError, "error: parameter must be a module");
for (klass = KLASS_OF(self); klass != rb_class_real(klass); klass = RCLASS_SUPER(klass)) {
@@ -101,7 +99,7 @@ static VALUE rb_mixin(VALUE self, VALUE module) {
int index;
/* check that module is valid */
- if (!TYPE(module) == T_MODULE)
+ if (TYPE(module) != T_MODULE)
rb_raise(rb_eArgError, "error: parameter must be a module");
rb_unmix(self, module);

0 comments on commit b95715f

Please sign in to comment.