Skip to content
Snippets Groups Projects
Commit d0579b17 authored by snyderx's avatar snyderx
Browse files

As Douglas and Sergey (thanks) pointed out and corrected, C++ needs explicit...

As Douglas and Sergey (thanks) pointed out and corrected, C++ needs explicit casts on some of the function returns and data transfers.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2263 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 36e9956c
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@
#include "utility.h"
#include "os_openbsd.h"
const char *os_XXXX_c_cvsid = "$Id: os_openbsd.cpp,v 1.11 2006/08/25 06:06:25 sxzzsf Exp $" \
const char *os_XXXX_c_cvsid = "$Id: os_openbsd.cpp,v 1.12 2006/09/19 07:22:09 snyderx Exp $" \
ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_OPENBSD_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
/* global variable holding byte count of allocated memory */
......@@ -105,7 +105,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;
}
......@@ -121,7 +121,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;
......@@ -131,7 +131,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;
......@@ -390,7 +390,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 : iop->timeout; /* XXX */
......
......@@ -26,7 +26,7 @@
#ifndef OS_OPENBSD_H_
#define OS_OPENBSD_H_
#define OS_OPENBSD_H_CVSID "$Id: os_openbsd.h,v 1.4 2006/04/12 14:54:28 ballen4705 Exp $\n"
#define OS_OPENBSD_H_CVSID "$Id: os_openbsd.h,v 1.5 2006/09/19 07:22:09 snyderx Exp $\n"
/* from NetBSD: atareg.h,v 1.17, by Manuel Bouyer */
/* Actually fits _perfectly_ into OBSDs wdcreg.h, but... */
......@@ -51,5 +51,6 @@
#include <err.h>
#include <fcntl.h>
#include <util.h>
#include <unistd.h>
#endif /* OS_OPENBSD_H_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment