]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Compat: cleanup several config.h hacks
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 13 Dec 2010 11:31:14 +0000 (00:31 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 13 Dec 2010 11:31:14 +0000 (00:31 +1300)
* removes the xmemcpy and xmemmove hacks. Squid has been building for some
  long time without them being consistently used all-over. No complaints.
  bcopy() alternative is still use if needed. However main code can now
  use memcpy( )and memmove() without special X knowledge.

* shuffle strnstr replacement into libcompat from libmisc

* shuffles xis*() function wrappers for is*() with type-casting into compat

No operational changes.

74 files changed:
compat/GnuRegex.c
compat/Makefile.am
compat/compat_shared.h
compat/os/mswin.h
compat/strnstr.cc [moved from lib/strnstr.cc with 96% similarity]
compat/xalloc.cc
compat/xis.h [new file with mode: 0644]
doc/Programming-Guide/02_CodingConventions.dox
include/config.h
include/strnstr.h [deleted file]
lib/Makefile.am
snmplib/asn1.c
snmplib/snmp_pdu.c
snmplib/snmp_vars.c
src/CacheDigest.cc
src/CpuAffinitySet.cc
src/DiskIO/DiskDaemon/DiskdFile.cc
src/DiskIO/DiskThreads/aiops.cc
src/DiskIO/DiskThreads/aiops_win32.cc
src/MemBuf.cc
src/MemObject.cc
src/StatHist.cc
src/StoreMeta.cc
src/StoreMetaUnpacker.cc
src/String.cc
src/acl/Asn.cc
src/acl/TimeData.cc
src/cache_diff.cc
src/client_side.cc
src/client_side_reply.cc
src/comm_select.cc
src/comm_select_win32.cc
src/disk.cc
src/dns_internal.cc
src/esi/Esi.cc
src/esi/Include.cc
src/esi/Segment.cc
src/filemap.cc
src/fs/coss/store_dir_coss.cc
src/fs/coss/store_io_coss.cc
src/fs/ufs/store_dir_ufs.cc
src/fs/ufs/ufscommon.cc
src/ftp.cc
src/gopher.cc
src/htcp.cc
src/http.cc
src/icmp/Icmp4.cc
src/icmp/Icmp6.cc
src/icmp/IcmpPinger.cc
src/icmp/IcmpSquid.cc
src/icmp/net_db.cc
src/icp_v2.cc
src/ipc/TypedMsgHdr.cc
src/ipcache.cc
src/log/ModDaemon.cc
src/log/ModStdio.cc
src/log/ModTcp.cc
src/log/ModUdp.cc
src/pconn.cc
src/peer_digest.cc
src/recv-announce.cc
src/snmp_core.cc
src/stat.cc
src/stmem.cc
src/store_client.cc
src/store_dir.cc
src/store_key_md5.cc
src/store_swapmeta.cc
src/test_cache_digest.cc
src/url.cc
src/urn.cc
src/wccp.cc
src/wccp2.cc
test-suite/pconn-banger.c

index 86cdc2962fa4f5beb32ff8691ae54d445e413bff..3bfa598942fa3e011b62b25d06d594f3305fecf4 100644 (file)
@@ -214,7 +214,7 @@ char *alloca();
 /* Assumes a `char *destination' variable.  */
 #define REGEX_REALLOCATE(source, osize, nsize)                         \
   (destination = (char *) alloca (nsize),                              \
-   xmemcpy (destination, source, osize),                               \
+   memcpy (destination, source, osize),                                \
    destination)
 
 #endif /* not REGEX_MALLOC */
index 21abe287e7f852ac3024072b72fe79ee0d8de829..671c5106d1d0ab293290b0625e9ae5f262380cb6 100644 (file)
@@ -32,6 +32,7 @@ libcompat_squid_a_SOURCES = \
        osdetect.h \
        psignal.h \
        stdvarargs.h \
+       strnstr.cc \
        strsep.h \
        strtoll.h \
        tempnam.h \
@@ -40,6 +41,7 @@ libcompat_squid_a_SOURCES = \
        valgrind.h \
        xalloc.cc \
        xalloc.h \
+       xis.h \
        xstrerror.cc \
        xstrerror.h \
        xstring.cc \
index 6e63e635bdbb1da68def1b824d5ecae01b52f39c..3ca876b2c38418eb2239a873c45c71f3aa55b3d9 100644 (file)
@@ -205,6 +205,41 @@ extern "C" {
 #include "compat/xstrerror.h"
 #include "compat/xstring.h"
 #include "compat/xstrto.h"
+#include "compat/xis.h"
 
+#if !HAVE_MEMCPY
+#if HAVE_BCOPY
+#define memcpy(d,s,n) bcopy((s),(d),(n))
+#elif HAVE_MEMMOVE
+#define memcpy(d,s,n) memmove((d),(s),(n))
+#endif
+#endif
+
+#if !HAVE_MEMMOVE && HAVE_BCOPY
+#define memmove(d,s,n) bcopy((s),(d),(n))
+#endif
+
+/*
+ * strnstr() is needed. The OS may not provide a working copy.
+ */
+#if HAVE_STRNSTR
+/* If strnstr exists and is usable we do so. */
+#define squid_strnstr(a,b,c)    strnstr(a,b,c)
+#else
+/* If not we have our own copy imported from FreeBSD */
+const char * squid_strnstr(const char *s, const char *find, size_t slen);
+#endif
+
+#if __GNUC__
+#if !defined(PRINTF_FORMAT_ARG1)
+#define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2)))
+#endif
+#if !defined(PRINTF_FORMAT_ARG2)
+#define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3)))
+#endif
+#if !defined(PRINTF_FORMAT_ARG3)
+#define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4)))
+#endif
+#endif
 
 #endif /* _SQUID_COMPAT_SHARED_H */
index f59dd621d8a1d272a796d8b59dd011919d577de8..15beb902f2d34f98282b18352c37768110f29b0d 100644 (file)
@@ -749,5 +749,14 @@ struct rusage {
 SQUIDCEXTERN size_t getpagesize(void);
 #endif
 
+/* gcc doesn't recognize the Windows native 64 bit formatting tags causing
+ * the compile fail, so we must disable the check on native Windows.
+ */
+#if __GNUC__
+#define PRINTF_FORMAT_ARG1
+#define PRINTF_FORMAT_ARG2
+#define PRINTF_FORMAT_ARG3
+#endif
+
 #endif /* _SQUID_WIN32_ */
 #endif /* SQUID_OS_MSWIN_H */
similarity index 96%
rename from lib/strnstr.cc
rename to compat/strnstr.cc
index 4d7676fdb6ffe977cb76d09e8e23491e19585e50..3c86e170c00eb7a88dd3b5ad35d49536d137f60a 100644 (file)
@@ -1,5 +1,6 @@
-#ifndef _SQUID_COMPAT_STRNSTR_C_
-#define _SQUID_COMPAT_STRNSTR_C_
+#ifndef _SQUID_COMPAT_STRNSTR_CC_
+#define _SQUID_COMPAT_STRNSTR_CC_
+
 /*
  *  Shamelessly duplicated from the FreeBSD public sources
  *  for use by the Squid Project under GNU Public License.
@@ -17,7 +18,6 @@
  */
 
 #include "config.h"
-#include "strnstr.h"
 
 #if !HAVE_STRNSTR
 
@@ -65,7 +65,7 @@
 #include <string.h>
 #endif
 
-/*
+/**
  * Find the first occurrence of find in s, where the search is limited to the
  * first slen characters of s.
  */
@@ -93,4 +93,4 @@ squid_strnstr(const char *s, const char *find, size_t slen)
 }
 
 #endif /* !HAVE_STRNSTR */
-#endif /* _SQUID_COMPAT_STRNSTR_C_ */
+#endif /* _SQUID_COMPAT_STRNSTR_CC_ */
index c1e59773c617db1b55f936d946c7b6aa3611f0e5..a9f6cf5376a3bea237779860ee2aceb685758c57 100644 (file)
@@ -56,7 +56,7 @@ malloc_statistics(void (*func) (int, int, int, void *), void *data)
     for (; i <= XMS_DBG_MAXSIZE; i += XMS_DBG_GRAIN)
         func(i, malloc_sizes[XMS_DBG_INDEX(i)], malloc_histo[XMS_DBG_INDEX(i)], data);
 
-    xmemcpy(&malloc_histo, &malloc_sizes, sizeof(malloc_sizes));
+    memcpy(&malloc_histo, &malloc_sizes, sizeof(malloc_sizes));
 }
 #endif /* XMALLOC_STATISTICS */
 
diff --git a/compat/xis.h b/compat/xis.h
new file mode 100644 (file)
index 0000000..0e5eac1
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _SQUID_COMPAT_XIS_H
+#define _SQUID_COMPAT_XIS_H
+
+#if HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+#define xisspace(x) isspace((unsigned char)x)
+#define xtoupper(x) toupper((unsigned char)x)
+#define xtolower(x) tolower((unsigned char)x)
+#define xisdigit(x) isdigit((unsigned char)x)
+#define xisascii(x) isascii((unsigned char)x)
+#define xislower(x) islower((unsigned char)x)
+#define xisalpha(x) isalpha((unsigned char)x)
+#define xisprint(x) isprint((unsigned char)x)
+#define xisalnum(x) isalnum((unsigned char)x)
+#define xiscntrl(x) iscntrl((unsigned char)x)
+#define xispunct(x) ispunct((unsigned char)x)
+#define xisupper(x) isupper((unsigned char)x)
+#define xisxdigit(x) isxdigit((unsigned char)x)
+#define xisgraph(x) isgraph((unsigned char)x)
+
+#endif /* _SQUID_COMPAT_XIS_H */
index bb99c8d2f859c40a66ccbe77731c3f1cd4bb2b85..22bccd5d5249d32fade98864cd821febd1560bea 100644 (file)
@@ -176,7 +176,7 @@ fubar(char *g, int glen, void *state) {
      * then passes the state off to FUBAR.
      * No check for null-termination is done.
      */
-   xmemcpy(g, glen, state->foo_end_ptr );
+   memcpy(g, glen, state->foo_end_ptr );
    state->foo_end_ptr += glen;
    fubar(state);
 }
index 4ae2da08ffcd6e566d6427b115c37b4319ccddde..34ae37b4170c50f8e3eccd8f76449ec08867f467 100644 (file)
 #define SQUID_UDP_SO_RCVBUF SQUID_DETECT_UDP_SO_RCVBUF
 #endif
 
-#if HAVE_MEMCPY
-#define xmemcpy(d,s,n) memcpy((d),(s),(n))
-#elif HAVE_BCOPY
-#define xmemcpy(d,s,n) bcopy((s),(d),(n))
-#elif HAVE_MEMMOVE
-#define xmemcpy(d,s,n) memmove((d),(s),(n))
-#endif
-
-#if HAVE_MEMMOVE
-#define xmemmove(d,s,n) memmove((d),(s),(n))
-#elif HAVE_BCOPY
-#define xmemmove(d,s,n) bcopy((s),(d),(n))
-#endif
-
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#define xisspace(x) isspace((unsigned char)x)
-#define xtoupper(x) toupper((unsigned char)x)
-#define xtolower(x) tolower((unsigned char)x)
-#define xisdigit(x) isdigit((unsigned char)x)
-#define xisascii(x) isascii((unsigned char)x)
-#define xislower(x) islower((unsigned char)x)
-#define xisalpha(x) isalpha((unsigned char)x)
-#define xisprint(x) isprint((unsigned char)x)
-#define xisalnum(x) isalnum((unsigned char)x)
-#define xiscntrl(x) iscntrl((unsigned char)x)
-#define xispunct(x) ispunct((unsigned char)x)
-#define xisupper(x) isupper((unsigned char)x)
-#define xisxdigit(x) isxdigit((unsigned char)x)
-#define xisgraph(x) isgraph((unsigned char)x)
-
 #if HAVE_RANDOM
 #define squid_random random
 #define squid_srandom srandom
 #define squid_srandom srand
 #endif
 
-/* gcc doesn't recognize the Windows native 64 bit formatting tags causing
- * the compile fail, so we must disable the check on native Windows.
- */
-
-#if __GNUC__ && !defined(_SQUID_MSWIN_)
-#define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2)))
-#define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3)))
-#define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4)))
-#else
-#define PRINTF_FORMAT_ARG1
-#define PRINTF_FORMAT_ARG2
-#define PRINTF_FORMAT_ARG3
-#endif
-
 /*
  * Determine if this is a leak check build or standard
  */
 /* temp hack: needs to be pre-defined for now. */
 #define SQUID_MAXPATHLEN 256
 
-/*
- * strnstr() is needed. The OS may not provide a working copy.
- */
-#include "strnstr.h"
-
 #endif /* SQUID_CONFIG_H */
diff --git a/include/strnstr.h b/include/strnstr.h
deleted file mode 100644 (file)
index 4173160..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#if HAVE_STRNSTR
-
-/* Is strnstr exists and is usable we do so. */
-#define squid_strnstr(a,b,c)   strnstr(a,b,c)
-
-#else /* not HAVE_STRNSTR */
-
-/* If its not usable we have our own copy imported from FreeBSD */
-const char * squid_strnstr(const char *s, const char *find, size_t slen);
-
-#endif /* HAVE_STRNSTR*/
index 01366d15bc5f2d8aed2dc5c2021ad064d25798fc..11bbba253f8e0df13c6e2803747bea1bcae814de 100644 (file)
@@ -70,7 +70,6 @@ libmiscutil_la_SOURCES = \
        rfc3596.c \
        $(SNPRINTFSOURCE) \
        Splay.cc \
-       strnstr.cc \
        stub_memaccount.c \
        util.c \
        xusleep.c \
index b2ccfde3dc78838cda6cca03951f515421d7b629..46b154ac5a135da4ad3c8076d71dbc965556795e 100644 (file)
@@ -409,7 +409,7 @@ asn_parse_string(u_char * data, int *datalength,
         snmp_set_api_error(SNMPERR_ASN_DECODE);
         return (NULL);
     }
-    xmemcpy((char *) string, (char *) bufp, (int) asn_length);
+    memcpy((char *) string, (char *) bufp, (int) asn_length);
     *strlength = (int) asn_length;
     *datalength -= (int) asn_length + (bufp - data);
     return (bufp + asn_length);
@@ -448,7 +448,7 @@ asn_build_string(u_char * data, int *datalength,
         snmp_set_api_error(SNMPERR_ASN_DECODE);
         return (NULL);
     }
-    xmemcpy((char *) data, (char *) string, strlength);
+    memcpy((char *) data, (char *) string, strlength);
     *datalength -= strlength;
     return (data + strlength);
 }
