• Home
  • Raw
  • Download

Lines Matching full:destination

181 int aom_vector_copy(Vector *destination, Vector *source) {
182 assert(destination != NULL);
185 assert(!aom_vector_is_initialized(destination));
187 if (destination == NULL) return VECTOR_ERROR;
189 if (aom_vector_is_initialized(destination)) return VECTOR_ERROR;
193 destination->size = source->size;
194 destination->capacity = source->size * 2;
195 destination->element_size = source->element_size;
198 destination->data = malloc(destination->capacity * source->element_size);
199 if (destination->data == NULL) return VECTOR_ERROR;
201 memcpy(destination->data, source->data, aom_vector_byte_size(source));
206 int aom_vector_copy_assign(Vector *destination, Vector *source) {
207 assert(destination != NULL);
210 assert(aom_vector_is_initialized(destination));
212 if (destination == NULL) return VECTOR_ERROR;
214 if (!aom_vector_is_initialized(destination)) return VECTOR_ERROR;
217 aom_vector_destroy(destination);
219 return aom_vector_copy(destination, source);
222 int aom_vector_move(Vector *destination, Vector *source) {
223 assert(destination != NULL);
226 if (destination == NULL) return VECTOR_ERROR;
229 *destination = *source;
235 int aom_vector_move_assign(Vector *destination, Vector *source) {
236 aom_vector_swap(destination, source);
240 int aom_vector_swap(Vector *destination, Vector *source) {
243 assert(destination != NULL);
246 assert(aom_vector_is_initialized(destination));
248 if (destination == NULL) return VECTOR_ERROR;
250 if (!aom_vector_is_initialized(destination)) return VECTOR_ERROR;
253 _vector_swap(&destination->size, &source->size);
254 _vector_swap(&destination->capacity, &source->capacity);
255 _vector_swap(&destination->element_size, &source->element_size);
257 temp = destination->data;
258 destination->data = source->data;