Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Use "const" for all input parameters of ethers(3) functions.
details: https://anonhg.NetBSD.org/src/rev/3e268b77d6e8
branches: trunk
changeset: 536480:3e268b77d6e8
user: tron <tron%NetBSD.org@localhost>
date: Mon Sep 16 19:25:30 2002 +0000
description:
Use "const" for all input parameters of ethers(3) functions.
diffstat:
lib/libc/net/ethers.3 | 6 +++---
lib/libc/net/ethers.c | 10 +++++-----
sys/net/if_ether.h | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diffs (88 lines):
diff -r 226fc58da5b4 -r 3e268b77d6e8 lib/libc/net/ethers.3
--- a/lib/libc/net/ethers.3 Mon Sep 16 19:24:59 2002 +0000
+++ b/lib/libc/net/ethers.3 Mon Sep 16 19:25:30 2002 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: ethers.3,v 1.11 2002/08/06 16:08:47 soren Exp $
+.\" $NetBSD: ethers.3,v 1.12 2002/09/16 19:25:32 tron Exp $
.\"
.\" Written by roland%frob.com@localhost. Public domain.
.\"
@@ -20,11 +20,11 @@
.Fd #include \*[Lt]net/if.h\*[Gt]
.Fd #include \*[Lt]net/if_ether.h\*[Gt]
.Ft char *
-.Fn ether_ntoa "struct ether_addr *e"
+.Fn ether_ntoa "const struct ether_addr *e"
.Ft struct ether_addr *
.Fn ether_aton "const char *s"
.Ft int
-.Fn ether_ntohost "char *hostname" "struct ether_addr *e"
+.Fn ether_ntohost "char *hostname" "const struct ether_addr *e"
.Ft int
.Fn ether_hostton "const char *hostname" "struct ether_addr *e"
.Ft int
diff -r 226fc58da5b4 -r 3e268b77d6e8 lib/libc/net/ethers.c
--- a/lib/libc/net/ethers.c Mon Sep 16 19:24:59 2002 +0000
+++ b/lib/libc/net/ethers.c Mon Sep 16 19:25:30 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ethers.c,v 1.19 2000/10/04 14:46:23 sommerfeld Exp $ */
+/* $NetBSD: ethers.c,v 1.20 2002/09/16 19:25:33 tron Exp $ */
/*
* ethers(3N) a la Sun.
@@ -9,7 +9,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ethers.c,v 1.19 2000/10/04 14:46:23 sommerfeld Exp $");
+__RCSID("$NetBSD: ethers.c,v 1.20 2002/09/16 19:25:33 tron Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -45,13 +45,13 @@
char *
ether_ntoa(e)
- struct ether_addr *e;
+ const struct ether_addr *e;
{
static char a[18];
_DIAGASSERT(e != NULL);
- snprintf(a, sizeof a, "%02x:%02x:%02x:%02x:%02x:%02x",
+ (void) snprintf(a, sizeof a, "%02x:%02x:%02x:%02x:%02x:%02x",
e->ether_addr_octet[0], e->ether_addr_octet[1],
e->ether_addr_octet[2], e->ether_addr_octet[3],
e->ether_addr_octet[4], e->ether_addr_octet[5]);
@@ -83,7 +83,7 @@
int
ether_ntohost(hostname, e)
char *hostname;
- struct ether_addr *e;
+ const struct ether_addr *e;
{
FILE *f;
char *p;
diff -r 226fc58da5b4 -r 3e268b77d6e8 sys/net/if_ether.h
--- a/sys/net/if_ether.h Mon Sep 16 19:24:59 2002 +0000
+++ b/sys/net/if_ether.h Mon Sep 16 19:25:30 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ether.h,v 1.27 2002/03/05 04:13:00 itojun Exp $ */
+/* $NetBSD: if_ether.h,v 1.28 2002/09/16 19:25:30 tron Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -250,10 +250,10 @@
*/
#include <sys/cdefs.h>
__BEGIN_DECLS
-char * ether_ntoa __P((struct ether_addr *));
+char * ether_ntoa __P((const struct ether_addr *));
struct ether_addr *
ether_aton __P((const char *));
-int ether_ntohost __P((char *, struct ether_addr *));
+int ether_ntohost __P((char *, const struct ether_addr *));
int ether_hostton __P((const char *, struct ether_addr *));
int ether_line __P((const char *, struct ether_addr *, char *));
__END_DECLS
Home |
Main Index |
Thread Index |
Old Index