Changeset f9c314a5 in mainline for uspace/app/bithenge/expression.c


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

Bithenge: make scopes reference-counted

File:
1 edited

Legend:

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

    r0ce0103 rf9c314a5  
    424424{
    425425        param_wrapper_t *self = transform_as_param_wrapper(base);
    426         bithenge_scope_t inner;
    427         bithenge_scope_init(&inner);
    428         int rc = param_wrapper_fill_scope(self, &inner, outer);
    429         if (rc != EOK)
    430                 goto error;
    431 
    432         rc = bithenge_transform_apply(self->transform, &inner, in, out);
     426        bithenge_scope_t *inner;
     427        int rc = bithenge_scope_new(&inner);
     428        if (rc != EOK)
     429                return rc;
     430        rc = param_wrapper_fill_scope(self, inner, outer);
     431        if (rc != EOK)
     432                goto error;
     433
     434        rc = bithenge_transform_apply(self->transform, inner, in, out);
    433435        in = NULL;
    434436
    435437error:
    436         bithenge_scope_destroy(&inner);
     438        bithenge_scope_dec_ref(inner);
    437439        return rc;
    438440}
     
    442444{
    443445        param_wrapper_t *self = transform_as_param_wrapper(base);
    444         bithenge_scope_t inner;
    445         bithenge_scope_init(&inner);
    446         int rc = param_wrapper_fill_scope(self, &inner, outer);
    447         if (rc != EOK)
    448                 goto error;
    449 
    450         rc = bithenge_transform_prefix_length(self->transform, &inner, in,
    451             out);
     446        bithenge_scope_t *inner;
     447        int rc = bithenge_scope_new(&inner);
     448        if (rc != EOK)
     449                return rc;
     450        rc = param_wrapper_fill_scope(self, inner, outer);
     451        if (rc != EOK)
     452                goto error;
     453
     454        rc = bithenge_transform_prefix_length(self->transform, inner, in, out);
    452455        in = NULL;
    453456
    454457error:
    455         bithenge_scope_destroy(&inner);
     458        bithenge_scope_dec_ref(inner);
    456459        return rc;
    457460}
Note: See TracChangeset for help on using the changeset viewer.