/* generated by Id 1.1 at ,$ */ /* with the command: -I../stage1/ -c Magnitude.st -o ../stage2/Magnitude.o.c */ #include static struct __libid *_libid= 0; #ifdef ID_DEBUG # define _enter(info) void *__id_debug= _libid->enter(info) # define _line(lno) _libid->line(lno) # define _leave() _libid->leave(__id_debug) # define _backtrace() _libid->backtrace() #else # define _enter(info) (void)info # define _line(lno) # define _leave() # define _backtrace() "(no debugging information)\n" #endif #define _return _leave(); return #define _sendv(MSG, N, RCV, ARG...) ({ \ struct __send _s= { (MSG), (N), (RCV) }; \ ((_imp_t)(_libid->bindv(&_s)))(&_s, _s.receiver, _s.receiver, ##ARG); \ }) #define _superv(TYP, MSG, N, RCV, ARG...) ({ \ struct __send _s= { (MSG), (N), (TYP) }; \ _imp_t _imp= _libid->bindv(&_s); \ _s.receiver= (RCV); \ _imp(&_s, _s.receiver, _s.receiver, ##ARG); \ }) static oop s__3c_3d= 0; static oop s_min_= 0; static oop s__3d= 0; static oop s_between_and_= 0; static oop s_ifTrue_ifFalse_= 0; static oop s__3c= 0; static oop s_subclassResponsibility_= 0; static oop s__5fimport_= 0; static oop s_and_= 0; static oop s_size_5f_value_5f_= 0; static oop s__3e= 0; static oop s_or_= 0; static oop s_not= 0; static oop s__3e_3d= 0; static oop s__7e_3d= 0; static oop s_max_= 0; static struct _Selector { const char *name; oop *addr; } _Selectors[]= { { "<=", &s__3c_3d }, { "min:", &s_min_ }, { "=", &s__3d }, { "between:and:", &s_between_and_ }, { "ifTrue:ifFalse:", &s_ifTrue_ifFalse_ }, { "<", &s__3c }, { "subclassResponsibility:", &s_subclassResponsibility_ }, { "_import:", &s__5fimport_ }, { "and:", &s_and_ }, { "size_:value_:", &s_size_5f_value_5f_ }, { ">", &s__3e }, { "or:", &s_or_ }, { "not", &s_not }, { ">=", &s__3e_3d }, { "~=", &s__7e_3d }, { "max:", &s_max_ }, { 0, 0 } }; struct t__object { struct _vtable *_vtable[0]; }; struct t__selector { struct _vtable *_vtable[0]; oop v__size; oop v__elements; }; struct t__assoc { struct _vtable *_vtable[0]; oop v_key; oop v_value; }; struct t__closure { struct _vtable *_vtable[0]; oop v__method; oop v_data; }; struct t__vector { struct _vtable *_vtable[0]; oop v__size; }; struct t__vtable { struct _vtable *_vtable[0]; oop v__tally; oop v_bindings; oop v_delegate; }; struct t_Object { struct _vtable *_vtable[0]; }; struct t_UndefinedObject { struct _vtable *_vtable[0]; }; struct t_StaticBlockClosure { struct _vtable *_vtable[0]; oop v__function; oop v__arity; }; struct t_BlockClosure { struct _vtable *_vtable[0]; oop v__function; oop v__arity; oop v_outer; oop v_state; oop v__nlr; }; struct t_Magnitude { struct _vtable *_vtable[0]; }; struct t_Character { struct _vtable *_vtable[0]; oop v_value; }; struct t_Number { struct _vtable *_vtable[0]; }; struct t_Fraction { struct _vtable *_vtable[0]; oop v_numerator; oop v_denominator; }; struct t_Float { struct _vtable *_vtable[0]; }; struct t_Integer { struct _vtable *_vtable[0]; }; struct t_SmallInteger { struct _vtable *_vtable[0]; }; struct t_LargePositiveInteger { struct _vtable *_vtable[0]; oop v_bytes; }; struct t_LargeNegativeInteger { struct _vtable *_vtable[0]; oop v_bytes; }; struct t_Collection { struct _vtable *_vtable[0]; }; struct t_SequenceableCollection { struct _vtable *_vtable[0]; }; struct t_ArrayedCollection { struct _vtable *_vtable[0]; oop v_size; }; struct t_Array { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; struct t_ImmutableArray { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; struct t_WordArray { struct _vtable *_vtable[0]; oop v_size; oop v__words; }; struct t_ImmutableWordArray { struct _vtable *_vtable[0]; oop v_size; oop v__words; }; struct t_ByteArray { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_ImmutableByteArray { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_String { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_ImmutableString { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_Symbol { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_nil { struct _vtable *_vtable[0]; }; struct t_true { struct _vtable *_vtable[0]; }; struct t_false { struct _vtable *_vtable[0]; }; struct t_CharacterTable { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; static oop l_5= 0; static oop v__object= 0; static oop v_Object= 0; static oop v_UndefinedObject= 0; static oop v_StaticBlockClosure= 0; static oop v_Magnitude= 0; static oop v_Number= 0; static oop v_Integer= 0; static oop v_LargePositiveInteger= 0; static oop v_Collection= 0; static oop v_SequenceableCollection= 0; static oop v_ArrayedCollection= 0; static oop v_Array= 0; static oop v_WordArray= 0; static oop v_ByteArray= 0; static oop v_String= 0; static oop v_ImmutableString= 0; static oop v_true= 0; static oop v_false= 0; static struct __methodinfo __info1= { "min:", "Magnitude", "/Users/piumarta/src/idst/object/st80/Magnitude.st", 0, 25, 26, 0 }; static oop Magnitude__min_(oop v__closure, oop v_stateful_self, oop v_self, oop v_aMagnitude) { _enter(&__info1); oop _1= 0; oop _2= 0; _line(25); /* ifTrue:ifFalse: */ _1= v_self; _2= v_aMagnitude; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 < (long)_2) ? v_true : v_false); } else _1= _sendv(s__3c, 2, _1, _2); if (!_1) goto _l1; { _1= v_self; } goto _l2; _l1:; { _1= v_aMagnitude; } _l2:; _leave(); return _1; _leave(); } static struct __methodinfo __info2= { "max:", "Magnitude", "/Users/piumarta/src/idst/object/st80/Magnitude.st", 0, 26, 28, &__info1 }; static oop Magnitude__max_(oop v__closure, oop v_stateful_self, oop v_self, oop v_aMagnitude) { _enter(&__info2); oop _1= 0; oop _2= 0; _line(26); /* ifTrue:ifFalse: */ _1= v_self; _2= v_aMagnitude; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 < (long)_2) ? v_true : v_false); } else _1= _sendv(s__3c, 2, _1, _2); if (!_1) goto _l3; { _1= v_aMagnitude; } goto _l4; _l3:; { _1= v_self; } _l4:; _leave(); return _1; _leave(); } static struct __methodinfo __info3= { "between:and:", "Magnitude", "/Users/piumarta/src/idst/object/st80/Magnitude.st", 0, 28, 33, &__info2 }; static oop Magnitude__between_and_(oop v__closure, oop v_stateful_self, oop v_self, oop v_lower, oop v_upper) { _enter(&__info3); oop _1= 0; oop _2= 0; _line(28); /* and: */ _1= v_self; _2= v_lower; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 >= (long)_2) ? v_true : v_false); } else _1= _sendv(s__3e_3d, 2, _1, _2); if (!_1) goto _l5; { _1= v_self; _2= v_upper; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 <= (long)_2) ? v_true : v_false); } else _1= _sendv(s__3c_3d, 2, _1, _2); } _l5:; _leave(); return _1; _leave(); } static struct __methodinfo __info4= { "<", "Magnitude", "/Users/piumarta/src/idst/object/st80/Magnitude.st", 0, 33, 34, &__info3 }; static oop Magnitude___3c(oop v__closure, oop v_stateful_self, oop v_self, oop v_aMagnitude) { _enter(&__info4); oop _1= 0; oop _2= 0; _line(33); _1= v_self; _2= l_5; _line(33); _1=_sendv(s_subclassResponsibility_, 2, _1, _2); _leave(); return _1; _leave(); } static struct __methodinfo __info6= { "<=", "Magnitude", "/Users/piumarta/src/idst/object/st80/Magnitude.st", 0, 34, 35, &__info4 }; static oop Magnitude___3c_3d(oop v__closure, oop v_stateful_self, oop v_self, oop v_aMagnitude) { _enter(&__info6); oop _1= 0; oop _2= 0; _line(34); /* or: */ _1= v_self; _2= v_aMagnitude; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 < (long)_2) ? v_true : v_false); } else _1= _sendv(s__3c, 2, _1, _2); if (_1) goto _l6; { _1= v_self; _2= v_aMagnitude; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 == (long)_2) ? v_true : v_false); } else _1= _sendv(s__3d, 2, _1, _2); } _l6:; _leave(); return _1; _leave(); } static struct __methodinfo __info7= { "~=", "Magnitude", "/Users/piumarta/src/idst/object/st80/Magnitude.st", 0, 35, 36, &__info6 }; static oop Magnitude___7e_3d(oop v__closure, oop v_stateful_self, oop v_self, oop v_aMagnitude) { _enter(&__info7); oop _1= 0; oop _2= 0; _line(35); _1= v_self; _2= v_aMagnitude; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 == (long)_2) ? v_true : v_false); } else _1= _sendv(s__3d, 2, _1, _2); _line(35); _1=_sendv(s_not, 1, _1); _leave(); return _1; _leave(); } static struct __methodinfo __info8= { ">=", "Magnitude", "/Users/piumarta/src/idst/object/st80/Magnitude.st", 0, 36, 37, &__info7 }; static oop Magnitude___3e_3d(oop v__closure, oop v_stateful_self, oop v_self, oop v_aMagnitude) { _enter(&__info8); oop _1= 0; oop _2= 0; _line(36); _1= v_self; _2= v_aMagnitude; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 < (long)_2) ? v_true : v_false); } else _1= _sendv(s__3c, 2, _1, _2); _line(36); _1=_sendv(s_not, 1, _1); _leave(); return _1; _leave(); } static struct __methodinfo __info9= { ">", "Magnitude", "/Users/piumarta/src/idst/object/st80/Magnitude.st", 0, 37, 38, &__info8 }; static oop Magnitude___3e(oop v__closure, oop v_stateful_self, oop v_self, oop v_aMagnitude) { _enter(&__info9); oop _1= 0; oop _2= 0; _line(37); _1= v_self; _2= v_aMagnitude; if (1 & (long)_1 & (long)_2) { _1= (((long)_1 <= (long)_2) ? v_true : v_false); } else _1= _sendv(s__3c_3d, 2, _1, _2); _line(37); _1=_sendv(s_not, 1, _1); _leave(); return _1; _leave(); } static struct __methodinfo __info= { "__id__init__", "", "Magnitude.st", 0, 0, 0, &__info9 }; void __id__init__Magnitude(struct __libid *__libid) { if (_libid) return; if (!(_libid= __libid)) { fprintf(stderr, "init _libid %p\n", __libid); abort(); } # define GC_add_roots _libid->gc_addRoots GC_INIT(); { struct _Selector *s= 0; for (s= _Selectors; s->name; ++s) *s->addr= _libid->intern(s->name); } _enter(&__info); _libid->infos(&__info, &__info1); _sendv(s__5fimport_, 3, _libid->_object, "Object", "__id__init__Object"); v__object= _libid->import("_object"); v_Object= _libid->import("Object"); v_UndefinedObject= _libid->import("UndefinedObject"); v_StaticBlockClosure= _libid->import("StaticBlockClosure"); v_Magnitude= _libid->import("Magnitude"); v_Number= _libid->import("Number"); v_Integer= _libid->import("Integer"); v_LargePositiveInteger= _libid->import("LargePositiveInteger"); v_Collection= _libid->import("Collection"); v_SequenceableCollection= _libid->import("SequenceableCollection"); v_ArrayedCollection= _libid->import("ArrayedCollection"); v_Array= _libid->import("Array"); v_WordArray= _libid->import("WordArray"); v_ByteArray= _libid->import("ByteArray"); v_String= _libid->import("String"); v_ImmutableString= _libid->import("ImmutableString"); v_true= _libid->import("true"); v_false= _libid->import("false"); _libid->method(v_Magnitude, s_min_, (_imp_t)Magnitude__min_); _libid->method(v_Magnitude, s_max_, (_imp_t)Magnitude__max_); _libid->method(v_Magnitude, s_between_and_, (_imp_t)Magnitude__between_and_); l_5= _sendv(s_size_5f_value_5f_, 3, v_ImmutableString, 1, "<"); _libid->method(v_Magnitude, s__3c, (_imp_t)Magnitude___3c); _libid->method(v_Magnitude, s__3c_3d, (_imp_t)Magnitude___3c_3d); _libid->method(v_Magnitude, s__7e_3d, (_imp_t)Magnitude___7e_3d); _libid->method(v_Magnitude, s__3e_3d, (_imp_t)Magnitude___3e_3d); _libid->method(v_Magnitude, s__3e, (_imp_t)Magnitude___3e); _leave(); }