Changeset 1433ecda in mainline for uspace/srv


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/srv
Files:
49 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/audio_data.h

    r47b2d7e3 r1433ecda  
    6767} audio_pipe_t;
    6868
    69 audio_data_t * audio_data_create(const void *data, size_t size,
     69audio_data_t *audio_data_create(const void *data, size_t size,
    7070    pcm_format_t format);
    7171void audio_data_addref(audio_data_t *adata);
  • uspace/srv/audio/hound/audio_device.c

    r47b2d7e3 r1433ecda  
    5454static errno_t device_source_connection_callback(audio_source_t *source, bool new);
    5555static void device_event_callback(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg);
    56 static errno_t device_check_format(audio_sink_t* sink);
     56static errno_t device_check_format(audio_sink_t *sink);
    5757static errno_t get_buffer(audio_device_t *dev);
    5858static errno_t release_buffer(audio_device_t *dev);
     
    118118 *         capable of capturing audio.
    119119 */
    120 audio_source_t * audio_device_get_source(audio_device_t *dev)
     120audio_source_t *audio_device_get_source(audio_device_t *dev)
    121121{
    122122        assert(dev);
     
    134134 *         capable of audio playback.
    135135 */
    136 audio_sink_t * audio_device_get_sink(audio_device_t *dev)
     136audio_sink_t *audio_device_get_sink(audio_device_t *dev)
    137137{
    138138        assert(dev);
     
    153153 * connections.
    154154 */
    155 static errno_t device_sink_connection_callback(audio_sink_t* sink, bool new)
     155static errno_t device_sink_connection_callback(audio_sink_t *sink, bool new)
    156156{
    157157        assert(sink);
     
    275275                cap_call_handle_t chandle = async_get_call(&call);
    276276                async_answer_0(chandle, EOK);
    277                 switch(IPC_GET_IMETHOD(call)) {
     277                switch (IPC_GET_IMETHOD(call)) {
    278278                case PCM_EVENT_FRAMES_PLAYED:
    279279                        getuptime(&time1);
     
    327327 * @return Error code.
    328328 */
    329 static errno_t device_check_format(audio_sink_t* sink)
     329static errno_t device_check_format(audio_sink_t *sink)
    330330{
    331331        assert(sink);
  • uspace/srv/audio/hound/audio_device.h

    r47b2d7e3 r1433ecda  
    7171
    7272/** Linked list instance helper */
    73 static inline audio_device_t * audio_device_list_instance(link_t *l)
     73static inline audio_device_t *audio_device_list_instance(link_t *l)
    7474{
    7575        return l ? list_get_instance(l, audio_device_t, link) : NULL;
     
    7878errno_t audio_device_init(audio_device_t *dev, service_id_t id, const char *name);
    7979void audio_device_fini(audio_device_t *dev);
    80 audio_source_t * audio_device_get_source(audio_device_t *dev);
    81 audio_sink_t * audio_device_get_sink(audio_device_t *dev);
     80audio_source_t *audio_device_get_source(audio_device_t *dev);
     81audio_sink_t *audio_device_get_sink(audio_device_t *dev);
    8282errno_t audio_device_recorded_data(audio_device_t *dev, void **base, size_t *size);
    8383errno_t audio_device_available_buffer(audio_device_t *dev, void **base, size_t *size);
  • uspace/srv/audio/hound/audio_sink.c

    r47b2d7e3 r1433ecda  
    134134 * @return Error code.
    135135 */
    136 void audio_sink_mix_inputs(audio_sink_t *sink, void* dest, size_t size)
     136void audio_sink_mix_inputs(audio_sink_t *sink, void *dest, size_t size)
    137137{
    138138        assert(sink);
  • uspace/srv/audio/hound/audio_sink.h

    r47b2d7e3 r1433ecda  
    7272 * @return pointer to a sink structure, NULL on failure.
    7373 */
    74 static inline audio_sink_t * audio_sink_list_instance(link_t *l)
     74static inline audio_sink_t *audio_sink_list_instance(link_t *l)
    7575{
    7676        return l ? list_get_instance(l, audio_sink_t, link) : NULL;
     
    8484void audio_sink_fini(audio_sink_t *sink);
    8585errno_t audio_sink_set_format(audio_sink_t *sink, const pcm_format_t *format);
    86 void audio_sink_mix_inputs(audio_sink_t *sink, void* dest, size_t size);
     86void audio_sink_mix_inputs(audio_sink_t *sink, void *dest, size_t size);
    8787
    8888#endif
  • uspace/srv/audio/hound/audio_source.h

    r47b2d7e3 r1433ecda  
    6565 * @return pointer to a source structure, NULL on failure.
    6666 */
    67 static inline audio_source_t * audio_source_list_instance(link_t *l)
     67static inline audio_source_t *audio_source_list_instance(link_t *l)
    6868{
    6969        return l ? list_get_instance(l, audio_source_t, link) : NULL;
  • uspace/srv/audio/hound/connection.h

    r47b2d7e3 r1433ecda  
    6666 * @return pointer to a connection structure, NULL on failure.
    6767 */
    68 static inline connection_t * connection_from_source_list(link_t *l)
     68static inline connection_t *connection_from_source_list(link_t *l)
    6969{
    7070        return l ? list_get_instance(l, connection_t, source_link) : NULL;
     
    7676 * @return pointer to a connection structure, NULL on failure.
    7777 */
    78 static inline connection_t * connection_from_hound_list(link_t *l)
     78static inline connection_t *connection_from_hound_list(link_t *l)
    7979{
    8080        return l ? list_get_instance(l, connection_t, hound_link) : NULL;
  • uspace/srv/audio/hound/hound.c

    r47b2d7e3 r1433ecda  
    111111}
    112112
    113 static errno_t hound_disconnect_internal(hound_t *hound, const char* source_name, const char* sink_name);
     113static errno_t hound_disconnect_internal(hound_t *hound, const char *source_name, const char *sink_name);
    114114
    115115/**
     
    287287        if (ret != EOK) {
    288288                log_debug("Failed to initialize new audio device: %s",
    289                         str_error(ret));
     289                    str_error(ret));
    290290                free(dev);
    291291                return ret;
     
    517517 * @return Error code.
    518518 */
    519 errno_t hound_connect(hound_t *hound, const char* source_name, const char* sink_name)
     519errno_t hound_connect(hound_t *hound, const char *source_name, const char *sink_name)
    520520{
    521521        assert(hound);
     
    526526            audio_source_list_instance(list_first(&hound->sources));
    527527        if (str_cmp(source_name, "default") != 0)
    528             source = find_source_by_name(&hound->sources, source_name);
     528                source = find_source_by_name(&hound->sources, source_name);
    529529
    530530        audio_sink_t *sink =
    531531            audio_sink_list_instance(list_first(&hound->sinks));
    532532        if (str_cmp(sink_name, "default") != 0)
    533             sink = find_sink_by_name(&hound->sinks, sink_name);
     533                sink = find_sink_by_name(&hound->sinks, sink_name);
    534534
    535535        if (!source || !sink) {
     
    556556 * @return Error code.
    557557 */
    558 errno_t hound_disconnect(hound_t *hound, const char* source_name, const char* sink_name)
     558errno_t hound_disconnect(hound_t *hound, const char *source_name, const char *sink_name)
    559559{
    560560        assert(hound);
     
    574574 * This function has to be called with the list_guard lock held.
    575575 */
    576 static errno_t hound_disconnect_internal(hound_t *hound, const char* source_name,
    577     const char* sink_name)
     576static errno_t hound_disconnect_internal(hound_t *hound, const char *source_name,
     577    const char *sink_name)
    578578{
    579579        assert(hound);
     
    585585                if (str_cmp(connection_source_name(conn), source_name) == 0 ||
    586586                    str_cmp(connection_sink_name(conn), sink_name) == 0) {
    587                     log_debug("Removing %s -> %s", connection_source_name(conn),
    588                         connection_sink_name(conn));
    589                     list_remove(it);
    590                     connection_destroy(conn);
     587                        log_debug("Removing %s -> %s", connection_source_name(conn),
     588                            connection_sink_name(conn));
     589                        list_remove(it);
     590                        connection_destroy(conn);
    591591                }
    592592        }
  • uspace/srv/bd/file_bd/file_bd.c

    r47b2d7e3 r1433ecda  
    9797        block_size = DEFAULT_BLOCK_SIZE;
    9898
    99         ++argv; --argc;
     99        ++argv;
     100        --argc;
    100101        while (*argv != NULL && (*argv)[0] == '-') {
    101102                /* Option */
     
    113114                                return -1;
    114115                        }
    115                         ++argv; --argc;
     116                        ++argv;
     117                        --argc;
    116118                } else {
    117119                        printf("Invalid option '%s'.\n", *argv);
     
    119121                        return -1;
    120122                }
    121                 ++argv; --argc;
     123                ++argv;
     124                --argc;
    122125        }
    123126
  • uspace/srv/bd/sata_bd/sata_bd.c

    r47b2d7e3 r1433ecda  
    9797        /* If device is SATA, add device to the disk array. */
    9898        disk[disk_count].sess = ahci_get_sess(funh, &disk[disk_count].dev_name);
    99         if(disk[disk_count].sess != NULL) {
     99        if (disk[disk_count].sess != NULL) {
    100100
    101101                ahci_get_sata_device_name(disk[disk_count].sess,
     
    113113                printf("Device %s - %s , blocks: %lu, block_size: %lu\n",
    114114                    disk[disk_count].dev_name, disk[disk_count].sata_dev_name,
    115                             (long unsigned int) disk[disk_count].blocks,
    116                                 (long unsigned int) disk[disk_count].block_size);
     115                    (long unsigned int) disk[disk_count].blocks,
     116                    (long unsigned int) disk[disk_count].block_size);
    117117
    118118                ++disk_count;
     
    268268        }
    269269
    270         for(int i = 0; i < disk_count; i++) {
     270        for (int i = 0; i < disk_count; i++) {
    271271                char name[1024];
    272272                snprintf(name, 1024, "%s/%s", NAMESPACE, disk[i].dev_name);
  • uspace/srv/bd/vbd/disk.c

    r47b2d7e3 r1433ecda  
    181181
    182182        list_foreach(vbds_disks, ldisks, vbds_disk_t, disk)
    183                 disk->present = false;
     183            disk->present = false;
    184184
    185185        for (i = 0; i < count; i++) {
  • uspace/srv/devman/devtree.c

    r47b2d7e3 r1433ecda  
    4444static inline size_t handle_key_hash(void *key)
    4545{
    46         devman_handle_t handle = *(devman_handle_t*)key;
     46        devman_handle_t handle = *(devman_handle_t *)key;
    4747        return handle;
    4848}
     
    6262static bool devman_devices_key_equal(void *key, const ht_link_t *item)
    6363{
    64         devman_handle_t handle = *(devman_handle_t*)key;
     64        devman_handle_t handle = *(devman_handle_t *)key;
    6565        dev_node_t *dev = hash_table_get_inst(item, dev_node_t, devman_dev);
    6666        return dev->handle == handle;
     
    6969static bool devman_functions_key_equal(void *key, const ht_link_t *item)
    7070{
    71         devman_handle_t handle = *(devman_handle_t*)key;
     71        devman_handle_t handle = *(devman_handle_t *)key;
    7272        fun_node_t *fun = hash_table_get_inst(item, fun_node_t, devman_fun);
    7373        return fun->handle == handle;
     
    7676static inline size_t service_id_key_hash(void *key)
    7777{
    78         service_id_t service_id = *(service_id_t*)key;
     78        service_id_t service_id = *(service_id_t *)key;
    7979        return service_id;
    8080}
     
    8888static bool loc_functions_key_equal(void *key, const ht_link_t *item)
    8989{
    90         service_id_t service_id = *(service_id_t*)key;
     90        service_id_t service_id = *(service_id_t *)key;
    9191        fun_node_t *fun = hash_table_get_inst(item, fun_node_t, loc_fun);
    9292        return fun->service_id == service_id;
  • uspace/srv/devman/match.c

    r47b2d7e3 r1433ecda  
    231231
    232232        size_t read_bytes;
    233         rc = vfs_read(fd, (aoff64_t []) {0}, buf, len, &read_bytes);
     233        rc = vfs_read(fd, (aoff64_t []) { 0 }, buf, len, &read_bytes);
    234234        if (rc != EOK) {
    235235                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s': %s.", conf_path,
  • uspace/srv/devman/util.c

    r47b2d7e3 r1433ecda  
    8383        size_t len = 0;
    8484
    85         while(*str != '\0' && !isspace(*str)) {
     85        while (*str != '\0' && !isspace(*str)) {
    8686                len++;
    8787                str++;
  • uspace/srv/fs/cdfs/cdfs_endian.h

    r47b2d7e3 r1433ecda  
    3737
    3838#if !(defined(__BE__) ^ defined(__LE__))
    39         #error The architecture must be either big-endian or little-endian.
     39#error The architecture must be either big-endian or little-endian.
    4040#endif
    4141
  • uspace/srv/fs/exfat/exfat.h

    r47b2d7e3 r1433ecda  
    8181                uint8_t minor;
    8282                uint8_t major;
    83         } __attribute__ ((packed)) version;
     83        } __attribute__((packed)) version;
    8484        uint16_t volume_flags;                  /* 0x6A volume state flags */
    8585        uint8_t bytes_per_sector;               /* 0x6C sector size as (1 << n) */
  • uspace/srv/fs/exfat/exfat_bitmap.c

    r47b2d7e3 r1433ecda  
    167167        clst = firstc;
    168168
    169         while (clst < firstc + count ) {
     169        while (clst < firstc + count) {
    170170                rc = exfat_bitmap_set_cluster(bs, service_id, clst);
    171171                if (rc != EOK) {
     
    211211                                endc++;
    212212                }
    213                 startc = endc+1;
     213                startc = endc + 1;
    214214        }
    215215        return ENOSPC;
     
    229229                clst = lastc + 1;
    230230                while (exfat_bitmap_is_free(bs, nodep->idx->service_id, clst) == EOK) {
    231                         if (clst - lastc == count){
     231                        if (clst - lastc == count) {
    232232                                return exfat_bitmap_set_clusters(bs, nodep->idx->service_id,
    233233                                    lastc + 1, count);
  • uspace/srv/fs/exfat/exfat_dentry.h

    r47b2d7e3 r1433ecda  
    6464        uint16_t        label[11];
    6565        uint8_t         _reserved[8];
    66 } __attribute__ ((packed)) exfat_vollabel_dentry_t;
     66} __attribute__((packed)) exfat_vollabel_dentry_t;
    6767
    6868typedef struct {
     
    7171        uint32_t        firstc;
    7272        uint64_t        size;
    73 } __attribute__ ((packed)) exfat_bitmap_dentry_t;
     73} __attribute__((packed)) exfat_bitmap_dentry_t;
    7474
    7575typedef struct {
     
    7979        uint32_t        firstc;
    8080        uint64_t        size;
    81 } __attribute__ ((packed)) exfat_uctable_dentry_t;
     81} __attribute__((packed)) exfat_uctable_dentry_t;
    8282
    8383typedef struct {
     
    8787        uint8_t         guid[16];
    8888        uint8_t         _reserved[10];
    89 } __attribute__ ((packed)) exfat_guid_dentry_t;
     89} __attribute__((packed)) exfat_guid_dentry_t;
    9090
    9191typedef struct {
     
    103103        uint8_t         atime_tz;
    104104        uint8_t         _reserved2[7];
    105 } __attribute__ ((packed)) exfat_file_dentry_t;
     105} __attribute__((packed)) exfat_file_dentry_t;
    106106
    107107typedef struct {
     
    115115        uint32_t        firstc;
    116116        uint64_t        data_size;
    117 } __attribute__ ((packed)) exfat_stream_dentry_t;
     117} __attribute__((packed)) exfat_stream_dentry_t;
    118118
    119119typedef struct {
    120120        uint8_t         flags;
    121121        uint16_t        name[EXFAT_NAME_PART_LEN];
    122 } __attribute__ ((packed)) exfat_name_dentry_t;
     122} __attribute__((packed)) exfat_name_dentry_t;
    123123
    124124
     
    134134                exfat_name_dentry_t     name;
    135135        };
    136 } __attribute__ ((packed)) exfat_dentry_t;
     136} __attribute__((packed)) exfat_dentry_t;
    137137
    138138
  • uspace/srv/fs/fat/fat.h

    r47b2d7e3 r1433ecda  
    105105                        /** Boot sector signature. */
    106106                        uint16_t        signature;
    107                 } __attribute__ ((packed));
     107                } __attribute__((packed));
    108108                struct {
    109109                        /* FAT32 only */
     
    136136                        /** Signature. */
    137137                        uint16_t        signature;
    138                 } __attribute__ ((packed)) fat32;
     138                } __attribute__((packed)) fat32;
    139139        };
    140 } __attribute__ ((packed)) fat_bs_t;
     140} __attribute__((packed)) fat_bs_t;
    141141
    142142#define FAT32_FSINFO_SIG1       "RRaA"
     
    152152        uint8_t res2[12];
    153153        uint8_t sig3[4];
    154 } __attribute__ ((packed)) fat32_fsinfo_t;
     154} __attribute__((packed)) fat32_fsinfo_t;
    155155
    156156typedef enum {
  • uspace/srv/fs/fat/fat_dentry.c

    r47b2d7e3 r1433ecda  
    382382{
    383383        wchar_t ch;
    384         size_t offset=0;
     384        size_t offset = 0;
    385385        bool result = true;
    386386
  • uspace/srv/fs/fat/fat_dentry.h

    r47b2d7e3 r1433ecda  
    117117                        uint16_t        eaidx;          /* FAT12/FAT16 */
    118118                        uint16_t        firstc_hi;      /* FAT32 */
    119                 } __attribute__ ((packed));
     119                } __attribute__((packed));
    120120                uint16_t        mtime;
    121121                uint16_t        mdate;
     
    123123                        uint16_t        firstc;         /* FAT12/FAT16 */
    124124                        uint16_t        firstc_lo;      /* FAT32 */
    125                 } __attribute__ ((packed));
     125                } __attribute__((packed));
    126126                uint32_t        size;
    127         } __attribute__ ((packed));
     127        } __attribute__((packed));
    128128        struct {
    129129                uint8_t         order;
     
    135135                uint16_t        firstc_lo; /* MUST be 0 */
    136136                uint16_t        part3[FAT_LFN_PART3_SIZE];
    137         } __attribute__ ((packed)) lfn;
    138 } __attribute__ ((packed)) fat_dentry_t;
     137        } __attribute__((packed)) lfn;
     138} __attribute__((packed)) fat_dentry_t;
    139139
    140140extern int fat_dentry_namecmp(char *, const char *);
  • uspace/srv/fs/fat/fat_directory.c

    r47b2d7e3 r1433ecda  
    383383                /* Copy number */
    384384                size_t offset;
    385                 if (str_size(name)+str_size(number) + 1 > FAT_NAME_LEN)
     385                if (str_size(name) + str_size(number) + 1 > FAT_NAME_LEN)
    386386                        offset = FAT_NAME_LEN - str_size(number) - 1;
    387387                else
  • uspace/srv/fs/udf/udf_file.h

    r47b2d7e3 r1433ecda  
    104104        uint8_t implementation_use[0];
    105105        udf_dstring file_id[0];
    106 }__attribute__((packed)) udf_file_identifier_descriptor_t;
     106} __attribute__((packed)) udf_file_identifier_descriptor_t;
    107107
    108108/* ICB tag - Information Control Block  (ECMA 167 4/14.6) */
     
    184184        uint32_t ad_lenght;
    185185        uint8_t allocation_descriptors[0];
    186 }__attribute__((packed)) udf_unallocated_space_entry_descriptor_t;
     186} __attribute__((packed)) udf_unallocated_space_entry_descriptor_t;
    187187
    188188/* Space Bitmap Descriptor format (ECMA 167 4/14.12) */
     
    192192        uint32_t byts_number;
    193193        uint8_t bitmap[0];
    194 }__attribute__((packed)) udf_space_bitmap_descriptor_t;
     194} __attribute__((packed)) udf_space_bitmap_descriptor_t;
    195195
    196196extern errno_t udf_node_get_core(udf_node_t *);
  • uspace/srv/hid/console/console.c

    r47b2d7e3 r1433ecda  
    280280}
    281281
    282 static errno_t input_ev_abs_move(input_t *input, unsigned x , unsigned y,
     282static errno_t input_ev_abs_move(input_t *input, unsigned x, unsigned y,
    283283    unsigned max_x, unsigned max_y)
    284284{
  • uspace/srv/hid/input/gsp.c

    r47b2d7e3 r1433ecda  
    123123                mods = *dp++;
    124124                key = *dp++;
    125                 if (key == 0) break;
     125                if (key == 0)
     126                        break;
    126127
    127128                /* Insert one sequence. */
     
    252253
    253254        item = hash_table_find(&p->trans, &key);
    254         if (item == NULL) return NULL;
     255        if (item == NULL)
     256                return NULL;
    255257
    256258        return hash_table_get_inst(item, gsp_trans_t, link);
  • uspace/srv/hid/input/proto/mousedev.c

    r47b2d7e3 r1433ecda  
    9696                case MOUSEEV_ABS_MOVE_EVENT:
    9797                        mouse_push_event_abs_move(mousedev->mouse_dev,
    98                                 IPC_GET_ARG1(call), IPC_GET_ARG2(call),
    99                                 IPC_GET_ARG3(call), IPC_GET_ARG4(call));
     98                            IPC_GET_ARG1(call), IPC_GET_ARG2(call),
     99                            IPC_GET_ARG3(call), IPC_GET_ARG4(call));
    100100                        retval = EOK;
    101101                        break;
  • uspace/srv/hid/isdv4_tablet/isdv4.c

    r47b2d7e3 r1433ecda  
    9898                                event.button = 1;
    9999                                state->emit_event_fn(&event);
    100                         }
    101                         else if (finger1 && !state->finger1_pressed) {
     100                        } else if (finger1 && !state->finger1_pressed) {
    102101                                state->finger1_pressed = true;
    103102
     
    105104                                event.button = 1;
    106105                                state->emit_event_fn(&event);
    107                         }
    108                         else {
     106                        } else {
    109107                                event.type = MOVE;
    110108                                event.button = 1;
     
    112110                        }
    113111                }
    114         }
    115         else {
     112        } else {
    116113                if (size != 9)
    117114                        return true;
     
    133130                        event.type = PROXIMITY_IN;
    134131                        state->emit_event_fn(&event);
    135                 }
    136                 else if (!proximity && state->stylus_in_proximity) {
     132                } else if (!proximity && state->stylus_in_proximity) {
    137133                        /* Stylus came out of proximity */
    138134                        state->stylus_in_proximity = false;
     
    140136                        event.type = PROXIMITY_OUT;
    141137                        state->emit_event_fn(&event);
    142                 }
    143                 else {
     138                } else {
    144139                        /* Proximity state didn't change, but we need to check if it is still eraser */
    145140                        if (state->stylus_is_eraser && !button2) {
     
    151146                                state->emit_event_fn(&event);
    152147                                state->stylus_is_eraser = false;
    153                         }
    154                         else if (!state->stylus_is_eraser && !tip && button2) {
     148                        } else if (!state->stylus_is_eraser && !tip && button2) {
    155149                                event.type = PROXIMITY_OUT;
    156150                                event.source = STYLUS_TIP;
     
    170164                                event.button = 1;
    171165                                state->emit_event_fn(&event);
    172                         }
    173                         else if (!tip && state->tip_pressed) {
     166                        } else if (!tip && state->tip_pressed) {
    174167                                state->tip_pressed = false;
    175168                                event.type = RELEASE;
     
    184177                                event.button = 2;
    185178                                state->emit_event_fn(&event);
    186                         }
    187                         else if (!button1 && state->button1_pressed) {
     179                        } else if (!button1 && state->button1_pressed) {
    188180                                state->button1_pressed = false;
    189181                                event.type = RELEASE;
     
    198190                                event.button = 3;
    199191                                state->emit_event_fn(&event);
    200                         }
    201                         else if (!button2 && state->button2_pressed) {
     192                        } else if (!button2 && state->button2_pressed) {
    202193                                state->button2_pressed = false;
    203194                                event.type = RELEASE;
     
    210201                        event.button = 0;
    211202                        state->emit_event_fn(&event);
    212                 }
    213                 else {
     203                } else {
    214204                        if (tip && !state->tip_pressed) {
    215205                                state->tip_pressed = true;
     
    218208                                event.button = 1;
    219209                                state->emit_event_fn(&event);
    220                         }
    221                         else if (!tip && state->tip_pressed) {
     210                        } else if (!tip && state->tip_pressed) {
    222211                                state->tip_pressed = false;
    223212                                event.type = RELEASE;
     
    310299
    311300                /* Skip data until a start of packet is found */
    312                 while (i < state->buf_end && (state->buf[i] & START_OF_PACKET) == 0) i++;
     301                while (i < state->buf_end && (state->buf[i] & START_OF_PACKET) == 0)
     302                        i++;
    313303
    314304                size_t start = i;
     
    322312                        if (state->buf[i] & CONTROL_PACKET) {
    323313                                packet_remaining = 11;
    324                         }
    325                         else if (state->buf[i] & TOUCH_EVENT) {
     314                        } else if (state->buf[i] & TOUCH_EVENT) {
    326315                                packet_remaining = 5;
    327                         }
    328                         else {
     316                        } else {
    329317                                packet_remaining = 9;
    330318                        }
  • uspace/srv/hid/isdv4_tablet/main.c

    r47b2d7e3 r1433ecda  
    9494        fibril_mutex_unlock(&client_mutex);
    9595
    96         if (!sess) return;
     96        if (!sess)
     97                return;
    9798
    9899        async_exch_t *exch = async_exchange_begin(sess);
     
    105106                }
    106107                async_msg_4(exch, MOUSEEV_ABS_MOVE_EVENT, event->x, event->y,
    107                                     max_x, max_y);
     108                    max_x, max_y);
    108109                if (event->type == PRESS || event->type == RELEASE) {
    109110                        async_msg_2(exch, MOUSEEV_BUTTON_EVENT, event->button,
    110                                     event->type == PRESS);
     111                            event->type == PRESS);
    111112                }
    112113        }
     
    118119        const char *type = NULL;
    119120        switch (event->type) {
    120                 case PRESS:
    121                         type = "PRESS";
    122                         break;
    123                 case RELEASE:
    124                         type = "RELEASE";
    125                         break;
    126                 case PROXIMITY_IN:
    127                         type = "PROXIMITY IN";
    128                         break;
    129                 case PROXIMITY_OUT:
    130                         type = "PROXIMITY OUT";
    131                         break;
    132                 case MOVE:
    133                         type = "MOVE";
    134                         break;
    135                 default:
    136                         type = "UNKNOWN";
    137                         break;
     121        case PRESS:
     122                type = "PRESS";
     123                break;
     124        case RELEASE:
     125                type = "RELEASE";
     126                break;
     127        case PROXIMITY_IN:
     128                type = "PROXIMITY IN";
     129                break;
     130        case PROXIMITY_OUT:
     131                type = "PROXIMITY OUT";
     132                break;
     133        case MOVE:
     134                type = "MOVE";
     135                break;
     136        default:
     137                type = "UNKNOWN";
     138                break;
    138139        }
    139140
    140141        const char *source = NULL;
    141142        switch (event->source) {
    142                 case STYLUS_TIP:
    143                         source = "stylus tip";
    144                         break;
    145                 case STYLUS_ERASER:
    146                         source = "stylus eraser";
    147                         break;
    148                 case TOUCH:
    149                         source = "touch";
    150                         break;
     143        case STYLUS_TIP:
     144                source = "stylus tip";
     145                break;
     146        case STYLUS_ERASER:
     147                source = "stylus eraser";
     148                break;
     149        case TOUCH:
     150                source = "touch";
     151                break;
    151152        }
    152153
     
    160161{
    161162        switch (data_id) {
    162                 case 0:
    163                         return "resistive+stylus";
    164                 case 1:
    165                         return "capacitive+stylus";
    166                 case 2:
    167                         return "resistive";
    168                 case 3:
    169                 case 4:
    170                         return "capacitive";
    171                 case 5:
    172                         return "penabled";
     163        case 0:
     164                return "resistive+stylus";
     165        case 1:
     166                return "capacitive+stylus";
     167        case 2:
     168                return "resistive";
     169        case 3:
     170        case 4:
     171                return "capacitive";
     172        case 5:
     173                return "penabled";
    173174        }
    174175        return "unknown";
     
    189190        if (argc > arg && str_test_prefix(argv[arg], "--baud=")) {
    190191                size_t arg_offset = str_lsize(argv[arg], 7);
    191                 char* arg_str = argv[arg] + arg_offset;
     192                char *arg_str = argv[arg] + arg_offset;
    192193                if (str_length(arg_str) == 0) {
    193194                        fprintf(stderr, "--baud requires an argument\n");
     
    219220                }
    220221                arg++;
    221         }
    222         else {
     222        } else {
    223223                category_id_t serial_cat_id;
    224224
     
    233233                size_t svc_count;
    234234
    235                 rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count);                if (rc != EOK) {
     235                rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count);
     236                if (rc != EOK) {
    236237                        fprintf(stderr, "Failed getting list of services\n");
    237238                        return 1;
     
    301302        if (state.stylus_tilt_supported) {
    302303                printf("%ux%u\n", state.stylus_max_xtilt, state.stylus_max_ytilt);
    303         }
    304         else {
     304        } else {
    305305                printf("not supported\n");
    306306        }
    307307        printf(" Touch: %ux%u type: %s\n", state.touch_max_x, state.touch_max_y,
    308                 touch_type(state.touch_type));
     308            touch_type(state.touch_type));
    309309
    310310        fid_t fibril = fibril_create(read_fibril, NULL);
     
    337337        if (rc != EOK) {
    338338                printf(NAME ": Unable to get mouse category id.\n");
    339         }
    340         else {
     339        } else {
    341340                rc = loc_service_add_to_cat(service_id, mouse_category);
    342341                if (rc != EOK) {
  • uspace/srv/hid/output/port/ega.c

    r47b2d7e3 r1433ecda  
    214214                return rc;
    215215
    216         rc = pio_enable((void*)EGA_IO_BASE, EGA_IO_SIZE, NULL);
     216        rc = pio_enable((void *)EGA_IO_BASE, EGA_IO_SIZE, NULL);
    217217        if (rc != EOK)
    218218                return rc;
  • uspace/srv/hid/output/proto/vt100.c

    r47b2d7e3 r1433ecda  
    140140vt100_state_t *vt100_state_create(sysarg_t cols, sysarg_t rows,
    141141    vt100_putchar_t putchar_fn, vt100_control_puts_t control_puts_fn,
    142         vt100_flush_t flush_fn)
     142    vt100_flush_t flush_fn)
    143143{
    144144        vt100_state_t *state = malloc(sizeof(vt100_state_t));
  • uspace/srv/hid/remcons/user.c

    r47b2d7e3 r1433ecda  
    219219 * @param c Pressed character.
    220220 */
    221 static kbd_event_t* new_kbd_event(kbd_event_type_t type, wchar_t c) {
     221static kbd_event_t *new_kbd_event(kbd_event_type_t type, wchar_t c)
     222{
    222223        kbd_event_t *event = malloc(sizeof(kbd_event_t));
    223224        assert(event);
  • uspace/srv/hid/rfb/main.c

    r47b2d7e3 r1433ecda  
    9191                rfb.damage_rect.height = height;
    9292                rfb.damage_valid = true;
    93         }
    94         else {
     93        } else {
    9594                if (x0 < rfb.damage_rect.x) {
    9695                        rfb.damage_rect.width += rfb.damage_rect.x - x0;
  • uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c

    r47b2d7e3 r1433ecda  
    172172        con = con | ADCCON_PRSCEN;
    173173
    174         pio_write_32(&ts->io->con, con);
     174        pio_write_32(&ts->io->con, con);
    175175
    176176        /*
     
    256256
    257257        /* Enable auto xy-conversion mode */
    258         pio_write_32(&ts->io->tsc, (pio_read_32(&ts->io->tsc)
    259             & ~3) | 4);
     258        pio_write_32(&ts->io->tsc, (pio_read_32(&ts->io->tsc) & ~3) | 4);
    260259
    261260        /* Start the conversion. */
    262         pio_write_32(&ts->io->con, pio_read_32(&ts->io->con)
    263             | ADCCON_ENABLE_START);
     261        pio_write_32(&ts->io->con, pio_read_32(&ts->io->con) | ADCCON_ENABLE_START);
    264262}
    265263
  • uspace/srv/klog/klog.c

    r47b2d7e3 r1433ecda  
    5353#define NAME  "klog"
    5454
    55 typedef size_t __attribute__ ((aligned(1))) unaligned_size_t;
     55typedef size_t __attribute__((aligned(1))) unaligned_size_t;
    5656
    5757typedef struct {
  • uspace/srv/net/inetsrv/inet_link.c

    r47b2d7e3 r1433ecda  
    6868
    6969static addr128_t link_local_node_ip =
    70     {0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xfe, 0, 0, 0};
     70    { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xfe, 0, 0, 0 };
    7171
    7272static void inet_link_local_node_ip(addr48_t mac_addr,
  • uspace/srv/net/inetsrv/inetsrv.c

    r47b2d7e3 r1433ecda  
    6565static inet_naddr_t solicited_node_mask = {
    6666        .version = ip_v6,
    67         .addr6 = {0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0},
     67        .addr6 = { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0 },
    6868        .prefix = 104
    6969};
     
    7676static inet_addr_t multicast_all_nodes = {
    7777        .version = ip_v6,
    78         .addr6 = {0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01}
     78        .addr6 = { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01 }
    7979};
    8080
     
    182182
    183183                if (dgram->src.version != ip_v4 ||
    184                         dgram->dest.version != ip_v4)
     184                    dgram->dest.version != ip_v4)
    185185                        return EINVAL;
    186186
  • uspace/srv/net/inetsrv/ndp.c

    r47b2d7e3 r1433ecda  
    4949
    5050static addr128_t solicited_node_ip =
    51     {0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0};
     51    { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0 };
    5252
    5353/** Compute solicited node IPv6 multicast address from target IPv6 address
  • uspace/srv/net/tcp/iqueue.c

    r47b2d7e3 r1433ecda  
    110110        link = list_first(&iqueue->list);
    111111        while (link != NULL) {
    112                         log_msg(LOG_DEFAULT, LVL_NOTE, "tcp_iqueue_remove_seg() - next");
     112                log_msg(LOG_DEFAULT, LVL_NOTE, "tcp_iqueue_remove_seg() - next");
    113113                qe = list_get_instance(link,
    114114                    tcp_iqueue_entry_t, link);
     
    162162                tcp_segment_delete(iqe->seg);
    163163
    164                 link = list_first(&iqueue->list);
     164                link = list_first(&iqueue->list);
    165165                if (link == NULL) {
    166166                        log_msg(LOG_DEFAULT, LVL_DEBUG, "iqueue is empty");
  • uspace/srv/net/tcp/service.c

    r47b2d7e3 r1433ecda  
    116116
    117117        /* XXX Failed to establish connection */
    118         if (0) tcp_ev_conn_failed(cconn);
     118        if (0)
     119                tcp_ev_conn_failed(cconn);
    119120}
    120121
  • uspace/srv/net/tcp/tcp.c

    r47b2d7e3 r1433ecda  
    7474        tcp_ncsim_fibril_start();
    7575
    76         if (0) tcp_test();
     76        if (0)
     77                tcp_test();
    7778
    7879        rc = tcp_inet_init();
  • uspace/srv/net/tcp/test.c

    r47b2d7e3 r1433ecda  
    7979                printf("S: User received %zu bytes '%s'.\n", rcvd, rcv_buf);
    8080
    81                 async_usleep(1000*1000*2);
     81                async_usleep(1000 * 1000 * 2);
    8282        }
    8383
    84         async_usleep(/*10**/1000*1000);
     84        async_usleep(/*10**/1000 * 1000);
    8585
    8686        printf("S: User close...\n");
     
    107107        epp.remote.port = 80;
    108108
    109         async_usleep(1000*1000*3);
     109        async_usleep(1000 * 1000 * 3);
    110110        printf("C: User open...\n");
    111111        tcp_uc_open(&epp, ap_active, 0, &conn);
    112112        conn->name = (char *) "C";
    113113
    114         async_usleep(1000*1000*10);
     114        async_usleep(1000 * 1000 * 10);
    115115        printf("C: User send...\n");
    116116        tcp_uc_send(conn, (void *)msg, str_size(msg), 0);
    117117
    118         async_usleep(1000*1000*20/**20*2*/);
     118        async_usleep(1000 * 1000 * 20/**20*2*/);
    119119        printf("C: User close...\n");
    120120        tcp_uc_close(conn);
     
    130130        printf("tcp_test()\n");
    131131
    132         async_usleep(1000*1000);
     132        async_usleep(1000 * 1000);
    133133
    134134        if (0) {
  • uspace/srv/ns/task.c

    r47b2d7e3 r1433ecda  
    5858static size_t task_key_hash(void *key)
    5959{
    60         return *(task_id_t*)key;
     60        return *(task_id_t *)key;
    6161}
    6262
     
    7070{
    7171        hashed_task_t *ht = hash_table_get_inst(item, hashed_task_t, link);
    72         return ht->id == *(task_id_t*)key;
     72        return ht->id == *(task_id_t *)key;
    7373}
    7474
     
    101101static size_t p2i_key_hash(void *key)
    102102{
    103         sysarg_t in_phone_hash = *(sysarg_t*)key;
     103        sysarg_t in_phone_hash = *(sysarg_t *)key;
    104104        return in_phone_hash;
    105105}
     
    113113static bool p2i_key_equal(void *key, const ht_link_t *item)
    114114{
    115         sysarg_t in_phone_hash = *(sysarg_t*)key;
     115        sysarg_t in_phone_hash = *(sysarg_t *)key;
    116116        p2i_entry_t *entry = hash_table_get_inst(item, p2i_entry_t, link);
    117117
  • uspace/srv/taskmon/taskmon.c

    r47b2d7e3 r1433ecda  
    4949static bool write_core_files;
    5050
    51 static void corecfg_client_conn(cap_call_handle_t , ipc_call_t *, void *);
     51static void corecfg_client_conn(cap_call_handle_t, ipc_call_t *, void *);
    5252
    5353static void fault_event(ipc_call_t *call, void *arg)
  • uspace/srv/vfs/vfs.h

    r47b2d7e3 r1433ecda  
    4747
    4848#ifndef dprintf
    49         #define dprintf(...)
     49#define dprintf(...)
    5050#endif
    5151
  • uspace/srv/vfs/vfs_file.c

    r47b2d7e3 r1433ecda  
    185185                        }
    186186                        vfs_node_delref(file->node);
    187                 }
     187                }
    188188                free(file);
    189189        }
  • uspace/srv/vfs/vfs_ipc.c

    r47b2d7e3 r1433ecda  
    149149        int outfd = 0;
    150150        rc = vfs_op_mount(mpfd, service_id, flags, instance, opts, fs_name,
    151              &outfd);
     151            &outfd);
    152152        async_answer_1(req_handle, rc, outfd);
    153153
  • uspace/srv/vfs/vfs_lookup.c

    r47b2d7e3 r1433ecda  
    276276                                goto out;
    277277                        }
    278                         if (!base->mount) {
     278                        if (!base->mount) {
    279279                                vfs_node_put(base);
    280280                                rc = ENOENT;
  • uspace/srv/vfs/vfs_ops.c

    r47b2d7e3 r1433ecda  
    265265
    266266        rc = vfs_connect_internal(service_id, flags, instance, opts, fs_name,
    267              &root);
     267            &root);
    268268        if (rc == EOK && !(flags & VFS_MOUNT_CONNECT_ONLY)) {
    269269                vfs_node_addref(mp->node);
     
    347347}
    348348
    349 typedef errno_t (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,
     349typedef errno_t (*rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,
    350350    ipc_call_t *, bool, void *);
    351351
  • uspace/srv/volsrv/volsrv.c

    r47b2d7e3 r1433ecda  
    262262
    263263        printf("vol_part_mkfs_srv: label=%p\n", label);
    264         if (label!=NULL) printf("vol_part_mkfs_srv: label='%s'\n", label);
     264        if (label != NULL)
     265                printf("vol_part_mkfs_srv: label='%s'\n", label);
    265266
    266267        rc = vol_part_find_by_id(sid, &part);
Note: See TracChangeset for help on using the changeset viewer.