@@ -587,7 +587,7 @@ asn_parse_length(u_char * data, u_int * length)
             return (NULL);
         }
         *length = (u_int) 0;
-        xmemcpy((char *) (length), (char *) data + 1, (int) lengthbyte);
+        memcpy((char *) (length), (char *) data + 1, (int) lengthbyte);
         *length = ntohl(*length);
         *length >>= (8 * ((sizeof *length) - lengthbyte));
         return (data + lengthbyte + 1);
@@ -818,7 +818,7 @@ asn_build_objid(u_char * data, int *datalength,
         snmp_set_api_error(SNMPERR_ASN_DECODE);
         return (NULL);
     }
-    xmemcpy((char *) data, (char *) buf, asnlength);
+    memcpy((char *) data, (char *) buf, asnlength);
     *datalength -= asnlength;
     return (data + asnlength);
 }
@@ -932,7 +932,7 @@ asn_parse_bitstring(u_char * data, int *datalength,
         snmp_set_api_error(SNMPERR_ASN_DECODE);
         return (NULL);
     }
-    xmemcpy((char *) string, (char *) bufp, (int) asn_length);
+    memcpy((char *) string, (char *) bufp, (int) asn_length);
     *strlength = (int) asn_length;
     *datalength -= (int) asn_length + (bufp - data);
     return (bufp + asn_length);
@@ -973,7 +973,7 @@ asn_build_bitstring(u_char * data, int *datalength,
         snmp_set_api_error(SNMPERR_ASN_ENCODE);
         return (NULL);
     }
-    xmemcpy((char *) data, (char *) string, strlength);
+    memcpy((char *) data, (char *) string, strlength);
     *datalength -= strlength;
     return (data + strlength);
 }
index 418e4969c2183cfd8945f684dddb3b1d80e7d777..94fe830deddbe4334d86661d75afb4ae5acbc267 100644 (file)
@@ -150,7 +150,7 @@ snmp_pdu_clone(struct snmp_pdu *Src) {
         snmp_set_api_error(SNMPERR_OS_ERR);
         return (NULL);
     }
-    xmemcpy((char *) Dest, (char *) Src, sizeof(struct snmp_pdu));
+    memcpy((char *) Dest, (char *) Src, sizeof(struct snmp_pdu));
 
 #if DEBUG_PDU
     snmplib_debug(8, "PDU %x:  Created %x\n", (unsigned int) Src, (unsigned int) Dest);
@@ -518,7 +518,7 @@ snmp_pdu_decode(u_char * Packet,    /* data */
             snmp_set_api_error(SNMPERR_OS_ERR);
             return (NULL);
         }
