Index: uspace/lib/bithenge/src/expression.c
===================================================================
--- uspace/lib/bithenge/src/expression.c	(revision 6cd10acfc0149d4728e582f5922234de9820fc86)
+++ uspace/lib/bithenge/src/expression.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -48,5 +48,5 @@
  * @param[in] ops Operations provided by the expression.
  * @return EOK or an error code from errno.h. */
-int bithenge_init_expression(bithenge_expression_t *self,
+errno_t bithenge_init_expression(bithenge_expression_t *self,
     const bithenge_expression_ops_t *ops)
 {
@@ -88,8 +88,8 @@
 }
 
-static int binary_expression_evaluate(bithenge_expression_t *base,
+static errno_t binary_expression_evaluate(bithenge_expression_t *base,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
-	int rc;
+	errno_t rc;
 	binary_expression_t *self = expression_as_binary(base);
 	bithenge_node_t *a, *b;
@@ -250,9 +250,9 @@
  * @param b The second operand.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_binary_expression(bithenge_expression_t **out,
+errno_t bithenge_binary_expression(bithenge_expression_t **out,
     bithenge_binary_op_t op, bithenge_expression_t *a,
     bithenge_expression_t *b)
 {
-	int rc;
+	errno_t rc;
 	binary_expression_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -283,5 +283,5 @@
 /***************** in_node_expression                        *****************/
 
-static int in_node_evaluate(bithenge_expression_t *self,
+static errno_t in_node_evaluate(bithenge_expression_t *self,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -306,5 +306,5 @@
  * @param[out] out Holds the new expression.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_in_node_expression(bithenge_expression_t **out)
+errno_t bithenge_in_node_expression(bithenge_expression_t **out)
 {
 	if (bithenge_should_fail())
@@ -319,5 +319,5 @@
 /***************** current_node_expression                   *****************/
 
-static int current_node_evaluate(bithenge_expression_t *self,
+static errno_t current_node_evaluate(bithenge_expression_t *self,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -340,5 +340,5 @@
  * @param[out] out Holds the new expression.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_current_node_expression(bithenge_expression_t **out)
+errno_t bithenge_current_node_expression(bithenge_expression_t **out)
 {
 	bithenge_expression_inc_ref(&current_node_expression);
@@ -368,5 +368,5 @@
 }
 
-static int param_expression_evaluate(bithenge_expression_t *base,
+static errno_t param_expression_evaluate(bithenge_expression_t *base,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -390,7 +390,7 @@
  * @param index The index of the parameter to get.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_param_expression(bithenge_expression_t **out, int index)
-{
-	int rc;
+errno_t bithenge_param_expression(bithenge_expression_t **out, int index)
+{
+	errno_t rc;
 	param_expression_t *self = malloc(sizeof(*self));
 	if (!self)
@@ -430,5 +430,5 @@
 }
 
-static int const_expression_evaluate(bithenge_expression_t *base,
+static errno_t const_expression_evaluate(bithenge_expression_t *base,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -455,8 +455,8 @@
  * @param node The constant.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_const_expression(bithenge_expression_t **out,
+errno_t bithenge_const_expression(bithenge_expression_t **out,
     bithenge_node_t *node)
 {
-	int rc;
+	errno_t rc;
 	const_expression_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -501,5 +501,5 @@
 }
 
-static int scope_member_expression_evaluate(bithenge_expression_t *base, 
+static errno_t scope_member_expression_evaluate(bithenge_expression_t *base, 
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -511,5 +511,5 @@
 			continue;
 		bithenge_node_inc_ref(self->key);
-		int rc = bithenge_node_get(cur, self->key, out);
+		errno_t rc = bithenge_node_get(cur, self->key, out);
 		bithenge_node_dec_ref(cur);
 		if (rc != ENOENT) /* EOK or error */
@@ -537,8 +537,8 @@
  * @param key The key to search for in nodes being created.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_scope_member_expression(bithenge_expression_t **out,
+errno_t bithenge_scope_member_expression(bithenge_expression_t **out,
     bithenge_node_t *key)
 {
-	int rc;
+	errno_t rc;
 	scope_member_expression_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -582,10 +582,10 @@
 }
 
-static int subblob_expression_evaluate(bithenge_expression_t *base, 
+static errno_t subblob_expression_evaluate(bithenge_expression_t *base, 
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
 	subblob_expression_t *self = expression_as_subblob(base);
 	bithenge_node_t *start_node;
-	int rc = bithenge_expression_evaluate(self->start, scope, &start_node);
+	errno_t rc = bithenge_expression_evaluate(self->start, scope, &start_node);
 	if (rc != EOK)
 		return rc;
@@ -658,9 +658,9 @@
  * it is relative to the start.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_subblob_expression(bithenge_expression_t **out,
+errno_t bithenge_subblob_expression(bithenge_expression_t **out,
     bithenge_expression_t *blob, bithenge_expression_t *start,
     bithenge_expression_t *limit, bool absolute_limit)
 {
-	int rc;
+	errno_t rc;
 	subblob_expression_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -709,8 +709,8 @@
 }
 
-static int param_wrapper_fill_scope(param_wrapper_t *self, bithenge_scope_t
+static errno_t param_wrapper_fill_scope(param_wrapper_t *self, bithenge_scope_t
     *inner, bithenge_scope_t *outer)
 {
-	int rc;
+	errno_t rc;
 	int num_params = bithenge_transform_num_params(self->transform);
 	rc = bithenge_scope_alloc_params(inner, num_params);
@@ -730,10 +730,10 @@
 }
 
-static int param_wrapper_apply(bithenge_transform_t *base,
+static errno_t param_wrapper_apply(bithenge_transform_t *base,
     bithenge_scope_t *outer, bithenge_node_t *in, bithenge_node_t **out)
 {
 	param_wrapper_t *self = transform_as_param_wrapper(base);
 	bithenge_scope_t *inner;
-	int rc = bithenge_scope_new(&inner, outer);
+	errno_t rc = bithenge_scope_new(&inner, outer);
 	if (rc != EOK)
 		return rc;
@@ -750,10 +750,10 @@
 }
 
-static int param_wrapper_prefix_length(bithenge_transform_t *base,
+static errno_t param_wrapper_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *outer, bithenge_blob_t *in, aoff64_t *out)
 {
 	param_wrapper_t *self = transform_as_param_wrapper(base);
 	bithenge_scope_t *inner;
-	int rc = bithenge_scope_new(&inner, outer);
+	errno_t rc = bithenge_scope_new(&inner, outer);
 	if (rc != EOK)
 		return rc;
@@ -770,5 +770,5 @@
 }
 
-static int param_wrapper_prefix_apply(bithenge_transform_t *base,
+static errno_t param_wrapper_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *outer, bithenge_blob_t *in, bithenge_node_t **out_node,
     aoff64_t *out_length)
@@ -776,5 +776,5 @@
 	param_wrapper_t *self = transform_as_param_wrapper(base);
 	bithenge_scope_t *inner;
-	int rc = bithenge_scope_new(&inner, outer);
+	errno_t rc = bithenge_scope_new(&inner, outer);
 	if (rc != EOK)
 		return rc;
@@ -816,8 +816,8 @@
  * @param params The expressions used to calculate the parameters.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_param_wrapper(bithenge_transform_t **out,
+errno_t bithenge_param_wrapper(bithenge_transform_t **out,
     bithenge_transform_t *transform, bithenge_expression_t **params)
 {
-	int rc;
+	errno_t rc;
 	int num_params = bithenge_transform_num_params(transform);
 	param_wrapper_t *self = malloc(sizeof(*self));
@@ -868,10 +868,10 @@
 }
 
-static int expression_transform_apply(bithenge_transform_t *base,
+static errno_t expression_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
 	expression_transform_t *self = transform_as_expression(base);
 	bithenge_scope_t *inner;
-	int rc = bithenge_scope_new(&inner, scope);
+	errno_t rc = bithenge_scope_new(&inner, scope);
 	if (rc != EOK)
 		return rc;
@@ -900,8 +900,8 @@
  * @param expr The expression to evaluate.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_expression_transform(bithenge_transform_t ** out,
+errno_t bithenge_expression_transform(bithenge_transform_t ** out,
     bithenge_expression_t *expr)
 {
-	int rc;
+	errno_t rc;
 	expression_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -929,5 +929,5 @@
 /***************** inputless_transform            *****************/
 
-static int inputless_transform_prefix_length(bithenge_transform_t *base,
+static errno_t inputless_transform_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *in, aoff64_t *out)
 {
@@ -936,5 +936,5 @@
 }
 
-static int inputless_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t inputless_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *in, bithenge_node_t **out_node,
     aoff64_t *out_size)
@@ -957,8 +957,8 @@
  * @param expr The expression to evaluate.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_inputless_transform(bithenge_transform_t ** out,
+errno_t bithenge_inputless_transform(bithenge_transform_t ** out,
     bithenge_expression_t *expr)
 {
-	int rc;
+	errno_t rc;
 	expression_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -1004,10 +1004,10 @@
 }
 
-static int concat_blob_evaluate_b(concat_blob_t *self)
+static errno_t concat_blob_evaluate_b(concat_blob_t *self)
 {
 	if (self->b)
 		return EOK;
 	bithenge_node_t *b_node;
-	int rc = bithenge_expression_evaluate(self->b_expr, self->scope,
+	errno_t rc = bithenge_expression_evaluate(self->b_expr, self->scope,
 	    &b_node);
 	if (rc != EOK)
@@ -1026,8 +1026,8 @@
 }
 
-static int concat_blob_size(bithenge_blob_t *base, aoff64_t *size)
+static errno_t concat_blob_size(bithenge_blob_t *base, aoff64_t *size)
 {
 	concat_blob_t *self = blob_as_concat(base);
-	int rc = concat_blob_evaluate_b(self);
+	errno_t rc = concat_blob_evaluate_b(self);
 	if (rc != EOK)
 		return rc;
@@ -1037,8 +1037,8 @@
 }
 
-static int concat_blob_read(bithenge_blob_t *base, aoff64_t offset,
+static errno_t concat_blob_read(bithenge_blob_t *base, aoff64_t offset,
     char *buffer, aoff64_t *size)
 {
-	int rc;
+	errno_t rc;
 	concat_blob_t *self = blob_as_concat(base);
 
@@ -1065,8 +1065,8 @@
 }
 
-static int concat_blob_read_bits(bithenge_blob_t *base, aoff64_t offset,
+static errno_t concat_blob_read_bits(bithenge_blob_t *base, aoff64_t offset,
     char *buffer, aoff64_t *size, bool little_endian)
 {
-	int rc;
+	errno_t rc;
 	concat_blob_t *self = blob_as_concat(base);
 
@@ -1118,5 +1118,5 @@
  * @param b The second blob.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_concat_blob(bithenge_node_t **out, bithenge_blob_t *a,
+errno_t bithenge_concat_blob(bithenge_node_t **out, bithenge_blob_t *a,
     bithenge_blob_t *b)
 {
@@ -1124,5 +1124,5 @@
 	assert(a);
 	assert(b);
-	int rc;
+	errno_t rc;
 	concat_blob_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -1160,5 +1160,5 @@
  * @param scope The scope in which @a b_expr should be evaluated.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_concat_blob_lazy(bithenge_node_t **out, bithenge_blob_t *a,
+errno_t bithenge_concat_blob_lazy(bithenge_node_t **out, bithenge_blob_t *a,
     bithenge_expression_t *b_expr, bithenge_scope_t *scope)
 {
@@ -1167,5 +1167,5 @@
 	assert(b_expr);
 	assert(scope);
-	int rc;
+	errno_t rc;
 	concat_blob_t *self = malloc(sizeof(*self));
 	if (!self) {
