4f796efffe
While here, fix other problems caught by gcc: - casting malloc instead of including <stdlib.h> - casting calloc instead of including <stdlib.h> - failing to include <time.h> with bad consequences for -current. PKGREVISION -> 5.
39 lines
852 B
Text
39 lines
852 B
Text
$NetBSD: patch-cdrom__sun_c,v 1.1 2011/09/04 22:05:39 dholland Exp $
|
|
|
|
- needs stdlib.h
|
|
- use calloc properly
|
|
|
|
--- cdrom_sun.c~ 1993-01-12 18:59:44.000000000 +0000
|
|
+++ cdrom_sun.c
|
|
@@ -27,6 +27,7 @@ static int c;
|
|
|
|
# include <mntent.h>
|
|
# include <string.h>
|
|
+# include <stdlib.h>
|
|
|
|
# include <sys/buf.h>
|
|
# ifdef sun4c
|
|
@@ -635,10 +636,9 @@ unsigned short *
|
|
ushort_malloc(n)
|
|
int n;
|
|
{
|
|
- extern char *calloc();
|
|
unsigned short *ptr;
|
|
|
|
- ptr = (unsigned short *) calloc(n, sizeof(unsigned short));
|
|
+ ptr = calloc(n, sizeof(unsigned short));
|
|
if (ptr == NULL) {
|
|
perror("calloc");
|
|
exit(1);
|
|
@@ -651,10 +651,9 @@ struct msf *
|
|
msf_malloc(n)
|
|
int n;
|
|
{
|
|
- extern char *calloc();
|
|
struct msf *ptr;
|
|
|
|
- ptr = (struct msf *) calloc(n, sizeof(struct msf));
|
|
+ ptr = calloc(n, sizeof(struct msf));
|
|
if (ptr == NULL) {
|
|
perror("calloc");
|
|
exit(1);
|