Index: uspace/lib/bithenge/src/sequence.c
===================================================================
--- uspace/lib/bithenge/src/sequence.c	(revision 6cd10acfc0149d4728e582f5922234de9820fc86)
+++ uspace/lib/bithenge/src/sequence.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -58,5 +58,5 @@
 
 typedef struct seq_node_ops {
-	int (*get_transform)(seq_node_t *self, bithenge_transform_t **out,
+	errno_t (*get_transform)(seq_node_t *self, bithenge_transform_t **out,
 	    bithenge_int_t index);
 } seq_node_ops_t;
@@ -72,5 +72,5 @@
 }
 
-static int seq_node_field_offset(seq_node_t *self, aoff64_t *out, size_t index)
+static errno_t seq_node_field_offset(seq_node_t *self, aoff64_t *out, size_t index)
 {
 	if (index == 0) {
@@ -83,5 +83,5 @@
 	for (; self->num_ends <= index; self->num_ends++) {
 		bithenge_transform_t *subxform;
-		int rc = self->ops->get_transform(self, &subxform,
+		errno_t rc = self->ops->get_transform(self, &subxform,
 		    self->num_ends);
 		if (rc != EOK)
@@ -136,9 +136,9 @@
 }
 
-static int seq_node_subtransform(seq_node_t *self, bithenge_node_t **out,
+static errno_t seq_node_subtransform(seq_node_t *self, bithenge_node_t **out,
     size_t index)
 {
 	aoff64_t start_pos;
-	int rc = seq_node_field_offset(self, &start_pos, index);
+	errno_t rc = seq_node_field_offset(self, &start_pos, index);
 	if (rc != EOK)
 		return rc;
@@ -194,5 +194,5 @@
 	} else {
 		aoff64_t end_pos;
-		int rc = seq_node_field_offset(self, &end_pos, index + 1);
+		errno_t rc = seq_node_field_offset(self, &end_pos, index + 1);
 		if (rc != EOK) {
 			bithenge_transform_dec_ref(subxform);
@@ -220,8 +220,8 @@
 }
 
-static int seq_node_complete(seq_node_t *self, bool *out)
+static errno_t seq_node_complete(seq_node_t *self, bool *out)
 {
 	aoff64_t blob_size, end_pos;
-	int rc = bithenge_blob_size(self->blob, &blob_size);
+	errno_t rc = bithenge_blob_size(self->blob, &blob_size);
 	if (rc != EOK)
 		return rc;
@@ -251,5 +251,5 @@
 }
 
-static int seq_node_init(seq_node_t *self, const seq_node_ops_t *ops,
+static errno_t seq_node_init(seq_node_t *self, const seq_node_ops_t *ops,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_int_t num_xforms,
     bool end_on_empty)
@@ -319,8 +319,8 @@
 }
 
-static int struct_node_for_each(bithenge_node_t *base,
+static errno_t struct_node_for_each(bithenge_node_t *base,
     bithenge_for_each_func_t func, void *data)
 {
-	int rc = EOK;
+	errno_t rc = EOK;
 	struct_node_t *self = node_as_struct(base);
 	bithenge_named_transform_t *subxforms =
@@ -368,10 +368,10 @@
 }
 
-static int struct_node_get(bithenge_node_t *base, bithenge_node_t *key,
+static errno_t struct_node_get(bithenge_node_t *base, bithenge_node_t *key,
     bithenge_node_t **out)
 {
 	struct_node_t *self = node_as_struct(base);
 
-	int rc = ENOENT;
+	errno_t rc = ENOENT;
 	if (bithenge_node_type(key) != BITHENGE_NODE_STRING)
 		goto end;
@@ -455,5 +455,5 @@
 };
 
-static int struct_node_get_transform(seq_node_t *base,
+static errno_t struct_node_get_transform(seq_node_t *base,
     bithenge_transform_t **out, bithenge_int_t index)
 {
@@ -468,5 +468,5 @@
 };
 
-static int struct_transform_make_node(struct_transform_t *self,
+static errno_t struct_transform_make_node(struct_transform_t *self,
     bithenge_node_t **out, bithenge_scope_t *scope, bithenge_blob_t *blob,
     bool prefix)
@@ -476,5 +476,5 @@
 		return ENOMEM;
 
-	int rc = bithenge_init_internal_node(struct_as_node(node),
+	errno_t rc = bithenge_init_internal_node(struct_as_node(node),
 	    &struct_node_ops);
 	if (rc != EOK) {
@@ -513,5 +513,5 @@
 }
 
-static int struct_transform_apply(bithenge_transform_t *base,
+static errno_t struct_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -523,10 +523,10 @@
 }
 
-static int struct_transform_prefix_length(bithenge_transform_t *base,
+static errno_t struct_transform_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, aoff64_t *out)
 {
 	struct_transform_t *self = transform_as_struct(base);
 	bithenge_node_t *struct_node;
-	int rc = struct_transform_make_node(self, &struct_node, scope, blob,
+	errno_t rc = struct_transform_make_node(self, &struct_node, scope, blob,
 	    true);
 	if (rc != EOK)
@@ -539,10 +539,10 @@
 }
 
-static int struct_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t struct_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
 {
 	struct_transform_t *self = transform_as_struct(base);
-	int rc = struct_transform_make_node(self, out_node, scope, blob,
+	errno_t rc = struct_transform_make_node(self, out_node, scope, blob,
 	    true);
 	if (rc != EOK)
@@ -592,8 +592,8 @@
  * @param subtransforms The subtransforms and field names.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_struct(bithenge_transform_t **out,
+errno_t bithenge_new_struct(bithenge_transform_t **out,
     bithenge_named_transform_t *subtransforms)
 {
-	int rc;
+	errno_t rc;
 	struct_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -669,8 +669,8 @@
 }
 
-static int repeat_node_for_each(bithenge_node_t *base,
+static errno_t repeat_node_for_each(bithenge_node_t *base,
     bithenge_for_each_func_t func, void *data)
 {
-	int rc = EOK;
+	errno_t rc = EOK;
 	repeat_node_t *self = node_as_repeat(base);
 
@@ -712,5 +712,5 @@
 }
 
-static int repeat_node_get(bithenge_node_t *base, bithenge_node_t *key,
+static errno_t repeat_node_get(bithenge_node_t *base, bithenge_node_t *key,
     bithenge_node_t **out)
 {
@@ -743,5 +743,5 @@
 };
 
-static int repeat_node_get_transform(seq_node_t *base,
+static errno_t repeat_node_get_transform(seq_node_t *base,
     bithenge_transform_t **out, bithenge_int_t index)
 {
@@ -756,5 +756,5 @@
 };
 
-static int repeat_transform_make_node(repeat_transform_t *self,
+static errno_t repeat_transform_make_node(repeat_transform_t *self,
     bithenge_node_t **out, bithenge_scope_t *scope, bithenge_blob_t *blob,
     bool prefix)
@@ -763,5 +763,5 @@
 	if (self->expr != NULL) {
 		bithenge_node_t *count_node;
-		int rc = bithenge_expression_evaluate(self->expr, scope,
+		errno_t rc = bithenge_expression_evaluate(self->expr, scope,
 		    &count_node);
 		if (rc != EOK)
@@ -781,5 +781,5 @@
 		return ENOMEM;
 
-	int rc = bithenge_init_internal_node(repeat_as_node(node),
+	errno_t rc = bithenge_init_internal_node(repeat_as_node(node),
 	    &repeat_node_ops);
 	if (rc != EOK) {
@@ -803,5 +803,5 @@
 }
 
-static int repeat_transform_apply(bithenge_transform_t *base,
+static errno_t repeat_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -813,10 +813,10 @@
 }
 
-static int repeat_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t repeat_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
 {
 	repeat_transform_t *self = transform_as_repeat(base);
-	int rc = repeat_transform_make_node(self, out_node, scope, blob, true);
+	errno_t rc = repeat_transform_make_node(self, out_node, scope, blob, true);
 	if (rc != EOK)
 		return rc;
@@ -871,8 +871,8 @@
  * May be NULL, in which case @a xform will be applied indefinitely.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_repeat_transform(bithenge_transform_t **out,
+errno_t bithenge_repeat_transform(bithenge_transform_t **out,
     bithenge_transform_t *xform, bithenge_expression_t *expr)
 {
-	int rc;
+	errno_t rc;
 	repeat_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -947,8 +947,8 @@
 }
 
-static int do_while_node_for_each(bithenge_node_t *base,
+static errno_t do_while_node_for_each(bithenge_node_t *base,
     bithenge_for_each_func_t func, void *data)
 {
-	int rc = EOK;
+	errno_t rc = EOK;
 	do_while_node_t *self = node_as_do_while(base);
 
@@ -1018,5 +1018,5 @@
 };
 
-static int do_while_node_get_transform(seq_node_t *base,
+static errno_t do_while_node_get_transform(seq_node_t *base,
     bithenge_transform_t **out, bithenge_int_t index)
 {
@@ -1031,5 +1031,5 @@
 };
 
-static int do_while_transform_make_node(do_while_transform_t *self,
+static errno_t do_while_transform_make_node(do_while_transform_t *self,
     bithenge_node_t **out, bithenge_scope_t *scope, bithenge_blob_t *blob)
 {
@@ -1038,5 +1038,5 @@
 		return ENOMEM;
 
-	int rc = bithenge_init_internal_node(do_while_as_node(node),
+	errno_t rc = bithenge_init_internal_node(do_while_as_node(node),
 	    &do_while_node_ops);
 	if (rc != EOK) {
@@ -1061,5 +1061,5 @@
 }
 
-static int for_each_noop(bithenge_node_t *key, bithenge_node_t *value,
+static errno_t for_each_noop(bithenge_node_t *key, bithenge_node_t *value,
     void *data)
 {
@@ -1069,10 +1069,10 @@
 }
 
-static int do_while_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t do_while_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
 {
 	do_while_transform_t *self = transform_as_do_while(base);
-	int rc = do_while_transform_make_node(self, out_node, scope, blob);
+	errno_t rc = do_while_transform_make_node(self, out_node, scope, blob);
 	if (rc != EOK)
 		return rc;
@@ -1116,8 +1116,8 @@
  * determine whether there will be more.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_do_while_transform(bithenge_transform_t **out,
+errno_t bithenge_do_while_transform(bithenge_transform_t **out,
     bithenge_transform_t *xform, bithenge_expression_t *expr)
 {
-	int rc;
+	errno_t rc;
 	do_while_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