-        xmemcpy((char *) PDU->enterprise, (char *) objid,
+        memcpy((char *) PDU->enterprise, (char *) objid,
                 PDU->enterprise_length * sizeof(oid));
 
         /* Agent-addr */
index 09d5680051823e6e862d26673e40c0803e411c3b..ed3c581eaad3c9c9b19bd34cd096cdddc643012b 100644 (file)
@@ -141,7 +141,7 @@ snmp_var_new(oid * Name, int Len) {
 
     /* Only copy a name if it was specified. */
     if (Name)
-        xmemcpy((char *) New->name, (char *) Name, Len * sizeof(oid));
+        memcpy((char *) New->name, (char *) Name, Len * sizeof(oid));
 
     return (New);
 }
@@ -179,7 +179,7 @@ snmp_var_clone(struct variable_list *Src) {
            sizeof(struct variable_list));
 #endif
 
-    xmemcpy((char *) Dest, (char *) Src, sizeof(struct variable_list));
+    memcpy((char *) Dest, (char *) Src, sizeof(struct variable_list));
 
     if (Src->name != NULL) {
         Dest->name = (oid *) xmalloc(Src->name_length * sizeof(oid));
@@ -191,7 +191,7 @@ snmp_var_clone(struct variable_list *Src) {
 #if DEBUG_VARS
         printf("VARS: Copying name OID. (Size %d)\n", Src->name_length);
 #endif
-        xmemcpy((char *) Dest->name, (char *) Src->name,
+        memcpy((char *) Dest->name, (char *) Src->name,
                 Src->name_length * sizeof(oid));
     }
     /* CISCO Catalyst 2900 returns NULL strings as data of length 0. */
@@ -207,7 +207,7 @@ snmp_var_clone(struct variable_list *Src) {
 #if DEBUG_VARS
         printf("VARS: Copying value (Size %d)\n", Src->val_len);
 #endif
-        xmemcpy((char *) Dest->val.string, (char *) Src->val.string, Src->val_len);
+        memcpy((char *) Dest->val.string, (char *) Src->val.string, Src->val_len);
     }
 #if DEBUG_VARS
     printf("VARS: Cloned %x.\n", (unsigned int) Dest);
@@ -530,7 +530,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen,
             }
             /* Only copy if we successfully decoded something */
             if (bufp) {
-                xmemcpy((char *) Var->val.objid, (char *) TmpBuf, Var->val_len);
+                memcpy((char *) Var->val.objid, (char *) TmpBuf, Var->val_len);
             }
 #if DEBUG_VARS_DECODE
             printf("VARS: Decoded OBJID (length %d) (%d bytes left)\n",
index 6f0988abbac90fcdd4850c27aac87a661a2504c4..0830c480f68f5beebae52a620333dbef84c4ecdd 100644 (file)
@@ -102,7 +102,7 @@ cacheDigestClone(const CacheDigest * cd)
     clone->count = cd->count;
     clone->del_count = cd->del_count;
     assert(cd->mask_size == clone->mask_size);
-    xmemcpy(clone->mask, cd->mask, cd->mask_size);
+    memcpy(clone->mask, cd->mask, cd->mask_size);
     return clone;
 }
 
@@ -328,7 +328,7 @@ cacheDigestHashKey(const CacheDigest * cd, const cache_key * key)
     const unsigned int bit_count = cd->mask_size * 8;
     unsigned int tmp_keys[4];
     /* we must memcpy to ensure alignment */
-    xmemcpy(tmp_keys, key, sizeof(tmp_keys));
+    memcpy(tmp_keys, key, sizeof(tmp_keys));
     hashed_keys[0] = htonl(tmp_keys[0]) % bit_count;
     hashed_keys[1] = htonl(tmp_keys[1]) % bit_count;
     hashed_keys[2] = htonl(tmp_keys[2]) % bit_count;
index dded9f8f4945095b6cfd12a726489006c5c556ff..80e1406357951e986f31d5340db6ad989415b0c8 100644 (file)
@@ -38,7 +38,7 @@ CpuAffinitySet::apply()
                "this process: " << xstrerror());
     } else {
         cpu_set_t cpuSet;
-        xmemcpy(&cpuSet, &theCpuSet, sizeof(cpuSet));
+        memcpy(&cpuSet, &theCpuSet, sizeof(cpuSet));
         CPU_AND(&cpuSet, &cpuSet, &theOrigCpuSet);
         if (CPU_COUNT(&cpuSet) <= 0) {
             debugs(54, DBG_IMPORTANT, "ERROR: invalid CPU affinity for process "
@@ -76,5 +76,5 @@ CpuAffinitySet::applied() const
 void
 CpuAffinitySet::set(const cpu_set_t &aCpuSet)
 {
-    xmemcpy(&theCpuSet, &aCpuSet, sizeof(theCpuSet));
+    memcpy(&theCpuSet, &aCpuSet, sizeof(theCpuSet));
 }
index 398431b991f7c48f70ff66722669c955005ba9be..10e6c52137cb706f736a004139966477390a6666 100644 (file)
@@ -312,7 +312,7 @@ DiskdFile::write(WriteRequest *aRequest)
     debugs(79, 3, "DiskdFile::write: this " << (void *)this << ", buf " << (void *)aRequest->buf << ", off " << aRequest->offset << ", len " << aRequest->len);
     ssize_t shm_offset;
     char *sbuf = (char *)IO->shm.get(&shm_offset);
-    xmemcpy(sbuf, aRequest->buf, aRequest->len);
+    memcpy(sbuf, aRequest->buf, aRequest->len);
 
     if (aRequest->free_func)
         aRequest->free_func(const_cast<char *>(aRequest->buf));
index dadcfed3ed5096a7006f2fd937dc365bc93b8dfa..38a54a0bf2ac03303ffb6af4cab696cf058a869f 100644 (file)
@@ -587,8 +587,7 @@ squidaio_cleanup_request(squidaio_request_t * requestp)
     case _AIO_OP_STAT:
 
         if (!cancelled && requestp->ret == 0)
-
-            xmemcpy(requestp->statp, requestp->tmpstatp, sizeof(struct stat));
+            memcpy(requestp->statp, requestp->tmpstatp, sizeof(struct stat));
 
         squidaio_xfree(requestp->tmpstatp, sizeof(struct stat));
 
index 0440a92a7a48747646e84f3e0dabdef34384181d..7fcb2526ae53620fc2cf5d3d7d10c90c415889ed 100644 (file)
@@ -672,8 +672,7 @@ squidaio_cleanup_request(squidaio_request_t * requestp)
     case _AIO_OP_STAT:
 
         if (!cancelled && requestp->ret == 0)
-
-            xmemcpy(requestp->statp, requestp->tmpstatp, sizeof(struct stat));
+            memcpy(requestp->statp, requestp->tmpstatp, sizeof(struct stat));
 
         squidaio_xfree(requestp->tmpstatp, sizeof(struct stat));
 
index 70480bec6506f9e6780aa386a509ab99525e10d4..46c5ec1fc6dbf6ffbc6a84b8258c09cf95bd466b 100644 (file)
@@ -217,7 +217,7 @@ void MemBuf::consume(mb_size_t shiftSize)
     PROF_start(MemBuf_consume);
     if (shiftSize > 0) {
         if (shiftSize < cSize)
-            xmemmove(buf, buf + shiftSize, cSize - shiftSize);
+            memmove(buf, buf + shiftSize, cSize - shiftSize);
 
         size -= shiftSize;
 
@@ -251,9 +251,7 @@ void MemBuf::append(const char *newContent, mb_size_t sz)
             grow(size + sz + 1);
 
         assert(size + sz <= capacity); /* paranoid */
-
-        xmemcpy(space(), newContent, sz);
-
+        memcpy(space(), newContent, sz);
         appended(sz);
     }
     PROF_stop(MemBuf_append);
index 1f93fe93cbaa8460c004357557519eb4667c0525..e4b48b7b78e2ec11b34504fc66d335073a416f4f 100644 (file)
@@ -57,7 +57,7 @@ url_checksum(const char *url)
     SquidMD5Init(&M);
     SquidMD5Update(&M, (unsigned char *) url, strlen(url));
     SquidMD5Final(digest, &M);
-    xmemcpy(&ck, digest, sizeof(ck));
+    memcpy(&ck, digest, sizeof(ck));
     return ck;
 }
 
index eaac62c53c6240b88d021b1906d7f94fa33415e9..f224ea92d96a4cda0316c898152f4910759b09e9 100644 (file)
@@ -128,7 +128,7 @@ statHistCopy(StatHist * Dest, const StatHist * Orig)
            (long int) (Dest->capacity * sizeof(*Dest->bins)) << " bytes to " <<
            Dest->bins << " from " << Orig->bins);
 
-    xmemcpy(Dest->bins, Orig->bins, Dest->capacity * sizeof(*Dest->bins));
+    memcpy(Dest->bins, Orig->bins, Dest->capacity * sizeof(*Dest->bins));
 }
 
 /*
index 4065a4854cdea85eb0743a03313a3c3d791c6f57..f784a8c2099ff2bf9c059334c8a0a7512ab3c393 100644 (file)
@@ -158,7 +158,7 @@ StoreMeta::Factory (char type, size_t len, void const *value)
 
     result->length = len;
     result->value = xmalloc(len);
-    xmemcpy(result->value, value, len);
+    memcpy(result->value, value, len);
     return result;
 }
 
index e9e1b266f8f42f5f1621948e4efc05227559d22c..a92165192a9b4ade5650c28a9d4d8c55a8479c2a 100644 (file)
@@ -63,7 +63,7 @@ StoreMetaUnpacker::isBufferSane()
 void
 StoreMetaUnpacker::getBufferLength()
 {
-    xmemcpy(hdr_len, &buf[1], sizeof(int));
+    memcpy(hdr_len, &buf[1], sizeof(int));
 }
 
 StoreMetaUnpacker::StoreMetaUnpacker (char const *aBuffer, ssize_t aLen, int *anInt) : buf (aBuffer), buflen(aLen), hdr_len(anInt), position(1 + sizeof(int))
@@ -80,7 +80,7 @@ StoreMetaUnpacker::getType()
 void
 StoreMetaUnpacker::getLength()
 {
-    xmemcpy(&length, &buf[position], sizeof(int));
+    memcpy(&length, &buf[position], sizeof(int));
     position += sizeof(int);
 }
 
index c86696a86f3a941981eb08239f8a297335efa163..7bdb48ba8f873078d907e9f95e6154a4f8a321cc 100644 (file)
@@ -130,7 +130,7 @@ String::allocAndFill(const char *str, int len)
     assert(this && str);
     allocBuffer(len + 1);
     len_ = len;
-    xmemcpy(buf_, str, len);
+    memcpy(buf_, str, len);
     buf_[len] = '\0';
     PROF_stop(StringAllocAndFill);
 }
@@ -200,10 +200,10 @@ String::append(const char *str, int len)
         snew.allocBuffer(snew.len_ + 1);
 
         if (len_)
-            xmemcpy(snew.buf_, rawBuf(), len_);
+            memcpy(snew.buf_, rawBuf(), len_);
 
         if (len)
-            xmemcpy(snew.buf_ + len_, str, len);
+            memcpy(snew.buf_ + len_, str, len);
 
         snew.buf_[snew.len_] = '\0';
 
index 552a2e9670eb2400f520b4813210d457a31ed99f..2137edf3e42a86784de358b7b7a8e3a58e1ee4ad 100644 (file)
@@ -341,7 +341,7 @@ asHandleReply(void *data, StoreIOBuffer result)
      * Next, copy the left over data, from s to s + leftoversz to the
      * beginning of the buffer
      */
-    xmemmove(buf, s, leftoversz);
+    memmove(buf, s, leftoversz);
 
     /*
      * Next, update our offset and reqofs, and kick off a copy if required
index c2d677395f910e9a1aa4461bd27cb4f805541c7e..f90a269d13675acbcb18da2f3616ef8cd4ad8d85 100644 (file)
@@ -77,8 +77,7 @@ ACLTimeData::match(time_t when)
 
     if (when != last_when) {
         last_when = when;
-
-        xmemcpy(&tm, localtime(&when), sizeof(struct tm));
+        memcpy(&tm, localtime(&when), sizeof(struct tm));
     }
 
     t = (time_t) (tm.tm_hour * 60 + tm.tm_min);
index 782dc6f2a7ccd7fd991a3fdf4ea3df5cd79ef94d..94be60f183791257704311246d68622560e9a9d8 100644 (file)
@@ -81,7 +81,7 @@ cacheEntryCreate(const StoreSwapLogData * s)
     CacheEntry *e = xcalloc(1, sizeof(CacheEntry));
     assert(s);
     /* e->s = *s; */
-    xmemcpy(e->key_arr, s->key, SQUID_MD5_DIGEST_LENGTH);
+    memcpy(e->key_arr, s->key, SQUID_MD5_DIGEST_LENGTH);
     e->key = &e->key_arr[0];
     return e;
 }
index 229cb1179c1e9bdd4ccb065ca1c588ee819edaa9..4d0d54530e51eb6343fea13771c1fab917b0e7f9 100644 (file)
@@ -2332,8 +2332,7 @@ connNoteUseOfBuffer(ConnStateData* conn, size_t byteCount)
      */
 
     if (conn->in.notYetUsed > 0)
-        xmemmove(conn->in.buf, conn->in.buf + byteCount,
-                 conn->in.notYetUsed);
+        memmove(conn->in.buf, conn->in.buf + byteCount, conn->in.notYetUsed);
 }
 
 /// respond with ERR_TOO_BIG if request header exceeds request_header_max_size
@@ -2624,7 +2623,7 @@ static void
 connStripBufferWhitespace (ConnStateData * conn)
 {
     while (conn->in.notYetUsed > 0 && xisspace(conn->in.buf[0])) {
-        xmemmove(conn->in.buf, conn->in.buf + 1, conn->in.notYetUsed - 1);
+        memmove(conn->in.buf, conn->in.buf + 1, conn->in.notYetUsed - 1);
         --conn->in.notYetUsed;
     }
 }
@@ -2827,7 +2826,7 @@ ConnStateData::handleReadData(char *buf, size_t size)
     char *current_buf = in.addressToReadInto();
 
     if (buf != current_buf)
-        xmemmove(current_buf, buf, size);
+        memmove(current_buf, buf, size);
 
     in.notYetUsed += size;
 
index c7b06a10f8a9e79b9f75966c2f004ac340000705..d6ada937d2289ac07d574759cfbeb3c829cfe776 100644 (file)
@@ -2056,7 +2056,7 @@ clientReplyContext::sendMoreData (StoreIOBuffer result)
     if (buf != result.data) {
         /* we've got to copy some data */
         assert(result.length <= next()->readBuffer.length);
-        xmemcpy(buf, result.data, result.length);
+        memcpy(buf, result.data, result.length);
         body_buf = buf;
     }
 
index 46c39664c3eefaf6eaa632c6e2080b662e8e5188..5b8b40a3bc2407b86b2888e02a7dafb6aeea6e74 100644 (file)
@@ -380,10 +380,10 @@ comm_select(int msec)
 
         maxfd = Biggest_FD + 1;
 
