Changeset 810a36f in mainline for uspace/lib


Ignore:
Timestamp:
2017-10-24T05:29:08Z (8 years ago)
Author:
jzr <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b1eb7ef
Parents:
c8fbbe7 (diff), 673ea28 (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.
Message:

Merge branch 'types'.

Location:
uspace/lib
Files:
1 added
32 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/bithenge/src/print.c

    rc8fbbe7 r810a36f  
    4040#include <stdarg.h>
    4141#include <stdio.h>
     42#include <wchar.h>
    4243#include <bithenge/blob.h>
    4344#include <bithenge/print.h>
  • uspace/lib/c/Makefile

    rc8fbbe7 r810a36f  
    3232
    3333CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
    34 COMMON_HEADER_ARCH = arch/$(UARCH)/include/libarch/common.h
    3534
    3635LINKER_SCRIPTS = \
     
    4039        $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld
    4140
    42 PRE_DEPEND = $(COMMON_HEADER_ARCH)
     41PRE_DEPEND =
    4342EXTRA_OUTPUT = $(LINKER_SCRIPTS)
    44 EXTRA_CLEAN = $(COMMON_HEADER_ARCH) $(LINKER_SCRIPTS)
     43EXTRA_CLEAN = $(LINKER_SCRIPTS)
    4544LIBRARY = libc
    4645SLIBRARY = libc.so.0.0
     
    208207$(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in
    209208        $(CC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@
    210 
    211 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    212         ln -sfn ../../../../$< $@
  • uspace/lib/c/arch/ia64/include/libarch/faddr.h

    rc8fbbe7 r810a36f  
    3838#include <types/common.h>
    3939
     40typedef struct {
     41        uintptr_t fnc;
     42        uintptr_t gp;
     43} __attribute__((may_alias)) fncptr_t;
     44
    4045/**
    4146 *
  • uspace/lib/c/generic/double_to_str.c

    rc8fbbe7 r810a36f  
    3232#include <ieee_double.h>
    3333
     34#include <limits.h>
    3435#include <stdint.h>
    3536#include <stdbool.h>
  • uspace/lib/c/generic/gsort.c

    rc8fbbe7 r810a36f  
    4141
    4242#include <gsort.h>
     43#include <inttypes.h>
    4344#include <mem.h>
    4445#include <malloc.h>
  • uspace/lib/c/generic/inet/addr.c

    rc8fbbe7 r810a36f  
    4141#include <malloc.h>
    4242#include <bitops.h>
     43#include <inttypes.h>
    4344
    4445#define INET_PREFIXSTRSIZE  5
  • uspace/lib/c/generic/io/printf_core.c

    rc8fbbe7 r810a36f  
    4646#include <assert.h>
    4747#include <macros.h>
     48#include <wchar.h>
    4849
    4950
     
    114115        PrintfQualifierLongLong,
    115116        PrintfQualifierPointer,
    116         PrintfQualifierSize
     117        PrintfQualifierSize,
     118        PrintfQualifierMax
    117119} qualifier_t;
    118120
     
    14841486                                uc = str_decode(fmt, &nxt, STR_NO_LIMIT);
    14851487                                break;
     1488                        case 'j':
     1489                                qualifier = PrintfQualifierMax;
     1490                                i = nxt;
     1491                                uc = str_decode(fmt, &nxt, STR_NO_LIMIT);
     1492                                break;
    14861493                        default:
    14871494                                /* Default type */
     
    16291636                                number = (uint64_t) va_arg(ap, size_t);
    16301637                                break;
     1638                        case PrintfQualifierMax:
     1639                                size = sizeof(uintmax_t);
     1640                                number = (uint64_t) va_arg(ap, uintmax_t);
     1641                                break;
    16311642                        default:
    16321643                                /* Unknown qualifier */
  • uspace/lib/c/generic/str.c

    rc8fbbe7 r810a36f  
    4646#include <align.h>
    4747#include <mem.h>
     48#include <limits.h>
    4849
    4950/** Check the condition if wchar_t is signed */
    50 #ifdef WCHAR_IS_UNSIGNED
     51#ifdef __WCHAR_UNSIGNED__
    5152        #define WCHAR_SIGNED_CHECK(cond)  (true)
    5253#else
  • uspace/lib/c/include/inttypes.h

    rc8fbbe7 r810a36f  
    3636#define LIBC_INTTYPES_H_
    3737
    38 #include <libarch/inttypes.h>
     38#include <_bits/inttypes.h>
    3939
    4040#endif
  • uspace/lib/c/include/io/charfield.h

    rc8fbbe7 r810a36f  
    3838
    3939#include <stdbool.h>
     40#include <wchar.h>
    4041#include <io/color.h>
    4142#include <io/style.h>
  • uspace/lib/c/include/limits.h

    rc8fbbe7 r810a36f  
    3636#define LIBC_LIMITS_H_
    3737
    38 /* XXX Make this more accurate */
    39 #include <stdint.h>
    40 #include <libarch/stdint.h>
     38#include <_bits/limits.h>
    4139
    4240#endif
  • uspace/lib/c/include/stddef.h

    rc8fbbe7 r810a36f  
    3636#define LIBC_STDDEF_H_
    3737
    38 #include <libarch/stddef.h>
     38#include <_bits/size_t.h>
     39#include <_bits/ptrdiff_t.h>
     40#include <_bits/wchar_t.h>
    3941
    40 #ifndef NULL
    41         #define NULL  ((void *) 0)
    42 #endif
     42#include <_bits/NULL.h>
    4343
    4444#define offsetof(type, member) \
  • uspace/lib/c/include/stdint.h

    rc8fbbe7 r810a36f  
    3636#define LIBC_STDINT_H_
    3737
    38 #define INT8_MIN  INT8_C(0x80)
    39 #define INT8_MAX  INT8_C(0x7F)
    40 
    41 #define UINT8_MIN  UINT8_C(0)
    42 #define UINT8_MAX  UINT8_C(0xFF)
    43 
    44 #define INT16_MIN  INT16_C(0x8000)
    45 #define INT16_MAX  INT16_C(0x7FFF)
    46 
    47 #define UINT16_MIN  UINT16_C(0)
    48 #define UINT16_MAX  UINT16_C(0xFFFF)
    49 
    50 #define INT32_MIN  INT32_C(0x80000000)
    51 #define INT32_MAX  INT32_C(0x7FFFFFFF)
    52 
    53 #define UINT32_MIN  UINT32_C(0)
    54 #define UINT32_MAX  UINT32_C(0xFFFFFFFF)
    55 
    56 #define INT64_MIN  INT64_C(0x8000000000000000)
    57 #define INT64_MAX  INT64_C(0x7FFFFFFFFFFFFFFF)
    58 
    59 #define UINT64_MIN  UINT64_C(0)
    60 #define UINT64_MAX  UINT64_C(0xFFFFFFFFFFFFFFFF)
    61 
    62 #include <libarch/stdint.h>
     38#include <_bits/stdint.h>
    6339
    6440#endif
  • uspace/lib/c/include/types/common.h

    rc8fbbe7 r810a36f  
    3636#define LIBC_TYPES_COMMON_H_
    3737
    38 #include <libarch/types.h>
     38#if __SIZEOF_POINTER__ == 4
     39#define __32_BITS__
     40#elif __SIZEOF_POINTER__ == 8
     41#define __64_BITS__
     42#else
     43#error __SIZEOF_POINTER__ is not defined.
     44#endif
     45
     46#include <_bits/all.h>
    3947
    4048#endif
  • uspace/lib/draw/gfx/font-8x16.h

    rc8fbbe7 r810a36f  
    3838#include <stdint.h>
    3939#include <stdbool.h>
     40#include <stddef.h>
    4041
    4142#define FONT_GLYPHS     2899
  • uspace/lib/drv/generic/logbuf.c

    rc8fbbe7 r810a36f  
    3131 */
    3232
    33 #include <libarch/common.h>
    3433#include <stdio.h>
    3534#include <stddef.h>
  • uspace/lib/drv/include/ddf/interrupt.h

    rc8fbbe7 r810a36f  
    3636#define DDF_INTERRUPT_H_
    3737
    38 #include <libarch/common.h>
    3938#include <types/common.h>
    4039#include <abi/ddi/irq.h>
  • uspace/lib/http/include/http/receive-buffer.h

    rc8fbbe7 r810a36f  
    3939#include <adt/list.h>
    4040#include <stddef.h>
     41#include <types/common.h>
    4142
    4243/** Receive data.
  • uspace/lib/math/include/mathtypes.h

    rc8fbbe7 r810a36f  
    191191#endif
    192192
    193 
    194 #if defined(FLOAT_SIZE_32)
    195 
    196 #ifndef float32_t
    197         #define float32_t  float
    198 #endif
    199 
    200 #elif defined(FLOAT_SIZE_64)
    201 
    202 #ifndef float64_t
    203         #define float64_t  float
    204 #endif
    205 
    206 #elif defined(FLOAT_SIZE_96)
    207 
    208 #ifndef float96_t
    209         #define float96_t  float
    210 #endif
    211 
    212 #elif defined(FLOAT_SIZE_128)
    213 
    214 #ifndef float128_t
    215         #define float128_t  float
    216 #endif
    217 
    218 #endif
    219 
    220 
    221 #if defined(DOUBLE_SIZE_32)
    222 
    223 #ifndef float32_t
    224         #define float32_t  double
    225 #endif
    226 
    227 #elif defined(DOUBLE_SIZE_64)
    228 
    229 #ifndef float64_t
    230         #define float64_t  double
    231 #endif
    232 
    233 #elif defined(DOUBLE_SIZE_96)
    234 
    235 #ifndef float96_t
    236         #define float96_t  double
    237 #endif
    238 
    239 #elif defined(DOUBLE_SIZE_128)
    240 
    241 #ifndef float128_t
    242         #define float128_t  double
    243 #endif
    244 
    245 #endif
    246 
    247 
    248 #if defined(LONG_DOUBLE_SIZE_32)
    249 
    250 #ifndef float32_t
    251         #define float32_t  long double
    252 #endif
    253 
    254 #elif defined(LONG_DOUBLE_SIZE_64)
    255 
    256 #ifndef float64_t
    257         #define float64_t  long double
    258 #endif
    259 
    260 #elif defined(LONG_DOUBLE_SIZE_96)
    261 
    262 #ifndef float96_t
    263         #define float96_t  long double
    264 #endif
    265 
    266 #elif defined(LONG_DOUBLE_SIZE_128)
    267 
    268 #ifndef float128_t
    269         #define float128_t  long double
    270 #endif
    271 
    272 #endif
    273 
     193#if __SIZEOF_FLOAT__ == 4
     194#define float32_t float
     195#elif __SIZEOF_DOUBLE__ == 4
     196#define float32_t double
     197#elif __SIZEOF_LONG_DOUBLE__ == 4
     198#define float32_t long double
     199#endif
     200
     201#if __SIZEOF_FLOAT__ == 8
     202#define float64_t float
     203#elif __SIZEOF_DOUBLE__ == 8
     204#define float64_t double
     205#elif __SIZEOF_LONG_DOUBLE__ == 8
     206#define float64_t long double
     207#endif
     208
     209#if __SIZEOF_FLOAT__ == 12
     210#define float96_t float
     211#elif __SIZEOF_DOUBLE__ == 12
     212#define float96_t double
     213#elif __SIZEOF_LONG_DOUBLE__ == 12
     214#define float96_t long double
     215#endif
     216
     217#if __SIZEOF_FLOAT__ == 16
     218#define float128_t float
     219#elif __SIZEOF_DOUBLE__ == 16
     220#define float128_t double
     221#elif __SIZEOF_LONG_DOUBLE__ == 16
     222#define float128_t long double
     223#endif
    274224
    275225#ifdef float32_t
  • uspace/lib/nic/include/nic_addr_db.h

    rc8fbbe7 r810a36f  
    4444
    4545#include <adt/hash_table.h>
     46#include <types/common.h>
    4647
    4748/**
  • uspace/lib/nic/src/nic_addr_db.c

    rc8fbbe7 r810a36f  
    3636 */
    3737#include "nic_addr_db.h"
    38 #include "libarch/common.h"
    3938#include <assert.h>
    4039#include <stdlib.h>
  • uspace/lib/posix/include/posix/limits.h

    rc8fbbe7 r810a36f  
    4242#define PATH_MAX 256
    4343
    44 /* it's probably a safe assumption */
    45 #undef CHAR_BIT
    46 #define CHAR_BIT 8
    47 
    4844#endif /* POSIX_LIMITS_H_ */
    4945
  • uspace/lib/posix/include/posix/locale.h

    rc8fbbe7 r810a36f  
    4040#endif
    4141
    42 #ifndef NULL
    43         #define NULL ((void *) 0)
    44 #endif
     42#include <_bits/NULL.h>
    4543
    4644#ifndef __locale_t_defined
  • uspace/lib/posix/include/posix/stddef.h

    rc8fbbe7 r810a36f  
    4242#include "sys/types.h"
    4343
    44 #ifndef NULL
    45         #define NULL  ((void *) 0)
    46 #endif
     44#include <_bits/NULL.h>
    4745
    4846#define offsetof(type,member) ((size_t) &(((type *) 0)->member))
  • uspace/lib/posix/include/posix/stdint.h

    rc8fbbe7 r810a36f  
    4242#include "libc/stdint.h"
    4343
    44 #undef INT8_MAX
    45 #undef INT8_MIN
    46 #define INT8_MAX  127
    47 #define INT8_MIN  (-128)
    48 
    49 #undef UINT8_MAX
    50 #undef UINT8_MIN
    51 #define UINT8_MAX  255
    52 #define UINT8_MIN  0
    53 
    54 #undef INT16_MAX
    55 #undef INT16_MIN
    56 #define INT16_MAX  32767
    57 #define INT16_MIN  (-32768)
    58 
    59 #undef UINT16_MAX
    60 #undef UINT16_MIN
    61 #define UINT16_MAX  65535
    62 #define UINT16_MIN  0
    63 
    64 #undef INT32_MAX
    65 #undef INT32_MIN
    66 #define INT32_MAX  2147483647
    67 #define INT32_MIN  (-INT32_MAX - 1)
    68 
    69 #undef UINT32_MAX
    70 #undef UINT32_MIN
    71 #define UINT32_MAX  4294967295U
    72 #define UINT32_MIN  0U
    73 
    74 #undef INT64_MAX
    75 #undef INT64_MIN
    76 #define INT64_MAX  9223372036854775807LL
    77 #define INT64_MIN  (-INT64_MAX - 1LL)
    78 
    79 #undef UINT64_MAX
    80 #undef  UINT64_MIN
    81 #define UINT64_MAX  18446744073709551615ULL
    82 #define UINT64_MIN  0ULL
    83 
    8444#undef OFF64_MAX
    8545#undef OFF64_MIN
     
    9252#define AOFF64_MIN  UINT64_MIN
    9353
    94 #undef INTMAX_MIN
    95 #undef INTMAX_MAX
    96 #define INTMAX_MIN INT64_MIN
    97 #define INTMAX_MAX INT64_MAX
    98 
    99 #undef UINTMAX_MIN
    100 #undef UINTMAX_MAX
    101 #define UINTMAX_MIN UINT64_MIN
    102 #define UINTMAX_MAX UINT64_MAX
    103 
    104 /*
    105  * Fast* and least* integer types.
    106  *
    107  * The definitions below are correct as long as uint8/16/32/64_t are defined.
    108  * Considering the entire rest of the system would break down if they were not,
    109  * these definitions are just fine.
    110  */
    111 typedef uint8_t uint_least8_t;
    112 typedef uint16_t uint_least16_t;
    113 typedef uint32_t uint_least32_t;
    114 typedef uint64_t uint_least64_t;
    115 
    116 typedef int8_t int_least8_t;
    117 typedef int16_t int_least16_t;
    118 typedef int32_t int_least32_t;
    119 typedef int64_t int_least64_t;
    120 
    121 typedef uint8_t uint_fast8_t;
    122 typedef uint16_t uint_fast16_t;
    123 typedef uint32_t uint_fast32_t;
    124 typedef uint64_t uint_fast64_t;
    125 
    126 typedef int8_t int_fast8_t;
    127 typedef int16_t int_fast16_t;
    128 typedef int32_t int_fast32_t;
    129 typedef int64_t int_fast64_t;
    130 
    13154#endif /* POSIX_STDINT_H_ */
    13255
  • uspace/lib/posix/include/posix/stdlib.h

    rc8fbbe7 r810a36f  
    4343#include "sys/types.h"
    4444
    45 #ifndef NULL
    46         #define NULL  ((void *) 0)
    47 #endif
     45#include <_bits/NULL.h>
    4846
    4947#define RAND_MAX  714025
  • uspace/lib/posix/include/posix/string.h

    rc8fbbe7 r810a36f  
    5151 */
    5252
    53 #ifndef NULL
    54         #define NULL  ((void *) 0)
    55 #endif
     53#include <_bits/NULL.h>
    5654
    5755/*
  • uspace/lib/posix/include/posix/time.h

    rc8fbbe7 r810a36f  
    4343#include "sys/types.h"
    4444
    45 #ifndef NULL
    46         #define NULL  ((void *) 0)
    47 #endif
     45#include <_bits/NULL.h>
    4846
    4947#ifndef CLOCKS_PER_SEC
  • uspace/lib/trackmod/xm.c

    rc8fbbe7 r810a36f  
    3838#include <stdlib.h>
    3939#include <mem.h>
     40#include <types/common.h>
    4041
    4142#include "byteorder.h"
Note: See TracChangeset for help on using the changeset viewer.