Changeset 07525cd in mainline


Ignore:
Timestamp:
2013-09-10T18:34:16Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
08bc23d
Parents:
85147f3
Message:

cstyle

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/list.h

    r85147f3 r07525cd  
    6868
    6969#define list_foreach(list, member, itype, iterator) \
    70         for (itype *iterator = NULL; iterator == NULL; iterator =(itype *)1) \
     70        for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \
    7171            for (link_t *_link = (list).head.next; \
    7272            iterator = list_get_instance(_link, itype, member), \
  • uspace/lib/c/include/adt/list.h

    r85147f3 r07525cd  
    6868
    6969#define list_foreach(list, member, itype, iterator) \
    70         for (itype *iterator = NULL; iterator == NULL; iterator =(itype *)1) \
     70        for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \
    7171            for (link_t *_link = (list).head.next; \
    7272            iterator = list_get_instance(_link, itype, member), \
     
    7474
    7575/** Unlike list_foreach(), allows removing items while traversing a list.
    76  * 
     76 *
    7777 * @code
    7878 * list_t mylist;
     
    249249 *
    250250 * @return Next item or NULL if @a link is the last item.
     251 *
    251252 */
    252253static inline link_t *list_next(link_t *link, const list_t *list)
     
    261262 *
    262263 * @return Previous item or NULL if @a link is the first item.
     264 *
    263265 */
    264266static inline link_t *list_prev(link_t *link, const list_t *list)
  • uspace/lib/usbhid/src/hidparser.c

    r85147f3 r07525cd  
    132132        usb_hid_report_description_t *report_des;
    133133        usb_hid_report_type_t type = USB_HID_REPORT_TYPE_INPUT;
    134 
     134       
    135135        if (report == NULL) {
    136136                return EINVAL;
     
    155155
    156156                if (USB_HID_ITEM_FLAG_CONSTANT(item->item_flags) == 0) {
    157 
     157                       
    158158                        if (USB_HID_ITEM_FLAG_VARIABLE(item->item_flags) == 0) {
    159159                                /* array */
    160160                                item->value =
    161161                                        usb_hid_translate_data(item, data);
    162 
     162                               
    163163                                item->usage = USB_HID_EXTENDED_USAGE(
    164164                                    item->usages[item->value -
     
    185185                }
    186186        }
    187 
     187       
    188188        return EOK;
    189189}
     
    340340        int length;
    341341        int32_t tmp_value;
    342 
     342       
    343343        if (report == NULL) {
    344344                return EINVAL;
     
    352352        report_des = usb_hid_report_find_description(report, report_id,
    353353            USB_HID_REPORT_TYPE_OUTPUT);
    354 
     354       
    355355        if (report_des == NULL) {
    356356                return EINVAL;
     
    364364                offset = report_des->bit_length - report_item->offset - 1;
    365365                length = report_item->size;
    366 
     366               
    367367                usb_log_debug("\ttranslated value: %x\n", value);
    368368
     
    375375                        value = value << shift;
    376376                        value = value & (((1 << length) - 1) << shift);
    377 
     377                       
    378378                        uint8_t mask = 0;
    379379                        mask = 0xff - (((1 << length) - 1) << shift);
     
    391391
    392392                                        tmp_value = tmp_value << (offset % 8);
    393 
     393                                       
    394394                                        mask = ~(((1 << (8 - (offset % 8))) - 1)
    395395                                            << (offset % 8));
     
    398398                                            tmp_value;
    399399                                } else if (i == ((offset + length - 1) / 8)) {
    400 
     400                                       
    401401                                        value = value >> (length -
    402402                                            ((offset + length) % 8));
     
    404404                                        value = value & ((1 << (length -
    405405                                            ((offset + length) % 8))) - 1);
    406 
     406                                       
    407407                                        mask = (1 << (length -
    408408                                            ((offset + length) % 8))) - 1;
     
    418418                report_item->value = 0;
    419419        }
    420 
     420       
    421421        return EOK;
    422422}
  • uspace/lib/usbhid/src/hidpath.c

    r85147f3 r07525cd  
    237237                    usb_hid_report_usage_path_t, report_item) {
    238238
    239                         if(USB_HID_SAME_USAGE_PAGE(report_item->usage_page,
    240                                 path_item->usage_page)){
    241 
    242                                 if(only_page == 0){
    243                                         if(USB_HID_SAME_USAGE(
    244                                                 report_item->usage,
    245                                                 path_item->usage)) {
    246 
     239                        if (USB_HID_SAME_USAGE_PAGE(report_item->usage_page,
     240                                path_item->usage_page)) {
     241                               
     242                                if (only_page == 0) {
     243                                        if (USB_HID_SAME_USAGE(report_item->usage,
     244                                            path_item->usage))
    247245                                                return EOK;
    248                                         }
    249246                                }
    250247                                else {
     
    268265                report_link = report_path->items.head.next;
    269266                path_link = path->items.head.next;
    270 
    271                 while((report_link != &report_path->items.head) &&
    272                       (path_link != &path->items.head)) {
    273 
     267               
     268                while ((report_link != &report_path->items.head) &&
     269                    (path_link != &path->items.head)) {
     270                       
    274271                        report_item = list_get_instance(report_link,
    275                                 usb_hid_report_usage_path_t, rpath_items_link);
    276 
     272                            usb_hid_report_usage_path_t, rpath_items_link);
     273                       
    277274                        path_item = list_get_instance(path_link,
    278275                                usb_hid_report_usage_path_t, rpath_items_link);
    279276
    280                         if(!USB_HID_SAME_USAGE_PAGE(report_item->usage_page,
    281                                 path_item->usage_page) || ((only_page == 0) &&
     277                        if (!USB_HID_SAME_USAGE_PAGE(report_item->usage_page,
     278                            path_item->usage_page) || ((only_page == 0) &&
    282279                            !USB_HID_SAME_USAGE(report_item->usage,
    283                                 path_item->usage))) {
    284 
     280                            path_item->usage))) {
    285281                                return 1;
    286282                        } else {
     
    290286                }
    291287
    292                 if((((flags & USB_HID_PATH_COMPARE_BEGIN) != 0) &&
    293                         (path_link == &path->items.head)) ||
    294                    ((report_link == &report_path->items.head) &&
    295                         (path_link == &path->items.head))) {
    296 
     288                if ((((flags & USB_HID_PATH_COMPARE_BEGIN) != 0) &&
     289                    (path_link == &path->items.head)) ||
     290                    ((report_link == &report_path->items.head) &&
     291                    (path_link == &path->items.head))) {
    297292                        return EOK;
    298                 }
    299                 else {
     293                } else {
    300294                        return 1;
    301                 }                                               
     295                }
    302296                break;
    303297
Note: See TracChangeset for help on using the changeset viewer.