-        xmemcpy(&readfds, &global_readfds,
+        memcpy(&readfds, &global_readfds,
                 howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES);
 
-        xmemcpy(&writefds, &global_writefds,
+        memcpy(&writefds, &global_writefds,
                 howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES);
 
         /* remove stalled FDs, and deal with pending descriptors */
index 58c93cb576ec6b88c273cda3122b851c504e28c2..74a13089f7c8c2d3870d3b4b66e7d0991155a4ac 100644 (file)
@@ -380,11 +380,11 @@ comm_select(int msec)
 
         maxfd = Biggest_FD + 1;
 
-        xmemcpy(&readfds, &global_readfds, sizeof(global_readfds));
+        memcpy(&readfds, &global_readfds, sizeof(global_readfds));
 
-        xmemcpy(&writefds, &global_writefds, sizeof(global_writefds));
+        memcpy(&writefds, &global_writefds, sizeof(global_writefds));
 
-        xmemcpy(&errfds, &global_writefds, sizeof(global_writefds));
+        memcpy(&errfds, &global_writefds, sizeof(global_writefds));
 
         /* remove stalled FDs, and deal with pending descriptors */
         pending = 0;
index 85936a4ed0412d3ba0eb4e949954989c38d37e35..88257e9649c592cc434696a9fbaf7f1766b69ad6 100644 (file)
@@ -196,7 +196,7 @@ diskCombineWrites(struct _fde_disk *fdd)
             dwrite_q *q = fdd->write_q;
 
             len = q->len - q->buf_offset;
-            xmemcpy(wq->buf + wq->len, q->buf + q->buf_offset, len);
+            memcpy(wq->buf + wq->len, q->buf + q->buf_offset, len);
             wq->len += len;
             fdd->write_q = q->next;
 
index c6fe4a04f4d0b77357c610d8ae5e33e73b5538ca..95dd38a2770e36afd0e7bc160b23b571c68a5924 100644 (file)
@@ -278,7 +278,7 @@ idnsAddNameserver(const char *buf)
         nameservers = (ns *)xcalloc(nns_alloc, sizeof(*nameservers));
 
         if (oldptr && oldalloc)
-            xmemcpy(nameservers, oldptr, oldalloc * sizeof(*nameservers));
+            memcpy(nameservers, oldptr, oldalloc * sizeof(*nameservers));
 
         if (oldptr)
             safe_free(oldptr);
@@ -310,7 +310,7 @@ idnsAddPathComponent(const char *buf)
         searchpath = (sp *)xcalloc(npc_alloc, sizeof(*searchpath));
 
         if (oldptr && oldalloc)
-            xmemcpy(searchpath, oldptr, oldalloc * sizeof(*searchpath));
+            memcpy(searchpath, oldptr, oldalloc * sizeof(*searchpath));
 
         if (oldptr)
             safe_free(oldptr);
index 88e85884ad203c20c6be53be81efb5400b583746..7f0cceb10cf153d2c085bebfbfcf5196e0ea94e3 100644 (file)
@@ -640,7 +640,7 @@ ESIContext::send ()
     assert (len != 0 || rep != NULL);
 
     if (len) {
-        xmemcpy (next->readBuffer.data, &outbound->buf[outbound_offset], len);
+        memcpy(next->readBuffer.data, &outbound->buf[outbound_offset], len);
 
         if (len + outbound_offset == outbound->len) {
             ESISegment::Pointer temp = outbound->next;
@@ -798,7 +798,7 @@ esiProcessStream (clientStreamNode *thisNode, ClientHttpRequest *http, HttpReply
                    &context->incoming->buf[context->incoming->len] <<
                    " because our buffer was not used");
 
-            xmemcpy (&context->incoming->buf[context->incoming->len], receivedData.data, len);
+            memcpy(&context->incoming->buf[context->incoming->len], receivedData.data, len);
             context->incoming->len += len;
 
             if (context->incoming->len == HTTP_REQBUF_SZ) {
@@ -809,7 +809,7 @@ esiProcessStream (clientStreamNode *thisNode, ClientHttpRequest *http, HttpReply
 
             if (len != receivedData.length) {
                 /* capture the remnants */
-                xmemcpy (context->incoming->buf, &receivedData.data[len], receivedData.length - len);
+                memcpy(context->incoming->buf, &receivedData.data[len], receivedData.length - len);
                 context->incoming->len = receivedData.length - len;
             }
 
@@ -2296,7 +2296,7 @@ ElementList::pop_front (size_t const count)
     if (!count)
         return;
 
-    xmemmove (elements, &elements[count], (elementcount - count)  * sizeof (ESIElement::Pointer));
+    memmove(elements, &elements[count], (elementcount - count)  * sizeof (ESIElement::Pointer));
 
     elementcount -= count;
 }
index 797fbd3fdb2132ece6dc7d7d2788d856098b96f2..54880c534912fed6a54c3fe64e8b873f6fa928d0 100644 (file)
@@ -140,7 +140,7 @@ esiBufferRecipient (clientStreamNode *node, ClientHttpRequest *http, HttpReply *
 
             if (receivedData.data != esiStream->localbuffer->buf) {
                 /* But not the start of it */
-                xmemmove (esiStream->localbuffer->buf, receivedData.data, receivedData.length);
+                memmove(esiStream->localbuffer->buf, receivedData.data, receivedData.length);
             }
 
             esiStream->localbuffer->len = receivedData.length;
index a6f9df604d7ec915137ff1e53884d1516ee91026..8ed6ddc6a492f9db0013ce191f2d51b171ff5948 100644 (file)
@@ -114,7 +114,7 @@ ESISegment::listToChar() const
     size_t pos = 0;
 
     while (temp.getRaw()) {
-        xmemcpy (&rv[pos], temp->buf, temp->len);
+        memcpy(&rv[pos], temp->buf, temp->len);
         pos += temp->len;
         temp = temp->next;
     }
@@ -179,7 +179,7 @@ size_t
 ESISegment::append(char const *appendBuffer, size_t appendLength)
 {
     size_t toCopy = min(appendLength, space());
-    xmemcpy (&buf[len], appendBuffer, toCopy);
+    memcpy(&buf[len], appendBuffer, toCopy);
     len += toCopy;
     return toCopy;
 }
index e7dcc6b034eafcb0f05efcf028bbfaa569182b89..d6d41ad1c937e003af614f5cd852c65ad528a0ca 100644 (file)
@@ -78,7 +78,7 @@ file_map_grow(fileMap * fm)
     debugs(8, 3, "file_map_grow: creating space for " << fm->max_n_files << " files");
     fm->file_map = (unsigned long *)xcalloc(fm->nwords, sizeof(*fm->file_map));
     debugs(8, 3, "copying " << old_sz << " old bytes");
-    xmemcpy(fm->file_map, old_map, old_sz);
+    memcpy(fm->file_map, old_map, old_sz);
     xfree(old_map);
     /* XXX account fm->file_map */
 }
index 3f900c7a21c5524579cc82b93012b5eff877aa4c..7b84624077b6548e693ed162aca6d7c92c29bff3 100644 (file)
@@ -201,11 +201,11 @@ CossSwapDir::readCompleted(const char *buf, int len, int errflag, RefCount<ReadR
             cstate->readbuffer = (char *)xmalloc(cstate->st_size);
             p = storeCossMemPointerFromDiskOffset(storeCossFilenoToDiskOffset(sio->swap_filen),
                                                   NULL);
-            xmemcpy(cstate->readbuffer, p, cstate->st_size);
+            memcpy(cstate->readbuffer, p, cstate->st_size);
         }
 
         sio->offset_ += len;
-        xmemcpy(cstate->requestbuf, &cstate->readbuffer[cstate->requestoffset],
+        memcpy(cstate->requestbuf, &cstate->readbuffer[cstate->requestoffset],
                 cstate->requestlen);
         rlen = (size_t) cstate->requestlen;
     }
@@ -785,8 +785,8 @@ CossCleanLog::write(StoreEntry const &e)
     s.swap_file_sz = e.swap_file_sz;
     s.refcount = e.refcount;
     s.flags = e.flags;
-    xmemcpy(&s.key, e.key, SQUID_MD5_DIGEST_LENGTH);
-    xmemcpy(outbuf + outbuf_offset, &s, ss);
+    memcpy(&s.key, e.key, SQUID_MD5_DIGEST_LENGTH);
+    memcpy(outbuf + outbuf_offset, &s, ss);
     outbuf_offset += ss;
     /* buffered write */
 
@@ -890,7 +890,7 @@ CossSwapDir::logEntry(const StoreEntry & e, int op) const
     s->swap_file_sz = e.swap_file_sz;
     s->refcount = e.refcount;
     s->flags = e.flags;
-    xmemcpy(s->key, e.key, SQUID_MD5_DIGEST_LENGTH);
+    memcpy(s->key, e.key, SQUID_MD5_DIGEST_LENGTH);
     file_write(swaplog_fd,
                -1,
                s,
index b82d71c012d7be618a0a4899089bc67ab5de148e..659395d85a0db95c725412cd1813b44dd4382468 100644 (file)
@@ -221,7 +221,7 @@ CossSwapDir::openStoreIO(StoreEntry & e, StoreIOState::STFNCB * file_callback,
 
     if (p) {
         cstate->readbuffer = (char *)xmalloc(cstate->st_size);
-        xmemcpy(cstate->readbuffer, p, cstate->st_size);
+        memcpy(cstate->readbuffer, p, cstate->st_size);
         StoreFScoss::GetInstance().stats.open_mem_hits++;
     } else {
         /* Do the allocation */
@@ -344,7 +344,7 @@ CossState::write(char const *buf, size_t size, off_t offset, FREE * free_func)
     CossSwapDir *SD = (CossSwapDir *)INDEXSD(swap_dirn);
     dest = SD->storeCossMemPointerFromDiskOffset(diskoffset, &membuf);
     assert(dest != NULL);
-    xmemcpy(dest, buf, size);
+    memcpy(dest, buf, size);
     offset_ += size;
 
     if (free_func)
index d364a87b129bf81c85ec79aac0dbb8878ab7b1f1..9d514f47e408573162ff420c3701ab92bc878f39 100644 (file)
@@ -882,7 +882,7 @@ UFSSwapDir::writeCleanStart()
     state->outbuf = (char *)xcalloc(CLEAN_BUF_SZ, 1);
     state->outbuf_offset = 0;
     /*copy the header */
-    xmemcpy(state->outbuf, &header, sizeof(StoreSwapLogHeader));
+    memcpy(state->outbuf, &header, sizeof(StoreSwapLogHeader));
     state->outbuf_offset += header.record_size;
 
     state->walker = repl->WalkInit(repl);
@@ -931,8 +931,8 @@ UFSCleanLog::write(StoreEntry const &e)
     s.swap_file_sz = e.swap_file_sz;
     s.refcount = e.refcount;
     s.flags = e.flags;
-    xmemcpy(&s.key, e.key, SQUID_MD5_DIGEST_LENGTH);
-    xmemcpy(outbuf + outbuf_offset, &s, ss);
+    memcpy(&s.key, e.key, SQUID_MD5_DIGEST_LENGTH);
+    memcpy(outbuf + outbuf_offset, &s, ss);
     outbuf_offset += ss;
     /* buffered write */
 
@@ -1040,7 +1040,7 @@ UFSSwapDir::logEntry(const StoreEntry & e, int op) const
     s->swap_file_sz = e.swap_file_sz;
     s->refcount = e.refcount;
     s->flags = e.flags;
-    xmemcpy(s->key, e.key, SQUID_MD5_DIGEST_LENGTH);
+    memcpy(s->key, e.key, SQUID_MD5_DIGEST_LENGTH);
     file_write(swaplog_fd,
                -1,
                s,
index fcfbab3d7a4db84c5d6a445afebcbe38d96ed256..5c89a1d2ee12c924f7009b5b46795b4bdc272321 100644 (file)
@@ -89,7 +89,7 @@ public:
         swapData.swap_file_sz = readData.swap_file_sz;
         swapData.refcount = readData.refcount;
         swapData.flags = readData.flags;
-        xmemcpy(swapData.key, readData.key, SQUID_MD5_DIGEST_LENGTH);
+        memcpy(swapData.key, readData.key, SQUID_MD5_DIGEST_LENGTH);
         return true;
     }
 };
@@ -137,7 +137,7 @@ public:
         swapData.swap_file_sz = readData.swap_file_sz;
         swapData.refcount = readData.refcount;
         swapData.flags = readData.flags;
-        xmemcpy(swapData.key, readData.key, SQUID_MD5_DIGEST_LENGTH);
+        memcpy(swapData.key, readData.key, SQUID_MD5_DIGEST_LENGTH);
         return true;
     }
 };
@@ -186,7 +186,7 @@ public:
         swapData.swap_file_sz = readData.swap_file_sz;
         swapData.refcount = readData.refcount;
         swapData.flags = readData.flags;
-        xmemcpy(swapData.key, readData.key, SQUID_MD5_DIGEST_LENGTH);
+        memcpy(swapData.key, readData.key, SQUID_MD5_DIGEST_LENGTH);
         return true;
     }
 };
@@ -370,7 +370,7 @@ struct InitStoreEntry : public unary_function<StoreMeta, void> {
 
         case STORE_META_KEY:
             assert(x.length == SQUID_MD5_DIGEST_LENGTH);
-            xmemcpy(index, x.value, SQUID_MD5_DIGEST_LENGTH);
+            memcpy(index, x.value, SQUID_MD5_DIGEST_LENGTH);
             break;
 
         case STORE_META_STD:
@@ -396,7 +396,7 @@ struct InitStoreEntry : public unary_function<StoreMeta, void> {
 
         case STORE_META_STD_LFS:
             assert(x.length == STORE_HDR_METASIZE);
-            xmemcpy(&what->timestamp, x.value, STORE_HDR_METASIZE);
+            memcpy(&what->timestamp, x.value, STORE_HDR_METASIZE);
             break;
 
         default:
index ed3f22dcebbba00e9ed4100745c1b37085eff9b3..a401ebffd3fe6fdd651f741502c6d13b6e6db69a 100644 (file)
@@ -1767,8 +1767,7 @@ FtpStateData::handleControlReply()
         /* Got some data past the complete reply */
         assert(bytes_used < ctrl.offset);
         ctrl.offset -= bytes_used;
-        xmemmove(ctrl.buf, ctrl.buf + bytes_used,
-                 ctrl.offset);
+        memmove(ctrl.buf, ctrl.buf + bytes_used, ctrl.offset);
     }
 
     /* Move the last line of the reply message to ctrl.last_reply */
index 5b31f3a3956da0b9d8aaf6b627cfff4cad689f01..5204526241a17c369b51efb05ab738ea2002287c 100644 (file)
@@ -467,7 +467,7 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
                     len = TEMP_BUF_SIZE - gopherState->len;
                 }
 
-                xmemcpy(gopherState->buf + gopherState->len, inbuf, len);
+                memcpy(gopherState->buf + gopherState->len, inbuf, len);
                 gopherState->len += len;
                 return;
             }
@@ -498,7 +498,7 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
                 }
 
                 if (len > (pos - inbuf)) {
-                    xmemcpy(gopherState->buf, pos, len - (pos - inbuf));
+                    memcpy(gopherState->buf, pos, len - (pos - inbuf));
                     gopherState->len = len - (pos - inbuf);
                 }
 
index 898189b763a0708d3c8e71558553c59588511ca0..df13aa591fa9743db36857e99cefefea78e14ace 100644 (file)
@@ -332,7 +332,7 @@ htcpBuildAuth(char *buf, size_t buflen)
     copy_sz += 2;
     if (buflen < copy_sz)
         return -1;
-    xmemcpy(buf, &auth, copy_sz);
+    memcpy(buf, &auth, copy_sz);
     return copy_sz;
 }
 
