Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 193d280c in mainline


Ignore:
Timestamp:
2015-06-01T00:04:05Z (5 years ago)
Author:
Martin Decky <martin@…>
Branches:
master
Children:
53031c2
Parents:
91deaff
Message:

cstyle improvements
replace traditional K&R-style function declarations and definitions

Files:
29 edited

Legend:

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

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

    r91deaff r193d280c  
    193193}
    194194
    195 static void enable_paging()
    196 {
    197         /* c3   - each two bits controls access to the one of domains (16)
     195static void enable_paging(void)
     196{
     197        /*
     198         * c3   - each two bits controls access to the one of domains (16)
    198199         * 0b01 - behave as a client (user) of a domain
    199200         */
     
    232233
    233234/** Start the MMU - initialize page table and enable paging. */
    234 void mmu_start() {
     235void mmu_start(void)
     236{
    235237        disable_paging();
    236238#ifdef PROCESSOR_ARCH_armv7_a
  • boot/arch/ppc32/include/asm.h

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

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

    r91deaff r193d280c  
    7676}
    7777
    78 static void mmu_disable()
     78static void mmu_disable(void)
    7979{
    8080        uint32_t cr = asi_u32_read(ASI_MMUREGS, 0x000);
  • kernel/arch/abs32le/src/abs32le.c

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

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

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

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

    r91deaff r193d280c  
    4646 * older archs.
    4747 */
    48 static inline bool sec_ext_is_implemented()
     48static inline bool sec_ext_is_implemented(void)
    4949{
    5050#ifdef PROCESSOR_ARCH_armv7_a
     
    6060 * mode.
    6161 */
    62 static inline bool sec_ext_is_monitor_mode()
     62static inline bool sec_ext_is_monitor_mode(void)
    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()
     77static inline bool sec_ext_is_secure(void)
    7878{
    7979        return sec_ext_is_implemented()
  • kernel/arch/arm32/src/arm32.c

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

    r91deaff r193d280c  
    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
    103104extern uint32_t fpscr_read(void);
    104105extern void fpscr_write(uint32_t);
     
    114115static void (*restore_context)(fpu_context_t *ctx);
    115116
    116 static int fpu_have_coprocessor_access()
    117 {
    118 /* The register containing the information (CPACR) is not available on armv6-
     117static int fpu_have_coprocessor_access(void)
     118{
     119/*
     120 * The register containing the information (CPACR) is not available on armv6-
    119121 * rely on user decision to use CONFIG_FPU.
    120122 */
     
    143145 * @note do we need to call secure monitor here?
    144146 */
    145 static void fpu_enable_coprocessor_access()
    146 {
    147 /* The register containing the information (CPACR) is not available on armv6-
     147static void fpu_enable_coprocessor_access(void)
     148{
     149/*
     150 * The register containing the information (CPACR) is not available on armv6-
    148151 * rely on user decision to use CONFIG_FPU.
    149152 */
  • kernel/arch/ia32/src/fpu_context.c

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

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

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

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

    r91deaff r193d280c  
    9696
    9797
    98 void arch_post_cpu_init()
     98void arch_post_cpu_init(void)
    9999{
    100100}
  • kernel/generic/include/typedefs.h

    r91deaff r193d280c  
    5050} atomic_t;
    5151
    52 typedef void (* function)();
     52typedef void (* function)(void);
    5353
    5454typedef uint32_t container_id_t;
  • kernel/generic/src/lib/func.c

    r91deaff r193d280c  
    5151 *
    5252 */
    53 void halt()
     53void halt(void)
    5454{
    5555#if (defined(CONFIG_DEBUG)) && (defined(CONFIG_KCONSOLE))
  • uspace/app/bdsh/cmds/modules/cat/cat.c

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

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

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

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

    r91deaff r193d280c  
    9595 * Compute the greatest common divisor of a and b.
    9696 */
    97 static int
    98 gcd(a, b)
    99         int a;
    100         int b;
     97static int gcd(int a, int b)
    10198{
    10299        int c;
    103 
     100       
    104101        c = a % b;
    105102        while (c != 0) {
     
    108105                c = a % b;
    109106        }
    110            
     107       
    111108        return b;
    112109}
     
    117114 * in each block).
    118115 */
    119 static void
    120 permute_args(panonopt_start, panonopt_end, opt_end, nargv)
    121         int panonopt_start;
    122         int panonopt_end;
    123         int opt_end;
    124         char **nargv;
     116static void permute_args(int panonopt_start, int panonopt_end, int opt_end,
     117    char **nargv)
    125118{
    126119        int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
     
    157150 *  Returns -2 if -- is found (can be long option or end of options marker).
    158151 */
    159 static int
    160 getopt_internal(nargc, nargv, options)
    161         int nargc;
    162         char **nargv;
    163         const char *options;
     152static int getopt_internal(int nargc, char **nargv, const char *options)
    164153{
    165154        const char *oli;                                /* option letter list index */
     
    299288 *      Parse argc/argv argument vector.
    300289 */
    301 int
    302 getopt(nargc, nargv, options)
    303         int nargc;
    304         char * const *nargv;
    305         const char *options;
     290int getopt(int nargc, char * const *nargv, const char *options)
    306291{
    307292        int retval;
     
    332317 *      Parse argc/argv argument vector.
    333318 */
    334 int
    335 getopt_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;
     319int getopt_long(int nargc, char * const *nargv, const char *options,
     320    const struct option *long_options, int *idx)
    341321{
    342322        int retval;
  • uspace/lib/ieee80211/src/ieee80211.c

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

    r91deaff r193d280c  
    7373static int default_suite_initialized = 0;
    7474
    75 static void init_default_suite_when_needed() {
    76         if (default_suite_initialized) {
     75static void init_default_suite_when_needed(void)
     76{
     77        if (default_suite_initialized)
    7778                return;
    78         }
     79       
    7980        default_suite.id = -1;
    8081        default_suite.kind = PCUT_KIND_TESTSUITE;
     
    9192 * @return Always a valid test suite item.
    9293 */
    93 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) {
     94static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it)
     95{
    9496        while (it != NULL) {
    95                 if (it->kind == PCUT_KIND_TESTSUITE) {
     97                if (it->kind == PCUT_KIND_TESTSUITE)
    9698                        return it;
    97                 }
     99               
    98100                it = it->previous;
    99101        }
     102       
    100103        init_default_suite_when_needed();
    101104        return &default_suite;
     
    106109 * @param func Function to run (can be NULL).
    107110 */
    108 static void run_setup_teardown(pcut_setup_func_t func) {
    109         if (func != NULL) {
     111static void run_setup_teardown(pcut_setup_func_t func)
     112{
     113        if (func != NULL)
    110114                func();
    111         }
    112115}
    113116
     
    119122 * @param outcome Outcome of the current test.
    120123 */
    121 static void leave_test(int outcome) {
     124static void leave_test(int outcome)
     125{
    122126        PCUT_DEBUG("leave_test(outcome=%d), will_exit=%s", outcome,
    123                 leave_means_exit ? "yes" : "no");
    124         if (leave_means_exit) {
     127            leave_means_exit ? "yes" : "no");
     128        if (leave_means_exit)
    125129                exit(outcome);
    126         }
    127 
     130       
    128131#ifndef PCUT_NO_LONG_JUMP
    129132        longjmp(start_test_jump, 1);
     
    138141 * @param message Message describing the failure.
    139142 */
    140 void pcut_failed_assertion(const char *message) {
     143void pcut_failed_assertion(const char *message)
     144{
    141145        static const char *prev_message = NULL;
     146       
    142147        /*
    143148         * The assertion failed. We need to abort the current test,
     
    145150         * include running the tear-down routine.
    146151         */
    147         if (print_test_error) {
     152        if (print_test_error)
    148153                pcut_print_fail_message(message);
    149         }
    150 
     154       
    151155        if (execute_teardown_on_failure) {
    152156                execute_teardown_on_failure = 0;
    153157                prev_message = message;
    154158                run_setup_teardown(current_suite->teardown_func);
    155 
     159               
    156160                /* Tear-down was okay. */
    157161                if (report_test_result) {
     
    165169                }
    166170        }
    167 
     171       
    168172        prev_message = NULL;
    169 
     173       
    170174        leave_test(TEST_OUTCOME_FAIL); /* No return. */
    171175}
     
    176180 * @return Error status (zero means success).
    177181 */
    178 static int run_test(pcut_item_t *test) {
     182static int run_test(pcut_item_t *test)
     183{
    179184        /*
    180185         * Set here as the returning point in case of test failure.
     
    182187         * test execution.
    183188         */
     189       
    184190#ifndef PCUT_NO_LONG_JUMP
    185191        int test_finished = setjmp(start_test_jump);
    186         if (test_finished) {
     192        if (test_finished)
    187193                return 1;
    188         }
    189194#endif
    190 
    191         if (report_test_result) {
     195       
     196        if (report_test_result)
    192197                pcut_report_test_start(test);
    193         }
    194 
     198       
    195199        current_suite = pcut_find_parent_suite(test);
    196200        current_test = test;
    197 
     201       
    198202        pcut_hook_before_test(test);
    199 
     203       
    200204        /*
    201205         * If anything goes wrong, execute the tear-down function
     
    203207         */
    204208        execute_teardown_on_failure = 1;
    205 
     209       
    206210        /*
    207211         * Run the set-up function.
    208212         */
    209213        run_setup_teardown(current_suite->setup_func);
    210 
     214       
    211215        /*
    212216         * The setup function was performed, it is time to run
     
    214218         */
    215219        test->test_func();
    216 
     220       
    217221        /*
    218222         * Finally, run the tear-down function. We need to clear
     
    221225        execute_teardown_on_failure = 0;
    222226        run_setup_teardown(current_suite->teardown_func);
    223 
     227       
    224228        /*
    225229         * If we got here, it means everything went well with
    226230         * this test.
    227231         */
    228         if (report_test_result) {
     232        if (report_test_result)
    229233                pcut_report_test_done(current_test, TEST_OUTCOME_PASS,
    230                         NULL, NULL, NULL);
    231         }
    232 
     234                    NULL, NULL, NULL);
     235       
    233236        return 0;
    234237}
     
    242245 * @return Error status (zero means success).
    243246 */
    244 int pcut_run_test_forked(pcut_item_t *test) {
    245         int rc;
    246 
     247int pcut_run_test_forked(pcut_item_t *test)
     248{
    247249        report_test_result = 0;
    248250        print_test_error = 1;
    249251        leave_means_exit = 1;
    250 
    251         rc = run_test(test);
    252 
     252       
     253        int rc = run_test(test);
     254       
    253255        current_test = NULL;
    254256        current_suite = NULL;
    255 
     257       
    256258        return rc;
    257259}
     
    265267 * @return Error status (zero means success).
    266268 */
    267 int pcut_run_test_single(pcut_item_t *test) {
    268         int rc;
    269 
     269int pcut_run_test_single(pcut_item_t *test)
     270{
    270271        report_test_result = 1;
    271272        print_test_error = 0;
    272273        leave_means_exit = 0;
    273 
    274         rc = run_test(test);
    275 
     274       
     275        int rc = run_test(test);
     276       
    276277        current_test = NULL;
    277278        current_suite = NULL;
    278 
     279       
    279280        return rc;
    280281}
     
    285286 * @return Timeout in seconds.
    286287 */
    287 int pcut_get_test_timeout(pcut_item_t *test) {
     288int pcut_get_test_timeout(pcut_item_t *test)
     289{
    288290        int timeout = PCUT_DEFAULT_TEST_TIMEOUT;
    289291        pcut_extra_t *extras = test->extras;
    290 
    291 
     292       
    292293        while (extras->type != PCUT_EXTRA_LAST) {
    293                 if (extras->type == PCUT_EXTRA_TIMEOUT) {
     294                if (extras->type == PCUT_EXTRA_TIMEOUT)
    294295                        timeout = extras->timeout;
    295                 }
     296               
    296297                extras++;
    297298        }
    298 
     299       
    299300        return timeout;
    300301}
  • uspace/lib/posix/source/signal.c

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

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

    r91deaff r193d280c  
    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()
     100static void producer(void)
    101101{
    102102        int read = klog_read(buffer, BUFFER_SIZE);
Note: See TracChangeset for help on using the changeset viewer.