Changes in / [bc417660:098e16a5] in mainline


Ignore:
Location:
uspace
Files:
1 added
8 deleted
7 edited

Legend:

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

    rbc417660 r098e16a5  
    7070
    7171        /* Parse command-line options */
    72         while ((optres = getopt(argc, argv, "ubh")) != -1) {
     72        while ((optres = getopt(argc, argv, ":ubh")) != -1) {
    7373                switch (optres) {
    7474                case 'h':
     
    7878                case 'b':
    7979                        display_blocks = true;
     80                        break;
     81
     82                case ':':
     83                        fprintf(stderr, "Option -%c requires an operand\n",
     84                            optopt);
     85                        errflg++;
    8086                        break;
    8187
  • uspace/lib/c/Makefile

    rbc417660 r098e16a5  
    190190TEST_SOURCES = \
    191191        test/adt/circ_buf.c \
    192         test/adt/odict.c \
    193         test/cap.c \
    194192        test/casting.c \
    195         test/double_to_str.c \
    196193        test/fibril/timer.c \
    197         test/getopt.c \
    198         test/gsort.c \
    199         test/ieee_double.c \
    200         test/imath.c \
     194        test/main.c \
     195        test/mem.c \
    201196        test/inttypes.c \
    202197        test/io/table.c \
    203         test/main.c \
    204         test/mem.c \
     198        test/stdio/scanf.c \
     199        test/odict.c \
    205200        test/perf.c \
    206201        test/perm.c \
    207202        test/qsort.c \
    208203        test/sprintf.c \
    209         test/stdio/scanf.c \
    210204        test/stdio.c \
    211205        test/stdlib.c \
    212206        test/str.c \
    213         test/string.c \
    214         test/uuid.c
     207        test/string.c
    215208
    216209include $(USPACE_PREFIX)/Makefile.common
  • uspace/lib/c/generic/gsort.c

    rbc417660 r098e16a5  
    3333/**
    3434 * @file
    35  * @brief Gnome Sort.
     35 * @brief Sorting functions.
    3636 *
    37  * This file contains an implementation of gnome sort
     37 * This files contains functions implementing several sorting
     38 * algorithms (e.g. quick sort and gnome sort).
    3839 *
    3940 */
  • uspace/lib/c/generic/imath.c

    rbc417660 r098e16a5  
    5050errno_t ipow10_u64(unsigned exp, uint64_t *res)
    5151{
    52         uint64_t a;
     52        unsigned a;
    5353        uint64_t r;
    5454
  • uspace/lib/c/generic/uuid.c

    rbc417660 r098e16a5  
    3939#include <stddef.h>
    4040#include <str.h>
    41 #include <stdio.h>
    4241
    4342/** Generate UUID.
     
    6867        uuid->b[8] = (uuid->b[8] & 0x3f) | 0x80;
    6968
     69        return EOK;
    7070error:
    7171        rndgen_destroy(rndgen);
     
    139139
    140140        rc = str_uint64_t(str + 24, &eptr, 16, false, &node);
    141         if (rc != EOK || eptr != str + 36)
     141        if (rc != EOK || eptr != str + 36 || *eptr != '\0')
    142142                return EINVAL;
    143143
     
    176176 * @return EOK on success, ENOMEM if out of memory
    177177 */
    178 errno_t uuid_format(uuid_t *uuid, char **rstr, bool uppercase)
     178errno_t uuid_format(uuid_t *uuid, char **rstr)
    179179{
    180         size_t size = 37;
    181         char *str = malloc(sizeof(char) * size);
    182         if (str == NULL)
    183                 return ENOMEM;
    184 
    185         const char *format = "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x";
    186         if (uppercase)
    187                 format = "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X";
    188 
    189         int ret = snprintf(str, size, format, uuid->b[0], uuid->b[1], uuid->b[2], uuid->b[3], uuid->b[4], uuid->b[5], uuid->b[6], uuid->b[7], uuid->b[8], uuid->b[9], uuid->b[10], uuid->b[11], uuid->b[12], uuid->b[13], uuid->b[14], uuid->b[15]);
    190 
    191         if (ret != 36)
    192                 return EINVAL;
    193 
    194         *rstr = str;
    195         return EOK;
     180        return ENOTSUP;
    196181}
    197182
  • uspace/lib/c/include/uuid.h

    rbc417660 r098e16a5  
    3838#include <stdint.h>
    3939#include <types/uuid.h>
    40 #include <stdbool.h>
    4140
    4241extern errno_t uuid_generate(uuid_t *);
     
    4443extern void uuid_decode(uint8_t *, uuid_t *);
    4544extern errno_t uuid_parse(const char *, uuid_t *, const char **);
    46 extern errno_t uuid_format(uuid_t *, char **, bool);
     45extern errno_t uuid_format(uuid_t *, char **);
    4746
    4847#endif
  • uspace/lib/c/test/main.c

    rbc417660 r098e16a5  
    3232PCUT_INIT;
    3333
    34 PCUT_IMPORT(cap);
    3534PCUT_IMPORT(casting);
    3635PCUT_IMPORT(circ_buf);
    37 PCUT_IMPORT(double_to_str);
    3836PCUT_IMPORT(fibril_timer);
    39 PCUT_IMPORT(getopt);
    40 PCUT_IMPORT(gsort);
    41 PCUT_IMPORT(ieee_double);
    42 PCUT_IMPORT(imath);
    4337PCUT_IMPORT(inttypes);
    4438PCUT_IMPORT(mem);
     
    5448PCUT_IMPORT(string);
    5549PCUT_IMPORT(table);
    56 PCUT_IMPORT(uuid);
    5750
    5851PCUT_MAIN();
Note: See TracChangeset for help on using the changeset viewer.