Skip to content

Commit

Permalink
ANSIify libsa functions
Browse files Browse the repository at this point in the history
Convert libsa files to use ANSI function definitions.

Pull request: freebsd/freebsd-src#508
[ cut and paste error corrected ]

(cherry picked from commit 1f62996)
  • Loading branch information
AZero13 authored and bsdimp committed Dec 6, 2021
1 parent b77d660 commit 85ba40d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 21 deletions.
9 changes: 3 additions & 6 deletions stand/libsa/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,19 @@ __FBSDID("$FreeBSD$");
#include "stand.h"

int
nodev()
nodev(void)
{
return (ENXIO);
}

void
nullsys()
nullsys(void)
{
}

/* ARGSUSED */
int
noioctl(f, cmd, data)
struct open_file *f;
u_long cmd;
void *data;
noioctl(struct open_file *f __unused, u_long cmd __unused, void *data __unused)
{
return (EINVAL);
}
4 changes: 1 addition & 3 deletions stand/libsa/in_cksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ __FBSDID("$FreeBSD$");
* In particular, it should not be this one.
*/
int
in_cksum(p, len)
void *p;
int len;
in_cksum(void *p, int len)
{
int sum = 0, oddbyte = 0, v = 0;
u_char *cp = p;
Expand Down
3 changes: 1 addition & 2 deletions stand/libsa/inet_ntoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ static char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93";
* to base 256 d.d.d.d representation.
*/
char *
inet_ntoa(in)
struct in_addr in;
inet_ntoa(struct in_addr in)
{
static const char fmt[] = "%u.%u.%u.%u";
static char ret[sizeof "255.255.255.255"];
Expand Down
4 changes: 1 addition & 3 deletions stand/libsa/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
#include "stand.h"

int
stat(str, sb)
const char *str;
struct stat *sb;
stat(const char *str, struct stat *sb)
{
int fd, rv;

Expand Down
7 changes: 2 additions & 5 deletions stand/libsa/strcasecmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */

int
strcasecmp(s1, s2)
const char *s1, *s2;
strcasecmp(const char *s1, const char *s2)
{
const u_char
*us1 = (const u_char *)s1,
Expand All @@ -53,9 +52,7 @@ strcasecmp(s1, s2)
}

int
strncasecmp(s1, s2, n)
const char *s1, *s2;
size_t n;
strncasecmp(const char *s1, const char *s2, size_t n)
{
if (n != 0) {
const u_char
Expand Down
3 changes: 1 addition & 2 deletions stand/libsa/strdup.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93";
#include <string.h>

char *
strdup(str)
const char *str;
strdup(const char *str)
{
size_t len;
char *copy = NULL;
Expand Down

0 comments on commit 85ba40d

Please sign in to comment.