Changeset 1433ecda in mainline for uspace/lib/posix/src


Ignore:
Timestamp:
2018-04-04T15:42:37Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c4e1cc
Parents:
47b2d7e3
Message:

Fix cstyle: make ccheck-fix and commit only files where all the changes are good.

Location:
uspace/lib/posix/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/internal/common.h

    r47b2d7e3 r1433ecda  
    5656 * If so, writes the error code to errno and returns true.
    5757 */
    58 static inline bool failed(int rc) {
     58static inline bool failed(int rc)
     59{
    5960        if (rc != EOK) {
    6061                errno = rc;
  • uspace/lib/posix/src/pthread/keys.c

    r47b2d7e3 r1433ecda  
    5757}
    5858
    59 int pthread_key_create(pthread_key_t *key, void (*destructor)(void*))
     59int pthread_key_create(pthread_key_t *key, void (*destructor)(void *))
    6060{
    6161        not_implemented();
  • uspace/lib/posix/src/pwd.c

    r47b2d7e3 r1433ecda  
    163163
    164164        static const char bf[] = { 'u', 's', 'e', 'r', '\0',
    165             '/', '\0', 'b', 'd', 's', 'h', '\0' };
     165                '/', '\0', 'b', 'd', 's', 'h', '\0' };
    166166
    167167        if (uid != 0) {
  • uspace/lib/posix/src/stdio.c

    r47b2d7e3 r1433ecda  
    6363        // TODO: return a real terminal path
    6464
    65         static char dummy_path[L_ctermid] = {'\0'};
     65        static char dummy_path[L_ctermid] = { '\0' };
    6666
    6767        if (s == NULL) {
  • uspace/lib/posix/src/stdio/scanf.c

    r47b2d7e3 r1433ecda  
    9595        int (*undo)(struct __input_provider *);
    9696        /** Lend the cursor to the caller.  */
    97         const char * (*borrow_cursor)(struct __input_provider *);
     97        const char *(*borrow_cursor)(struct __input_provider *);
    9898        /** Take control over possibly incremented cursor and update the internal
    9999          * structures if necessary. */
     
    10011001                                }
    10021002
    1003                                 char * buf = NULL;
     1003                                char *buf = NULL;
    10041004                                size_t buf_size = 0;
    1005                                 char * cur = NULL;
     1005                                char *cur = NULL;
    10061006                                size_t alloc_step = 80; /* Buffer size gain during reallocation. */
    10071007                                int my_buffer_idx = 0;
     
    12161216{
    12171217        _input_provider provider = {
    1218             { 0 }, 0, 0, NULL, 0, NULL, _PROV_CONSTRUCTED,
    1219             _capture_stream, _pop_stream, _undo_stream,
    1220             _borrow_cursor_universal, _return_cursor_stream, _release_stream
     1218                { 0 }, 0, 0, NULL, 0, NULL, _PROV_CONSTRUCTED,
     1219                _capture_stream, _pop_stream, _undo_stream,
     1220                _borrow_cursor_universal, _return_cursor_stream, _release_stream
    12211221        };
    12221222        provider.source.stream = stream;
     
    12361236{
    12371237        _input_provider provider = {
    1238             { 0 }, 0, 0, NULL, 0, NULL, _PROV_CONSTRUCTED,
    1239             _capture_string, _pop_string, _undo_string,
    1240             _borrow_cursor_universal, _return_cursor_string, _release_string
     1238                { 0 }, 0, 0, NULL, 0, NULL, _PROV_CONSTRUCTED,
     1239                _capture_string, _pop_string, _undo_string,
     1240                _borrow_cursor_universal, _return_cursor_string, _release_string
    12411241        };
    12421242        provider.source.string = s;
  • uspace/lib/posix/src/stdlib.c

    r47b2d7e3 r1433ecda  
    204204 *     or not (zero).
    205205 */
    206 int system(const char *string) {
     206int system(const char *string)
     207{
    207208        // TODO: does nothing at the moment
    208209        not_implemented();
     
    222223char *realpath(const char *restrict name, char *restrict resolved)
    223224{
    224         #ifndef PATH_MAX
    225                 assert(resolved == NULL);
    226         #endif
     225#ifndef PATH_MAX
     226        assert(resolved == NULL);
     227#endif
    227228
    228229        if (name == NULL) {
     
    238239         * to be updated when that support is implemented.
    239240         */
    240         char* absolute = vfs_absolutize(name, NULL);
     241        char *absolute = vfs_absolutize(name, NULL);
    241242
    242243        if (absolute == NULL) {
     
    252253                return absolute;
    253254        } else {
    254                 #ifdef PATH_MAX
    255                         str_cpy(resolved, PATH_MAX, absolute);
    256                 #endif
     255#ifdef PATH_MAX
     256                str_cpy(resolved, PATH_MAX, absolute);
     257#endif
    257258                free(absolute);
    258259                return resolved;
  • uspace/lib/posix/src/stdlib/strtold.c

    r47b2d7e3 r1433ecda  
    5151
    5252#ifndef HUGE_VALL
    53         #define HUGE_VALL (+1.0l / +0.0l)
     53#define HUGE_VALL (+1.0l / +0.0l)
    5454#endif
    5555
    5656#ifndef abs
    57         #define abs(x) (((x) < 0) ? -(x) : (x))
     57#define abs(x) (((x) < 0) ? -(x) : (x))
    5858#endif
    5959
    6060/* If the constants are not defined, use double precision as default. */
    6161#ifndef LDBL_MANT_DIG
    62         #define LDBL_MANT_DIG 53
     62#define LDBL_MANT_DIG 53
    6363#endif
    6464#ifndef LDBL_MAX_EXP
    65         #define LDBL_MAX_EXP 1024
     65#define LDBL_MAX_EXP 1024
    6666#endif
    6767#ifndef LDBL_MIN_EXP
    68         #define LDBL_MIN_EXP (-1021)
     68#define LDBL_MIN_EXP (-1021)
    6969#endif
    7070#ifndef LDBL_DIG
    71         #define LDBL_DIG 15
     71#define LDBL_DIG 15
    7272#endif
    7373#ifndef LDBL_MIN
    74         #define LDBL_MIN 2.2250738585072014E-308
     74#define LDBL_MIN 2.2250738585072014E-308
    7575#endif
    7676
  • uspace/lib/posix/src/string.c

    r47b2d7e3 r1433ecda  
    198198        assert(src != NULL);
    199199
    200         unsigned char* bdest = dest;
    201         const unsigned char* bsrc = src;
     200        unsigned char *bdest = dest;
     201        const unsigned char *bsrc = src;
    202202
    203203        for (size_t i = 0; i < n; ++i) {
     
    458458                        j = prefix_table[j];
    459459                }
    460                 i++; j++;
     460                i++;
     461                j++;
    461462                prefix_table[i] = j;
    462463        }
     
    518519
    519520        /* Skip over leading delimiters. */
    520         while (*s && (strchr(delim, *s) != NULL)) ++s;
     521        while (*s && (strchr(delim, *s) != NULL))
     522                ++s;
    521523        start = s;
    522524
    523525        /* Skip over token characters. */
    524         while (*s && (strchr(delim, *s) == NULL)) ++s;
     526        while (*s && (strchr(delim, *s) == NULL))
     527                ++s;
    525528        end = s;
    526529        *next = (*s ? s + 1 : s);
  • uspace/lib/posix/src/sys/wait.c

    r47b2d7e3 r1433ecda  
    4545#include "posix/signal.h"
    4646
    47 int __posix_wifexited(int status) {
     47int __posix_wifexited(int status)
     48{
    4849        return status != INT_MIN;
    4950}
    5051
    51 int __posix_wexitstatus(int status) {
     52int __posix_wexitstatus(int status)
     53{
    5254        assert(__posix_wifexited(status));
    5355        return status;
    5456}
    5557
    56 int __posix_wifsignaled(int status) {
     58int __posix_wifsignaled(int status)
     59{
    5760        return status == INT_MIN;
    5861}
    5962
    60 int __posix_wtermsig(int status) {
     63int __posix_wtermsig(int status)
     64{
    6165        assert(__posix_wifsignaled(status));
    6266        /* There is no way to distinguish reason
Note: See TracChangeset for help on using the changeset viewer.