Changes in uspace/lib/c/generic/str.c [b7fd2a0:cde999a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str.c
rb7fd2a0 rcde999a 196 196 * code was invalid. 197 197 */ 198 errno_t chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size)198 int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size) 199 199 { 200 200 if (*offset >= size) … … 839 839 * non-ASCII bytes. 840 840 */ 841 errno_t spascii_to_str(char *dest, size_t size, const uint8_t *src, size_t n)841 int spascii_to_str(char *dest, size_t size, const uint8_t *src, size_t n) 842 842 { 843 843 size_t sidx; … … 845 845 size_t dlast; 846 846 uint8_t byte; 847 errno_t rc;848 errno_t result;847 int rc; 848 int result; 849 849 850 850 /* There must be space for a null terminator in the buffer. */ … … 920 920 * @return EOK, if success, an error code otherwise. 921 921 */ 922 errno_t utf16_to_str(char *dest, size_t size, const uint16_t *src)922 int utf16_to_str(char *dest, size_t size, const uint16_t *src) 923 923 { 924 924 size_t idx = 0, dest_off = 0; 925 925 wchar_t ch; 926 errno_t rc = EOK;926 int rc = EOK; 927 927 928 928 /* There must be space for a null terminator in the buffer. */ … … 963 963 * @return EOK, if success, an error code otherwise. 964 964 */ 965 errno_t str_to_utf16(uint16_t *dest, size_t dlen, const char *src)966 { 967 errno_t rc = EOK;965 int str_to_utf16(uint16_t *dest, size_t dlen, const char *src) 966 { 967 int rc = EOK; 968 968 size_t offset = 0; 969 969 size_t idx = 0; … … 1539 1539 * 1540 1540 */ 1541 static errno_t str_uint(const char *nptr, char **endptr, unsigned int base,1541 static int str_uint(const char *nptr, char **endptr, unsigned int base, 1542 1542 bool *neg, uint64_t *result) 1543 1543 { … … 1660 1660 * 1661 1661 */ 1662 errno_t str_uint8_t(const char *nptr, const char **endptr, unsigned int base,1662 int str_uint8_t(const char *nptr, const char **endptr, unsigned int base, 1663 1663 bool strict, uint8_t *result) 1664 1664 { … … 1668 1668 char *lendptr; 1669 1669 uint64_t res; 1670 errno_t ret = str_uint(nptr, &lendptr, base, &neg, &res);1670 int ret = str_uint(nptr, &lendptr, base, &neg, &res); 1671 1671 1672 1672 if (endptr != NULL) … … 1707 1707 * 1708 1708 */ 1709 errno_t str_uint16_t(const char *nptr, const char **endptr, unsigned int base,1709 int str_uint16_t(const char *nptr, const char **endptr, unsigned int base, 1710 1710 bool strict, uint16_t *result) 1711 1711 { … … 1715 1715 char *lendptr; 1716 1716 uint64_t res; 1717 errno_t ret = str_uint(nptr, &lendptr, base, &neg, &res);1717 int ret = str_uint(nptr, &lendptr, base, &neg, &res); 1718 1718 1719 1719 if (endptr != NULL) … … 1754 1754 * 1755 1755 */ 1756 errno_t str_uint32_t(const char *nptr, const char **endptr, unsigned int base,1756 int str_uint32_t(const char *nptr, const char **endptr, unsigned int base, 1757 1757 bool strict, uint32_t *result) 1758 1758 { … … 1762 1762 char *lendptr; 1763 1763 uint64_t res; 1764 errno_t ret = str_uint(nptr, &lendptr, base, &neg, &res);1764 int ret = str_uint(nptr, &lendptr, base, &neg, &res); 1765 1765 1766 1766 if (endptr != NULL) … … 1801 1801 * 1802 1802 */ 1803 errno_t str_uint64_t(const char *nptr, const char **endptr, unsigned int base,1803 int str_uint64_t(const char *nptr, const char **endptr, unsigned int base, 1804 1804 bool strict, uint64_t *result) 1805 1805 { … … 1808 1808 bool neg; 1809 1809 char *lendptr; 1810 errno_t ret = str_uint(nptr, &lendptr, base, &neg, result);1810 int ret = str_uint(nptr, &lendptr, base, &neg, result); 1811 1811 1812 1812 if (endptr != NULL) … … 1840 1840 * 1841 1841 */ 1842 errno_t str_size_t(const char *nptr, const char **endptr, unsigned int base,1842 int str_size_t(const char *nptr, const char **endptr, unsigned int base, 1843 1843 bool strict, size_t *result) 1844 1844 { … … 1848 1848 char *lendptr; 1849 1849 uint64_t res; 1850 errno_t ret = str_uint(nptr, &lendptr, base, &neg, &res);1850 int ret = str_uint(nptr, &lendptr, base, &neg, &res); 1851 1851 1852 1852 if (endptr != NULL)
Note:
See TracChangeset
for help on using the changeset viewer.