Move the C_ARRAY_SIZE macro to a common place

This commit is contained in:
Jef Driesen 2022-05-13 21:18:05 +02:00
parent 82c0134811
commit 8bfb965589
14 changed files with 2 additions and 26 deletions

View File

@ -22,6 +22,8 @@
#ifndef ARRAY_H #ifndef ARRAY_H
#define ARRAY_H #define ARRAY_H
#define C_ARRAY_SIZE(a) (sizeof (a) / sizeof *(a))
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */

View File

@ -30,8 +30,6 @@
#include "ringbuffer.h" #include "ringbuffer.h"
#include "rbstream.h" #include "rbstream.h"
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define MAXRETRIES 2 #define MAXRETRIES 2
#define COCHRAN_MODEL_COMMANDER_TM 0 #define COCHRAN_MODEL_COMMANDER_TM 0

View File

@ -29,8 +29,6 @@
#include "parser-private.h" #include "parser-private.h"
#include "array.h" #include "array.h"
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define COCHRAN_MODEL_COMMANDER_TM 0 #define COCHRAN_MODEL_COMMANDER_TM 0
#define COCHRAN_MODEL_COMMANDER_PRE21000 1 #define COCHRAN_MODEL_COMMANDER_PRE21000 1
#define COCHRAN_MODEL_COMMANDER_AIR_NITROX 2 #define COCHRAN_MODEL_COMMANDER_AIR_NITROX 2

View File

@ -28,8 +28,6 @@
#define ISINSTANCE(parser) dc_device_isinstance((parser), &cressi_goa_parser_vtable) #define ISINSTANCE(parser) dc_device_isinstance((parser), &cressi_goa_parser_vtable)
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define SZ_HEADER 23 #define SZ_HEADER 23
#define SZ_HEADER_SCUBA 0x61 #define SZ_HEADER_SCUBA 0x61
#define SZ_HEADER_FREEDIVE 0x2B #define SZ_HEADER_FREEDIVE 0x2B

View File

@ -30,8 +30,6 @@
#include "checksum.h" #include "checksum.h"
#include "array.h" #include "array.h"
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define ISINSTANCE(device) dc_device_isinstance((device), &divesystem_idive_device_vtable) #define ISINSTANCE(device) dc_device_isinstance((device), &divesystem_idive_device_vtable)
#define ISIX3M(model) ((model) >= 0x21) #define ISIX3M(model) ((model) >= 0x21)

View File

@ -26,8 +26,6 @@
#include "parser-private.h" #include "parser-private.h"
#include "array.h" #include "array.h"
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define ISINSTANCE(parser) dc_device_isinstance((parser), &divesystem_idive_parser_vtable) #define ISINSTANCE(parser) dc_device_isinstance((parser), &divesystem_idive_parser_vtable)
#define ISIX3M(model) ((model) >= 0x21) #define ISIX3M(model) ((model) >= 0x21)

View File

@ -31,8 +31,6 @@
#define ISINSTANCE(device) dc_device_isinstance((device), &hw_ostc_device_vtable) #define ISINSTANCE(device) dc_device_isinstance((device), &hw_ostc_device_vtable)
#define C_ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
#define MAXRETRIES 9 #define MAXRETRIES 9
#define FW_190 0x015A #define FW_190 0x015A

View File

@ -31,8 +31,6 @@
#define ISINSTANCE(parser) dc_parser_isinstance((parser), &liquivision_lynx_parser_vtable) #define ISINSTANCE(parser) dc_parser_isinstance((parser), &liquivision_lynx_parser_vtable)
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define XEN 0 #define XEN 0
#define XEO 1 #define XEO 1
#define LYNX 2 #define LYNX 2

View File

@ -30,8 +30,6 @@
#include "rbstream.h" #include "rbstream.h"
#include "platform.h" #include "platform.h"
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define ISINSTANCE(device) dc_device_isinstance((device), &mares_iconhd_device_vtable) #define ISINSTANCE(device) dc_device_isinstance((device), &mares_iconhd_device_vtable)
#define NSTEPS 1000 #define NSTEPS 1000

View File

@ -28,8 +28,6 @@
#define ISINSTANCE(parser) dc_device_isinstance((parser), &sporasub_sp2_parser_vtable) #define ISINSTANCE(parser) dc_device_isinstance((parser), &sporasub_sp2_parser_vtable)
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define SZ_HEADER 0x20 #define SZ_HEADER 0x20
#define SZ_SAMPLE 0x04 #define SZ_SAMPLE 0x04

View File

@ -31,8 +31,6 @@
#define ISINSTANCE(device) dc_device_isinstance((device), (const dc_device_vtable_t *) &suunto_d9_device_vtable) #define ISINSTANCE(device) dc_device_isinstance((device), (const dc_device_vtable_t *) &suunto_d9_device_vtable)
#define C_ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
#define D4i 0x19 #define D4i 0x19
#define D6i 0x1A #define D6i 0x1A
#define D9tx 0x1B #define D9tx 0x1B

View File

@ -30,8 +30,6 @@
#include "array.h" #include "array.h"
#include "platform.h" #include "platform.h"
#define C_ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
enum eon_sample { enum eon_sample {
ES_none = 0, ES_none = 0,
ES_dtime, // duint16,precision=3 (time delta in ms) ES_dtime, // duint16,precision=3 (time delta in ms)

View File

@ -31,8 +31,6 @@
#define ISINSTANCE(device) dc_device_isinstance((device), &uwatec_smart_device_vtable) #define ISINSTANCE(device) dc_device_isinstance((device), &uwatec_smart_device_vtable)
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define DATASIZE 254 #define DATASIZE 254
#define PACKETSIZE_USBHID_RX 64 #define PACKETSIZE_USBHID_RX 64
#define PACKETSIZE_USBHID_TX 32 #define PACKETSIZE_USBHID_TX 32

View File

@ -31,8 +31,6 @@
#define ISINSTANCE(parser) dc_parser_isinstance((parser), &uwatec_smart_parser_vtable) #define ISINSTANCE(parser) dc_parser_isinstance((parser), &uwatec_smart_parser_vtable)
#define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
#define NBITS 8 #define NBITS 8
#define SMARTPRO 0x10 #define SMARTPRO 0x10