quipu mercurial repository
Revision | 3d562cb27f9583f4be97d241ca469507b58efd78 (tree) |
---|---|
Zeit | 2019-10-18 06:32:31 |
Autor | Agustina Arzille <avarzille@rise...> |
Commiter | Agustina Arzille |
Several style fixes
@@ -221,7 +221,7 @@ | ||
221 | 221 | else if (!fct_p (*ptr)) |
222 | 222 | interp->raise ("type-error", QP_SPRINTF (interp, |
223 | 223 | "expected a function as slot initializer, got %Q", *ptr)); |
224 | - else if (as_int (slotdef_flags (slotdef)) & SLOTDEF_SHARED_FLG) | |
224 | + else if (slotdef_flags (slotdef) & fixint (SLOTDEF_SHARED_FLG)) | |
225 | 225 | xflags &= ~instance::init_flag; |
226 | 226 | |
227 | 227 | // Verify slot type. |
@@ -339,7 +339,7 @@ | ||
339 | 339 | tmp = *elem = copy_a (interp, tmp, false); |
340 | 340 | |
341 | 341 | slots_insert (interp, tmp, ptr, size); |
342 | - if (!(as_int (slotdef_flags (tmp)) & SLOTDEF_SHARED_FLG)) | |
342 | + if (!(slotdef_flags (tmp) & fixint (SLOTDEF_SHARED_FLG))) | |
343 | 343 | // Local slot. |
344 | 344 | slotdef_index(tmp) = fixint (ix++); |
345 | 345 | else |
@@ -363,7 +363,7 @@ | ||
363 | 363 | { |
364 | 364 | object tmp = ptr[j]; |
365 | 365 | if (tmp == fixint (0) || |
366 | - !(as_int (slotdef_flags (tmp)) & SLOTDEF_SHARED_FLG)) | |
366 | + !(slotdef_flags (tmp) & fixint (SLOTDEF_SHARED_FLG))) | |
367 | 367 | continue; |
368 | 368 | |
369 | 369 | *elem = copy_a (interp, tmp, false); |
@@ -634,7 +634,7 @@ | ||
634 | 634 | return (nullptr); |
635 | 635 | |
636 | 636 | *outpp = entry; |
637 | - if (as_int (entry->data[SLOTDEF_FLAGS]) & SLOTDEF_SHARED_FLG) | |
637 | + if (entry->data[SLOTDEF_FLAGS] & fixint (SLOTDEF_SHARED_FLG)) | |
638 | 638 | { // Inherited shared slot. |
639 | 639 | int ix = as_int (entry->data[SLOTDEF_INDEX]); |
640 | 640 | int i1 = ix & 0x3fff, i2 = ix >> 14; |
@@ -663,7 +663,7 @@ | ||
663 | 663 | *outpp = entry; |
664 | 664 | int ix = as_int (entry->data[SLOTDEF_INDEX]); |
665 | 665 | |
666 | - if (as_int (entry->data[SLOTDEF_FLAGS]) & SLOTDEF_SHARED_FLG) | |
666 | + if (entry->data[SLOTDEF_FLAGS] & fixint (SLOTDEF_SHARED_FLG)) | |
667 | 667 | { // Inherited shared slot. |
668 | 668 | int i1 = ix & 0x3fff, i2 = ix >> 14; |
669 | 669 | if (i2 != 0) |
@@ -725,7 +725,7 @@ | ||
725 | 725 | { |
726 | 726 | object def = it.slotdef (); |
727 | 727 | if (xaref (def, SLOTDEF_INIT) == UNBOUND || |
728 | - (as_int (xaref (def, SLOTDEF_FLAGS)) & SLOTDEF_SHARED_FLG)) | |
728 | + (xaref (def, SLOTDEF_FLAGS) & fixint (SLOTDEF_SHARED_FLG))) | |
729 | 729 | continue; |
730 | 730 | |
731 | 731 | interp->push (xaref (def, SLOTDEF_INIT)); |
@@ -750,7 +750,7 @@ | ||
750 | 750 | |
751 | 751 | if (sdef) |
752 | 752 | { |
753 | - if (as_int (sdef->data[SLOTDEF_FLAGS]) & SLOTDEF_GETTER_FLG) | |
753 | + if (sdef->data[SLOTDEF_FLAGS] & fixint (SLOTDEF_GETTER_FLG)) | |
754 | 754 | { |
755 | 755 | interp->push (xaref (sdef->data[SLOTDEF_PROPS], 0)); |
756 | 756 | interp->push (inst); |
@@ -784,13 +784,13 @@ | ||
784 | 784 | else if (!str_p (key)) |
785 | 785 | interp->raise ("type-error", "slot name must be a string or keyword"); |
786 | 786 | |
787 | - const array *sdef; | |
787 | + const array *sdef = nullptr; | |
788 | 788 | object *ptr = slot_ptr (interp, inst, as_str (key), &sdef); |
789 | 789 | |
790 | 790 | if (!ptr) |
791 | - interp->raise ("unbound-error", QP_SPRINTF (interp, | |
792 | - "slot %Q is unbound", key)); | |
793 | - else if (as_int (sdef->data[SLOTDEF_FLAGS]) & SLOTDEF_SETTER_FLG) | |
791 | + interp->raise ("unbound-error", | |
792 | + QP_SPRINTF (interp, "slot %Q is unbound", key)); | |
793 | + else if (sdef->data[SLOTDEF_FLAGS] & fixint (SLOTDEF_SETTER_FLG)) | |
794 | 794 | { |
795 | 795 | interp->push (xaref (sdef->data[SLOTDEF_PROPS], 1)); |
796 | 796 | interp->push (inst); |
@@ -806,7 +806,7 @@ | ||
806 | 806 | *ptr = val; |
807 | 807 | gc_wbarrier (interp, inst, val); |
808 | 808 | |
809 | - if (!(as_int (sdef->data[SLOTDEF_FLAGS]) & SLOTDEF_GETTER_FLG)) | |
809 | + if (!(sdef->data[SLOTDEF_FLAGS] & fixint (SLOTDEF_GETTER_FLG))) | |
810 | 810 | ; |
811 | 811 | else if (qp_likely (singlethr_p ())) |
812 | 812 | sdef->data[SLOTDEF_FLAGS] &= ~fixint (SLOTDEF_GETTER_FLG); |