From b303bba5f90b53d1385c413f2c2da47c38a42b9c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 4 Jul 2002 15:04:04 +0000 Subject: factorize common constants in private header --- libldetect-private.h | 3 +++ pci.c | 2 +- usb.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libldetect-private.h b/libldetect-private.h index 400b846..9addd46 100644 --- a/libldetect-private.h +++ b/libldetect-private.h @@ -1,2 +1,5 @@ extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable, int no_subid); extern void pciusb_initialize(struct pciusb_entry *e); + +#define MAX_DEVICES 100 +#define BUF_SIZE 512 diff --git a/pci.c b/pci.c index 9aca845..0467b85 100644 --- a/pci.c +++ b/pci.c @@ -12,7 +12,7 @@ extern struct pciusb_entries pci_probe(int probe_type) { char buf[512]; unsigned short devbusfn; unsigned int id; - struct pciusb_entry t[100]; + struct pciusb_entry t[MAX_DEVICES]; struct pciusb_entries r; if (!(f = fopen("/proc/bus/pci/devices", "r"))) exit(1); diff --git a/usb.c b/usb.c index 44ea5db..f7c2c7e 100644 --- a/usb.c +++ b/usb.c @@ -11,7 +11,7 @@ extern struct pciusb_entries usb_probe(void) { char buf[512]; int line; const char *file = "/proc/bus/usb/devices"; - struct pciusb_entry t[100]; + struct pciusb_entry t[MAX_DEVICES]; struct pciusb_entries r; struct pciusb_entry *e = NULL; -- cgit v1.2.1