Changes in / [b5143bd:94e46c9] in mainline


Ignore:
Files:
45 edited

Legend:

Unmodified
Added
Removed
  • abi/include/abi/proc/uarg.h

    rb5143bd r94e46c9  
    4242        size_t uspace_stack_size;
    4343       
    44         void (* uspace_thread_function)(void *);
     44        void (* uspace_thread_function)();
    4545        void *uspace_thread_arg;
    4646       
  • boot/arch/arm32/src/mm.c

    rb5143bd r94e46c9  
    193193}
    194194
    195 static void enable_paging(void)
    196 {
    197         /*
    198          * c3   - each two bits controls access to the one of domains (16)
     195static void enable_paging()
     196{
     197        /* c3   - each two bits controls access to the one of domains (16)
    199198         * 0b01 - behave as a client (user) of a domain
    200199         */
     
    233232
    234233/** Start the MMU - initialize page table and enable paging. */
    235 void mmu_start(void)
    236 {
     234void mmu_start() {
    237235        disable_paging();
    238236#ifdef PROCESSOR_ARCH_armv7_a
  • boot/arch/ppc32/include/asm.h

    rb5143bd r94e46c9  
    3535extern void jump_to_kernel(void *, void *, size_t, void *)
    3636    __attribute__((noreturn));
    37 extern void real_mode(void);
     37extern void real_mode();
    3838
    3939#endif
  • boot/arch/sparc32/src/ambapp.c

    rb5143bd r94e46c9  
    5858static void ambapp_scan_area(uintptr_t, unsigned int);
    5959
    60 void ambapp_scan(void)
     60void ambapp_scan()
    6161{
    6262        amba_fake = false;
     
    104104}
    105105
    106 void ambapp_qemu_fake_scan(void)
     106void ambapp_qemu_fake_scan()
    107107{
    108108        /* UART */
     
    134134}
    135135
    136 bool ambapp_fake(void)
     136bool ambapp_fake()
    137137{
    138138        return amba_fake;
    139139}
    140140
    141 void ambapp_print_devices(void)
     141void ambapp_print_devices()
    142142{
    143143        printf("ABMA devices:\n");
  • boot/arch/sparc32/src/mm.c

    rb5143bd r94e46c9  
    7676}
    7777
    78 static void mmu_disable(void)
     78static void mmu_disable()
    7979{
    8080        uint32_t cr = asi_u32_read(ASI_MMUREGS, 0x000);
  • boot/generic/include/memstr.h

    rb5143bd r94e46c9  
    3636
    3737extern void *memcpy(void *, const void *, size_t)
    38     __attribute__((nonnull(1, 2)))
    39     __attribute__((optimize("-fno-tree-loop-distribute-patterns")));
     38    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
    4039extern void *memset(void *, int, size_t)
    41     __attribute__((nonnull(1)))
    42     __attribute__((optimize("-fno-tree-loop-distribute-patterns")));
    43 extern void *memmove(void *, const void *, size_t)
    44     __attribute__((nonnull(1, 2)));
     40    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
     41extern void *memmove(void *, const void *, size_t);
    4542
    4643#endif
  • contrib/bazaar/bzreml/__init__.py

    rb5143bd r94e46c9  
    7070       
    7171        sender_user, sender_email = parseaddr(sender)
    72         payload = MIMEText(body.decode("utf-8", 'ignore').encode("utf-8", 'ignore'), "plain", "utf-8")
     72        payload = MIMEText(body.encode("utf-8"), "plain", "utf-8")
    7373       
    7474        msg = MIMEMultipart()
  • contrib/bazaar/mbprotect/__init__.py

    rb5143bd r94e46c9  
    6060                return
    6161       
    62         # First permitted case is appending changesets to main branch. Look for
     62        # First permitted case is appending changesets to main branch.Look for
    6363        # old tip in new main branch.
    6464        for revision_id in iter_reverse_revision_history(repo, params.new_revid):
    6565                if revision_id == params.old_revid:
    66                         # Old tip found
    67                         return
     66                        return  # Found old tip
    6867       
    6968        # Another permitted case is backing out changesets. Look for new tip
     
    7170        for revision_id in iter_reverse_revision_history(repo, params.old_revid):
    7271                if revision_id == params.new_revid:
    73                         # New tip found
    74                         return
     72                        return  # Found new tip
    7573       
    7674        # Trying to do something else. Reject the change.
  • kernel/arch/abs32le/src/abs32le.c

    rb5143bd r94e46c9  
    6969}
    7070
    71 void arch_post_cpu_init(void)
     71void arch_post_cpu_init()
    7272{
    7373}
  • kernel/arch/amd64/include/arch/asm.h

    rb5143bd r94e46c9  
    339339 *
    340340 */
    341 NO_TRACE static inline void enable_l_apic_in_msr(void)
     341NO_TRACE static inline void enable_l_apic_in_msr()
    342342{
    343343        asm volatile (
  • kernel/arch/amd64/src/fpu_context.c

    rb5143bd r94e46c9  
    5454}
    5555
    56 void fpu_init(void)
     56void fpu_init()
    5757{
    5858        /* TODO: Zero all SSE, MMX etc. registers */
  • kernel/arch/arm32/include/arch/cp15.h

    rb5143bd r94e46c9  
    4747
    4848#define CONTROL_REG_GEN_READ(name, crn, opc1, crm, opc2) \
    49 static inline uint32_t name##_read(void) \
     49static inline uint32_t name##_read() \
    5050{ \
    5151        uint32_t val; \
  • kernel/arch/arm32/include/arch/security_ext.h

    rb5143bd r94e46c9  
    4646 * older archs.
    4747 */
    48 static inline bool sec_ext_is_implemented(void)
     48static inline bool sec_ext_is_implemented()
    4949{
    5050#ifdef PROCESSOR_ARCH_armv7_a
     
    6060 * mode.
    6161 */
    62 static inline bool sec_ext_is_monitor_mode(void)
     62static inline bool sec_ext_is_monitor_mode()
    6363{
    6464        return (current_status_reg_read() & MODE_MASK) == MONITOR_MODE;
     
    7575 * Look for 'secureworld_exit' in arch/arm/cpu/armv7/omap3/board.c.
    7676 */
    77 static inline bool sec_ext_is_secure(void)
     77static inline bool sec_ext_is_secure()
    7878{
    7979        return sec_ext_is_implemented()
  • kernel/arch/arm32/src/arm32.c

    rb5143bd r94e46c9  
    158158
    159159/** Reboot. */
    160 void arch_reboot(void)
     160void arch_reboot()
    161161{
    162162        /* not implemented */
  • kernel/arch/arm32/src/fpu_context.c

    rb5143bd r94e46c9  
    101101        FPSCR_EN_ALL = FPSCR_DENORMAL_EN_FLAG | FPSCR_INEXACT_EN_FLAG | FPSCR_UNDERFLOW_EN_FLAG | FPSCR_OVERFLOW_EN_FLAG | FPSCR_ZERO_DIV_EN_FLAG | FPSCR_INVALID_OP_EN_FLAG,
    102102};
    103 
    104103extern uint32_t fpscr_read(void);
    105104extern void fpscr_write(uint32_t);
     
    115114static void (*restore_context)(fpu_context_t *ctx);
    116115
    117 static int fpu_have_coprocessor_access(void)
    118 {
    119 /*
    120  * The register containing the information (CPACR) is not available on armv6-
     116static int fpu_have_coprocessor_access()
     117{
     118/* The register containing the information (CPACR) is not available on armv6-
    121119 * rely on user decision to use CONFIG_FPU.
    122120 */
     
    145143 * @note do we need to call secure monitor here?
    146144 */
    147 static void fpu_enable_coprocessor_access(void)
    148 {
    149 /*
    150  * The register containing the information (CPACR) is not available on armv6-
     145static void fpu_enable_coprocessor_access()
     146{
     147/* The register containing the information (CPACR) is not available on armv6-
    151148 * rely on user decision to use CONFIG_FPU.
    152149 */
  • kernel/arch/ia32/src/fpu_context.c

    rb5143bd r94e46c9  
    125125
    126126/** Initialize x87 FPU. Mask all exceptions. */
    127 void fpu_init(void)
     127void fpu_init()
    128128{
    129129        uint32_t help0 = 0;
  • kernel/arch/ia64/src/mm/vhpt.c

    rb5143bd r94e46c9  
    8282}
    8383
    84 void vhpt_invalidate_all(void)
     84void vhpt_invalidate_all()
    8585{
    8686        memsetb(vhpt_base, VHPT_SIZE, 0);
  • kernel/arch/mips32/src/debugger.c

    rb5143bd r94e46c9  
    288288 *
    289289 */
    290 void debugger_init(void)
     290void debugger_init()
    291291{
    292292        unsigned int i;
  • kernel/arch/mips32/src/fpu_context.c

    rb5143bd r94e46c9  
    5353}
    5454
    55 void fpu_init(void)
     55void fpu_init()
    5656{
    5757        /* TODO: Zero all registers */
  • kernel/arch/sparc32/src/sparc32.c

    rb5143bd r94e46c9  
    9696
    9797
    98 void arch_post_cpu_init(void)
     98void arch_post_cpu_init()
    9999{
    100100}
  • kernel/generic/include/lib/memfnc.h

    rb5143bd r94e46c9  
    4646
    4747extern void *memset(void *, int, size_t)
    48     __attribute__((nonnull(1)))
    4948    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns") DO_NOT_DISCARD;
    5049extern void *memcpy(void *, const void *, size_t)
    51     __attribute__((nonnull(1, 2)))
    5250    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns") DO_NOT_DISCARD;
    5351
  • kernel/generic/include/memstr.h

    rb5143bd r94e46c9  
    4848#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
    4949
    50 extern void memsetb(void *, size_t, uint8_t)
    51     __attribute__((nonnull(1)));
    52 extern void memsetw(void *, size_t, uint16_t)
    53     __attribute__((nonnull(1)));
    54 extern void *memmove(void *, const void *, size_t)
    55     __attribute__((nonnull(1, 2))) DO_NOT_DISCARD;
     50extern void memsetb(void *, size_t, uint8_t);
     51extern void memsetw(void *, size_t, uint16_t);
     52extern void *memmove(void *, const void *, size_t) DO_NOT_DISCARD;
    5653
    5754#endif
  • kernel/generic/include/mm/slab.h

    rb5143bd r94e46c9  
    142142extern void *malloc(size_t, unsigned int)
    143143    __attribute__((malloc));
    144 extern void *realloc(void *, size_t, unsigned int)
    145     __attribute__((warn_unused_result));
     144extern void *realloc(void *, size_t, unsigned int);
    146145extern void free(void *);
    147146
  • kernel/generic/include/typedefs.h

    rb5143bd r94e46c9  
    5050} atomic_t;
    5151
    52 typedef void (* function)(void);
     52typedef void (* function)();
    5353
    5454typedef uint32_t container_id_t;
  • kernel/generic/src/ipc/ops/conctmeto.c

    rb5143bd r94e46c9  
    4444        int newphid = phone_alloc(TASK);
    4545
    46         /* Remember the phoneid or the error. */
    47         call->priv = newphid;
    4846        if (newphid < 0)
    4947                return ELIMIT;
     
    5149        /* Set arg5 for server */
    5250        IPC_SET_ARG5(call->data, (sysarg_t) &TASK->phones[newphid]);
     51        call->priv = newphid;
    5352
    5453        return EOK;
     
    7473static int answer_process(call_t *answer)
    7574{
    76         int newphid = (int) answer->priv;
    77 
    78         if (IPC_GET_RETVAL(answer->data)) {
    79                 if (newphid >= 0) {
    80                         /*
    81                          * The phone was indeed allocated and now needs
    82                          * to be deallocated.
    83                          */
    84                         phone_dealloc(newphid);
    85                 }
    86         } else {
    87                 IPC_SET_ARG5(answer->data, newphid);
    88         }
     75        if (IPC_GET_RETVAL(answer->data))
     76                phone_dealloc(answer->priv);
     77        else
     78                IPC_SET_ARG5(answer->data, answer->priv);
    8979       
    9080        return EOK;
  • kernel/generic/src/ipc/sysipc.c

    rb5143bd r94e46c9  
    388388{
    389389        call_t *call = get_call(callid);
     390        phone_t *phone;
     391        bool need_old = answer_need_old(call);
     392        bool after_forward = false;
     393        ipc_data_t old;
     394        int rc;
     395
    390396        if (!call)
    391397                return ENOENT;
    392        
    393         ipc_data_t old;
    394         bool need_old = answer_need_old(call);
     398
    395399        if (need_old)
    396400                old = call->data;
    397        
    398         bool after_forward = false;
    399         int rc;
    400         phone_t *phone;
    401401       
    402402        if (phone_get(phoneid, &phone) != EOK) {
     
    409409                goto error;
    410410        }
    411        
     411
    412412        call->flags |= IPC_CALL_FORWARDED;
    413413       
  • kernel/generic/src/lib/func.c

    rb5143bd r94e46c9  
    5151 *
    5252 */
    53 void halt(void)
     53void halt()
    5454{
    5555#if (defined(CONFIG_DEBUG)) && (defined(CONFIG_KCONSOLE))
  • kernel/generic/src/mm/as.c

    rb5143bd r94e46c9  
    834834                        if ((cond = (bool) node->keys)) {
    835835                                uintptr_t ptr = node->key[node->keys - 1];
    836                                 size_t node_size =
     836                                size_t size =
    837837                                    (size_t) node->value[node->keys - 1];
    838838                                size_t i = 0;
    839839                               
    840                                 if (overlaps(ptr, P2SZ(node_size), area->base,
     840                                if (overlaps(ptr, P2SZ(size), area->base,
    841841                                    P2SZ(pages))) {
    842842                                       
    843                                         if (ptr + P2SZ(node_size) <= start_free) {
     843                                        if (ptr + P2SZ(size) <= start_free) {
    844844                                                /*
    845845                                                 * The whole interval fits
     
    860860                                        i = (start_free - ptr) >> PAGE_WIDTH;
    861861                                        if (!used_space_remove(area, start_free,
    862                                             node_size - i))
     862                                            size - i))
    863863                                                panic("Cannot remove used space.");
    864864                                } else {
     
    867867                                         * completely removed.
    868868                                         */
    869                                         if (!used_space_remove(area, ptr, node_size))
     869                                        if (!used_space_remove(area, ptr, size))
    870870                                                panic("Cannot remove used space.");
    871871                                }
     
    887887                                    area->pages - pages);
    888888               
    889                                 for (; i < node_size; i++) {
     889                                for (; i < size; i++) {
    890890                                        pte_t *pte = page_mapping_find(as,
    891891                                            ptr + P2SZ(i), false);
  • kernel/generic/src/mm/slab.c

    rb5143bd r94e46c9  
    610610    unsigned int kmflag), size_t (*destructor)(void *obj), unsigned int flags)
    611611{
    612         ASSERT(size > 0);
    613        
    614612        memsetb(cache, sizeof(*cache), 0);
    615613        cache->name = name;
     
    890888        /* Initialize magazine cache */
    891889        _slab_cache_create(&mag_cache, "slab_magazine_t",
    892             sizeof(slab_magazine_t) + SLAB_MAG_SIZE * sizeof(void *),
     890            sizeof(slab_magazine_t) + SLAB_MAG_SIZE * sizeof(void*),
    893891            sizeof(uintptr_t), NULL, NULL, SLAB_CACHE_NOMAGAZINE |
    894892            SLAB_CACHE_SLINSIDE);
  • kernel/generic/src/udebug/udebug_ops.c

    rb5143bd r94e46c9  
    375375        if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) {
    376376                mutex_unlock(&TASK->udebug.lock);
    377                 free(id_buffer);
    378377                return EINVAL;
    379378        }
     
    457456int udebug_args_read(thread_t *thread, void **buffer)
    458457{
     458        /* Prepare a buffer to hold the arguments. */
     459        sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
     460       
    459461        /* On success, this will lock t->udebug.lock. */
    460462        int rc = _thread_op_begin(thread, false);
     
    469471        }
    470472       
    471         /* Prepare a buffer to hold the arguments. */
    472         sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
    473        
    474473        /* Copy to a local buffer before releasing the lock. */
    475474        memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(sysarg_t));
     
    500499int udebug_regs_read(thread_t *thread, void **buffer)
    501500{
     501        /* Prepare a buffer to hold the data. */
     502        istate_t *state_buf = malloc(sizeof(istate_t), 0);
     503       
    502504        /* On success, this will lock t->udebug.lock */
    503505        int rc = _thread_op_begin(thread, false);
     
    510512                return EBUSY;
    511513        }
    512        
    513         /* Prepare a buffer to hold the data. */
    514         istate_t *state_buf = malloc(sizeof(istate_t), 0);
    515514       
    516515        /* Copy to the allocated buffer */
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    rb5143bd r94e46c9  
    108108}
    109109
    110 static void waitprompt(void)
     110static void waitprompt()
    111111{
    112112        console_set_pos(console, 0, console_rows-1);
     
    120120}
    121121
    122 static void waitkey(void)
     122static void waitkey()
    123123{
    124124        cons_event_t ev;
     
    149149}
    150150
    151 static void newpage(void)
     151static void newpage()
    152152{
    153153        console_clear(console);
  • uspace/app/bdsh/input.c

    rb5143bd r94e46c9  
    219219}
    220220
    221 void print_pipe_usage(void)
     221void print_pipe_usage()
    222222{
    223223        printf("Invalid syntax!\n");
  • uspace/app/trace/trace.c

    rb5143bd r94e46c9  
    730730}
    731731
    732 static void print_syntax(void)
     732static void print_syntax()
    733733{
    734734        printf("Syntax:\n");
  • uspace/drv/bus/usb/vhc/devconn.c

    rb5143bd r94e46c9  
    3232
    3333
    34 static vhc_virtdev_t *vhc_virtdev_create(void)
     34static vhc_virtdev_t *vhc_virtdev_create()
    3535{
    3636        vhc_virtdev_t *dev = malloc(sizeof(vhc_virtdev_t));
  • uspace/lib/c/generic/getopt.c

    rb5143bd r94e46c9  
    9595 * Compute the greatest common divisor of a and b.
    9696 */
    97 static int gcd(int a, int b)
     97static int
     98gcd(a, b)
     99        int a;
     100        int b;
    98101{
    99102        int c;
    100        
     103
    101104        c = a % b;
    102105        while (c != 0) {
     
    105108                c = a % b;
    106109        }
    107        
     110           
    108111        return b;
    109112}
     
    114117 * in each block).
    115118 */
    116 static void permute_args(int panonopt_start, int panonopt_end, int opt_end,
    117     char **nargv)
     119static void
     120permute_args(panonopt_start, panonopt_end, opt_end, nargv)
     121        int panonopt_start;
     122        int panonopt_end;
     123        int opt_end;
     124        char **nargv;
    118125{
    119126        int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
     
    150157 *  Returns -2 if -- is found (can be long option or end of options marker).
    151158 */
    152 static int getopt_internal(int nargc, char **nargv, const char *options)
     159static int
     160getopt_internal(nargc, nargv, options)
     161        int nargc;
     162        char **nargv;
     163        const char *options;
    153164{
    154165        const char *oli;                                /* option letter list index */
     
    288299 *      Parse argc/argv argument vector.
    289300 */
    290 int getopt(int nargc, char * const *nargv, const char *options)
     301int
     302getopt(nargc, nargv, options)
     303        int nargc;
     304        char * const *nargv;
     305        const char *options;
    291306{
    292307        int retval;
     
    317332 *      Parse argc/argv argument vector.
    318333 */
    319 int getopt_long(int nargc, char * const *nargv, const char *options,
    320     const struct option *long_options, int *idx)
     334int
     335getopt_long(nargc, nargv, options, long_options, idx)
     336        int nargc;
     337        char * const *nargv;
     338        const char *options;
     339        const struct option *long_options;
     340        int *idx;
    321341{
    322342        int retval;
  • uspace/lib/c/include/malloc.h

    rb5143bd r94e46c9  
    4444extern void *memalign(const size_t align, const size_t size)
    4545    __attribute__((malloc));
    46 extern void *realloc(const void *addr, const size_t size)
    47     __attribute__((warn_unused_result));
     46extern void *realloc(const void *addr, const size_t size);
    4847extern void free(const void *addr);
    4948extern void *heap_check(void);
  • uspace/lib/c/include/mem.h

    rb5143bd r94e46c9  
    4040
    4141extern void *memset(void *, int, size_t)
    42     __attribute__((nonnull(1)))
    4342    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns");
    4443extern void *memcpy(void *, const void *, size_t)
    45     __attribute__((nonnull(1, 2)))
    4644    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns");
    47 extern void *memmove(void *, const void *, size_t)
    48     __attribute__((nonnull(1, 2)));
    49 extern int memcmp(const void *, const void *, size_t)
    50     __attribute__((nonnull(1, 2)));
     45extern void *memmove(void *, const void *, size_t);
     46extern int memcmp(const void *, const void *, size_t);
    5147
    5248#endif
  • uspace/lib/c/include/task.h

    rb5143bd r94e46c9  
    6060extern int task_spawn(task_id_t *, task_wait_t *, const char *path, int,
    6161    va_list ap);
    62 extern int task_spawnl(task_id_t *, task_wait_t *, const char *path, ...)
    63     __attribute__((sentinel));
     62extern int task_spawnl(task_id_t *, task_wait_t *, const char *path, ...);
    6463
    6564extern int task_setup_wait(task_id_t, task_wait_t *);
  • uspace/lib/ieee80211/src/ieee80211.c

    rb5143bd r94e46c9  
    718718 *
    719719 */
    720 ieee80211_dev_t *ieee80211_device_create(void)
     720ieee80211_dev_t *ieee80211_device_create()
    721721{
    722722        return calloc(1, sizeof(ieee80211_dev_t));
  • uspace/lib/pcut/src/run.c

    rb5143bd r94e46c9  
    7373static int default_suite_initialized = 0;
    7474
    75 static void init_default_suite_when_needed(void)
    76 {
    77         if (default_suite_initialized)
     75static void init_default_suite_when_needed() {
     76        if (default_suite_initialized) {
    7877                return;
    79        
     78        }
    8079        default_suite.id = -1;
    8180        default_suite.kind = PCUT_KIND_TESTSUITE;
     
    9291 * @return Always a valid test suite item.
    9392 */
    94 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it)
    95 {
     93static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) {
    9694        while (it != NULL) {
    97                 if (it->kind == PCUT_KIND_TESTSUITE)
     95                if (it->kind == PCUT_KIND_TESTSUITE) {
    9896                        return it;
    99                
     97                }
    10098                it = it->previous;
    10199        }
    102        
    103100        init_default_suite_when_needed();
    104101        return &default_suite;
     
    109106 * @param func Function to run (can be NULL).
    110107 */
    111 static void run_setup_teardown(pcut_setup_func_t func)
    112 {
    113         if (func != NULL)
     108static void run_setup_teardown(pcut_setup_func_t func) {
     109        if (func != NULL) {
    114110                func();
     111        }
    115112}
    116113
     
    122119 * @param outcome Outcome of the current test.
    123120 */
    124 static void leave_test(int outcome)
    125 {
     121static void leave_test(int outcome) {
    126122        PCUT_DEBUG("leave_test(outcome=%d), will_exit=%s", outcome,
    127             leave_means_exit ? "yes" : "no");
    128         if (leave_means_exit)
     123                leave_means_exit ? "yes" : "no");
     124        if (leave_means_exit) {
    129125                exit(outcome);
    130        
     126        }
     127
    131128#ifndef PCUT_NO_LONG_JUMP
    132129        longjmp(start_test_jump, 1);
     
    141138 * @param message Message describing the failure.
    142139 */
    143 void pcut_failed_assertion(const char *message)
    144 {
     140void pcut_failed_assertion(const char *message) {
    145141        static const char *prev_message = NULL;
    146        
    147142        /*
    148143         * The assertion failed. We need to abort the current test,
     
    150145         * include running the tear-down routine.
    151146         */
    152         if (print_test_error)
     147        if (print_test_error) {
    153148                pcut_print_fail_message(message);
    154        
     149        }
     150
    155151        if (execute_teardown_on_failure) {
    156152                execute_teardown_on_failure = 0;
    157153                prev_message = message;
    158154                run_setup_teardown(current_suite->teardown_func);
    159                
     155
    160156                /* Tear-down was okay. */
    161157                if (report_test_result) {
     
    169165                }
    170166        }
    171        
     167
    172168        prev_message = NULL;
    173        
     169
    174170        leave_test(TEST_OUTCOME_FAIL); /* No return. */
    175171}
     
    180176 * @return Error status (zero means success).
    181177 */
    182 static int run_test(pcut_item_t *test)
    183 {
     178static int run_test(pcut_item_t *test) {
    184179        /*
    185180         * Set here as the returning point in case of test failure.
     
    187182         * test execution.
    188183         */
    189        
    190184#ifndef PCUT_NO_LONG_JUMP
    191185        int test_finished = setjmp(start_test_jump);
    192         if (test_finished)
     186        if (test_finished) {
    193187                return 1;
     188        }
    194189#endif
    195        
    196         if (report_test_result)
     190
     191        if (report_test_result) {
    197192                pcut_report_test_start(test);
    198        
     193        }
     194
    199195        current_suite = pcut_find_parent_suite(test);
    200196        current_test = test;
    201        
     197
    202198        pcut_hook_before_test(test);
    203        
     199
    204200        /*
    205201         * If anything goes wrong, execute the tear-down function
     
    207203         */
    208204        execute_teardown_on_failure = 1;
    209        
     205
    210206        /*
    211207         * Run the set-up function.
    212208         */
    213209        run_setup_teardown(current_suite->setup_func);
    214        
     210
    215211        /*
    216212         * The setup function was performed, it is time to run
     
    218214         */
    219215        test->test_func();
    220        
     216
    221217        /*
    222218         * Finally, run the tear-down function. We need to clear
     
    225221        execute_teardown_on_failure = 0;
    226222        run_setup_teardown(current_suite->teardown_func);
    227        
     223
    228224        /*
    229225         * If we got here, it means everything went well with
    230226         * this test.
    231227         */
    232         if (report_test_result)
     228        if (report_test_result) {
    233229                pcut_report_test_done(current_test, TEST_OUTCOME_PASS,
    234                     NULL, NULL, NULL);
    235        
     230                        NULL, NULL, NULL);
     231        }
     232
    236233        return 0;
    237234}
     
    245242 * @return Error status (zero means success).
    246243 */
    247 int pcut_run_test_forked(pcut_item_t *test)
    248 {
     244int pcut_run_test_forked(pcut_item_t *test) {
     245        int rc;
     246
    249247        report_test_result = 0;
    250248        print_test_error = 1;
    251249        leave_means_exit = 1;
    252        
    253         int rc = run_test(test);
    254        
     250
     251        rc = run_test(test);
     252
    255253        current_test = NULL;
    256254        current_suite = NULL;
    257        
     255
    258256        return rc;
    259257}
     
    267265 * @return Error status (zero means success).
    268266 */
    269 int pcut_run_test_single(pcut_item_t *test)
    270 {
     267int pcut_run_test_single(pcut_item_t *test) {
     268        int rc;
     269
    271270        report_test_result = 1;
    272271        print_test_error = 0;
    273272        leave_means_exit = 0;
    274        
    275         int rc = run_test(test);
    276        
     273
     274        rc = run_test(test);
     275
    277276        current_test = NULL;
    278277        current_suite = NULL;
    279        
     278
    280279        return rc;
    281280}
     
    286285 * @return Timeout in seconds.
    287286 */
    288 int pcut_get_test_timeout(pcut_item_t *test)
    289 {
     287int pcut_get_test_timeout(pcut_item_t *test) {
    290288        int timeout = PCUT_DEFAULT_TEST_TIMEOUT;
    291289        pcut_extra_t *extras = test->extras;
    292        
     290
     291
    293292        while (extras->type != PCUT_EXTRA_LAST) {
    294                 if (extras->type == PCUT_EXTRA_TIMEOUT)
     293                if (extras->type == PCUT_EXTRA_TIMEOUT) {
    295294                        timeout = extras->timeout;
    296                
     295                }
    297296                extras++;
    298297        }
    299        
     298
    300299        return timeout;
    301300}
  • uspace/lib/posix/include/posix/stdlib.h

    rb5143bd r94e46c9  
    116116
    117117/* Memory Allocation */
    118 extern void *__POSIX_DEF__(malloc)(size_t size)
    119     __attribute__((malloc));
    120 extern void *__POSIX_DEF__(calloc)(size_t nelem, size_t elsize)
    121     __attribute__((malloc));
    122 extern void *__POSIX_DEF__(realloc)(void *ptr, size_t size)
    123     __attribute__((warn_unused_result));
     118extern void *__POSIX_DEF__(malloc)(size_t size);
     119extern void *__POSIX_DEF__(calloc)(size_t nelem, size_t elsize);
     120extern void *__POSIX_DEF__(realloc)(void *ptr, size_t size);
    124121extern void __POSIX_DEF__(free)(void *ptr);
    125122
  • uspace/lib/posix/include/posix/string.h

    rb5143bd r94e46c9  
    6767/* From mem.h */
    6868// #define bzero(ptr, len)  memset((ptr), 0, (len))
    69 extern void *memset(void *, int, size_t)
    70     __attribute__((nonnull(1)));
    71 extern void *memcpy(void *, const void *, size_t)
    72     __attribute__((nonnull(1, 2)));
    73 extern void *memmove(void *, const void *, size_t)
    74     __attribute__((nonnull(1, 2)));
     69extern void *memset(void *, int, size_t);
     70extern void *memcpy(void *, const void *, size_t);
     71extern void *memmove(void *, const void *, size_t);
    7572
    7673
  • uspace/lib/posix/source/signal.c

    rb5143bd r94e46c9  
    382382 * Raise all unblocked previously queued signals.
    383383 */
    384 static void _dequeue_unblocked_signals(void)
     384static void _dequeue_unblocked_signals()
    385385{
    386386        link_t *iterator = _signal_queue.head.next;
  • uspace/srv/bd/sata_bd/sata_bd.c

    rb5143bd r94e46c9  
    147147 *
    148148 */
    149 static int get_sata_disks(void)
     149static int get_sata_disks()
    150150{
    151151        devman_handle_t root_fun;
  • uspace/srv/klog/klog.c

    rb5143bd r94e46c9  
    5151#include <io/logctl.h>
    5252
    53 #define NAME  "klog"
     53#define NAME       "klog"
    5454
    5555typedef size_t __attribute__ ((aligned(1))) unaligned_size_t;
     
    9898 *
    9999 */
    100 static void producer(void)
     100static void producer()
    101101{
    102102        int read = klog_read(buffer, BUFFER_SIZE);
Note: See TracChangeset for help on using the changeset viewer.