| 142 | } |
| 143 | |
| 144 | static AttributeSet AttributeSet_AddPrepare |
| 145 | ( |
| 146 | AttributeSet *set, // set to update |
| 147 | ushort n // number of attributes to add |
| 148 | ) { |
| 149 | ASSERT(set != NULL); |
| 150 | |
| 151 | AttributeSet _set = *set; |
| 152 | |
| 153 | // attribute-set can't be read-only |
| 154 | ASSERT(ATTRIBUTE_SET_IS_READONLY(_set) == false); |
| 155 | |
| 156 | // allocate room for new attribute |
| 157 | if(_set == NULL) { |
| 158 | _set = rm_malloc(sizeof(_AttributeSet) + n * sizeof(Attribute)); |
| 159 | _set->attr_count = n; |
| 160 | } else { |
| 161 | _set->attr_count += n; |
| 162 | _set = rm_realloc(_set, ATTRIBUTESET_BYTE_SIZE(_set)); |
| 163 | } |
| 164 | |
| 165 | return _set; |
| 166 | } |
| 167 | |
| 168 | // adds an attribute to the set without cloning the SIvalue |
| 169 | void AttributeSet_AddNoClone |
no test coverage detected