Changeset f317490 in mainline


Ignore:
Timestamp:
2011-11-09T14:33:03Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d1ba51
Parents:
07b9cbae
Message:

usbhid: Change index and count to unsigned types.

Location:
uspace/drv/bus/usb/usbhid
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/usbhid.c

    r07b9cbae rf317490  
    5151#include "subdrivers.h"
    5252
    53 /*----------------------------------------------------------------------------*/
    54 
    5553/* Array of endpoints expected on the device, NULL terminated. */
    5654const usb_endpoint_description_t *usb_hid_endpoints[] = {
     
    324322        return EOK;
    325323}
    326 
    327324/*----------------------------------------------------------------------------*/
    328325/*
     
    429426         */
    430427        bool ok = false;
    431         for (int i = 0; i < hid_dev->subdriver_count; ++i) {
     428        for (unsigned i = 0; i < hid_dev->subdriver_count; ++i) {
    432429                if (hid_dev->subdrivers[i].init != NULL) {
    433430                        usb_log_debug("Initializing subdriver %d.\n",i);
     
    494491        bool cont = false;
    495492        /* Continue if at least one of the subdrivers want to continue */
    496         for (int i = 0; i < hid_dev->subdriver_count; ++i) {
     493        for (unsigned i = 0; i < hid_dev->subdriver_count; ++i) {
    497494                if (hid_dev->subdrivers[i].poll != NULL) {
    498495                        cont = cont || hid_dev->subdrivers[i].poll(
     
    503500        return cont;
    504501}
    505 
    506 /*----------------------------------------------------------------------------*/
    507 
     502/*----------------------------------------------------------------------------*/
    508503void usb_hid_polling_ended_callback(usb_device_t *dev, bool reason, void *arg)
    509504{
     
    513508        usb_hid_dev_t *hid_dev = arg;
    514509
    515         for (int i = 0; i < hid_dev->subdriver_count; ++i) {
     510        for (unsigned i = 0; i < hid_dev->subdriver_count; ++i) {
    516511                if (hid_dev->subdrivers[i].poll_end != NULL) {
    517512                        hid_dev->subdrivers[i].poll_end(
     
    522517        hid_dev->running = false;
    523518}
    524 
    525 /*----------------------------------------------------------------------------*/
    526 
     519/*----------------------------------------------------------------------------*/
    527520void usb_hid_new_report(usb_hid_dev_t *hid_dev)
    528521{
    529522        ++hid_dev->report_nr;
    530523}
    531 
    532 /*----------------------------------------------------------------------------*/
    533 
     524/*----------------------------------------------------------------------------*/
    534525int usb_hid_report_number(const usb_hid_dev_t *hid_dev)
    535526{
    536527        return hid_dev->report_nr;
    537528}
    538 
    539529/*----------------------------------------------------------------------------*/
    540530void usb_hid_deinit(usb_hid_dev_t *hid_dev)
     
    547537            hid_dev->subdrivers, hid_dev->subdriver_count);
    548538
    549         for (int i = 0; i < hid_dev->subdriver_count; ++i) {
     539        for (unsigned i = 0; i < hid_dev->subdriver_count; ++i) {
    550540                if (hid_dev->subdrivers[i].deinit != NULL) {
    551541                        hid_dev->subdrivers[i].deinit(hid_dev,
  • uspace/drv/bus/usb/usbhid/usbhid.h

    r07b9cbae rf317490  
    104104
    105105        /** Index of the polling pipe in usb_hid_endpoints array. */
    106         int poll_pipe_index;
     106        unsigned poll_pipe_index;
    107107
    108108        /** Subdrivers. */
     
    110110
    111111        /** Number of subdrivers. */
    112         int subdriver_count;
     112        unsigned subdriver_count;
    113113
    114114        /** Report descriptor. */
Note: See TracChangeset for help on using the changeset viewer.