Changes in uspace/app/bdsh/cmds/modules/sleep/sleep.c [205f1add:5f97ef44] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/sleep/sleep.c
r205f1add r5f97ef44 57 57 } 58 58 59 /** Convert string containing decimal seconds to usec _t.59 /** Convert string containing decimal seconds to useconds_t. 60 60 * 61 61 * @param nptr Pointer to string. … … 63 63 * @return EOK if conversion was successful. 64 64 */ 65 static errno_t decimal_to_useconds(const char *nptr, usec _t *result)65 static errno_t decimal_to_useconds(const char *nptr, useconds_t *result) 66 66 { 67 67 errno_t ret; 68 sec_t whole_seconds;69 u sec_t frac_seconds;68 uint64_t whole_seconds; 69 uint64_t frac_seconds; 70 70 const char *endptr; 71 71 … … 75 75 endptr = (char *)nptr; 76 76 } else { 77 ret = str_ int64_t(nptr, &endptr, 10, false, &whole_seconds);77 ret = str_uint64_t(nptr, &endptr, 10, false, &whole_seconds); 78 78 if (ret != EOK) 79 79 return ret; … … 87 87 } else if (*endptr == '.') { 88 88 nptr = endptr + 1; 89 ret = str_ int64_t(nptr, &endptr, 10, true, &frac_seconds);89 ret = str_uint64_t(nptr, &endptr, 10, true, &frac_seconds); 90 90 if (ret != EOK) 91 91 return ret; … … 101 101 102 102 /* Check for overflow */ 103 usec _t total = SEC2USEC(whole_seconds)+ frac_seconds;104 if ( USEC2SEC(total)!= whole_seconds)103 useconds_t total = whole_seconds * 1000000 + frac_seconds; 104 if (total / 1000000 != whole_seconds) 105 105 return EOVERFLOW; 106 106 … … 115 115 errno_t ret; 116 116 unsigned int argc; 117 usec _t duration = 0;117 useconds_t duration = 0; 118 118 119 119 /* Count the arguments */
Note:
See TracChangeset
for help on using the changeset viewer.