Changeset a8be91a in mainline for uspace/app/bithenge/transform.c


Ignore:
Timestamp:
2012-08-07T04:32:03Z (12 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c12b2ae
Parents:
0191bd3
Message:

Bithenge: bithenge_scope_copy can be deleted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bithenge/transform.c

    r0191bd3 ra8be91a  
    200200        free(self->params);
    201201        free(self);
    202 }
    203 
    204 /** Copy a scope.
    205  * @param[out] out The scope to fill in; must have been initialized with @a
    206  * bithenge_scope_init.
    207  * @param scope The scope to copy.
    208  * @return EOK on success or an error code from errno.h. */
    209 int bithenge_scope_copy(bithenge_scope_t *out, bithenge_scope_t *scope)
    210 {
    211         out->params = malloc(sizeof(*out->params) * scope->num_params);
    212         if (!out->params)
    213                 return ENOMEM;
    214         memcpy(out->params, scope->params, sizeof(*out->params) *
    215             scope->num_params);
    216         out->num_params = scope->num_params;
    217         for (int i = 0; i < out->num_params; i++)
    218                 bithenge_node_inc_ref(out->params[i]);
    219         bithenge_node_dec_ref(out->current_node);
    220         out->current_node = scope->current_node;
    221         if (out->current_node)
    222                 bithenge_node_inc_ref(out->current_node);
    223         return EOK;
    224202}
    225203
Note: See TracChangeset for help on using the changeset viewer.