Skip to content

Commit 2086d80

Browse files
committed
af.h/c: make several structs const
1 parent 6457f82 commit 2086d80

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

addrtoname.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ init_protoidarray(void)
768768
{
769769
register int i;
770770
register struct protoidmem *tp;
771-
struct protoidlist *pl;
771+
const struct protoidlist *pl;
772772
u_char protoid[5];
773773

774774
protoid[0] = 0;
@@ -817,7 +817,7 @@ static const struct etherlist {
817817
static void
818818
init_etherarray(void)
819819
{
820-
register struct etherlist *el;
820+
register const struct etherlist *el;
821821
register struct enamemem *tp;
822822
#ifdef USE_ETHER_NTOHOST
823823
char name[256];

af.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static const char rcsid[] _U_ =
2828
#include "interface.h"
2929
#include "af.h"
3030

31-
struct tok af_values[] = {
31+
const struct tok af_values[] = {
3232
{ 0, "Reserved"},
3333
{ AFNUM_INET, "IPv4"},
3434
{ AFNUM_INET6, "IPv6"},
@@ -50,7 +50,7 @@ struct tok af_values[] = {
5050
{ 0, NULL},
5151
};
5252

53-
struct tok bsd_af_values[] = {
53+
const struct tok bsd_af_values[] = {
5454
{ BSD_AFNUM_INET, "IPv4" },
5555
{ BSD_AFNUM_NS, "NS" },
5656
{ BSD_AFNUM_ISO, "ISO" },

af.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* Original code by Hannes Gredler ([email protected])
1818
*/
1919

20-
extern struct tok af_values[];
21-
extern struct tok bsd_af_values[];
20+
extern const struct tok af_values[];
21+
extern const struct tok bsd_af_values[];
2222

2323
/* RFC1700 address family numbers */
2424
#define AFNUM_INET 1

0 commit comments

Comments
 (0)