xalloc+memset(0) -> xcalloc

This commit is contained in:
Adam Jackson 2008-10-06 15:36:51 -04:00
commit 8a5b89e8e1
43 changed files with 68 additions and 179 deletions

View file

@ -80,8 +80,7 @@ hid_start_parse(report_desc_t d, int kindset)
_DIAGASSERT(d != NULL);
s = malloc(sizeof *s);
memset(s, 0, sizeof *s);
s = calloc(1, sizeof *s);
s->start = s->p = d->data;
s->end = d->data + d->size;
s->kindset = kindset;

View file

@ -321,7 +321,7 @@ sparcPromAssignNodes(void)
FILE *f;
sbusDevicePtr devicePtrs[32];
(void)memset(devicePtrs, 0, sizeof(devicePtrs));
memset(devicePtrs, 0, sizeof(devicePtrs));
for (psdpp = xf86SbusInfo, n = 0; (psdp = *psdpp); psdpp++, n++) {
if (psdp->fbNum != n)
holes = 1;

View file

@ -106,7 +106,7 @@ linuxPciInit(void)
struct stat st;
#ifndef INCLUDE_XF86_NO_DOMAIN
(void) memset(DomainMmappedIO, 0, sizeof(DomainMmappedIO));
memset(DomainMmappedIO, 0, sizeof(DomainMmappedIO));
#endif
if (-1 == stat("/proc/bus/pci", &st)) {

View file

@ -245,7 +245,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
* 64K bytes at a time.
*/
if (!videoBiosMapped) {
(void)memset((pointer)V_BIOS, 0, SYS_BIOS - V_BIOS);
memset((pointer)V_BIOS, 0, SYS_BIOS - V_BIOS);
#ifdef DEBUG
ErrorF("Reading BIOS\n");
#endif

View file

@ -244,8 +244,8 @@ xf86CloseConsole(void)
"xf86CloseConsole(): unable to mmap framebuffer"
" (%s)\n", strerror(errno));
} else {
(void)memset(fbdata, 0, fbattr.fbtype.fb_size);
(void)munmap(fbdata, fbattr.fbtype.fb_size);
memset(fbdata, 0, fbattr.fbtype.fb_size);
munmap(fbdata, fbattr.fbtype.fb_size);
}
}