From afebde01eb1871c2b2b3da3a8b21ce49865b42bb Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 9 Sep 2006 11:44:46 +0200 Subject: [PATCH] Cleaned up usage of `char' and `byte'. --- ChangeLog | 2 ++ lib/names.c | 28 ++++++++++++++-------------- lspci.c | 16 ++++++++-------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55abd40..a1ce916 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2006-09-09 Martin Mares + * Cleaned up usage of `char' and `byte'. + * lib/header.h: PCI_CLASS_DOCKING_OTHER should be 0x0a80, not 0x0a01. * lib/header.h: Added PCI_CLASS_xxx constants for all classes currently diff --git a/lib/names.c b/lib/names.c index e60de20..af3cc15 100644 --- a/lib/names.c +++ b/lib/names.c @@ -18,7 +18,7 @@ struct id_entry { struct id_entry *next; u32 id12, id34; byte cat; - byte name[1]; + char name[1]; }; enum id_entry_type { @@ -81,7 +81,7 @@ static inline unsigned int id_hash(int cat, u32 id12, u32 id34) return h % HASH_SIZE; } -static byte *id_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int id4) +static char *id_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int id4) { struct id_entry *n; u32 id12 = id_pair(id1, id2); @@ -95,7 +95,7 @@ static byte *id_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, return n ? n->name : NULL; } -static int id_insert(struct pci_access *a, int cat, int id1, int id2, int id3, int id4, byte *text) +static int id_insert(struct pci_access *a, int cat, int id1, int id2, int id3, int id4, char *text) { u32 id12 = id_pair(id1, id2); u32 id34 = id_pair(id3, id4); @@ -117,7 +117,7 @@ static int id_insert(struct pci_access *a, int cat, int id1, int id2, int id3, i return 0; } -static int id_hex(byte *p, int cnt) +static int id_hex(char *p, int cnt) { int x = 0; while (cnt--) @@ -143,8 +143,8 @@ static inline int id_white_p(int c) static const char *id_parse_list(struct pci_access *a, FILE *f, int *lino) { - byte line[MAX_LINE]; - byte *p; + char line[MAX_LINE]; + char *p; int id1=0, id2=0, id3=0, id4=0; int cat = -1; int nest; @@ -308,10 +308,10 @@ pci_free_name_list(struct pci_access *a) } } -static byte * +static char * id_lookup_subsys(struct pci_access *a, int iv, int id, int isv, int isd) { - byte *d = NULL; + char *d = NULL; if (iv > 0 && id > 0) /* Per-device lookup */ d = id_lookup(a, ID_SUBSYSTEM, iv, id, isv, isd); if (!d) /* Generic lookup */ @@ -321,8 +321,8 @@ id_lookup_subsys(struct pci_access *a, int iv, int id, int isv, int isd) return d; } -static byte * -format_name(char *buf, int size, int flags, byte *name, byte *num, byte *unknown) +static char * +format_name(char *buf, int size, int flags, char *name, char *num, char *unknown) { int res; if ((flags & PCI_LOOKUP_NO_NUMBERS) && !name) @@ -341,8 +341,8 @@ format_name(char *buf, int size, int flags, byte *name, byte *num, byte *unknown return buf; } -static byte * -format_name_pair(char *buf, int size, int flags, byte *v, byte *d, byte *num) +static char * +format_name_pair(char *buf, int size, int flags, char *v, char *d, char *num) { int res; if ((flags & PCI_LOOKUP_NO_NUMBERS) && (!v || !d)) @@ -377,9 +377,9 @@ char * pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, ...) { va_list args; - byte *v, *d, *cls, *pif; + char *v, *d, *cls, *pif; int iv, id, isv, isd, icls, ipif; - byte numbuf[16], pifbuf[32]; + char numbuf[16], pifbuf[32]; va_start(args, flags); diff --git a/lspci.c b/lspci.c index 76b9117..5d13fd8 100644 --- a/lspci.c +++ b/lspci.c @@ -256,7 +256,7 @@ show_terse(struct device *d) { int c; struct pci_dev *p = d->dev; - byte classbuf[128], devbuf[128]; + char classbuf[128], devbuf[128]; show_slot_name(d); printf(" %s: %s", @@ -534,7 +534,7 @@ show_pcix_nobridge(struct device *d, int where) static void show_pcix_bridge(struct device *d, int where) { - static const byte * const sec_clock_freq[8] = { "conv", "66MHz", "100MHz", "133MHz", "?4", "?5", "?6", "?7" }; + static const char * const sec_clock_freq[8] = { "conv", "66MHz", "100MHz", "133MHz", "?4", "?5", "?6", "?7" }; u16 secstatus; u32 status, upstcr, downstcr; @@ -2039,7 +2039,7 @@ grow_tree(void) } static void -print_it(byte *line, byte *p) +print_it(char *line, char *p) { *p++ = '\n'; *p = 0; @@ -2051,10 +2051,10 @@ print_it(byte *line, byte *p) *p = ' '; } -static void show_tree_bridge(struct bridge *, byte *, byte *); +static void show_tree_bridge(struct bridge *, char *, char *); static void -show_tree_dev(struct device *d, byte *line, byte *p) +show_tree_dev(struct device *d, char *line, char *p) { struct pci_dev *q = d->dev; struct bridge *b; @@ -2080,7 +2080,7 @@ show_tree_dev(struct device *d, byte *line, byte *p) } static void -show_tree_bus(struct bus *b, byte *line, byte *p) +show_tree_bus(struct bus *b, char*line, char *p) { if (!b->first_dev) print_it(line, p); @@ -2107,7 +2107,7 @@ show_tree_bus(struct bus *b, byte *line, byte *p) } static void -show_tree_bridge(struct bridge *b, byte *line, byte *p) +show_tree_bridge(struct bridge *b, char *line, char *p) { *p++ = '-'; if (!b->first_bus->sibling) @@ -2119,7 +2119,7 @@ show_tree_bridge(struct bridge *b, byte *line, byte *p) else { struct bus *u = b->first_bus; - byte *k; + char *k; while (u->sibling) { -- 2.39.2