Changeset 58e7b26 in mainline for uspace/lib


Ignore:
Timestamp:
2018-08-31T19:10:47Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
be34d6f
Parents:
bbe5e34
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-04-20 18:54:48)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-31 19:10:47)
Message:

Make uspace hosted.

Location:
uspace/lib
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    rbbe5e34 r58e7b26  
    3434
    3535EXTRA_OUTPUT = $(START_FILES)
    36 EXTRA_TEST_CFLAGS = -Wno-deprecated-declarations
    3736LIBRARY = libc
    3837SOVERSION = 0.0
  • uspace/lib/c/arch/amd64/Makefile.common

    rbbe5e34 r58e7b26  
    2727#
    2828
     29# TODO: We need to implement DWARF unwinding and get rid of this flag.
    2930COMMON_CFLAGS += -fno-omit-frame-pointer
    3031
    31 # XXX: clang doesn't support this flag, but the optimization is OS-specific,
    32 #      so it isn't used for amd64-unknown-elf target.
    33 
    34 ifneq ($(COMPILER),clang)
    35         COMMON_CFLAGS += -mno-tls-direct-seg-refs
    36 endif
     32# XXX: This architecture requires unoptimized TLS pointer access,
     33#      as with the GCC option `-mno-tls-direct-seg-refs`.
     34#      The `amd64-helenos` target defaults to this behavior.
    3735
    3836LDFLAGS += -Wl,--gc-sections
  • uspace/lib/c/arch/ia32/Makefile.common

    rbbe5e34 r58e7b26  
    3333endif
    3434
     35# XXX: This architecture requires unoptimized TLS pointer access,
     36#      as with the GCC option `-mno-tls-direct-seg-refs`.
     37#      The `i686-helenos` target defaults to this behavior.
     38
    3539COMMON_CFLAGS += -mno-tls-direct-seg-refs -fno-omit-frame-pointer
    3640LDFLAGS += -Wl,--gc-sections
  • uspace/lib/c/generic/stdio/sprintf.c

    rbbe5e34 r58e7b26  
    3636#include <stdint.h>
    3737#include <stdio.h>
     38#include <limits.h>
    3839
    3940/** Print formatted to string.
     
    5354        va_list args;
    5455        va_start(args, fmt);
    55         rc = vsnprintf(s, SIZE_MAX, fmt, args);
     56        rc = vsnprintf(s, INT_MAX, fmt, args);
    5657        va_end(args);
    5758
  • uspace/lib/c/generic/stdio/vsprintf.c

    rbbe5e34 r58e7b26  
    3636#include <stdint.h>
    3737#include <stdio.h>
     38#include <limits.h>
    3839
    3940/** Print formatted to string with arguments passed as va_list.
     
    5051int vsprintf(char *s, const char *fmt, va_list ap)
    5152{
    52         return vsnprintf(s, SIZE_MAX, fmt, ap);
     53        return vsnprintf(s, INT_MAX, fmt, ap);
    5354}
    5455
  • uspace/lib/c/generic/time.c

    rbbe5e34 r58e7b26  
    5252#include <stats.h>
    5353
    54 #define ASCTIME_BUF_LEN  26
     54#define ASCTIME_BUF_LEN  27
    5555
    5656#define HOURS_PER_DAY  24
  • uspace/lib/c/include/math.h

    rbbe5e34 r58e7b26  
    4949#define M_SQRT2     1.41421356237309504880
    5050#define M_SQRT1_2   0.70710678118654752440
     51
     52/* GNU extensions, but GCC emits calls to them as an optimization. */
     53void sincos(double, double *, double *);
     54void sincosf(float, float *, float *);
     55void sincosl(long double, long double *, long double *);
    5156
    5257#endif
  • uspace/lib/c/test/stdio/scanf.c

    rbbe5e34 r58e7b26  
    4242#include <stdlib.h>
    4343
     44#pragma GCC diagnostic ignored "-Wformat-zero-length"
     45
    4446PCUT_INIT;
    4547
     
    604606
    605607        cp = NULL;
    606         rc = sscanf("abc", "%m3c", &cp);
     608        rc = sscanf("abc", "%3mc", &cp);
    607609        PCUT_ASSERT_INT_EQUALS(1, rc);
    608610        PCUT_ASSERT_NOT_NULL(cp);
  • uspace/lib/c/test/string.c

    rbbe5e34 r58e7b26  
    3333#include <pcut/pcut.h>
    3434
     35#pragma GCC diagnostic ignored "-Wstringop-truncation"
     36#pragma GCC diagnostic ignored "-Wstringop-overflow"
     37
    3538PCUT_INIT;
    3639
     
    544547PCUT_TEST(strpbrk_empty_string)
    545548{
    546         char *p;
     549        const char *p;
    547550
    548551        p = strpbrk("", "abc");
     
    553556PCUT_TEST(strpbrk_empty_set)
    554557{
    555         char *p;
     558        const char *p;
    556559
    557560        p = strpbrk("abc", "");
  • uspace/lib/math/generic/trig.c

    rbbe5e34 r58e7b26  
    371371}
    372372
     373void sincosf(float x, float *s, float *c)
     374{
     375        float base_arg = fmodf(x, 2 * M_PI);
     376
     377        if (base_arg < 0) {
     378                *s = -base_sin_32(-base_arg);
     379                *c = base_cos_32(-base_arg);
     380        } else {
     381                *s = base_sin_32(base_arg);
     382                *c = base_cos_32(base_arg);
     383        }
     384}
     385
     386void sincos(double x, double *s, double *c)
     387{
     388        double base_arg = fmod(x, 2 * M_PI);
     389
     390        if (base_arg < 0) {
     391                *s = -base_sin_64(-base_arg);
     392                *c = base_cos_64(-base_arg);
     393        } else {
     394                *s = base_sin_64(base_arg);
     395                *c = base_cos_64(base_arg);
     396        }
     397}
     398
    373399/** @}
    374400 */
  • uspace/lib/pcut/include/pcut/asserts.h

    rbbe5e34 r58e7b26  
    148148#define PCUT_ASSERT_NULL(pointer) \
    149149        do { \
    150                 void *pcut_ptr_eval = (pointer); \
     150                const void *pcut_ptr_eval = (pointer); \
    151151                if (pcut_ptr_eval != (NULL)) { \
    152152                        PCUT_ASSERTION_FAILED("Expected <" #pointer "> to be NULL, " \
Note: See TracChangeset for help on using the changeset viewer.