@@ -357,7 +357,7 @@ htcpBuildCountstr(char *buf, size_t buflen, const char *s)
 
     length = htons((uint16_t) len);
 
-    xmemcpy(buf + off, &length, 2);
+    memcpy(buf + off, &length, 2);
 
     off += 2;
 
@@ -365,7 +365,7 @@ htcpBuildCountstr(char *buf, size_t buflen, const char *s)
         return -1;
 
     if (len)
-        xmemcpy(buf + off, s, len);
+        memcpy(buf + off, s, len);
 
     off += len;
 
@@ -473,7 +473,7 @@ htcpBuildClrOpData(char *buf, size_t buflen, htcpStuff * stuff)
     case RR_REQUEST:
         debugs(31, 3, "htcpBuildClrOpData: RR_REQUEST");
         reason = htons((u_short)stuff->reason);
-        xmemcpy(buf, &reason, 2);
+        memcpy(buf, &reason, 2);
         return htcpBuildSpecifier(buf + 2, buflen - 2, stuff) + 2;
     case RR_RESPONSE:
         break;
@@ -548,7 +548,7 @@ htcpBuildData(char *buf, size_t buflen, htcpStuff * stuff)
     hdr.msg_id = htonl(hdr.msg_id);
 
     if (!old_squid_format) {
-        xmemcpy(buf, &hdr, hdr_sz);
+        memcpy(buf, &hdr, hdr_sz);
     } else {
         htcpDataHeaderSquid hdrSquid;
         memset(&hdrSquid, 0, sizeof(hdrSquid));
@@ -557,7 +557,7 @@ htcpBuildData(char *buf, size_t buflen, htcpStuff * stuff)
         hdrSquid.response = hdr.response;
         hdrSquid.F1 = hdr.F1;
         hdrSquid.RR = hdr.RR;
-        xmemcpy(buf, &hdrSquid, hdr_sz);
+        memcpy(buf, &hdrSquid, hdr_sz);
     }
 
     debugs(31, 3, "htcpBuildData: size " << off);
@@ -605,7 +605,7 @@ htcpBuildPacket(char *buf, size_t buflen, htcpStuff * stuff)
     else
         hdr.minor = 1;
 
-    xmemcpy(buf, &hdr, hdr_sz);
+    memcpy(buf, &hdr, hdr_sz);
 
     debugs(31, 3, "htcpBuildPacket: size " << off);
 
@@ -1365,7 +1365,7 @@ htcpHandleMsg(char *buf, int sz, Ip::Address &from)
     }
 
     htcpHexdump("htcpHandle", buf, sz);
-    xmemcpy(&htcpHdr, buf, sizeof(htcpHeader));
+    memcpy(&htcpHdr, buf, sizeof(htcpHeader));
     htcpHdr.length = ntohs(htcpHdr.length);
 
     if (htcpHdr.minor == 0)
@@ -1399,10 +1399,10 @@ htcpHandleMsg(char *buf, int sz, Ip::Address &from)
     }
 
     if (!old_squid_format) {
-        xmemcpy(&hdr, hbuf, sizeof(hdr));
+        memcpy(&hdr, hbuf, sizeof(hdr));
     } else {
         htcpDataHeaderSquid hdrSquid;
-        xmemcpy(&hdrSquid, hbuf, sizeof(hdrSquid));
+        memcpy(&hdrSquid, hbuf, sizeof(hdrSquid));
         hdr.length = hdrSquid.length;
         hdr.opcode = hdrSquid.opcode;
         hdr.response = hdrSquid.response;
index d59403e4dd5f8b3e95d3ef26bde8068180b388b1..3b5997f9abba231d81dd0b9a59a928dbf6cbf81a 100644 (file)
@@ -1149,7 +1149,7 @@ HttpStateData::readReply(const CommIoCbParams &io)
         /* Skip whitespace between replies */
 
         while (len > 0 && xisspace(*buf))
-            xmemmove(buf, buf + 1, len--);
+            memmove(buf, buf + 1, len--);
 
         if (len == 0) {
             /* Continue to read... */
index ce221f9e7ed9a189a2f2582fd943e9f306adc5f8..e2edfc8a13258a6f62cad0085c011a312759af0b 100644 (file)
@@ -130,7 +130,7 @@ Icmp4::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
         if (len > MAX_PAYLOAD)
             len = MAX_PAYLOAD;
 
-        xmemcpy(echo->payload, payload, len);
+        memcpy(echo->payload, payload, len);
 
         icmp_pktsize += len;
     }
index e604754571adc1c3bbbd1e826a6aa5a5e008f5ae..21dc01feddec2b03dd854526e9e9fa1fa7de9686 100644 (file)
@@ -174,7 +174,7 @@ Icmp6::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
         if (len > MAX_PAYLOAD)
             len = MAX_PAYLOAD;
 
-        xmemcpy(echo->payload, payload, len);
+        memcpy(echo->payload, payload, len);
 
         icmp6_pktsize += len;
     }
index 88398b4d542fe44c7288d10f023316bbd36aab78..35758b4907d95217324d6c1d05a1d4a66d15fc6b 100644 (file)
@@ -93,7 +93,7 @@ IcmpPinger::Open(void)
         return -1;
     }
 
-    xmemcpy(&wpi, buf, sizeof(wpi));
+    memcpy(&wpi, buf, sizeof(wpi));
 
     write(1, "OK\n", 3);
     x = read(0, buf, sizeof(PS));
@@ -105,7 +105,7 @@ IcmpPinger::Open(void)
         return -1;
     }
 
-    xmemcpy(&PS, buf, sizeof(PS));
+    memcpy(&PS, buf, sizeof(PS));
 
     icmp_sock = WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, &wpi, 0, 0);
 
index f2b4899905e1e03044b62ddb7e33fdcaad12e304..708f4f4866a1104d9698f65dc26e49cb012bea31 100644 (file)
@@ -105,7 +105,7 @@ IcmpSquid::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
     pecho.psize = len;
 
     if (len > 0)
-        xmemcpy(pecho.payload, payload, len);
+        memcpy(pecho.payload, payload, len);
 
     slen = sizeof(pingerEchoData) - PINGER_PAYLOAD_SZ + pecho.psize;
 
index 016800d80761c45b90af3a7350e414e0e3ffb16f..5bb0e499ca52354b052bb1f0620832edca3ea7a4 100644 (file)
@@ -620,7 +620,7 @@ netdbReloadState(void)
 
         n = (netdbEntry *)memAllocate(MEM_NETDBENTRY);
 
-        xmemcpy(n, &N, sizeof(netdbEntry));
+        memcpy(n, &N, sizeof(netdbEntry));
 
         netdbHashInsert(n, addr);
 
@@ -778,21 +778,21 @@ netdbExchangeHandleReply(void *data, StoreIOBuffer receivedData)
             case NETDB_EX_NETWORK:
                 o++;
                 /* FIXME INET6 : NetDB can still ony send IPv4 */
