]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: Drop u_short type
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Aug 2011 16:50:49 +0000 (10:50 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Aug 2011 16:50:49 +0000 (10:50 -0600)
Use uint16_t for precise binary size or unsigned short instead.

45 files changed:
compat/getnameinfo.c
compat/os/mswin.h
helpers/basic_auth/RADIUS/basic_radius_auth.cc
helpers/basic_auth/RADIUS/radius.h
include/MemPool.h
include/MemPoolChunked.h
include/snmp_session.h
lib/ntlmauth/ntlmauth.cc
src/ClientDelayConfig.cc
src/ConfigParser.h
src/DelayConfig.cc
src/DelayPools.h
src/HttpRequest.h
src/Parsing.cc
src/Parsing.h
src/Store.h
src/StoreMeta.h
src/StoreSwapLogData.h
src/cache_cf.cc
src/comm.cc
src/comm.h
src/defines.h
src/delay_pools.cc
src/errorpage.h
src/fde.h
src/fs/ufs/ufscommon.cc
src/ftp.cc
src/htcp.cc
src/icmp/Icmp4.cc
src/icmp/Icmp6.cc
src/internal.cc
src/ip/Address.cc
src/ip/Address.h
src/ip/testAddress.cc
src/main.cc
src/neighbors.cc
src/protos.h
src/send-announce.cc
src/structs.h
src/tests/stub_cache_cf.cc
src/tests/testHttpRequest.cc
src/ufsdump.cc
src/url.cc
src/wccp2.cc
tools/purge/squid-tlv.hh

index 9dc5e1ce7ee1b8d225d1b740db3968a77d80ca44..92e423757baa274a891e95a6eb6fe29fae883f46 100644 (file)
@@ -156,7 +156,7 @@ int flags;
     const struct afd *afd;
     struct servent *sp;
     struct hostent *hp;
-    u_short port;
+    unsigned short port;
     int family, i;
     const char *addr;
     uint32_t v4a;
index 299c2bd7d630f01d6fb9e4352cb0282eb2bc5b15..45bcf4bcb211f1dd7ea54988c074ddf66490880d 100644 (file)
@@ -161,7 +161,6 @@ typedef unsigned long ino_t;
 #define SIGUSR1 30     /* user defined signal 1 */
 #define SIGUSR2 31     /* user defined signal 2 */
 
-typedef unsigned short int u_short;
 #if !_SQUID_CYGWIN_
 typedef int uid_t;
 typedef int gid_t;
index d219551873a5442496e3350959f91922e7236bf7..23708aebb9ce8c6198218660ead227e9abd73bae 100644 (file)
@@ -165,7 +165,7 @@ md5_calc(uint8_t out[16], void *in, size_t len)
  *    Receive and verify the result.
  */
 static int
-result_recv(uint32_t host, u_short udp_port, char *buffer, int length)
+result_recv(uint32_t host, unsigned short udp_port, char *buffer, int length)
 {
     AUTH_HDR *auth;
     int totallen;
@@ -280,7 +280,7 @@ static int
 authenticate(int socket_fd, const char *username, const char *passwd)
 {
     AUTH_HDR *auth;
-    u_short total_length;
+    unsigned short total_length;
     u_char *ptr;
     int length;
     char passbuf[MAXPASS];
@@ -445,7 +445,7 @@ main(int argc, char **argv)
     struct sockaddr_in salocal;
     struct sockaddr_in saremote;
     struct servent *svp;
-    u_short svc_port;
+    unsigned short svc_port;
     char username[MAXPWNAM];
     char passwd[MAXPASS];
     char *ptr;
@@ -510,7 +510,7 @@ main(int argc, char **argv)
      */
     svp = getservbyname(svc_name, "udp");
     if (svp != NULL)
-        svc_port = ntohs((u_short) svp->s_port);
+        svc_port = ntohs((unsigned short) svp->s_port);
     else
         svc_port = atoi(svc_name);
     if (svc_port == 0)
index aa5f3d6a7c6811e0695655a3878f8bea5817286e..fc16ed72ee7941588056a93ef417e5e627d1887d 100644 (file)
@@ -37,7 +37,7 @@
 typedef struct pw_auth_hdr {
     u_char             code;
     u_char             id;
-    u_short            length;
+    uint16_t           length;
     u_char             vector[AUTH_VECTOR_LEN];
     u_char             data[2];
 } AUTH_HDR;
index 1b0ff5aaa2b74e28fc6b267054b3d34839b74ee4..6da91221fbc5fe730f22727fe70ce940e406ca42 100644 (file)
@@ -57,7 +57,7 @@
 /// \ingroup MemPoolsAPI
 #define MEM_MIN_FREE  32
 /// \ingroup MemPoolsAPI
-#define MEM_MAX_FREE  65535    /* u_short is max number of items per chunk */
+#define MEM_MAX_FREE  65535    /* unsigned short is max number of items per chunk */
 
 class MemImplementingAllocator;
 class MemPoolStats;
index 874f25406c2cc041f63c5cd3091a14de1819db7f..78b24b83a0698ed33747698dda465fae0ec215a4 100644 (file)
@@ -12,7 +12,7 @@
 /// \ingroup MemPoolsAPI
 #define MEM_MIN_FREE  32
 /// \ingroup MemPoolsAPI
-#define MEM_MAX_FREE  65535    /* u_short is max number of items per chunk */
+#define MEM_MAX_FREE  65535    /* unsigned short is max number of items per chunk */
 
 class MemChunk;
 
index c5f64067605fb69ea57e3681af9322a0e3e0d6a5..bf962fae1d9a15641fd80c35f80fd52dbf96cc0d 100644 (file)
@@ -36,8 +36,8 @@ struct snmp_session {
     int retries;               /* Number of retries before timeout. */
     int timeout;               /* Number of uS until first timeout, then exponential backoff */
     char *peername;            /* Domain name or dotted IP address of default peer */
-    u_short remote_port;       /* UDP port number of peer. */
-    u_short local_port;                /* My UDP port number, 0 for default, picked randomly */
+    unsigned short remote_port;        /* UDP port number of peer. */
+    unsigned short local_port;         /* My UDP port number, 0 for default, picked randomly */
 };
 
 #define RECEIVED_MESSAGE   1
index 4bfa6ebfcf041854b059bc3a8a99a5a1a5819edb..a53900c994a620008a4d551af90a75f7e6f94ca4 100644 (file)
@@ -119,7 +119,7 @@ ntlm_fetch_string(const ntlmhdr *packet, const int32_t packet_size, const strhdr
     int32_t o;                 /* offset */
     static char buf[NTLM_MAX_FIELD_LENGTH];
     lstring rv;
-    u_short *s, c;
+    unsigned short *s, c;
     char *d, *sc;
 
     lstring_zero(rv);
@@ -135,7 +135,7 @@ ntlm_fetch_string(const ntlmhdr *packet, const int32_t packet_size, const strhdr
     rv.str = (char *)packet + o;
     if ((flags & NTLM_NEGOTIATE_ASCII) == 0) {
         /* UNICODE string */
-        s = (u_short *) ((char *) packet + o);
+        s = (unsigned short *) ((char *) packet + o);
         rv.str = d = buf;
 
         for (l >>= 1; l; s++, l--) {
index bdb670da01349ace0c79151ff27c26fecaebc040..61335b03f9dd7e4488aa8314fb131e0754eb51f8 100644 (file)
@@ -49,7 +49,7 @@ void ClientDelayConfig::parsePoolCount()
         debugs(3, 0, "parse_client_delay_pool_count: multiple client_delay_pools lines, aborting all previous client_delay_pools config");
         clean();
     }
-    u_short pools_;
+    unsigned short pools_;
     ConfigParser::ParseUShort(&pools_);
     for (int i = 0; i < pools_; i++) {
         pools.push_back(ClientDelayPool());
@@ -58,7 +58,7 @@ void ClientDelayConfig::parsePoolCount()
 
 void ClientDelayConfig::parsePoolRates()
 {
-    u_short pool;
+    unsigned short pool;
     ConfigParser::ParseUShort(&pool);
 
     if (pool < 1 || pool > pools.size()) {
@@ -74,7 +74,7 @@ void ClientDelayConfig::parsePoolRates()
 
 void ClientDelayConfig::parsePoolAccess(ConfigParser &parser)
 {
-    u_short pool;
+    unsigned short pool;
 
     ConfigParser::ParseUShort(&pool);
 
index 4d5a25ba6abdeca4ad4282f0a5343fd52409aaaa..3d47369d1fb47d6b991432fb48c394e6f46b84d2 100644 (file)
@@ -63,7 +63,7 @@ class ConfigParser
 
 public:
     void destruct();
-    static void ParseUShort(u_short *var);
+    static void ParseUShort(unsigned short *var);
     static void ParseBool(bool *var);
     static void ParseString(char **var);
     static void ParseString(String *var);
index 5691aff9a71014761242a6ae6638c944ed400997..9f3c1e76d9c1294e565f51f5bf5d77d76efd3bb9 100644 (file)
@@ -52,7 +52,7 @@
 void
 DelayConfig::parsePoolCount()
 {
-    u_short pools_;
+    unsigned short pools_;
     ConfigParser::ParseUShort(&pools_);
     DelayPools::pools(pools_);
 }
@@ -60,7 +60,7 @@ DelayConfig::parsePoolCount()
 void
 DelayConfig::parsePoolClass()
 {
-    u_short pool;
+    unsigned short pool;
 
     ConfigParser::ParseUShort(&pool);
 
@@ -69,7 +69,7 @@ DelayConfig::parsePoolClass()
         return;
     }
 
-    u_short delay_class_;
+    unsigned short delay_class_;
     ConfigParser::ParseUShort(&delay_class_);
 
     if (delay_class_ < 1 || delay_class_ > 5) {
@@ -85,7 +85,7 @@ DelayConfig::parsePoolClass()
 void
 DelayConfig::parsePoolRates()
 {
-    u_short pool;
+    unsigned short pool;
     ConfigParser::ParseUShort(&pool);
 
     if (pool < 1 || pool > DelayPools::pools()) {
@@ -106,7 +106,7 @@ DelayConfig::parsePoolRates()
 void
 DelayConfig::parsePoolAccess(ConfigParser &parser)
 {
-    u_short pool;
+    unsigned short pool;
 
     ConfigParser::ParseUShort(&pool);
 
index 4f258cea083cb218d9dc00869423afec97e96ebc..f7ff974e098e7b60247d48331744369187ab6457 100644 (file)
@@ -65,7 +65,7 @@ public:
     static void Init();
     static void Update(void *);
     static unsigned short pools();
-    static void pools (u_short pools);
+    static void pools(unsigned short pools);
     static void FreePools();
     static unsigned char *DelayClasses();
     static void registerForUpdates(Updateable *);
index 3de0af7cbb8d17864b866ead5bfa49fbcb3a7524..b9bea3e8c6dcb22e97b3d76bfe6dad6e94cf3738 100644 (file)
@@ -148,7 +148,7 @@ public:
 #if USE_AUTH
     AuthUserRequest::Pointer auth_user_request;
 #endif
-    u_short port;
+    unsigned short port;
 
     String urlpath;
 
index b5aef87741d23ff318d15252bb0f06918c888adc..e0371fc145c04972a1e9294a39c772145ce8e062 100644 (file)
@@ -111,7 +111,7 @@ GetInteger(void)
     return i;
 }
 
-u_short
+unsigned short
 GetShort(void)
 {
     char *token = strtok(NULL, w_space);
index 9bae0d6d20542ee0d8c16bed77e844634cedab01..2b78a0ca75b7bcec9a00fe31de692e6aeed5ca6e 100644 (file)
@@ -54,7 +54,7 @@ extern int64_t GetInteger64(void);
  */
 extern int GetInteger(void);
 
-extern u_short GetShort(void);
+extern unsigned short GetShort(void);
 
 // on success, returns true and sets *p (if any) to the end of the integer
 extern bool StringToInt(const char *str, int &result, const char **p, int base);
index 48fd9a31acfc5fcf68bbb9c0faa50a8afd70c3fc..c24b50cc0a1a4aacc8cd1e42621708c860265f5b 100644 (file)
@@ -152,15 +152,15 @@ public:
     time_t expires;
     time_t lastmod;
     uint64_t swap_file_sz;
-    u_short refcount;
-    u_short flags;
+    uint16_t refcount;
+    uint16_t flags;
     /* END OF ON-DISK STORE_META_STD */
 
     sfileno swap_filen:25;
 
     sdirno swap_dirn:7;
 
-    u_short lock_count;                /* Assume < 65536! */
+    unsigned short lock_count;         /* Assume < 65536! */
 
     mem_status_t mem_status:3;
 
index 0cecba927e19046f16ba7c28f5c126b04bb56644..250ae2d6864cd4ea76f20e3d8e5e6f72bbcfa661 100644 (file)
@@ -98,9 +98,9 @@ enum {
         time_t lastref;
         time_t expires;
         time_t lastmod;
-        size_t swap_file_sz;
-        u_short refcount;
-        u_short flags;
+        uint64_t swap_file_sz;
+        uint16_t refcount;
+        uint16_t flags;
      \endcode
      */
     STORE_META_STD,
index dbd576bc4dbbe059048724bd983c27c088b5ad9b..5fad46944fde8b61231e9a0d9696e365d7d8da9b 100644 (file)
@@ -146,14 +146,14 @@ public:
      * Since its a 16-bit quantity, it is susceptible to overflow
      * if a single object is accessed 65,536 times before being replaced.
      */
-    u_short refcount;
+    uint16_t refcount;
 
     /**
      * A copy of the StoreEntry flags field. Used as a sanity
      * check when rebuilding the cache at startup. Objects that
      * have the KEY_PRIVATE flag set are not added back to the cache.
      */
-    u_short flags;
+    uint16_t flags;
 
     /**
      * The 128-bit MD5 hash for this object.
index 40f3eb8e2bd7937ae71d8088e265851021b1a4d2..2a67a0e24e5fe630570b9d45697b4e365c11a119 100644 (file)
@@ -147,7 +147,7 @@ static void configDoConfigure(void);
 static void parse_refreshpattern(refresh_t **);
 static uint64_t parseTimeUnits(const char *unit,  bool allowMsec);
 static void parseTimeLine(time_msec_t * tptr, const char *units, bool allowMsec);
-static void parse_u_short(u_short * var);
+static void parse_u_short(unsigned short * var);
 static void parse_string(char **);
 static void default_all(void);
 static void defaults_if_none(void);
@@ -2090,7 +2090,7 @@ isUnsignedNumeric(const char *str, size_t len)
  \param proto  'tcp' or 'udp' for protocol
  \returns       Port the named service is supposed to be listening on.
  */
-static u_short
+static unsigned short
 GetService(const char *proto)
 {
     struct servent *port = NULL;
@@ -2104,7 +2104,7 @@ GetService(const char *proto)
     if ( !isUnsignedNumeric(token, strlen(token)) )
         port = getservbyname(token, proto);
     if (port != NULL) {
-        return ntohs((u_short)port->s_port);
+        return ntohs((unsigned short)port->s_port);
     }
     /** Or a numeric translation of the config text. */
     return xatos(token);
@@ -2114,7 +2114,7 @@ GetService(const char *proto)
  \returns       Port the named TCP service is supposed to be listening on.
  \copydoc GetService(const char *proto)
  */
-inline u_short
+inline unsigned short
 GetTcpService(void)
 {
     return GetService("tcp");
@@ -2124,7 +2124,7 @@ GetTcpService(void)
  \returns       Port the named UDP service is supposed to be listening on.
  \copydoc GetService(const char *proto)
  */
-inline u_short
+inline unsigned short
 GetUdpService(void)
 {
     return GetService("udp");
@@ -3195,25 +3195,25 @@ free_b_int64_t(int64_t * var)
 #define free_kb_int64_t free_b_int64_t
 
 static void
-dump_u_short(StoreEntry * entry, const char *name, u_short var)
+dump_u_short(StoreEntry * entry, const char *name, unsigned short var)
 {
     storeAppendPrintf(entry, "%s %d\n", name, var);
 }
 
 static void
-free_u_short(u_short * u)
+free_u_short(unsigned short * u)
 {
     *u = 0;
 }
 
 static void
-parse_u_short(u_short * var)
+parse_u_short(unsigned short * var)
 {
     ConfigParser::ParseUShort(var);
 }
 
 void
-ConfigParser::ParseUShort(u_short *var)
+ConfigParser::ParseUShort(unsigned short *var)
 {
     *var = GetShort();
 }
index a6ab545de771c507acf9ee3ffc0db90261f67d16..4b0938510bf6ad3deb7d3e0504dd2ad0961624aa 100644 (file)
@@ -362,7 +362,7 @@ comm_has_incomplete_write(int fd)
  */
 
 /* Return the local port associated with fd. */
-u_short
+unsigned short
 comm_local_port(int fd)
 {
     Ip::Address temp;
@@ -644,7 +644,7 @@ comm_apply_flags(int new_socket,
     if ((flags & COMM_REUSEADDR))
         commSetReuseAddr(new_socket);
 
-    if (addr.GetPort() > (u_short) 0) {
+    if (addr.GetPort() > (unsigned short) 0) {
 #if _SQUID_MSWIN_
         if (sock_type != SOCK_DGRAM)
 #endif
@@ -703,7 +703,7 @@ comm_import_opened(const Comm::ConnectionPointer &conn,
     if (!(conn->flags & COMM_NOCLOEXEC))
         fd_table[conn->fd].flags.close_on_exec = 1;
 
-    if (conn->local.GetPort() > (u_short) 0) {
+    if (conn->local.GetPort() > (unsigned short) 0) {
 #if _SQUID_MSWIN_
         if (AI->ai_socktype != SOCK_DGRAM)
 #endif
index 322d22ec93d10b291bce89c620799204b5d8d602..c4355e59756b5d8591bc48d928797978d96f7dd0 100644 (file)
@@ -52,7 +52,7 @@ extern int comm_open_listener(int sock_type, int proto, Ip::Address &addr, int f
 extern void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note);
 
 SQUIDCEXTERN int comm_openex(int, int, Ip::Address &, int, tos_t tos, nfmark_t nfmark, const char *);
-SQUIDCEXTERN u_short comm_local_port(int fd);
+SQUIDCEXTERN unsigned short comm_local_port(int fd);
 
 SQUIDCEXTERN int comm_udp_sendto(int sock, const Ip::Address &to, const void *buf, int buflen);
 SQUIDCEXTERN void commCallCloseHandlers(int fd);
index c0e2c87aa756c0a67fcdb39529f1c4a2647db2b9..5d9a81d0d4253dd226ea5b936265d15ad3dbe597 100644 (file)
 #define SwapMetaType(x) (char)x[0]
 #define SwapMetaSize(x) &x[sizeof(char)]
 #define SwapMetaData(x) &x[STORE_META_TLD_START]
-#define STORE_HDR_METASIZE (4*sizeof(time_t)+2*sizeof(u_short)+sizeof(uint64_t))
-#define STORE_HDR_METASIZE_OLD (4*sizeof(time_t)+2*sizeof(u_short)+sizeof(size_t))
+#define STORE_HDR_METASIZE (4*sizeof(time_t)+2*sizeof(uint16_t)+sizeof(uint64_t))
+#define STORE_HDR_METASIZE_OLD (4*sizeof(time_t)+2*sizeof(uint16_t)+sizeof(size_t))
 
 #define COUNT_INTERVAL 60
 /*
index 56a2561003a5623482e663d155cf3b3d6aefcbc6..890e3fdb39453877d25c9073ab8a4b7a8d895364 100644 (file)
@@ -669,7 +669,7 @@ DelayPools::pools()
 }
 
 void
-DelayPools::pools (u_short newPools)
+DelayPools::pools(unsigned short newPools)
 {
     if (pools()) {
         debugs(3, 0, "parse_delay_pool_count: multiple delay_pools lines, aborting all previous delay_pools config");
index 8eb3cb0caef21b7e6258d35d91c11c13016697b1..5d76575e80e5607590672e217cc30fe59200f4e3 100644 (file)
@@ -151,7 +151,7 @@ public:
     HttpRequest *request;
     char *url;
     int xerrno;
-    u_short port;
+    unsigned short port;
     String dnsError; ///< DNS lookup error message
     time_t ttl;
 
index 94cf3568df9e8a7d53cf173bc5d453361a8ee61a..f7ffa1c0c4de714f66d6e7df0a6e5d6ea8d3cbeb 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -57,7 +57,7 @@ public:
 
 public:
     unsigned int type;
-    u_short remote_port;
+    unsigned short remote_port;
 
     Ip::Address local_addr;
     tos_t tosToServer;          /**< The TOS value for packets going towards the server.
index 5c89a1d2ee12c924f7009b5b46795b4bdc272321..2fdceacd65d000f91a47414af388468e30de8e31 100644 (file)
@@ -63,8 +63,8 @@ public:
         time_t expires;
         time_t lastmod;
         uint32_t swap_file_sz;
-        u_short refcount;
-        u_short flags;
+        uint16_t refcount;
+        uint16_t flags;
         unsigned char key[SQUID_MD5_DIGEST_LENGTH];
     };
     UFSSwapLogParser_v1_32bs(FILE *fp):UFSSwapLogParser(fp) {
@@ -111,8 +111,8 @@ public:
         int32_t expires;
         int32_t lastmod;
         uint32_t swap_file_sz;
-        u_short refcount;
-        u_short flags;
+        uint16_t refcount;
+        uint16_t flags;
         unsigned char key[SQUID_MD5_DIGEST_LENGTH];
     };
     UFSSwapLogParser_v1_32bst(FILE *fp):UFSSwapLogParser(fp) {
@@ -157,8 +157,8 @@ public:
         time_t expires;
         time_t lastmod;
         uint64_t swap_file_sz;
-        u_short refcount;
-        u_short flags;
+        uint16_t refcount;
+        uint16_t flags;
         unsigned char key[SQUID_MD5_DIGEST_LENGTH];
     };
     UFSSwapLogParser_v1_64bfn(FILE *fp):UFSSwapLogParser(fp) {
@@ -380,8 +380,8 @@ struct InitStoreEntry : public unary_function<StoreMeta, void> {
                 time_t expires;
                 time_t lastmod;
                 size_t swap_file_sz;
-                u_short refcount;
-                u_short flags;
+                uint16_t refcount;
+                uint16_t flags;
             } *tmp;
             tmp = (struct old_metahdr *)x.value;
             assert(x.length == STORE_HDR_METASIZE_OLD);
index ee86185d0db93c76204886fd7e0f3104229f007b..150c4edaad3b801e73bf21ca287b6696b3f608be 100644 (file)
@@ -223,7 +223,7 @@ public:
     struct DataChannel: public FtpChannel {
         MemBuf *readBuf;
         char *host;
-        u_short port;
+        unsigned short port;
         bool read_pending;
     } data;
 
@@ -2431,7 +2431,7 @@ ftpReadEPSV(FtpStateData* ftpState)
     buf = ftpState->ctrl.last_reply + strcspn(ftpState->ctrl.last_reply, "(");
 
     char h1, h2, h3, h4;
-    u_short port;
+    unsigned short port;
     int n = sscanf(buf, "(%c%c%c%hu%c)", &h1, &h2, &h3, &port, &h4);
 
     if (n < 4 || h1 != h2 || h1 != h3 || h1 != h4) {
@@ -2644,7 +2644,7 @@ ftpReadPasv(FtpStateData * ftpState)
     int h1, h2, h3, h4;
     int p1, p2;
     int n;
-    u_short port;
+    unsigned short port;
     Ip::Address ipa_remote;
     char *buf;
     LOCAL_ARRAY(char, ipaddr, 1024);
index 96c67fc1a775aca72cc22fd6ef392a17dae9d889..5c5fbd90dddb3d1b3b3ed005863ab7a95620b0e9 100644 (file)
@@ -467,12 +467,12 @@ htcpBuildTstOpData(char *buf, size_t buflen, htcpStuff * stuff)
 static ssize_t
 htcpBuildClrOpData(char *buf, size_t buflen, htcpStuff * stuff)
 {
-    u_short reason;
+    unsigned short reason;
 
     switch (stuff->rr) {
     case RR_REQUEST:
         debugs(31, 3, "htcpBuildClrOpData: RR_REQUEST");
-        reason = htons((u_short)stuff->reason);
+        reason = htons((unsigned short)stuff->reason);
         memcpy(buf, &reason, 2);
         return htcpBuildSpecifier(buf + 2, buflen - 2, stuff) + 2;
     case RR_RESPONSE:
index e2edfc8a13258a6f62cad0085c011a312759af0b..f506d7ace4852d54652017d04242f1b312236de4 100644 (file)
@@ -117,7 +117,7 @@ Icmp4::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
     icmp->icmp_code = 0;
     icmp->icmp_cksum = 0;
     icmp->icmp_id = icmp_ident;
-    icmp->icmp_seq = (u_short) icmp_pkts_sent++;
+    icmp->icmp_seq = (unsigned short) icmp_pkts_sent++;
 
     // Construct ICMP packet data content
     echo = (icmpEchoData *) (icmp + 1);
@@ -135,7 +135,7 @@ Icmp4::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
         icmp_pktsize += len;
     }
 
-    icmp->icmp_cksum = CheckSum((u_short *) icmp, icmp_pktsize);
+    icmp->icmp_cksum = CheckSum((unsigned short *) icmp, icmp_pktsize);
 
     to.GetAddrInfo(S);
     ((sockaddr_in*)S->ai_addr)->sin_port = 0;
index 21dc01feddec2b03dd854526e9e9fa1fa7de9686..d8dcaa4b20b1da7a13b77b6c1d2e8b477364b3fc 100644 (file)
@@ -158,7 +158,7 @@ Icmp6::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
     icmp->icmp6_code = 0;
     icmp->icmp6_cksum = 0;
     icmp->icmp6_id = icmp_ident;
-    icmp->icmp6_seq = (u_short) icmp_pkts_sent++;
+    icmp->icmp6_seq = (unsigned short) icmp_pkts_sent++;
 
     icmp6_pktsize = sizeof(struct icmp6_hdr);
 
@@ -179,7 +179,7 @@ Icmp6::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
         icmp6_pktsize += len;
     }
 
-    icmp->icmp6_cksum = CheckSum((u_short *) icmp, icmp6_pktsize);
+    icmp->icmp6_cksum = CheckSum((unsigned short *) icmp, icmp6_pktsize);
 
     to.GetAddrInfo(S);
     ((sockaddr_in6*)S->ai_addr)->sin6_port = 0;
index 4e5be31c044edcd576ea12e875557782eee76d8f..8976164b5b1681034d1686af49b761ba9a5c4751 100644 (file)
@@ -97,7 +97,7 @@ internalStaticCheck(const char *urlpath)
  * makes internal url with a given host and port (remote internal url)
  */
 char *
-internalRemoteUri(const char *host, u_short port, const char *dir, const char *name)
+internalRemoteUri(const char *host, unsigned short port, const char *dir, const char *name)
 {
     static char lc_host[SQUIDHOSTNAMELEN];
     assert(host && name);
index a81da56bfb04bb2079790b8d5ebaed8fdaf88c58..d5095d88acbf20e527bf1f73108046e59447d348 100644 (file)
@@ -791,14 +791,14 @@ Ip::Address::operator <(const Ip::Address &rhs) const
     return ( matchIPAddr(rhs) < 0);
 }
 
-u_short
+unsigned short
 Ip::Address::GetPort() const
 {
     return ntohs( m_SocketAddr.sin6_port );
 }
 
-u_short
-Ip::Address::SetPort(u_short prt)
+unsigned short
+Ip::Address::SetPort(unsigned short prt)
 {
     m_SocketAddr.sin6_port = htons(prt);
 
index 8792d9c589da42e2b425d54c69ef58bd0cd20792..512ffd40e72833ee04af1cba9aec1e11a68fa8cb 100644 (file)
@@ -184,7 +184,7 @@ public:
      \retval 0 Port is unset or an error occured.
      \retval n Port associated with this address in host native -endian.
      */
-    u_short GetPort() const;
+    unsigned short GetPort() const;
 
     /** Set the Port value for an address.
      *  Replaces any previously existing Port value.
@@ -192,7 +192,7 @@ public:
      \retval 0 Port is unset or an error occured.
      \retval n Port associated with this address in host native -endian.
      */
-    u_short SetPort(u_short port);
+    unsigned short SetPort(unsigned short port);
 
     /// Set object to contain the specific IP case ANY_ADDR (format-neutral).
     /// see IsAnyAddr() for more detail.
index 310d201ee8f036e5843e372dbe323e28577351a7..180a0c2df4d6e987ba48a907a921d7415ea9a5f5 100644 (file)
@@ -43,7 +43,7 @@ testIpAddress::testDefaults()
     CPPUNIT_ASSERT( !anIPA.IsNoAddr() );
     CPPUNIT_ASSERT( !anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     CPPUNIT_ASSERT( anIPA.IsIPv6() );
 }
 
@@ -64,7 +64,7 @@ testIpAddress::testInAddrConstructor()
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     anIPA.GetInAddr(outval);
     CPPUNIT_ASSERT( memcmp(&inval, &outval, sizeof(struct in_addr)) == 0 );
 }
@@ -88,7 +88,7 @@ testIpAddress::testInAddr6Constructor()
     CPPUNIT_ASSERT( !anIPA.IsIPv4() );
     CPPUNIT_ASSERT( anIPA.IsIPv6() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     anIPA.GetInAddr(outval);
     CPPUNIT_ASSERT( memcmp( &inval, &outval, sizeof(struct in6_addr)) == 0 );
 }
@@ -117,7 +117,7 @@ testIpAddress::testSockAddrConstructor()
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
     CPPUNIT_ASSERT( anIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 80 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , anIPA.GetPort() );
     anIPA.GetSockAddr(outsock);
     CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in)) == 0 );
 }
@@ -149,7 +149,7 @@ testIpAddress::testSockAddr6Constructor()
     CPPUNIT_ASSERT( !anIPA.IsIPv4() );
     CPPUNIT_ASSERT( anIPA.IsIPv6() );
     CPPUNIT_ASSERT( anIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 80 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , anIPA.GetPort() );
     anIPA.GetSockAddr(outsock);
     CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in6)) == 0 );
 }
@@ -181,7 +181,7 @@ testIpAddress::testCopyConstructor()
     CPPUNIT_ASSERT( outIPA.IsIPv4() );
     CPPUNIT_ASSERT( !outIPA.IsIPv6() );
     CPPUNIT_ASSERT( outIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 80 , outIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , outIPA.GetPort() );
     outIPA.GetSockAddr(outsock);
     CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in)) == 0 );
 }
@@ -206,7 +206,7 @@ testIpAddress::testHostentConstructor()
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     anIPA.GetInAddr(outval);
     CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
 }
@@ -226,7 +226,7 @@ testIpAddress::testStringConstructor()
     CPPUNIT_ASSERT( !anIPA.IsNoAddr() );
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
     anIPA.GetInAddr(outval);
     CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
@@ -251,7 +251,7 @@ testIpAddress::testStringConstructor()
     CPPUNIT_ASSERT( !bnIPA.IsIPv4() );
     CPPUNIT_ASSERT(  bnIPA.IsIPv6() );
     CPPUNIT_ASSERT( !bnIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , bnIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , bnIPA.GetPort() );
     bnIPA.GetInAddr(outval6);
     CPPUNIT_ASSERT( memcmp( &expectv6, &outval6, sizeof(struct in6_addr)) == 0 );
 
@@ -269,7 +269,7 @@ testIpAddress::testStringConstructor()
     CPPUNIT_ASSERT( !cnIPA.IsIPv4() );
     CPPUNIT_ASSERT( cnIPA.IsIPv6() );
     CPPUNIT_ASSERT( !cnIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , cnIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , cnIPA.GetPort() );
     cnIPA.GetInAddr(outval6);
     CPPUNIT_ASSERT( memcmp( &expectv6, &outval6, sizeof(struct in6_addr)) == 0 );
 }
@@ -290,7 +290,7 @@ testIpAddress::testSetEmpty()
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
 
     anIPA.SetEmpty();
 
@@ -300,7 +300,7 @@ testIpAddress::testSetEmpty()
     CPPUNIT_ASSERT( !anIPA.IsIPv4() );
     CPPUNIT_ASSERT( anIPA.IsIPv6() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
 }
 
 void
@@ -740,7 +740,7 @@ testIpAddress::testBugNullingDisplay()
     CPPUNIT_ASSERT( !anIPA.IsNoAddr() );
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
     anIPA.GetInAddr(outval);
     CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
@@ -754,7 +754,7 @@ testIpAddress::testBugNullingDisplay()
     CPPUNIT_ASSERT( !anIPA.IsNoAddr() );
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
     anIPA.GetInAddr(outval);
     CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
@@ -769,7 +769,7 @@ testIpAddress::testBugNullingDisplay()
     CPPUNIT_ASSERT( !anIPA.IsNoAddr() );
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
     anIPA.GetInAddr(outval);
     CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
@@ -783,7 +783,7 @@ testIpAddress::testBugNullingDisplay()
     CPPUNIT_ASSERT( !anIPA.IsNoAddr() );
     CPPUNIT_ASSERT( anIPA.IsIPv4() );
     CPPUNIT_ASSERT( !anIPA.IsIPv6() );
-    CPPUNIT_ASSERT_EQUAL( (u_short) 0 , anIPA.GetPort() );
+    CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.GetPort() );
     CPPUNIT_ASSERT( !anIPA.IsSockAddr() );
     anIPA.GetInAddr(outval);
     CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
index 64531ce800f309bf6830a2fd068485dce01fdd60..f56501bcdb2bc88abc376b7d894d37cd448c53a1 100644 (file)
@@ -984,7 +984,7 @@ mainInitialize(void)
     setEffectiveUser();
 
     if (icpPortNumOverride != 1)
-        Config.Port.icp = (u_short) icpPortNumOverride;
+        Config.Port.icp = (unsigned short) icpPortNumOverride;
 
     _db_init(Debug::cache_log, Debug::debugOptions);
 
index 2c32190e4702c4813c391c5a49f3c08978b47a32..2254f56927fd4fec35d979a218baba67af892902 100644 (file)
@@ -77,7 +77,7 @@ static OBJH neighborDumpPeers;
 static OBJH neighborDumpNonPeers;
 static void dump_peers(StoreEntry * sentry, peer * peers);
 
-static u_short echo_port;
+static unsigned short echo_port;
 
 static int NLateReplies = 0;
 static peer *first_ping = NULL;
@@ -565,7 +565,7 @@ neighbors_init(void)
     peerRefreshDNS((void *) 1);
 
     sep = getservbyname("echo", "udp");
-    echo_port = sep ? ntohs((u_short) sep->s_port) : 7;
+    echo_port = sep ? ntohs((unsigned short) sep->s_port) : 7;
 
     first_ping = Config.peers;
 }
index 957a6aa217b626196258071b8850609bb1eecce1..858b42acbc33ae4b80823b074ffdf2cc4076f959 100644 (file)
@@ -599,7 +599,7 @@ SQUIDCEXTERN char *urlCanonicalClean(const HttpRequest *);
 SQUIDCEXTERN const char *urlCanonicalFakeHttps(const HttpRequest * request);
 SQUIDCEXTERN bool urlIsRelative(const char *);
 SQUIDCEXTERN char *urlMakeAbsolute(const HttpRequest *, const char *);
-SQUIDCEXTERN char *urlRInternal(const char *host, u_short port, const char *dir, const char *name);
+SQUIDCEXTERN char *urlRInternal(const char *host, unsigned short port, const char *dir, const char *name);
 SQUIDCEXTERN char *urlInternal(const char *dir, const char *name);
 SQUIDCEXTERN int matchDomainName(const char *host, const char *domain);
 SQUIDCEXTERN int urlCheckRequest(const HttpRequest *);
@@ -665,7 +665,7 @@ SQUIDCEXTERN void internalStart(const Comm::ConnectionPointer &clientConn, HttpR
 SQUIDCEXTERN int internalCheck(const char *urlpath);
 SQUIDCEXTERN int internalStaticCheck(const char *urlpath);
 SQUIDCEXTERN char *internalLocalUri(const char *dir, const char *name);
-SQUIDCEXTERN char *internalRemoteUri(const char *, u_short, const char *, const char *);
+SQUIDCEXTERN char *internalRemoteUri(const char *, unsigned short, const char *, const char *);
 SQUIDCEXTERN const char *internalHostname(void);
 SQUIDCEXTERN int internalHostnameIs(const char *);
 
index 085203d523d4509c1e124f6f0ccbd70cc8d52de3..03ea3e5624b9e3220e66bc51f06bdff4c400643d 100644 (file)
@@ -65,7 +65,7 @@ send_announce(const ipcache_addrs *ia, const DnsLookupDetails &, void *junk)
 
     char *host = Config.Announce.host;
     char *file = NULL;
-    u_short port = Config.Announce.port;
+    unsigned short port = Config.Announce.port;
     int l;
     int n;
     int fd;
index c48581684135b544d2a9f0c383981673e2e51145..0cc7c260675d1f38ebb93c1d6c4d531723db2757 100644 (file)
@@ -117,7 +117,7 @@ struct acl_size_t {
 };
 
 struct ushortlist {
-    u_short i;
+    unsigned short i;
     ushortlist *next;
 };
 
@@ -206,14 +206,14 @@ struct SquidConfig {
     acl_size_t *ReplyBodySize;
 
     struct {
-        u_short icp;
+        unsigned short icp;
 #if USE_HTCP
 
-        u_short htcp;
+        unsigned short htcp;
 #endif
 #if SQUID_SNMP
 
-        u_short snmp;
+        unsigned short snmp;
 #endif
     } Port;
 
@@ -322,7 +322,7 @@ struct SquidConfig {
         char *host;
         char *file;
         time_t period;
-        u_short port;
+        unsigned short port;
     } Announce;
 
     struct {
@@ -815,18 +815,18 @@ struct peer {
     struct {
         int version;
         int counts[ICP_END+1];
-        u_short port;
+        unsigned short port;
     } icp;
 
 #if USE_HTCP
     struct {
         double version;
         int counts[2];
-        u_short port;
+        unsigned short port;
     } htcp;
 #endif
 
-    u_short http_port;
+    unsigned short http_port;
     domain_ping *peer_domain;
     domain_type *typelist;
     acl_access *access;
index 9c3e7fb7ca39ec9aa0051b429860ee12c136e66e..9844b745fa47237cf16aabc06041eeee4bfd8450 100644 (file)
@@ -104,7 +104,7 @@ strtokFile(void)
 }
 
 void
-ConfigParser::ParseUShort(u_short *var)
+ConfigParser::ParseUShort(unsigned short *var)
 {
     fatal("not implemented 10");
 }
index a2337de040ce6800581d844b2e3bb5894d6ebc1b..01d0a3c6de084a06c2ba6a669eee0146ed632efb 100644 (file)
@@ -33,7 +33,7 @@ void
 testHttpRequest::testCreateFromUrlAndMethod()
 {
     /* vanilla url */
-    u_short expected_port;
+    unsigned short expected_port;
     char * url = xstrdup("http://foo:90/bar");
     HttpRequest *aRequest = HttpRequest::CreateFromUrlAndMethod(url, METHOD_GET);
     expected_port = 90;
@@ -83,7 +83,7 @@ void
 testHttpRequest::testCreateFromUrl()
 {
     /* vanilla url */
-    u_short expected_port;
+    unsigned short expected_port;
     char * url = xstrdup("http://foo:90/bar");
     HttpRequest *aRequest = HttpRequest::CreateFromUrl(url);
     expected_port = 90;
@@ -102,7 +102,7 @@ testHttpRequest::testCreateFromUrl()
 void
 testHttpRequest::testIPv6HostColonBug()
 {
-    u_short expected_port;
+    unsigned short expected_port;
     char * url = NULL;
     HttpRequest *aRequest = NULL;
 
index 401cbdb6bb9cf188d77db1979200d8ea08d12bc0..a3545de45e577d9bfddd773141534898204b4ede 100644 (file)
@@ -98,8 +98,8 @@ struct MetaStd {
     time_t expires;
     time_t lastmod;
     size_t swap_file_sz;
-    u_short refcount;
-    u_short flags;
+    uint16_t refcount;
+    uint16_t flags;
 };
 
 struct MetaStdLfs {
@@ -108,8 +108,8 @@ struct MetaStdLfs {
     time_t expires;
     time_t lastmod;
     uint64_t swap_file_sz;
-    u_short refcount;
-    u_short flags;
+    uint16_t refcount;
+    uint16_t flags;
 };
 
 struct DumpStoreMeta : public unary_function<StoreMeta, void> {
index 6abba4006edfe4e84dd23e86109e28cb207c42e7..ee1ec393aba4630706a99b0196f001e945ee15e3 100644 (file)
@@ -447,7 +447,7 @@ urlParseFinish(const HttpRequestMethod& method,
 
     request->SetHost(host);
     xstrncpy(request->login, login, MAX_LOGIN_SZ);
-    request->port = (u_short) port;
+    request->port = (unsigned short) port;
     return request;
 }
 
index 518dbe998b629ebde3628d614d0450bf52a7bc95..4e952aa09ba59c173c350d617ff8d0349c37fef7 100644 (file)
@@ -1630,7 +1630,7 @@ wccp2AssignBuckets(void *voidnotused)
     int router_len;
     int bucket_counter;
     uint32_t service_flags;
-    u_short port = WCCP_PORT;
+    unsigned short port = WCCP_PORT;
 
     /* Packet segments */
 
index a8531d2c1907d8154af01da42c90525bd7fe2230..1d9316d97e9fd50a095b93ca466e963f0fc6752e 100644 (file)
@@ -78,8 +78,8 @@ struct StoreMetaStd {
   time_t  expires;
   time_t  lastmod;
   size_t  swap_file_sz;
-  u_short refcount;
-  u_short flags;
+  uint16_t refcount;
+  uint16_t flags;
 };
 
 struct StoreMetaStdLFS {
@@ -87,9 +87,9 @@ struct StoreMetaStdLFS {
   time_t  lastref;
   time_t  expires;
   time_t  lastmod;
-  uint64_t  swap_file_sz;
-  u_short refcount;
-  u_short flags;
+  uint64_t swap_file_sz;
+  uint16_t refcount;
+  uint16_t flags;
 };
 
 struct SquidTLV {