Branch: Tag:

2013-06-11

2013-06-11 20:22:57 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added macro REFCOUNTED_TYPE().

This is to simplify renumbering of the types.

338:    default:    Pike_fatal("Instable mapping data flags.\n");    case MAPPING_WEAK_INDICES: -  if ((TYPEOF(from->ind) <= MAX_REF_TYPE) && +  if (REFCOUNTED_TYPE(TYPEOF(from->ind)) &&    (*from->ind.u.refs > 1)) {    goto keep_keypair;    }    break;    case MAPPING_WEAK_VALUES: -  if ((TYPEOF(from->val) <= MAX_REF_TYPE) && +  if (REFCOUNTED_TYPE(TYPEOF(from->val)) &&    (*from->val.u.refs > 1)) {    goto keep_keypair;    }
353:    /* NB: Compat: Unreference counted values are counted    * as multi-referenced here.    */ -  if (((TYPEOF(from->ind) > MAX_REF_TYPE) || +  if ((!REFCOUNTED_TYPE(TYPEOF(from->ind)) ||    (*from->ind.u.refs > 1)) && -  ((TYPEOF(from->val) > MAX_REF_TYPE) || +  (!REFCOUNTED_TYPE(TYPEOF(from->val)) ||    (*from->val.u.refs > 1))) {    goto keep_keypair;    }
431:    default:    Pike_fatal("Instable mapping data flags.\n");    case MAPPING_WEAK_INDICES: -  if ((TYPEOF(from->ind) <= MAX_REF_TYPE) && +  if (REFCOUNTED_TYPE(TYPEOF(from->ind)) &&    (*from->ind.u.refs > 1)) {    goto keep_keypair;    }    break;    case MAPPING_WEAK_VALUES: -  if ((TYPEOF(from->val) <= MAX_REF_TYPE) && +  if (REFCOUNTED_TYPE(TYPEOF(from->val)) &&    (*from->val.u.refs > 1)) {    goto keep_keypair;    }
446:    /* NB: Compat: Unreference counted values are counted    * as multi-referenced here.    */ -  if (((TYPEOF(from->ind) > MAX_REF_TYPE) || +  if ((!REFCOUNTED_TYPE(TYPEOF(from->ind)) ||    (*from->ind.u.refs > 1)) && -  ((TYPEOF(from->val) > MAX_REF_TYPE) || +  (!REFCOUNTED_TYPE(TYPEOF(from->val)) ||    (*from->val.u.refs > 1))) {    goto keep_keypair;    }