Changeset 46577995 in mainline for uspace/app/date


Ignore:
Timestamp:
2018-01-04T20:50:52Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/date/date.c

    rfacacc71 r46577995  
    3939#define NAME   "date"
    4040
    41 static int read_date_from_arg(char *wdate, struct tm *t);
    42 static int read_time_from_arg(char *wdate, struct tm *t);
    43 static int tm_sanity_check(struct tm *t);
     41static errno_t read_date_from_arg(char *wdate, struct tm *t);
     42static errno_t read_time_from_arg(char *wdate, struct tm *t);
     43static errno_t tm_sanity_check(struct tm *t);
    4444static bool is_leap_year(int year);
    4545
     
    5151main(int argc, char **argv)
    5252{
    53         int rc;
     53        errno_t rc;
    5454        int c;
    5555        category_id_t cat_id;
     
    197197 *  with the following format: DD/MM/YYYY
    198198 */
    199 static int
     199static errno_t
    200200read_date_from_arg(char *wdate, struct tm *t)
    201201{
    202         int rc;
     202        errno_t rc;
    203203        uint32_t tmp;
    204204
     
    232232 *  with the following format: HH:MM:SS or HH:MM
    233233 */
    234 static int
     234static errno_t
    235235read_time_from_arg(char *wtime, struct tm *t)
    236236{
    237         int rc;
     237        errno_t rc;
    238238        size_t len = str_size(wtime);
    239239        bool sec_present = len == 8;
     
    278278 * @return      EOK on success or EINVAL
    279279 */
    280 static int
     280static errno_t
    281281tm_sanity_check(struct tm *t)
    282282{
Note: See TracChangeset for help on using the changeset viewer.