-                xmemcpy(&line_addr, p + o, sizeof(struct in_addr));
+                memcpy(&line_addr, p + o, sizeof(struct in_addr));
                 addr = line_addr;
                 o += sizeof(struct in_addr);
                 break;
 
             case NETDB_EX_RTT:
                 o++;
-                xmemcpy(&j, p + o, sizeof(int));
+                memcpy(&j, p + o, sizeof(int));
                 o += sizeof(int);
                 rtt = (double) ntohl(j) / 1000.0;
                 break;
 
             case NETDB_EX_HOPS:
                 o++;
-                xmemcpy(&j, p + o, sizeof(int));
+                memcpy(&j, p + o, sizeof(int));
                 o += sizeof(int);
                 hops = (double) ntohl(j) / 1000.0;
                 break;
@@ -1247,7 +1247,7 @@ netdbBinaryExchange(StoreEntry * s)
         buf[i++] = (char) NETDB_EX_NETWORK;
 
         addr.GetInAddr(line_addr);
-        xmemcpy(&buf[i], &line_addr, sizeof(struct in_addr));
+        memcpy(&buf[i], &line_addr, sizeof(struct in_addr));
 
         i += sizeof(struct in_addr);
 
@@ -1255,7 +1255,7 @@ netdbBinaryExchange(StoreEntry * s)
 
         j = htonl((int) (n->rtt * 1000));
 
-        xmemcpy(&buf[i], &j, sizeof(int));
+        memcpy(&buf[i], &j, sizeof(int));
 
         i += sizeof(int);
 
@@ -1263,7 +1263,7 @@ netdbBinaryExchange(StoreEntry * s)
 
         j = htonl((int) (n->hops * 1000));
 
-        xmemcpy(&buf[i], &j, sizeof(int));
+        memcpy(&buf[i], &j, sizeof(int));
 
         i += sizeof(int);
 
index 87b2a8369ad05826d8044f62c250770de2e61049..d09aea28aa668f3696feb35e1d195ec7a14a37fb 100644 (file)
@@ -112,7 +112,7 @@ _icp_common_t::_icp_common_t(char *buf, unsigned int len)
         return;
     }
 
-    xmemcpy(this, buf, sizeof(icp_common_t));
+    memcpy(this, buf, sizeof(icp_common_t));
     /*
      * Convert network order sensitive fields
      */
@@ -291,7 +291,7 @@ _icp_common_t::createMessage(
     if (opcode == ICP_QUERY)
         urloffset += sizeof(uint32_t);
 
-    xmemcpy(urloffset, url, strlen(url));
+    memcpy(urloffset, url, strlen(url));
 
     return (icp_common_t *)buf;
 }
index a49527e5fdd3a7d800fbbee3e5e56bed3af68812..0f2116cc72d3e105ae4ccf86d491544e6aa06fb1 100644 (file)
@@ -20,14 +20,14 @@ Ipc::TypedMsgHdr::TypedMsgHdr()
 
 Ipc::TypedMsgHdr::TypedMsgHdr(const TypedMsgHdr &tmh)
 {
-    xmemcpy(this, &tmh, sizeof(*this));
+    memcpy(this, &tmh, sizeof(*this));
     sync();
 }
 
 Ipc::TypedMsgHdr &Ipc::TypedMsgHdr::operator =(const TypedMsgHdr &tmh)
 {
     if (this != &tmh) { // skip assignment to self
-        xmemcpy(this, &tmh, sizeof(*this));
+        memcpy(this, &tmh, sizeof(*this));
         sync();
     }
     return *this;
@@ -156,7 +156,7 @@ Ipc::TypedMsgHdr::getRaw(void *raw, size_t size) const
     Must(size >= 0);
     if (size > 0) {
         Must(size <= data.size - offset);
-        xmemcpy(raw, data.raw + offset, size);
+        memcpy(raw, data.raw + offset, size);
         offset += size;
     }
 }
@@ -168,7 +168,7 @@ Ipc::TypedMsgHdr::putRaw(const void *raw, size_t size)
     Must(size >= 0);
     if (size > 0) {
         Must(size <= sizeof(data.raw) - data.size);
-        xmemcpy(data.raw + data.size, raw, size);
+        memcpy(data.raw + data.size, raw, size);
         data.size += size;
     }
 }
@@ -187,7 +187,7 @@ Ipc::TypedMsgHdr::putFd(int fd)
     cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fdCount);
 
     int *fdStore = reinterpret_cast<int*>(CMSG_DATA(cmsg));
-    xmemcpy(fdStore, &fd, fdCount * sizeof(int));
+    memcpy(fdStore, &fd, fdCount * sizeof(int));
     msg_controllen = cmsg->cmsg_len;
 }
 
@@ -203,7 +203,7 @@ Ipc::TypedMsgHdr::getFd() const
     const int fdCount = 1;
     const int *fdStore = reinterpret_cast<const int*>(CMSG_DATA(cmsg));
     int fd = -1;
-    xmemcpy(&fd, fdStore, fdCount * sizeof(int));
+    memcpy(&fd, fdStore, fdCount * sizeof(int));
     return fd;
 }
 
index 45e7fc1620cdb9b2d56d6e2c311de71580549dcb..926b906e5c20f18011432482ea6f73e1e2d76cec 100644 (file)
@@ -535,7 +535,7 @@ ipcacheParse(ipcache_entry *i, rfc1035_rr * answers, int nr, const char *error_m
                 continue;
 
             struct in_addr temp;
-            xmemcpy(&temp, answers[k].rdata, sizeof(struct in_addr));
+            memcpy(&temp, answers[k].rdata, sizeof(struct in_addr));
             i->addrs.in_addrs[j] = temp;
 
             debugs(14, 3, "ipcacheParse: " << name << " #" << j << " " << i->addrs.in_addrs[j]);
@@ -546,7 +546,7 @@ ipcacheParse(ipcache_entry *i, rfc1035_rr * answers, int nr, const char *error_m
                 continue;
 
             struct in6_addr temp;
-            xmemcpy(&temp, answers[k].rdata, sizeof(struct in6_addr));
+            memcpy(&temp, answers[k].rdata, sizeof(struct in6_addr));
             i->addrs.in_addrs[j] = temp;
 
             debugs(14, 3, "ipcacheParse: " << name << " #" << j << " " << i->addrs.in_addrs[j] );
index b987d950925c6b1db7b41ee4f9e3975dad051729..d1f0fcf5e56ed6a314390875e33a92534ce9732f 100644 (file)
@@ -191,7 +191,7 @@ logfile_mod_daemon_append(Logfile * lf, const char *buf, int len)
         b = static_cast<logfile_buffer_t*>(ll->bufs.tail->data);
         debugs(50, 3, "logfile_mod_daemon_append: current buffer has " << b->len << " of " << b->size << " bytes before append");
         s = min(len, (b->size - b->len));
-        xmemcpy(b->buf + b->len, buf, s);
+        memcpy(b->buf + b->len, buf, s);
         len = len - s;
         buf = buf + s;
         b->len = b->len + s;
index 7a009140c7cf8308dc0b24e30a741b4c7b2f911d..e9d704b68cde7caac9b2d4296c22c4d75af97be1 100644 (file)
@@ -82,7 +82,7 @@ logfile_mod_stdio_writeline(Logfile * lf, const char *buf, size_t len)
         return;
     }
     /* buffer it */
-    xmemcpy(ll->buf + ll->offset, buf, len);
+    memcpy(ll->buf + ll->offset, buf, len);
 
     ll->offset += len;
 
index 816760b91aac51fd7ac8b08842199a4bf74f847a..4f5275c8745f8f896e8e8a3710622d633805e0bf 100644 (file)
@@ -101,7 +101,7 @@ logfile_mod_tcp_writeline(Logfile * lf, const char *buf, size_t len)
         return;
     }
     /* buffer it */
-    xmemcpy(ll->buf + ll->offset, buf, len);
+    memcpy(ll->buf + ll->offset, buf, len);
 
     ll->offset += len;
 
index b33e38fc0a4998439e453960034b60440cc7863c..ce373c83fe31c3a17cd3271736b08b9bee40921e 100644 (file)
@@ -99,7 +99,7 @@ logfile_mod_udp_writeline(Logfile * lf, const char *buf, size_t len)
         return;
     }
     /* buffer it */
-    xmemcpy(ll->buf + ll->offset, buf, len);
+    memcpy(ll->buf + ll->offset, buf, len);
 
     ll->offset += len;
 
index e2fcad7cbb1f36b862adc38c59f2b0ac5193d53e..fbcf3fb7f86c11ff5fa8520c2fe48bc2f0f712e6 100644 (file)
@@ -115,7 +115,7 @@ IdleConnList::push(int fd)
         nfds_alloc <<= 1;
         int *old = fds;
         fds = (int *)xmalloc(nfds_alloc * sizeof(int));
-        xmemcpy(fds, old, nfds * sizeof(int));
+        memcpy(fds, old, nfds * sizeof(int));
 
         if (nfds == PCONN_FDS_SZ)
             pconn_fds_pool->freeOne(old);
index 4f009ec93e592296c73dadd1388a13cf9d1154c4..d20525293e53912c2235c2fd7b0f40b0e99ed022 100644 (file)
@@ -491,7 +491,7 @@ peerDigestHandleReply(void *data, StoreIOBuffer receivedData)
          */
         newsize = fetch->bufofs - retsize;
 
-        xmemmove(fetch->buf, fetch->buf + retsize, fetch->bufofs - newsize);
+        memmove(fetch->buf, fetch->buf + retsize, fetch->bufofs - newsize);
 
         fetch->bufofs = newsize;
 
@@ -713,7 +713,7 @@ peerDigestSwapInMask(void *data, char *buf, ssize_t size)
      * NOTENOTENOTENOTENOTE: buf doesn't point to pd->cd->mask anymore!
      * we need to do the copy ourselves!
      */
-    xmemcpy(pd->cd->mask + fetch->mask_offset, buf, size);
+    memcpy(pd->cd->mask + fetch->mask_offset, buf, size);
 
     /* NOTE! buf points to the middle of pd->cd->mask! */
 
@@ -988,7 +988,7 @@ peerDigestSetCBlock(PeerDigest * pd, const char *buf)
     int freed_size = 0;
     const char *host = pd->host.termedBuf();
 
-    xmemcpy(&cblock, buf, sizeof(cblock));
+    memcpy(&cblock, buf, sizeof(cblock));
     /* network -> host conversions */
     cblock.ver.current = ntohs(cblock.ver.current);
     cblock.ver.required = ntohs(cblock.ver.required);
index 9a7fdcb767351a98793ec3922a55f070cfc49e13..a57fb4e4432515ceed9ae0d9dfe25031de705e85 100644 (file)
@@ -121,7 +121,7 @@ main(int argc, char *argv[])
             exit(2);
         }
 
-        xmemcpy(ip, &R.sin_addr.s_addr, 4);
+        memcpy(ip, &R.sin_addr.s_addr, 4);
         hp = gethostbyaddr(ip, 4, AF_INET);
         ipa = R.sin_addr;
         printf("==============================================================================\n");
