Changes in / [bc417660:098e16a5] in mainline
- Location:
- uspace
- Files:
-
- 1 added
- 8 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/df/df.c
rbc417660 r098e16a5 70 70 71 71 /* Parse command-line options */ 72 while ((optres = getopt(argc, argv, " ubh")) != -1) {72 while ((optres = getopt(argc, argv, ":ubh")) != -1) { 73 73 switch (optres) { 74 74 case 'h': … … 78 78 case 'b': 79 79 display_blocks = true; 80 break; 81 82 case ':': 83 fprintf(stderr, "Option -%c requires an operand\n", 84 optopt); 85 errflg++; 80 86 break; 81 87 -
uspace/lib/c/Makefile
rbc417660 r098e16a5 190 190 TEST_SOURCES = \ 191 191 test/adt/circ_buf.c \ 192 test/adt/odict.c \193 test/cap.c \194 192 test/casting.c \ 195 test/double_to_str.c \196 193 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 \ 201 196 test/inttypes.c \ 202 197 test/io/table.c \ 203 test/ main.c \204 test/ mem.c \198 test/stdio/scanf.c \ 199 test/odict.c \ 205 200 test/perf.c \ 206 201 test/perm.c \ 207 202 test/qsort.c \ 208 203 test/sprintf.c \ 209 test/stdio/scanf.c \210 204 test/stdio.c \ 211 205 test/stdlib.c \ 212 206 test/str.c \ 213 test/string.c \ 214 test/uuid.c 207 test/string.c 215 208 216 209 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/c/generic/gsort.c
rbc417660 r098e16a5 33 33 /** 34 34 * @file 35 * @brief Gnome Sort.35 * @brief Sorting functions. 36 36 * 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). 38 39 * 39 40 */ -
uspace/lib/c/generic/imath.c
rbc417660 r098e16a5 50 50 errno_t ipow10_u64(unsigned exp, uint64_t *res) 51 51 { 52 u int64_ta;52 unsigned a; 53 53 uint64_t r; 54 54 -
uspace/lib/c/generic/uuid.c
rbc417660 r098e16a5 39 39 #include <stddef.h> 40 40 #include <str.h> 41 #include <stdio.h>42 41 43 42 /** Generate UUID. … … 68 67 uuid->b[8] = (uuid->b[8] & 0x3f) | 0x80; 69 68 69 return EOK; 70 70 error: 71 71 rndgen_destroy(rndgen); … … 139 139 140 140 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') 142 142 return EINVAL; 143 143 … … 176 176 * @return EOK on success, ENOMEM if out of memory 177 177 */ 178 errno_t uuid_format(uuid_t *uuid, char **rstr , bool uppercase)178 errno_t uuid_format(uuid_t *uuid, char **rstr) 179 179 { 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; 196 181 } 197 182 -
uspace/lib/c/include/uuid.h
rbc417660 r098e16a5 38 38 #include <stdint.h> 39 39 #include <types/uuid.h> 40 #include <stdbool.h>41 40 42 41 extern errno_t uuid_generate(uuid_t *); … … 44 43 extern void uuid_decode(uint8_t *, uuid_t *); 45 44 extern errno_t uuid_parse(const char *, uuid_t *, const char **); 46 extern errno_t uuid_format(uuid_t *, char ** , bool);45 extern errno_t uuid_format(uuid_t *, char **); 47 46 48 47 #endif -
uspace/lib/c/test/main.c
rbc417660 r098e16a5 32 32 PCUT_INIT; 33 33 34 PCUT_IMPORT(cap);35 34 PCUT_IMPORT(casting); 36 35 PCUT_IMPORT(circ_buf); 37 PCUT_IMPORT(double_to_str);38 36 PCUT_IMPORT(fibril_timer); 39 PCUT_IMPORT(getopt);40 PCUT_IMPORT(gsort);41 PCUT_IMPORT(ieee_double);42 PCUT_IMPORT(imath);43 37 PCUT_IMPORT(inttypes); 44 38 PCUT_IMPORT(mem); … … 54 48 PCUT_IMPORT(string); 55 49 PCUT_IMPORT(table); 56 PCUT_IMPORT(uuid);57 50 58 51 PCUT_MAIN();
Note:
See TracChangeset
for help on using the changeset viewer.