Changeset bf61d3a in mainline for uspace/lib
- Timestamp:
- 2010-11-26T01:34:21Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 273b958
- Parents:
- 4b9a410 (diff), 7e752b2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/lib
- Files:
-
- 18 edited
-
block/libblock.c (modified) (2 diffs)
-
c/arch/abs32le/include/inttypes.h (modified) (1 diff)
-
c/arch/amd64/include/inttypes.h (modified) (1 diff)
-
c/arch/arm32/include/inttypes.h (modified) (1 diff)
-
c/arch/ia32/include/inttypes.h (modified) (1 diff)
-
c/arch/ia64/include/inttypes.h (modified) (1 diff)
-
c/arch/mips32/include/inttypes.h (modified) (1 diff)
-
c/arch/ppc32/include/inttypes.h (modified) (1 diff)
-
c/arch/sparc64/include/inttypes.h (modified) (1 diff)
-
c/generic/io/printf_core.c (modified) (5 diffs)
-
c/generic/stacktrace.c (modified) (1 diff)
-
c/include/assert.h (modified) (1 diff)
-
c/include/err.h (modified) (2 diffs)
-
c/include/stdint.h (modified) (1 diff)
-
c/include/stdio.h (modified) (2 diffs)
-
c/include/sys/typefmt.h (modified) (2 diffs)
-
c/include/sys/types.h (modified) (1 diff)
-
drv/generic/driver.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/block/libblock.c
r4b9a410 rbf61d3a 816 816 UPPER32(ba), cnt); 817 817 if (rc != EOK) { 818 printf("Error %d reading % dblocks starting at block %" PRIuOFF64819 " from device handle % d\n", rc, cnt, ba,818 printf("Error %d reading %zu blocks starting at block %" PRIuOFF64 819 " from device handle %" PRIun "\n", rc, cnt, ba, 820 820 devcon->devmap_handle); 821 821 #ifndef NDEBUG … … 843 843 UPPER32(ba), cnt); 844 844 if (rc != EOK) { 845 printf("Error %d writing % dblocks starting at block %" PRIuOFF64846 " to device handle % d\n", rc, cnt, ba, devcon->devmap_handle);845 printf("Error %d writing %zu blocks starting at block %" PRIuOFF64 846 " to device handle %" PRIun "\n", rc, cnt, ba, devcon->devmap_handle); 847 847 #ifndef NDEBUG 848 848 stacktrace_print(); -
uspace/lib/c/arch/abs32le/include/inttypes.h
r4b9a410 rbf61d3a 34 34 #define LIBC_abs32le_INTTYPES_H_ 35 35 36 #define PRIdPTR PRId32 37 #define PRIoPTR PRIo32 38 #define PRIuPTR PRIu32 39 #define PRIxPTR PRIx32 40 #define PRIXPTR PRIX32 36 #define PRIdn PRId32 /**< Format for sysarg_t, ipcarg_t, etc. */ 37 #define PRIun PRIu32 /**< Format for sysarg_t, ipcarg_t, etc. */ 38 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */ 39 #define PRIua PRIu32 /**< Format for atomic_count_t. */ 41 40 42 41 #endif -
uspace/lib/c/arch/amd64/include/inttypes.h
r4b9a410 rbf61d3a 30 30 * @{ 31 31 */ 32 /** @file Macros for format specifiers.33 *34 * Macros for formatting stdint types as specified in section35 * 7.8.1 Macros for format specifiers of the C99 draft specification36 * (ISO/IEC 9899:201x). Only some macros from the specification are37 * implemented.38 */39 32 40 33 #ifndef LIBC_amd64_INTTYPES_H_ 41 34 #define LIBC_amd64_INTTYPES_H_ 42 35 43 #define PRIdPTR PRId64 44 #define PRIoPTR PRIo64 45 #define PRIuPTR PRIu64 46 #define PRIxPTR PRIx64 47 #define PRIXPTR PRIX64 36 #define PRIdn PRId64 /**< Format for sysarg_t, ipcarg_t, etc. */ 37 #define PRIun PRIu64 /**< Format for sysarg_t, ipcarg_t, etc. */ 38 #define PRIxn PRIx64 /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */ 39 #define PRIua PRIu64 /**< Format for atomic_count_t. */ 48 40 49 41 #endif -
uspace/lib/c/arch/arm32/include/inttypes.h
r4b9a410 rbf61d3a 30 30 * @{ 31 31 */ 32 /** @file Macros for format specifiers.33 *34 * Macros for formatting stdint types as specified in section35 * 7.8.1 Macros for format specifiers of the C99 draft specification36 * (ISO/IEC 9899:201x). Only some macros from the specification are37 * implemented.38 */39 32 40 33 #ifndef LIBC_arm32_INTTYPES_H_ 41 34 #define LIBC_arm32_INTTYPES_H_ 42 35 43 #define PRIdPTR PRId32 44 #define PRIoPTR PRIo32 45 #define PRIuPTR PRIu32 46 #define PRIxPTR PRIx32 47 #define PRIXPTR PRIX32 36 #define PRIdn PRId32 /**< Format for sysarg_t, ipcarg_t, etc. */ 37 #define PRIun PRIu32 /**< Format for sysarg_t, ipcarg_t, etc. */ 38 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */ 39 #define PRIua PRIu32 /**< Format for atomic_count_t. */ 48 40 49 41 #endif -
uspace/lib/c/arch/ia32/include/inttypes.h
r4b9a410 rbf61d3a 30 30 * @{ 31 31 */ 32 /** @file Macros for format specifiers.33 *34 * Macros for formatting stdint types as specified in section35 * 7.8.1 Macros for format specifiers of the C99 draft specification36 * (ISO/IEC 9899:201x). Only some macros from the specification are37 * implemented.38 */39 32 40 33 #ifndef LIBC_ia32_INTTYPES_H_ 41 34 #define LIBC_ia32_INTTYPES_H_ 42 35 43 #define PRIdPTR PRId32 44 #define PRIoPTR PRIo32 45 #define PRIuPTR PRIu32 46 #define PRIxPTR PRIx32 47 #define PRIXPTR PRIX32 36 #define PRIdn PRId32 /**< Format for sysarg_t, ipcarg_t, etc. */ 37 #define PRIun PRIu32 /**< Format for sysarg_t, ipcarg_t, etc. */ 38 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */ 39 #define PRIua PRIu32 /**< Format for atomic_count_t. */ 48 40 49 41 #endif -
uspace/lib/c/arch/ia64/include/inttypes.h
r4b9a410 rbf61d3a 30 30 * @{ 31 31 */ 32 /** @file Macros for format specifiers.33 *34 * Macros for formatting stdint types as specified in section35 * 7.8.1 Macros for format specifiers of the C99 draft specification36 * (ISO/IEC 9899:201x). Only some macros from the specification are37 * implemented.38 */39 32 40 33 #ifndef LIBC_ia64_INTTYPES_H_ 41 34 #define LIBC_ia64_INTTYPES_H_ 42 35 43 #define PRIdPTR PRId64 44 #define PRIoPTR PRIo64 45 #define PRIuPTR PRIu64 46 #define PRIxPTR PRIx64 47 #define PRIXPTR PRIX64 36 #define PRIdn PRId64 /**< Format for sysarg_t, ipcarg_t, etc. */ 37 #define PRIun PRIu64 /**< Format for sysarg_t, ipcarg_t, etc. */ 38 #define PRIxn PRIx64 /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */ 39 #define PRIua PRIu64 /**< Format for atomic_count_t. */ 48 40 49 41 #endif -
uspace/lib/c/arch/mips32/include/inttypes.h
r4b9a410 rbf61d3a 30 30 * @{ 31 31 */ 32 /** @file Macros for format specifiers.33 *34 * Macros for formatting stdint types as specified in section35 * 7.8.1 Macros for format specifiers of the C99 draft specification36 * (ISO/IEC 9899:201x). Only some macros from the specification are37 * implemented.38 */39 32 40 33 #ifndef LIBC_mips32_INTTYPES_H_ 41 34 #define LIBC_mips32_INTTYPES_H_ 42 35 43 #define PRIdPTR PRId32 44 #define PRIoPTR PRIo32 45 #define PRIuPTR PRIu32 46 #define PRIxPTR PRIx32 47 #define PRIXPTR PRIX32 36 #define PRIdn PRId32 /**< Format for sysarg_t, ipcarg_t, etc. */ 37 #define PRIun PRIu32 /**< Format for sysarg_t, ipcarg_t, etc. */ 38 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */ 39 #define PRIua PRIu32 /**< Format for atomic_count_t. */ 48 40 49 41 #endif -
uspace/lib/c/arch/ppc32/include/inttypes.h
r4b9a410 rbf61d3a 30 30 * @{ 31 31 */ 32 /** @file Macros for format specifiers.33 *34 * Macros for formatting stdint types as specified in section35 * 7.8.1 Macros for format specifiers of the C99 draft specification36 * (ISO/IEC 9899:201x). Only some macros from the specification are37 * implemented.38 */39 32 40 33 #ifndef LIBC_ppc32_INTTYPES_H_ 41 34 #define LIBC_ppc32_INTTYPES_H_ 42 35 43 #define PRIdPTR PRId32 44 #define PRIoPTR PRIo32 45 #define PRIuPTR PRIu32 46 #define PRIxPTR PRIx32 47 #define PRIXPTR PRIX32 36 #define PRIdn PRId32 /**< Format for sysarg_t, ipcarg_t, etc. */ 37 #define PRIun PRIu32 /**< Format for sysarg_t, ipcarg_t, etc. */ 38 #define PRIxn PRIx32 /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */ 39 #define PRIua PRIu32 /**< Format for atomic_count_t. */ 48 40 49 41 #endif -
uspace/lib/c/arch/sparc64/include/inttypes.h
r4b9a410 rbf61d3a 30 30 * @{ 31 31 */ 32 /** @file Macros for format specifiers.33 *34 * Macros for formatting stdint types as specified in section35 * 7.8.1 Macros for format specifiers of the C99 draft specification36 * (ISO/IEC 9899:201x). Only some macros from the specification are37 * implemented.38 */39 32 40 33 #ifndef LIBC_sparc64_INTTYPES_H_ 41 34 #define LIBC_sparc64_INTTYPES_H_ 42 35 43 #define PRIdPTR PRId64 44 #define PRIoPTR PRIo64 45 #define PRIuPTR PRIu64 46 #define PRIxPTR PRIx64 47 #define PRIXPTR PRIX64 36 #define PRIdn PRId64 /**< Format for sysarg_t, ipcarg_t, etc. */ 37 #define PRIun PRIu64 /**< Format for sysarg_t, ipcarg_t, etc. */ 38 #define PRIxn PRIx64 /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */ 39 #define PRIua PRIu64 /**< Format for atomic_count_t. */ 48 40 49 41 #endif -
uspace/lib/c/generic/io/printf_core.c
r4b9a410 rbf61d3a 82 82 PrintfQualifierLong, 83 83 PrintfQualifierLongLong, 84 PrintfQualifierPointer 84 PrintfQualifierPointer, 85 PrintfQualifierSize 85 86 } qualifier_t; 86 87 … … 552 553 * - "" Signed or unsigned int (default value).@n 553 554 * - "l" Signed or unsigned long int.@n 554 * If conversion is "c", the character is w char_t (wide character).@n555 * If conversion is "c", the character is wint_t (wide character).@n 555 556 * If conversion is "s", the string is wchar_t * (wide string).@n 556 557 * - "ll" Signed or unsigned long long int.@n 558 * - "z" Signed or unsigned ssize_t or site_t.@n 557 559 * 558 560 * CONVERSION:@n … … 736 738 } 737 739 break; 740 case 'z': 741 qualifier = PrintfQualifierSize; 742 i = nxt; 743 uc = str_decode(fmt, &nxt, STR_NO_LIMIT); 744 break; 738 745 default: 739 746 /* Default type */ … … 763 770 case 'c': 764 771 if (qualifier == PrintfQualifierLong) 765 retval = print_wchar(va_arg(ap, w char_t), width, flags, ps);772 retval = print_wchar(va_arg(ap, wint_t), width, flags, ps); 766 773 else 767 774 retval = print_char(va_arg(ap, unsigned int), width, flags, ps); … … 849 856 precision = size << 1; 850 857 number = (uint64_t) (uintptr_t) va_arg(ap, void *); 858 break; 859 case PrintfQualifierSize: 860 size = sizeof(size_t); 861 number = (uint64_t) va_arg(ap, size_t); 851 862 break; 852 863 default: -
uspace/lib/c/generic/stacktrace.c
r4b9a410 rbf61d3a 50 50 51 51 while (stacktrace_fp_valid(&st, fp)) { 52 printf("%p: %p()\n", fp,pc);52 printf("%p: %p()\n", (void *) fp, (void *) pc); 53 53 (void) stacktrace_ra_get(&st, fp, &pc); 54 54 (void) stacktrace_fp_prev(&st, fp, &nfp); -
uspace/lib/c/include/assert.h
r4b9a410 rbf61d3a 51 51 52 52 #ifndef NDEBUG 53 # define assert(expr) \ 54 do { \ 55 if (!(expr)) { \ 56 printf("Assertion failed (%s) at file '%s', " \ 57 "line %d.\n", #expr, __FILE__, __LINE__); \ 58 abort(); \ 59 } \ 60 } while (0) 61 #else 62 # define assert(expr) 63 #endif 53 54 #define assert(expr) \ 55 do { \ 56 if (!(expr)) { \ 57 printf("Assertion failed (%s) at file '%s', " \ 58 "line %d.\n", #expr, __FILE__, __LINE__); \ 59 abort(); \ 60 } \ 61 } while (0) 62 63 #else /* NDEBUG */ 64 65 #define assert(expr) 66 67 #endif /* NDEBUG */ 64 68 65 69 #endif -
uspace/lib/c/include/err.h
r4b9a410 rbf61d3a 38 38 #include <stdio.h> 39 39 40 #define errx(status, fmt, ...) { \ 41 printf((fmt), ##__VA_ARGS__); \ 42 _exit(status); \ 43 } 40 #define errx(status, fmt, ...) \ 41 { \ 42 printf((fmt), ##__VA_ARGS__); \ 43 _exit(status); \ 44 } 44 45 45 46 #endif … … 47 48 /** @} 48 49 */ 49 -
uspace/lib/c/include/stdint.h
r4b9a410 rbf61d3a 36 36 #define LIBC_STDINT_H_ 37 37 38 #define INT8_MIN (0x80)39 #define INT8_MAX (0x7F)38 #define INT8_MIN INT8_C(0x80) 39 #define INT8_MAX INT8_C(0x7F) 40 40 41 #define UINT8_MIN (0u)42 #define UINT8_MAX (0xFFu)41 #define UINT8_MIN UINT8_C(0) 42 #define UINT8_MAX UINT8_C(0xFF) 43 43 44 #define INT16_MIN (0x8000)45 #define INT16_MAX (0x7FFF)44 #define INT16_MIN INT16_C(0x8000) 45 #define INT16_MAX INT16_C(0x7FFF) 46 46 47 #define UINT16_MIN (0u)48 #define UINT16_MAX (0xFFFFu)47 #define UINT16_MIN UINT16_C(0) 48 #define UINT16_MAX UINT16_C(0xFFFF) 49 49 50 #define INT32_MIN (0x80000000l)51 #define INT32_MAX (0x7FFFFFFFl)50 #define INT32_MIN INT32_C(0x80000000) 51 #define INT32_MAX INT32_C(0x7FFFFFFF) 52 52 53 #define UINT32_MIN (0ul)54 #define UINT32_MAX (0xFFFFFFFFul)53 #define UINT32_MIN UINT32_C(0) 54 #define UINT32_MAX UINT32_C(0xFFFFFFFF) 55 55 56 #define INT64_MIN (0x8000000000000000ll)57 #define INT64_MAX (0x7FFFFFFFFFFFFFFFll)56 #define INT64_MIN INT64_C(0x8000000000000000) 57 #define INT64_MAX INT64_C(0x7FFFFFFFFFFFFFFF) 58 58 59 #define UINT64_MIN (0ull)60 #define UINT64_MAX (0xFFFFFFFFFFFFFFFFull)59 #define UINT64_MIN UINT64_C(0) 60 #define UINT64_MAX UINT64_C(0xFFFFFFFFFFFFFFFF) 61 61 62 62 #include <libarch/types.h> -
uspace/lib/c/include/stdio.h
r4b9a410 rbf61d3a 41 41 #include <adt/list.h> 42 42 43 #ifndef NVERIFY_PRINTF 44 45 #define PRINTF_ATTRIBUTE(start, end) \ 46 __attribute__((format(gnu_printf, start, end))) 47 48 #else /* NVERIFY_PRINTF */ 49 50 #define PRINTF_ATTRIBUTE(start, end) 51 52 #endif /* NVERIFY_PRINTF */ 53 43 54 #define EOF (-1) 44 55 … … 149 160 150 161 /* Formatted string output functions */ 151 extern int fprintf(FILE *, const char*, ...); 162 extern int fprintf(FILE *, const char*, ...) 163 PRINTF_ATTRIBUTE(2, 3); 152 164 extern int vfprintf(FILE *, const char *, va_list); 153 165 154 extern int printf(const char *, ...); 166 extern int printf(const char *, ...) 167 PRINTF_ATTRIBUTE(1, 2); 155 168 extern int vprintf(const char *, va_list); 156 169 157 extern int snprintf(char *, size_t , const char *, ...); 158 extern int asprintf(char **, const char *, ...); 170 extern int snprintf(char *, size_t , const char *, ...) 171 PRINTF_ATTRIBUTE(3, 4); 172 extern int asprintf(char **, const char *, ...) 173 PRINTF_ATTRIBUTE(2, 3); 159 174 extern int vsnprintf(char *, size_t, const char *, va_list); 160 175 -
uspace/lib/c/include/sys/typefmt.h
r4b9a410 rbf61d3a 39 39 #include <inttypes.h> 40 40 41 /* off64_t */41 /* off64_t, aoff64_t */ 42 42 #define PRIdOFF64 PRId64 43 43 #define PRIuOFF64 PRIu64 … … 45 45 #define PRIXOFF64 PRIX64 46 46 47 /* (s)size_t */48 #define PRIdSIZE PRIdPTR49 #define PRIuSIZE PRIuPTR50 #define PRIxSIZE PRIxPTR51 #define PRIXSIZE PRIXPTR52 53 /* sysarg_t */54 #define PRIdSYSARG PRIdPTR55 #define PRIuSYSARG PRIuPTR56 #define PRIxSYSARG PRIxPTR57 #define PRIXSYSARG PRIxPTR58 59 /* ipcarg_t */60 #define PRIdIPCARG PRIdPTR61 #define PRIuIPCARG PRIuPTR62 #define PRIxIPCARG PRIxPTR63 #define PRIXIPCARG PRIXPTR64 65 /* taskid_t */66 #define PRIdTASKID PRId6467 #define PRIuTASKID PRIu6468 #define PRIxTASKID PRIx6469 #define PRIXTASKID PRIx6470 71 47 #endif 72 48 -
uspace/lib/c/include/sys/types.h
r4b9a410 rbf61d3a 46 46 typedef uint64_t aoff64_t; 47 47 48 /** Unicode code point */49 typedef int32_t wchar_t;50 51 48 typedef volatile uint8_t ioport8_t; 52 49 typedef volatile uint16_t ioport16_t; -
uspace/lib/drv/generic/driver.c
r4b9a410 rbf61d3a 48 48 #include <ctype.h> 49 49 #include <errno.h> 50 #include <inttypes.h> 50 51 51 52 #include <ipc/driver.h> … … 173 174 res = driver->driver_ops->add_device(dev); 174 175 if (0 == res) { 175 printf("%s: new device with handle = %xwas added.\n",176 printf("%s: new device with handle=%" PRIun " was added.\n", 176 177 driver->name, dev_handle); 177 178 } else { 178 printf("%s: failed to add a new device with handle = % d.\n",179 printf("%s: failed to add a new device with handle = %" PRIun ".\n", 179 180 driver->name, dev_handle); 180 181 remove_from_devices_list(dev); … … 225 226 if (dev == NULL) { 226 227 printf("%s: driver_connection_gen error - no device with handle" 227 " % xwas found.\n", driver->name, handle);228 " %" PRIun " was found.\n", driver->name, handle); 228 229 ipc_answer_0(iid, ENOENT); 229 230 return; … … 289 290 printf("%s: driver_connection_gen error - ", 290 291 driver->name); 291 printf("device with handle % dhas no interface "292 printf("device with handle %" PRIun " has no interface " 292 293 "with id %d.\n", handle, iface_idx); 293 294 ipc_answer_0(callid, ENOTSUP);
Note:
See TracChangeset
for help on using the changeset viewer.
