2007-02-06 Martin Mares <mj@ucw.cz>
+ * Replaced bzero() by memset() everywhere, it's better to lose a tiny
+ bit of readability than maintain hacks to make it work on various systems.
+
* lib/configure: tr on Solaris is a bit weird and it requires `[A-Z]'
instead of `A-Z'. Fortunately, the extra brackets don't hurt otherwise.
struct pci_access *a = malloc(sizeof(struct pci_access));
int i;
- bzero(a, sizeof(*a));
+ memset(a, 0, sizeof(*a));
pci_set_name_list_path(a, PCI_PATH_IDS_DIR "/" PCI_IDS, 0);
for(i=0; i<PCI_ACCESS_MAX; i++)
if (pci_methods[i] && pci_methods[i]->config)
{
struct pci_dev *d = pci_malloc(a, sizeof(struct pci_dev));
- bzero(d, sizeof(*d));
+ memset(d, 0, sizeof(*d));
d->access = a;
d->methods = a->methods;
d->hdrtype = -1;
int bus_number;
byte busmap[256];
- bzero(busmap, sizeof(busmap));
+ memset(busmap, 0, sizeof(busmap));
for (i = 0; i < pci_bus_count; i++)
{
bus_number = pci_buses[i].bus_number;
{
byte busmap[256];
- bzero(busmap, sizeof(busmap));
+ memset(busmap, 0, sizeof(busmap));
pci_generic_scan_bus(a, busmap, 0);
}
if (flags & PCI_FILL_BASES)
{
int cnt = 0, i;
- bzero(d->base_addr, sizeof(d->base_addr));
+ memset(d->base_addr, 0, sizeof(d->base_addr));
switch (d->hdrtype)
{
case PCI_HEADER_TYPE_NORMAL:
if (!(f = pci_open(a)))
return 0;
a->id_hash = pci_malloc(a, sizeof(struct id_entry *) * HASH_SIZE);
- bzero(a->id_hash, sizeof(struct id_entry *) * HASH_SIZE);
+ memset(a->id_hash, 0, sizeof(struct id_entry *) * HASH_SIZE);
err = id_parse_list(a, f, &lino);
PCI_ERROR(f, err);
pci_close(f);
typedef u16 word;
#ifdef PCI_OS_WINDOWS
-#define bzero(x,y) memset(x,0,y)
#define strcasecmp strcmpi
#endif
d->config_bufsize *= 2;
d->config = xrealloc(d->config, d->config_bufsize);
d->present = xrealloc(d->present, d->config_bufsize);
- bzero(d->present + orig_size, d->config_bufsize - orig_size);
+ memset(d->present + orig_size, 0, d->config_bufsize - orig_size);
}
result = pci_read_block(d->dev, pos, d->config + pos, len);
if (result)
if (!pci_filter_match(&filter, p))
return NULL;
d = xmalloc(sizeof(struct device));
- bzero(d, sizeof(*d));
+ memset(d, 0, sizeof(*d));
d->dev = p;
d->config_cached = d->config_bufsize = 64;
d->config = xmalloc(64);
pacc->method == PCI_ACCESS_DUMP)
printf("WARNING: Bus mapping can be reliable only with direct hardware access enabled.\n\n");
bus_info = xmalloc(sizeof(struct bus_info) * 256);
- bzero(bus_info, sizeof(struct bus_info) * 256);
+ memset(bus_info, 0, sizeof(struct bus_info) * 256);
if (filter.bus >= 0)
do_map_bus(filter.bus);
else