Changes in uspace/lib/c/generic/cap.c [05b59393:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/cap.c
r05b59393 rb7fd2a0 81 81 * and @c cv_max gives the maximum value. 82 82 */ 83 int cap_to_blocks(cap_spec_t *cap, cap_vsel_t cvsel, size_t block_size,83 errno_t cap_to_blocks(cap_spec_t *cap, cap_vsel_t cvsel, size_t block_size, 84 84 uint64_t *rblocks) 85 85 { … … 90 90 uint64_t blocks; 91 91 uint64_t rem; 92 int rc;92 errno_t rc; 93 93 94 94 exp = cap->cunit * 3 - cap->dp; … … 144 144 unsigned sdig; 145 145 unsigned rdig; 146 int rc;146 errno_t rc; 147 147 148 148 /* Change units so that we have at most @c scap_max_idig integer digits */ … … 175 175 } 176 176 177 int cap_format(cap_spec_t *cap, char **rstr) 178 { 179 int rc; 177 errno_t cap_format(cap_spec_t *cap, char **rstr) 178 { 179 errno_t rc; 180 int ret; 180 181 const char *sunit; 181 182 uint64_t ipart; … … 196 197 sunit = cu_str[cap->cunit]; 197 198 if (cap->dp > 0) { 198 r c= asprintf(rstr, "%" PRIu64 ".%0*" PRIu64 " %s", ipart,199 ret = asprintf(rstr, "%" PRIu64 ".%0*" PRIu64 " %s", ipart, 199 200 (int)cap->dp, fpart, sunit); 200 201 } else { 201 r c= asprintf(rstr, "%" PRIu64 " %s", ipart, sunit);202 } 203 if (r c< 0)202 ret = asprintf(rstr, "%" PRIu64 " %s", ipart, sunit); 203 } 204 if (ret < 0) 204 205 return ENOMEM; 205 206 … … 207 208 } 208 209 209 static int cap_digit_val(char c, int *val)210 static errno_t cap_digit_val(char c, int *val) 210 211 { 211 212 switch (c) { … … 227 228 } 228 229 229 int cap_parse(const char *str, cap_spec_t *cap)230 errno_t cap_parse(const char *str, cap_spec_t *cap) 230 231 { 231 232 const char *eptr;
Note:
See TracChangeset
for help on using the changeset viewer.