Commit e422ca0f authored by Ondrej Zajicek (work)'s avatar Ondrej Zajicek (work)
Browse files

Some consts for function arguments

Patch from Pavel Tvrdik
parent 5126380b
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -233,7 +233,7 @@ ip6_ntop(ip6_addr a, char *b)
}
}


int
int
ip4_pton(char *a, ip4_addr *o)
ip4_pton(const char *a, ip4_addr *o)
{
{
  int i;
  int i;
  unsigned long int l;
  unsigned long int l;
@@ -258,11 +258,11 @@ ip4_pton(char *a, ip4_addr *o)
}
}


int
int
ip6_pton(char *a, ip6_addr *o)
ip6_pton(const char *a, ip6_addr *o)
{
{
  u16 words[8];
  u16 words[8];
  int i, j, k, l, hfil;
  int i, j, k, l, hfil;
  char *start;
  const char *start;


  if (a[0] == ':')			/* Leading :: */
  if (a[0] == ':')			/* Leading :: */
  {
  {
+2 −2
Original line number Original line Diff line number Diff line
@@ -446,8 +446,8 @@ static inline char * ip4_ntox(ip4_addr a, char *b)
static inline char * ip6_ntox(ip6_addr a, char *b)
static inline char * ip6_ntox(ip6_addr a, char *b)
{ return b + bsprintf(b, "%08x.%08x.%08x.%08x", _I0(a), _I1(a), _I2(a), _I3(a)); }
{ return b + bsprintf(b, "%08x.%08x.%08x.%08x", _I0(a), _I1(a), _I2(a), _I3(a)); }


int ip4_pton(char *a, ip4_addr *o);
int ip4_pton(const char *a, ip4_addr *o);
int ip6_pton(char *a, ip6_addr *o);
int ip6_pton(const char *a, ip6_addr *o);


// XXXX these functions must be redesigned or removed
// XXXX these functions must be redesigned or removed
#ifdef IPV6
#ifdef IPV6
+1 −1
Original line number Original line Diff line number Diff line
@@ -16,7 +16,7 @@
#endif
#endif


int
int
MATCH_FUNC_NAME(byte *p, byte *s)
MATCH_FUNC_NAME(const byte *p, const byte *s)
{
{
  while (*p)
  while (*p)
    {
    {
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,6 +22,6 @@ int buffer_vprint(buffer *buf, const char *fmt, va_list args);
int buffer_print(buffer *buf, const char *fmt, ...);
int buffer_print(buffer *buf, const char *fmt, ...);
void buffer_puts(buffer *buf, const char *str);
void buffer_puts(buffer *buf, const char *str);


int patmatch(byte *pat, byte *str);
int patmatch(const byte *pat, const byte *str);


#endif
#endif
+2 −2
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@
#include "lib/string.h"
#include "lib/string.h"


static inline u16
static inline u16
get_u16(void *p)
get_u16(const void *p)
{
{
  u16 x;
  u16 x;
  memcpy(&x, p, 2);
  memcpy(&x, p, 2);
@@ -28,7 +28,7 @@ get_u16(void *p)
}
}


static inline u32
static inline u32
get_u32(void *p)
get_u32(const void *p)
{
{
  u32 x;
  u32 x;
  memcpy(&x, p, 4);
  memcpy(&x, p, 4);