--- act_mem.c 2002/01/02 17:05:53 1.10
+++ act_mem.c 2003/01/06 12:10:58 1.11
@@ -1,9 +1,10 @@
-/*
-** Act - Abstract Container Type Library
-** Copyright (c) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
+/*
+** OSSP act - Abstract Container Types
+** Copyright (c) 1999-2003 Ralf S. Engelschall <rse@engelschall.com>
+** Copyright (c) 1999-2003 The OSSP Project <http://www.ossp.org/>
**
-** This file is part of Act, a library for dealing with Abstract
-** Container Types which can be found at http://www.ossp.org/pkg/act/.
+** This file is part of OSSP act, an abstract container type library
+** which can be found at http://www.ossp.org/pkg/lib/act/.
**
** Permission to use, copy, modify, and distribute this software for
** any purpose with or without fee is hereby granted, provided that
@@ -42,7 +43,7 @@
void *(*act_mem_char)(const void *, unsigned char, size_t) = _act_mem_char;
int (*act_mem_cmp)(const void *, const void *, size_t) = _act_mem_cmp;
-/*
+/*
* Align a size to the next larger or equal size which is likely to have the
* longest *relevant* CPU-specific memory word alignment restrictions.
*/
@@ -116,7 +117,7 @@
}
/* fill the whole stamping word */
- if ((c = (unsigned char)c0) != 0) {
+ if ((c = (unsigned char)c0) != 0) {
c = c | (c << 8);
#if (SIZEOF_INT > 2)
c = c | (c << 16);
@@ -163,7 +164,7 @@
return NULL;
src_p = src;
dst_p = dst;
- if (dst > src) {
+ if (dst > src) {
/* must go high to low */
src_p += bytes;
dst_p += bytes;
@@ -196,19 +197,19 @@
/* additional function: memmem(3) like */
intern void *
_act_mem_mem(
- const void *haystack, size_t haystack_len,
+ const void *haystack, size_t haystack_len,
const void *needle, size_t needle_len)
{
register const char *begin;
register const char *last_possible;
-
- if (needle_len == 0)
+
+ if (needle_len == 0)
/* The first occurrence of the empty string is deemed to occur at
the end of the string. */
return (void *)&((const char *)haystack)[haystack_len - 1];
last_possible = (const char *)haystack + haystack_len - needle_len;
for (begin = (const char *)haystack; begin <= last_possible; begin++)
- if ( *begin == *((const char *)needle)
+ if ( *begin == *((const char *)needle)
&& act_mem_cmp(&begin[1], (const char *)needle + 1, needle_len - 1) == 0)
return (void *)begin;
return NULL;
@@ -219,7 +220,7 @@
{
register const unsigned char *cp1;
register const unsigned char *cp2;
-
+
if (bytes != 0) {
cp1 = src1;
cp2 = src2;
|