Changeset 1b6b76d in mainline for uspace/app/bithenge/transform.c
- Timestamp:
- 2012-08-12T05:10:17Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2988aec7
- Parents:
- 6be4142
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/transform.c
r6be4142 r1b6b76d 143 143 * @param[out] out_node Holds the result of applying this transform to the 144 144 * prefix. 145 * @param[out] out_size Holds the size of the prefix. 145 * @param[out] out_size Holds the size of the prefix. Can be null, in which 146 * case the size is not determined. 146 147 * @return EOK on success, ENOTSUP if not supported, or another error code from 147 148 * errno.h. */ … … 158 159 return ENOTSUP; 159 160 160 int rc = bithenge_transform_prefix_length(self, scope, blob, out_size); 161 aoff64_t size; 162 int rc = bithenge_transform_prefix_length(self, scope, blob, &size); 161 163 if (rc != EOK) 162 164 return rc; 163 165 bithenge_node_t *prefix_blob; 164 166 bithenge_blob_inc_ref(blob); 165 rc = bithenge_new_subblob(&prefix_blob, blob, 0, *out_size);167 rc = bithenge_new_subblob(&prefix_blob, blob, 0, size); 166 168 if (rc != EOK) 167 169 return rc; 168 170 rc = bithenge_transform_apply(self, scope, prefix_blob, out_node); 169 171 bithenge_node_dec_ref(prefix_blob); 172 if (out_size) 173 *out_size = size; 170 174 return rc; 171 175 } … … 560 564 { 561 565 char buffer; 562 *out_size = 1; 563 int rc = bithenge_blob_read_bits(blob, 0, &buffer, out_size, true); 564 if (rc != EOK) 565 return rc; 566 if (*out_size != 1) 567 return EINVAL; 566 aoff64_t size = 1; 567 int rc = bithenge_blob_read_bits(blob, 0, &buffer, &size, true); 568 if (rc != EOK) 569 return rc; 570 if (size != 1) 571 return EINVAL; 572 if (out_size) 573 *out_size = size; 568 574 return bithenge_new_boolean_node(out_node, (buffer & 1) != 0); 569 575 } … … 902 908 return EINVAL; 903 909 904 *out_size = num_bits;910 aoff64_t size = num_bits; 905 911 uint8_t buffer[sizeof(bithenge_int_t)]; 906 rc = bithenge_blob_read_bits(blob, 0, (char *)buffer, out_size,912 rc = bithenge_blob_read_bits(blob, 0, (char *)buffer, &size, 907 913 little_endian); 908 914 if (rc != EOK) 909 915 return rc; 910 if (*out_size != (aoff64_t)num_bits) 911 return EINVAL; 916 if (size != (aoff64_t)num_bits) 917 return EINVAL; 918 if (out_size) 919 *out_size = size; 912 920 913 921 bithenge_int_t result = 0;
Note:
See TracChangeset
for help on using the changeset viewer.