index 807fdc473c32f90a645174bd3ce483700197b341..f3d13f89515f899a42f52b936e964ffe0c3a4117 100644 (file)
@@ -763,7 +763,7 @@ static_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn
     oid *instance = NULL;
     if (*len <= current->len) {
         instance = (oid *)xmalloc(sizeof(name) * (*len + 1));
-        xmemcpy(instance, name, (sizeof(name) * *len));
+        memcpy(instance, name, (sizeof(name) * *len));
         instance[*len] = 0;
         *len += 1;
     }
@@ -780,7 +780,7 @@ time_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
 
     if (*len <= current->len) {
         instance = (oid *)xmalloc(sizeof(name) * (*len + 1));
-        xmemcpy(instance, name, (sizeof(name) * *len));
+        memcpy(instance, name, (sizeof(name) * *len));
         instance[*len] = *index;
         *len += 1;
     } else {
@@ -791,7 +791,7 @@ time_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
 
         if (loop < (TIME_INDEX_LEN - 1)) {
             instance = (oid *)xmalloc(sizeof(name) * (*len));
-            xmemcpy(instance, name, (sizeof(name) * *len));
+            memcpy(instance, name, (sizeof(name) * *len));
             instance[*len - 1] = index[++loop];
         }
     }
@@ -817,7 +817,7 @@ peer_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
     } else if (*len <= current->len) {
         debugs(49, 6, "snmp peer_Inst: *len <= current->len ???");
         instance = (oid *)xmalloc(sizeof(name) * ( *len + 1));
-        xmemcpy(instance, name, (sizeof(name) * *len));
+        memcpy(instance, name, (sizeof(name) * *len));
         instance[*len] = 1 ;
         *len += 1;
     } else {
@@ -829,7 +829,7 @@ peer_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
         if (peers) {
             debugs(49, 6, "snmp peer_Inst: Encode peer #" << i);
             instance = (oid *)xmalloc(sizeof(name) * (current->len + 1 ));
-            xmemcpy(instance, name, (sizeof(name) * current->len ));
+            memcpy(instance, name, (sizeof(name) * current->len ));
             instance[current->len] = no + 1 ; // i.e. the next index on cache_peeer table.
         } else {
             debugs(49, 6, "snmp peer_Inst: We have " << i << " peers. Can't find #" << no);
@@ -864,7 +864,7 @@ client_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn
         debugs(49, 6, HERE << "len" << *len << ", current-len" << current->len << ", addr=" << laddr << ", size=" << size);
 
         instance = (oid *)xmalloc(sizeof(name) * (*len + size ));
-        xmemcpy(instance, name, (sizeof(name) * (*len)));
+        memcpy(instance, name, (sizeof(name) * (*len)));
 
         if ( !laddr.IsAnyAddr() ) {
             addr2oid(laddr, &instance[ *len]);  // the addr
@@ -888,7 +888,7 @@ client_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn
             debugs(49, 6, HERE << "len" << *len << ", current-len" << current->len << ", addr=" << laddr << ", newshift=" << newshift);
 
             instance = (oid *)xmalloc(sizeof(name) * (current->len +  newshift));
-            xmemcpy(instance, name, (sizeof(name) * (current->len)));
+            memcpy(instance, name, (sizeof(name) * (current->len)));
             addr2oid(laddr, &instance[current->len]);  // the addr.
             *len = current->len + newshift ;
         }
index 706a1ac06615ac4b4632c66be6fb1eb835457d53..bcb28cbe72df7adba0e54e3fd0262c2a7990a112 100644 (file)
@@ -1425,7 +1425,7 @@ statAvgTick(void *notused)
     c->timestamp = current_time;
     /* even if NCountHist is small, we already Init()ed the tail */
     statCountersClean(CountHist + N_COUNT_HIST - 1);
-    xmemmove(p, t, (N_COUNT_HIST - 1) * sizeof(StatCounters));
+    memmove(p, t, (N_COUNT_HIST - 1) * sizeof(StatCounters));
     statCountersCopy(t, c);
     NCountHist++;
 
@@ -1435,7 +1435,7 @@ statAvgTick(void *notused)
         StatCounters *p2 = &CountHourHist[1];
         StatCounters *c2 = &CountHist[N_COUNT_HIST - 1];
         statCountersClean(CountHourHist + N_COUNT_HOUR_HIST - 1);
-        xmemmove(p2, t2, (N_COUNT_HOUR_HIST - 1) * sizeof(StatCounters));
+        memmove(p2, t2, (N_COUNT_HOUR_HIST - 1) * sizeof(StatCounters));
         statCountersCopy(t2, c2);
         NCountHourHist++;
     }
@@ -1545,7 +1545,7 @@ statCountersCopy(StatCounters * dest, const StatCounters * orig)
 {
     assert(dest && orig);
     /* this should take care of all the fields, but "special" ones */
-    xmemcpy(dest, orig, sizeof(*dest));
+    memcpy(dest, orig, sizeof(*dest));
     /* prepare space where to copy special entries */
     statCountersInitSpecial(dest);
     /* now handle special cases */
index b264138f69565c596c9daa97c4a41bf1e08bfdda..95257d6eb0653a11d7dfddc62145a7fb5ddc419c 100644 (file)
@@ -142,7 +142,7 @@ mem_hdr::writeAvailable(mem_node *aNode, int64_t location, size_t amount, char c
     assert (location - aNode->nodeBuffer.offset == (int64_t)aNode->nodeBuffer.length);
     size_t copyLen = min(amount, aNode->space());
 
-    xmemcpy(aNode->nodeBuffer.data + aNode->nodeBuffer.length, source, copyLen);
+    memcpy(aNode->nodeBuffer.data + aNode->nodeBuffer.length, source, copyLen);
 
     if (inmem_hi <= location)
         inmem_hi = location + copyLen;
@@ -218,7 +218,7 @@ mem_hdr::copyAvailable(mem_node *aNode, int64_t location, size_t amount, char *t
 
     size_t copyLen = min(amount, aNode->nodeBuffer.length - copyOffset);
 
-    xmemcpy(target, aNode->nodeBuffer.data + copyOffset, copyLen);
+    memcpy(target, aNode->nodeBuffer.data + copyOffset, copyLen);
 
     return copyLen;
 }
index 50ac793d0bdbc463c363fa1440edb736fa852a75..fd9b3dd344a6f23c6d8facd9db3d9af01d5912fa 100644 (file)
@@ -622,7 +622,7 @@ store_client::readHeader(char const *buf, ssize_t len)
          */
         size_t copy_sz = min(copyInto.length, body_sz);
         debugs(90, 3, "storeClientReadHeader: copying " << copy_sz << " bytes of body");
-        xmemmove(copyInto.data, copyInto.data + mem->swap_hdr_sz, copy_sz);
+        memmove(copyInto.data, copyInto.data + mem->swap_hdr_sz, copy_sz);
 
         readBody(copyInto.data, copy_sz);
 
index ce7523e22951a8654770342ee77e6f4c2af46436..cf95024df84ae294601e1fa6ee7abd7d4ce3f120 100644 (file)
@@ -624,7 +624,7 @@ allocate_new_swapdir(SquidConfig::_cacheSwap * swap)
         StorePointer *tmp;
         swap->n_allocated <<= 1;
         tmp = static_cast<StorePointer *>(xcalloc(swap->n_allocated, sizeof(StorePointer)));
-        xmemcpy(tmp, swap->swapDirs, swap->n_configured * sizeof(SwapDir *));
+        memcpy(tmp, swap->swapDirs, swap->n_configured * sizeof(SwapDir *));
         xfree(swap->swapDirs);
         swap->swapDirs = tmp;
     }
index be83ca0a8237047a6a96382b089d447f406ebdef..06f1377a4ab10e75692b4e116eecf200b52d5e43 100644 (file)
@@ -155,14 +155,14 @@ cache_key *
 storeKeyDup(const cache_key * key)
 {
     cache_key *dup = (cache_key *)memAllocate(MEM_MD5_DIGEST);
-    xmemcpy(dup, key, SQUID_MD5_DIGEST_LENGTH);
+    memcpy(dup, key, SQUID_MD5_DIGEST_LENGTH);
     return dup;
 }
 
 cache_key *
 storeKeyCopy(cache_key * dst, const cache_key * src)
 {
-    xmemcpy(dst, src, SQUID_MD5_DIGEST_LENGTH);
+    memcpy(dst, src, SQUID_MD5_DIGEST_LENGTH);
     return dst;
 }
 
index 0fa50acaf48f080afda4a751027ca25a2cd044d1..ed17af445a2b2357b2cf1021fa6c742ff17662f0 100644 (file)
@@ -135,15 +135,15 @@ storeSwapMetaPack(tlv * tlv_list, int *length)
 
     buf[j++] = (char) STORE_META_OK;
 
-    xmemcpy(&buf[j], &buflen, sizeof(int));
+    memcpy(&buf[j], &buflen, sizeof(int));
 
     j += sizeof(int);
 
     for (t = tlv_list; t; t = t->next) {
         buf[j++] = t->getType();
-        xmemcpy(&buf[j], &t->length, sizeof(int));
+        memcpy(&buf[j], &t->length, sizeof(int));
         j += sizeof(int);
-        xmemcpy(&buf[j], t->value, t->length);
+        memcpy(&buf[j], t->value, t->length);
         j += t->length;
     }
 
index 489896500d3ace1654b395cbc9d240cb1f36913a..30ae1dbf0989a6b7c1ba841f6cd7cd249a3060ed 100644 (file)
@@ -225,7 +225,7 @@ cacheEntryCreate(const storeSwapLogData * s)
     CacheEntry *e = (CacheEntry *)xcalloc(1, sizeof(CacheEntry));
     assert(s);
     /* e->s = *s; */
-    xmemcpy(e->key_arr, s->key, SQUID_MD5_DIGEST_LENGTH);
+    memcpy(e->key_arr, s->key, SQUID_MD5_DIGEST_LENGTH);
     e->key = &e->key_arr[0];
     return e;
 }
@@ -491,7 +491,7 @@ accessLogReader(FileIterator * fi)
      * strcmp(hier, "SSL_PARENT_MISS") &&
      * strcmp(hier, "DEFAULT_PARENT");
      */
-    xmemcpy(entry->key, storeKeyPublic(url, method_id), sizeof(entry->key));
+    memcpy(entry->key, storeKeyPublic(url, method_id), sizeof(entry->key));
 
     /*fprintf(stdout, "%s:%d: %s %s %s %s\n",
      * fname, count, method, storeKeyText(entry->key), url, hier); */
index 0e5d688cb8b4f6cd4c33de28c0e387d38b67f266..24d635412d39930b546440ca9a9c19d3118c891e 100644 (file)
@@ -934,7 +934,7 @@ URLHostName::trimAuth()
 
     if ((t = strrchr(Host, '@'))) {
         t++;
-        xmemmove(Host, t, strlen(t) + 1);
+        memmove(Host, t, strlen(t) + 1);
     }
 }
 
