Skip to content
Snippets Groups Projects
Commit 1f4120dc authored by shattered's avatar shattered
Browse files

Add explicit type casts.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2257 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent a9cf3a15
Branches
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@
#include "os_netbsd.h"
#include <unistd.h>
const char *os_XXXX_c_cvsid = "$Id: os_netbsd.cpp,v 1.17 2006/08/25 06:06:25 sxzzsf Exp $" \
const char *os_XXXX_c_cvsid = "$Id: os_netbsd.cpp,v 1.18 2006/09/17 07:37:27 shattered Exp $" \
ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_NETBSD_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
/* global variable holding byte count of allocated memory */
......@@ -104,7 +104,7 @@ get_dev_names(char ***names, const char *prefix)
pout("Failed to get value of sysctl `hw.disknames'\n");
return -1;
}
if (!(disknames = malloc(sysctl_len))) {
if (!(disknames = (char *)malloc(sysctl_len))) {
pout("Out of memory constructing scan device list\n");
return -1;
}
......@@ -120,7 +120,7 @@ get_dev_names(char ***names, const char *prefix)
if (strncmp(p, prefix, strlen(prefix))) {
continue;
}
mp[n] = malloc(strlen(net_dev_prefix) + strlen(p) + 2);
mp[n] = (char *)malloc(strlen(net_dev_prefix) + strlen(p) + 2);
if (!mp[n]) {
pout("Out of memory constructing scan device list\n");
return -1;
......@@ -130,7 +130,7 @@ get_dev_names(char ***names, const char *prefix)
n++;
}
mp = realloc(mp, n * (sizeof(char *)));
mp = (char **)realloc(mp, n * (sizeof(char *)));
bytes += (n) * (sizeof(char *));
*names = mp;
return n;
......@@ -191,7 +191,7 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
req.flags = ATACMD_READ;
req.features = WDSM_RD_DATA;
req.command = WDCC_SMART;
req.databuf = inbuf;
req.databuf = (char *)inbuf;
req.datalen = sizeof(inbuf);
req.cylinder = WDSMART_CYL;
req.timeout = 1000;
......@@ -201,7 +201,7 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
req.flags = ATACMD_READ;
req.features = WDSM_RD_THRESHOLDS;
req.command = WDCC_SMART;
req.databuf = inbuf;
req.databuf = (char *)inbuf;
req.datalen = sizeof(inbuf);
req.cylinder = WDSMART_CYL;
req.timeout = 1000;
......@@ -211,7 +211,7 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
req.flags = ATACMD_READ;
req.features = ATA_SMART_READ_LOG_SECTOR; /* XXX missing from wdcreg.h */
req.command = WDCC_SMART;
req.databuf = inbuf;
req.databuf = (char *)inbuf;
req.datalen = sizeof(inbuf);
req.cylinder = WDSMART_CYL;
req.sec_num = select;
......@@ -224,7 +224,7 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
req.flags = ATACMD_WRITE;
req.features = ATA_SMART_WRITE_LOG_SECTOR; /* XXX missing from wdcreg.h */
req.command = WDCC_SMART;
req.databuf = inbuf;
req.databuf = (char *)inbuf;
req.datalen = sizeof(inbuf);
req.cylinder = WDSMART_CYL;
req.sec_num = select;
......@@ -234,7 +234,7 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
case IDENTIFY:
req.flags = ATACMD_READ;
req.command = WDCC_IDENTIFY;
req.databuf = inbuf;
req.databuf = (char *)inbuf;
req.datalen = sizeof(inbuf);
req.timeout = 1000;
copydata = 1;
......@@ -242,7 +242,7 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
case PIDENTIFY:
req.flags = ATACMD_READ;
req.command = ATAPI_IDENTIFY_DEVICE;
req.databuf = inbuf;
req.databuf = (char *)inbuf;
req.datalen = sizeof(inbuf);
req.timeout = 1000;
copydata = 1;
......@@ -266,7 +266,7 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
req.flags = ATACMD_READ;
req.features = ATA_SMART_AUTO_OFFLINE; /* XXX missing from wdcreg.h */
req.command = WDCC_SMART;
req.databuf = inbuf;
req.databuf = (char *)inbuf;
req.datalen = sizeof(inbuf);
req.cylinder = WDSMART_CYL;
req.sec_num = select;
......@@ -287,7 +287,7 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
req.flags = ATACMD_READ;
req.features = ATA_SMART_IMMEDIATE_OFFLINE; /* XXX missing from wdcreg.h */
req.command = WDCC_SMART;
req.databuf = inbuf;
req.databuf = (char *)inbuf;
req.datalen = sizeof(inbuf);
req.cylinder = WDSMART_CYL;
req.sec_num = select;
......@@ -389,7 +389,7 @@ do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report)
memset(&sc, 0, sizeof(sc));
memcpy(sc.cmd, iop->cmnd, iop->cmnd_len);
sc.cmdlen = iop->cmnd_len;
sc.databuf = iop->dxferp;
sc.databuf = (char *)iop->dxferp;
sc.datalen = iop->dxfer_len;
sc.senselen = iop->max_sense_len;
sc.timeout = iop->timeout == 0 ? 60000 : (1000 * iop->timeout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment