From c1745cc535867b96d0e583f254d009488dfa5802 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 6 Apr 2009 07:26:16 +0000 Subject: [PATCH] Merge the typedef with the struct declaration. --- src/mares_nemo.c | 6 ++---- src/mares_puck.c | 6 ++---- src/oceanic_atom2.c | 7 ++----- src/oceanic_veo250.c | 6 ++---- src/oceanic_vtpro.c | 7 ++----- src/reefnet_sensus.c | 7 ++----- src/reefnet_sensuspro.c | 7 ++----- src/reefnet_sensusultra.c | 6 ++---- src/suunto_d9.c | 7 ++----- src/suunto_eon.c | 6 ++---- src/suunto_solution.c | 6 ++---- src/suunto_vyper.c | 6 ++---- src/suunto_vyper2.c | 7 ++----- src/uwatec_aladin.c | 6 ++---- src/uwatec_memomouse.c | 6 ++---- src/uwatec_smart.c | 6 ++---- 16 files changed, 32 insertions(+), 70 deletions(-) diff --git a/src/mares_nemo.c b/src/mares_nemo.c index 8cc942f..08d7235 100644 --- a/src/mares_nemo.c +++ b/src/mares_nemo.c @@ -48,13 +48,11 @@ #define RB_FREEDIVES_BEGIN 0x3400 #define RB_FREEDIVES_END 0x4000 -typedef struct mares_nemo_device_t mares_nemo_device_t; - -struct mares_nemo_device_t { +typedef struct mares_nemo_device_t { device_t base; struct serial *port; unsigned char fingerprint[FP_SIZE]; -}; +} mares_nemo_device_t; static device_status_t mares_nemo_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t mares_nemo_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result); diff --git a/src/mares_puck.c b/src/mares_puck.c index 3f913f4..5ea2a51 100644 --- a/src/mares_puck.c +++ b/src/mares_puck.c @@ -42,12 +42,10 @@ #define MAXRETRIES 4 -typedef struct mares_puck_device_t mares_puck_device_t; - -struct mares_puck_device_t { +typedef struct mares_puck_device_t { device_t base; struct serial *port; -}; +} mares_puck_device_t; static device_status_t mares_puck_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size); static device_status_t mares_puck_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result); diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index b9e5108..b7e408b 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -61,13 +61,10 @@ #define PT_PROFILE_FIRST(x) ( (x)[5] + (((x)[6] & 0x0F) << 8) ) #define PT_PROFILE_LAST(x) ( ((x)[6] >> 4) + ((x)[7] << 4) ) - -typedef struct oceanic_atom2_device_t oceanic_atom2_device_t; - -struct oceanic_atom2_device_t { +typedef struct oceanic_atom2_device_t { device_t base; struct serial *port; -}; +} oceanic_atom2_device_t; static device_status_t oceanic_atom2_device_version (device_t *abstract, unsigned char data[], unsigned int size); static device_status_t oceanic_atom2_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size); diff --git a/src/oceanic_veo250.c b/src/oceanic_veo250.c index bcb8eec..782f08f 100644 --- a/src/oceanic_veo250.c +++ b/src/oceanic_veo250.c @@ -61,13 +61,11 @@ #define PT_PROFILE_FIRST(x) ( (x)[4] + (((x)[5] & 0x0F) << 8) ) #define PT_PROFILE_LAST(x) ( (x)[6] + (((x)[7] & 0x0F) << 8) ) -typedef struct oceanic_veo250_device_t oceanic_veo250_device_t; - -struct oceanic_veo250_device_t { +typedef struct oceanic_veo250_device_t { device_t base; struct serial *port; unsigned int last; -}; +} oceanic_veo250_device_t; static device_status_t oceanic_veo250_device_version (device_t *abstract, unsigned char data[], unsigned int size); static device_status_t oceanic_veo250_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size); diff --git a/src/oceanic_vtpro.c b/src/oceanic_vtpro.c index d164faa..8fadeaf 100644 --- a/src/oceanic_vtpro.c +++ b/src/oceanic_vtpro.c @@ -45,13 +45,10 @@ #define ACK 0x5A #define NAK 0xA5 - -typedef struct oceanic_vtpro_device_t oceanic_vtpro_device_t; - -struct oceanic_vtpro_device_t { +typedef struct oceanic_vtpro_device_t { device_t base; struct serial *port; -}; +} oceanic_vtpro_device_t; static device_status_t oceanic_vtpro_device_version (device_t *abstract, unsigned char data[], unsigned int size); static device_status_t oceanic_vtpro_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size); diff --git a/src/reefnet_sensus.c b/src/reefnet_sensus.c index 25156be..7384950 100644 --- a/src/reefnet_sensus.c +++ b/src/reefnet_sensus.c @@ -41,17 +41,14 @@ rc == -1 ? DEVICE_STATUS_IO : DEVICE_STATUS_TIMEOUT \ ) - -typedef struct reefnet_sensus_device_t reefnet_sensus_device_t; - -struct reefnet_sensus_device_t { +typedef struct reefnet_sensus_device_t { device_t base; struct serial *port; unsigned int waiting; unsigned int timestamp; unsigned int devtime; time_t systime; -}; +} reefnet_sensus_device_t; static device_status_t reefnet_sensus_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t reefnet_sensus_device_handshake (device_t *abstract, unsigned char *data, unsigned int size); diff --git a/src/reefnet_sensuspro.c b/src/reefnet_sensuspro.c index 944ac42..e4110fc 100644 --- a/src/reefnet_sensuspro.c +++ b/src/reefnet_sensuspro.c @@ -40,16 +40,13 @@ rc == -1 ? DEVICE_STATUS_IO : DEVICE_STATUS_TIMEOUT \ ) - -typedef struct reefnet_sensuspro_device_t reefnet_sensuspro_device_t; - -struct reefnet_sensuspro_device_t { +typedef struct reefnet_sensuspro_device_t { device_t base; struct serial *port; unsigned int timestamp; unsigned int devtime; time_t systime; -}; +} reefnet_sensuspro_device_t; static device_status_t reefnet_sensuspro_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t reefnet_sensuspro_device_handshake (device_t *abstract, unsigned char *data, unsigned int size); diff --git a/src/reefnet_sensusultra.c b/src/reefnet_sensusultra.c index 2cd3304..7678c25 100644 --- a/src/reefnet_sensusultra.c +++ b/src/reefnet_sensusultra.c @@ -45,16 +45,14 @@ #define ACCEPT PROMPT #define REJECT 0x00 -typedef struct reefnet_sensusultra_device_t reefnet_sensusultra_device_t; - -struct reefnet_sensusultra_device_t { +typedef struct reefnet_sensusultra_device_t { device_t base; struct serial *port; unsigned int maxretries; unsigned int timestamp; unsigned int devtime; time_t systime; -}; +} reefnet_sensusultra_device_t; static device_status_t reefnet_sensusultra_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t reefnet_sensusultra_device_handshake (device_t *abstract, unsigned char *data, unsigned int size); diff --git a/src/suunto_d9.c b/src/suunto_d9.c index 23a5172..357517b 100644 --- a/src/suunto_d9.c +++ b/src/suunto_d9.c @@ -55,14 +55,11 @@ #define FP_OFFSET 0x15 #define FP_SIZE 7 - -typedef struct suunto_d9_device_t suunto_d9_device_t; - -struct suunto_d9_device_t { +typedef struct suunto_d9_device_t { device_t base; struct serial *port; unsigned char fingerprint[FP_SIZE]; -}; +} suunto_d9_device_t; static device_status_t suunto_d9_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t suunto_d9_device_version (device_t *abstract, unsigned char data[], unsigned int size); diff --git a/src/suunto_eon.c b/src/suunto_eon.c index ca2cac1..32158b7 100644 --- a/src/suunto_eon.c +++ b/src/suunto_eon.c @@ -44,13 +44,11 @@ #define FP_OFFSET 6 #define FP_SIZE 5 -typedef struct suunto_eon_device_t suunto_eon_device_t; - -struct suunto_eon_device_t { +typedef struct suunto_eon_device_t { device_t base; struct serial *port; unsigned char fingerprint[FP_SIZE]; -}; +} suunto_eon_device_t; static device_status_t suunto_eon_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t suunto_eon_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result); diff --git a/src/suunto_solution.c b/src/suunto_solution.c index f678068..e207716 100644 --- a/src/suunto_solution.c +++ b/src/suunto_solution.c @@ -42,12 +42,10 @@ #define RB_PROFILE_BEGIN 0x020 #define RB_PROFILE_END 0x100 -typedef struct suunto_solution_device_t suunto_solution_device_t; - -struct suunto_solution_device_t { +typedef struct suunto_solution_device_t { device_t base; struct serial *port; -}; +} suunto_solution_device_t; static device_status_t suunto_solution_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result); static device_status_t suunto_solution_device_foreach (device_t *abstract, dive_callback_t callback, void *userdata); diff --git a/src/suunto_vyper.c b/src/suunto_vyper.c index b769ff6..02fa4dd 100644 --- a/src/suunto_vyper.c +++ b/src/suunto_vyper.c @@ -48,14 +48,12 @@ #define FP_OFFSET_SPYDER 7 #define FP_SIZE 5 -typedef struct suunto_vyper_device_t suunto_vyper_device_t; - -struct suunto_vyper_device_t { +typedef struct suunto_vyper_device_t { device_t base; struct serial *port; unsigned int delay; unsigned char fingerprint[FP_SIZE]; -}; +} suunto_vyper_device_t; static device_status_t suunto_vyper_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t suunto_vyper_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size); diff --git a/src/suunto_vyper2.c b/src/suunto_vyper2.c index 8f9a45d..05567a6 100644 --- a/src/suunto_vyper2.c +++ b/src/suunto_vyper2.c @@ -55,14 +55,11 @@ #define FP_OFFSET 0x15 #define FP_SIZE 7 - -typedef struct suunto_vyper2_device_t suunto_vyper2_device_t; - -struct suunto_vyper2_device_t { +typedef struct suunto_vyper2_device_t { device_t base; struct serial *port; unsigned char fingerprint[FP_SIZE]; -}; +} suunto_vyper2_device_t; static device_status_t suunto_vyper2_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t suunto_vyper2_device_version (device_t *abstract, unsigned char data[], unsigned int size); diff --git a/src/uwatec_aladin.c b/src/uwatec_aladin.c index f588217..61407de 100644 --- a/src/uwatec_aladin.c +++ b/src/uwatec_aladin.c @@ -49,15 +49,13 @@ #define HEADER 4 -typedef struct uwatec_aladin_device_t uwatec_aladin_device_t; - -struct uwatec_aladin_device_t { +typedef struct uwatec_aladin_device_t { device_t base; struct serial *port; unsigned int timestamp; unsigned int devtime; time_t systime; -}; +} uwatec_aladin_device_t ; static device_status_t uwatec_aladin_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size); static device_status_t uwatec_aladin_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result); diff --git a/src/uwatec_memomouse.c b/src/uwatec_memomouse.c index b358988..b47b384 100644 --- a/src/uwatec_memomouse.c +++ b/src/uwatec_memomouse.c @@ -44,15 +44,13 @@ #define ACK 0x60 #define NAK 0xA8 -typedef struct uwatec_memomouse_device_t uwatec_memomouse_device_t; - -struct uwatec_memomouse_device_t { +typedef struct uwatec_memomouse_device_t { device_t base; struct serial *port; unsigned int timestamp; unsigned int devtime; time_t systime; -}; +} uwatec_memomouse_device_t; static device_status_t uwatec_memomouse_device_set_fingerprint (device_t *device, const unsigned char data[], unsigned int size); static device_status_t uwatec_memomouse_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result); diff --git a/src/uwatec_smart.c b/src/uwatec_smart.c index 0de8a4f..e93f92e 100644 --- a/src/uwatec_smart.c +++ b/src/uwatec_smart.c @@ -40,16 +40,14 @@ rc == -1 ? DEVICE_STATUS_IO : DEVICE_STATUS_TIMEOUT \ ) -typedef struct uwatec_smart_device_t uwatec_smart_device_t; - -struct uwatec_smart_device_t { +typedef struct uwatec_smart_device_t { device_t base; struct irda *socket; unsigned int address; unsigned int timestamp; unsigned int devtime; time_t systime; -}; +} uwatec_smart_device_t; static device_status_t uwatec_smart_device_set_fingerprint (device_t *device, const unsigned char data[], unsigned int size); static device_status_t uwatec_smart_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result);