index e96f2ad1df998e37d5375463833f9c4300f5ed79..8e1c4ad7145bf5009ec876ca79c37e6228a2feac 100644 (file)
@@ -482,7 +482,7 @@ urnParseReply(const char *inbuf, const HttpRequestMethod& m)
             old = list;
             n <<= 2;
             list = (url_entry *)xcalloc(n + 1, sizeof(*list));
-            xmemcpy(list, old, i * sizeof(*list));
+            memcpy(list, old, i * sizeof(*list));
             safe_free(old);
         }
 
index 9f0f5147987feac0137ea8f5eb3a19abf80b5138..fbe2e74e2d4c0f31af51a2e53d73acc9005f1716 100644 (file)
@@ -354,7 +354,7 @@ wccpAssignBuckets(void)
 
     for (loop = 0; loop < number_caches; loop++) {
         int i;
-        xmemcpy(&caches[loop],
+        memcpy(&caches[loop],
                 &wccp_i_see_you.wccp_cache_entry[loop].ip_addr,
                 sizeof(*caches));
 
index f9af664b1632336f90e9de95f3e7cd9d2cbda59e..6f49e7af4a23ce79cd2822b2fc73e1c04d54ffac 100644 (file)
@@ -744,13 +744,11 @@ wccp2Init(void)
         service_list_ptr->security_info = (struct wccp2_security_md5_t *) ptr;
 
         if (service_list_ptr->wccp2_security_type == WCCP2_MD5_SECURITY) {
-
-            xmemcpy(ptr, &wccp2_security_md5, sizeof(struct wccp2_security_md5_t));
-
+            memcpy(ptr, &wccp2_security_md5, sizeof(struct wccp2_security_md5_t));
             ptr += sizeof(struct wccp2_security_md5_t);
         } else {
             /* assume NONE, and XXX I hate magic length numbers */
-            xmemcpy(ptr, &wccp2_security_md5, 8);
+            memcpy(ptr, &wccp2_security_md5, 8);
             ptr += 8;
         }
 
@@ -760,7 +758,7 @@ wccp2Init(void)
 
         assert(wccp2_here_i_am_header.length <= WCCP_RESPONSE_SIZE);
 
-        xmemcpy(ptr, &service_list_ptr->info, sizeof(struct wccp2_service_info_t));
+        memcpy(ptr, &service_list_ptr->info, sizeof(struct wccp2_service_info_t));
 
         service_list_ptr->service_info = (struct wccp2_service_info_t *) ptr;
 
@@ -783,7 +781,7 @@ wccp2Init(void)
             wccp2_identity_info.cache_identity.weight = htons(Config.Wccp2.weight);
             memset(&wccp2_identity_info.cache_identity.status, '\0', sizeof(wccp2_identity_info.cache_identity.status));
 
-            xmemcpy(ptr, &wccp2_identity_info, sizeof(struct wccp2_identity_info_t));
+            memcpy(ptr, &wccp2_identity_info, sizeof(struct wccp2_identity_info_t));
             service_list_ptr->wccp2_identity_info_ptr = ptr;
 
             ptr += sizeof(struct wccp2_identity_info_t);
@@ -817,7 +815,7 @@ wccp2Init(void)
             wccp2_mask_identity_info.cache_identity.weight = 0;
             wccp2_mask_identity_info.cache_identity.status = 0;
 
-            xmemcpy(ptr, &wccp2_mask_identity_info, sizeof(struct wccp2_mask_identity_info_t));
+            memcpy(ptr, &wccp2_mask_identity_info, sizeof(struct wccp2_mask_identity_info_t));
             service_list_ptr->wccp2_identity_info_ptr = ptr;
 
             ptr += sizeof(struct wccp2_mask_identity_info_t);
@@ -839,7 +837,7 @@ wccp2Init(void)
 
         wccp2_cache_view_header.cache_view_version = htonl(1);
 
-        xmemcpy(ptr, &wccp2_cache_view_header, sizeof(wccp2_cache_view_header));
+        memcpy(ptr, &wccp2_cache_view_header, sizeof(wccp2_cache_view_header));
 
         ptr += sizeof(wccp2_cache_view_header);
 
@@ -850,7 +848,7 @@ wccp2Init(void)
 
         service_list_ptr->num_routers = htonl(wccp2_numrouters);
 
-        xmemcpy(ptr, &service_list_ptr->num_routers, sizeof(service_list_ptr->num_routers));
+        memcpy(ptr, &service_list_ptr->num_routers, sizeof(service_list_ptr->num_routers));
 
         ptr += sizeof(service_list_ptr->num_routers);
 
@@ -890,7 +888,7 @@ wccp2Init(void)
 
         wccp2_cache_view_info.num_caches = htonl(0);
 
-        xmemcpy(ptr, &wccp2_cache_view_info.num_caches, sizeof(wccp2_cache_view_info.num_caches));
+        memcpy(ptr, &wccp2_cache_view_info.num_caches, sizeof(wccp2_cache_view_info.num_caches));
 
         ptr += sizeof(wccp2_cache_view_info.num_caches);
 
@@ -903,7 +901,7 @@ wccp2Init(void)
 
         wccp2_capability_info_header.capability_info_length = htons(3 * sizeof(wccp2_capability_element));
 
-        xmemcpy(ptr, &wccp2_capability_info_header, sizeof(wccp2_capability_info_header));
+        memcpy(ptr, &wccp2_capability_info_header, sizeof(wccp2_capability_info_header));
 
         ptr += sizeof(wccp2_capability_info_header);
 
@@ -918,7 +916,7 @@ wccp2Init(void)
 
         wccp2_capability_element.capability_value = htonl(Config.Wccp2.forwarding_method);
 
-        xmemcpy(ptr, &wccp2_capability_element, sizeof(wccp2_capability_element));
+        memcpy(ptr, &wccp2_capability_element, sizeof(wccp2_capability_element));
 
         ptr += sizeof(wccp2_capability_element);
 
@@ -933,7 +931,7 @@ wccp2Init(void)
 
         wccp2_capability_element.capability_value = htonl(Config.Wccp2.assignment_method);
 
-        xmemcpy(ptr, &wccp2_capability_element, sizeof(wccp2_capability_element));
+        memcpy(ptr, &wccp2_capability_element, sizeof(wccp2_capability_element));
 
         ptr += sizeof(wccp2_capability_element);
 
@@ -948,7 +946,7 @@ wccp2Init(void)
 
         wccp2_capability_element.capability_value = htonl(Config.Wccp2.return_method);
 
-        xmemcpy(ptr, &wccp2_capability_element, sizeof(wccp2_capability_element));
+        memcpy(ptr, &wccp2_capability_element, sizeof(wccp2_capability_element));
 
         ptr += sizeof(wccp2_capability_element);
 
@@ -1766,7 +1764,7 @@ wccp2AssignBuckets(void *voidnotused)
         offset += sizeof(struct assignment_key_t);
 
         /* Number of routers */
-        xmemcpy(&wccp_packet[offset], &service_list_ptr->num_routers, sizeof(service_list_ptr->num_routers));
+        memcpy(&wccp_packet[offset], &service_list_ptr->num_routers, sizeof(service_list_ptr->num_routers));
 
         offset += sizeof(service_list_ptr->num_routers);
 
@@ -1795,7 +1793,7 @@ wccp2AssignBuckets(void *voidnotused)
 
             case WCCP2_ASSIGNMENT_METHOD_HASH:
                 /* Number of caches */
-                xmemcpy(&wccp_packet[offset], &router_list_ptr->num_caches, sizeof(router_list_ptr->num_caches));
+                memcpy(&wccp_packet[offset], &router_list_ptr->num_caches, sizeof(router_list_ptr->num_caches));
                 offset += sizeof(router_list_ptr->num_caches);
 
                 if (num_caches) {
@@ -1806,7 +1804,7 @@ wccp2AssignBuckets(void *voidnotused)
 
                         cache_address = (struct in_addr *) &wccp_packet[offset];
 
-                        xmemcpy(cache_address, &cache_list_ptr->cache_ip, sizeof(struct in_addr));
+                        memcpy(cache_address, &cache_list_ptr->cache_ip, sizeof(struct in_addr));
                         total_weight += cache_list_ptr->weight << 12;
                         weight[cache] = cache_list_ptr->weight << 12;
 
@@ -1865,7 +1863,7 @@ wccp2AssignBuckets(void *voidnotused)
 
             case WCCP2_ASSIGNMENT_METHOD_MASK:
                 num_maskval = htonl(1);
-                xmemcpy(&wccp_packet[offset], &num_maskval, sizeof(int));
+                memcpy(&wccp_packet[offset], &num_maskval, sizeof(int));
                 offset += sizeof(int);
 
                 mask_element = (struct wccp2_mask_element_t *) &wccp_packet[offset];
index 6f0b135c37633c4c7c28987caecef30383fd49f0..6bb8ebf997ef2a98c727f92512ba1712966d8576 100644 (file)
@@ -312,7 +312,7 @@ handle_read(char *inbuf, int len)
         return -1;
     }
     total_bytes_read += len;
-    xmemcpy(buf, inbuf, len);
+    memcpy(buf, inbuf, len);
     if (len == 0) {
         fprintf(stderr, "WARNING: %s, server closed socket after %d+%d bytes\n", r->url, r->hdr_offset, r->bytes_read);
         /* XXX, If no data was received and it isn't the first request on this
@@ -331,12 +331,12 @@ handle_read(char *inbuf, int len)
         /* Build headers */
         if (r->hdr_length == 0) {
             hlen = min(len, REPLY_HDR_SZ - r->hdr_offset - 1);
-            xmemcpy(r->reply_hdrs + r->hdr_offset, buf, hlen);
+            memcpy(r->reply_hdrs + r->hdr_offset, buf, hlen);
             r->hdr_offset += hlen;
             r->reply_hdrs[r->hdr_offset] = '\0';
             len -= hlen;
             /* Save any remaining read data */
-            xmemmove(buf, buf + hlen, len);
+            memmove(buf, buf + hlen, len);
         }
         /* Process headers */
         if (r->hdr_length == 0 && (end = mime_headers_end(r->reply_hdrs)) != NULL) {
@@ -352,8 +352,8 @@ handle_read(char *inbuf, int len)
             blen = r->hdr_offset - r->hdr_length;
             assert(blen >= 0);
             if (blen > 0) {
-                xmemmove(buf + blen, buf, len);
-                xmemcpy(buf, r->reply_hdrs + r->hdr_length, blen);
+                memmove(buf + blen, buf, len);
+                memcpy(buf, r->reply_hdrs + r->hdr_length, blen);
                 len += blen;
             }
             r->reply_hdrs[r->hdr_length] = '\0';       /* Null terminate headers */
@@ -398,7 +398,7 @@ handle_read(char *inbuf, int len)
             } else if (r->content_length > -1) {
                 assert(r->bytes_read < r->content_length);
             }
-            xmemmove(buf, buf + bytes_used, len);
+            memmove(buf, buf + bytes_used, len);
         }
     }
     return 0;