Massive constification.
[openssl.git] / crypto / bio / b_sock.c
index 402439cc2ef156f0042e1be148abe478572c6183..a1a37605e3b7d2d5517c18cc2730d5c52adfec13 100644 (file)
@@ -97,7 +97,7 @@ static struct ghbn_cache_st
        } ghbn_cache[GHBN_NUM];
 
 #ifndef NOPROTO
-static int get_ip(char *str,unsigned char *ip);
+static int get_ip(const char *str,unsigned char *ip);
 static void ghbn_free(struct hostent *a);
 static struct hostent *ghbn_dup(struct hostent *a);
 #else
@@ -107,7 +107,7 @@ static struct hostent *ghbn_dup();
 #endif
 
 int BIO_get_host_ip(str,ip)
-char *str;
+const char *str;
 unsigned char *ip;
        {
        int i;
@@ -147,7 +147,7 @@ unsigned char *ip;
        }
 
 int BIO_get_port(str,port_ptr)
-char *str;
+const char *str;
 unsigned short *port_ptr;
        {
        int i;
@@ -330,7 +330,7 @@ struct hostent *a;
        }
 
 struct hostent *BIO_gethostbyname(name)
-char *name;
+const char *name;
        {
        struct hostent *ret;
        int i,lowi=0,j;
@@ -439,7 +439,7 @@ unsigned long *arg;
 /* The reason I have implemented this instead of using sscanf is because
  * Visual C 1.52c gives an unresolved external when linking a DLL :-( */
 static int get_ip(str,ip)
-char *str;
+const char *str;
 unsigned char ip[4];
        {
        unsigned int tmp[4];
@@ -483,8 +483,9 @@ int bind_mode;
        struct sockaddr_in server,client;
        int s= -1,cs;
        unsigned char ip[4];
-       short port;
-       char *str,*h,*p,*e;
+       unsigned short port;
+       char *str,*e;
+       const char *h,*p;
        unsigned long l;
        int err_num;
 
@@ -518,7 +519,7 @@ int bind_mode;
 
        memset((char *)&server,0,sizeof(server));
        server.sin_family=AF_INET;
-       server.sin_port=htons((unsigned short)port);
+       server.sin_port=htons(port);
 
        if (strcmp(h,"*") == 0)
                server.sin_addr.s_addr=INADDR_ANY;
@@ -610,7 +611,7 @@ char **addr;
        int ret=INVALID_SOCKET;
        static struct sockaddr_in from;
        unsigned long l;
-       short port;
+       unsigned short port;
        int len;
        char *p;