From 16fbcdc0b5b73024ab0f41b7d505f3265bf136f0 Mon Sep 17 00:00:00 2001 From: inmarket Date: Wed, 17 Sep 2014 09:33:07 +1000 Subject: [PATCH] Convert GDRIVER instance numbers to unsigned. --- src/gdriver/gdriver_gdriver.c | 14 +++++++------- src/gdriver/sys_defs.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gdriver/gdriver_gdriver.c b/src/gdriver/gdriver_gdriver.c index 90a1d932..0a53aaf7 100644 --- a/src/gdriver/gdriver_gdriver.c +++ b/src/gdriver/gdriver_gdriver.c @@ -34,9 +34,9 @@ void _gdriverDeinit(void) { GDriver *gdriverRegister(const GDriverVMT *vmt) { - GDriver *pd; - GDriver *dtail; - int dinstance, sinstance; + GDriver * pd; + GDriver * dtail; + unsigned dinstance, sinstance; // Loop to find the driver instance and the system instance numbers dinstance = sinstance = 0; @@ -98,9 +98,9 @@ void gdriverUnRegister(GDriver *driver) { gfxFree(driver); } -GDriver *gdriverGetInstance(uint16_t type, int instance) { +GDriver *gdriverGetInstance(uint16_t type, unsigned instance) { GDriver *pd; - int sinstance; + unsigned sinstance; // Loop to find the system instance sinstance = 0; @@ -114,9 +114,9 @@ GDriver *gdriverGetInstance(uint16_t type, int instance) { return 0; } -int gdriverInstanceCount(uint16_t type) { +unsigned gdriverInstanceCount(uint16_t type) { GDriver *pd; - int sinstance; + unsigned sinstance; // Loop to count the system instances sinstance = 0; diff --git a/src/gdriver/sys_defs.h b/src/gdriver/sys_defs.h index 7f50fc6d..546246de 100644 --- a/src/gdriver/sys_defs.h +++ b/src/gdriver/sys_defs.h @@ -67,7 +67,7 @@ typedef struct GDriverVMT { uint16_t type; // @< What type of driver this is uint16_t flags; // @< Flags for the driver. Meaning is specific to each driver type. uint32_t objsize; // @< How big the runtime driver structure is - bool_t (*init)(GDriver *driver, int driverinstance, int systeminstance); // @< Initialise the driver. Returns TRUE if OK. + bool_t (*init)(GDriver *driver, unsigned driverinstance, unsigned systeminstance); // @< Initialise the driver. Returns TRUE if OK. // driverinstance is the instance 0..n of this driver. // systeminstance is the instance 0..n of this type of device. void (*postinit)(GDriver *driver); // @< Called once the driver is registered. @@ -118,7 +118,7 @@ extern "C" { * @param[in] type The type of driver to find * @param[in] instance The instance (0..n) to find */ - GDriver *gdriverGetInstance(uint16_t type, int instance); + GDriver *gdriverGetInstance(uint16_t type, unsigned instance); /** * @brief Get the count of instances of a type of device @@ -128,7 +128,7 @@ extern "C" { * * @param[in] type The type of driver to find */ - int gdriverInstanceCount(uint16_t type); + unsigned gdriverInstanceCount(uint16_t type); /** * @brief Get the next driver for a type of device