|
From: Dmitry Y. <di...@us...> - 2007-09-24 09:35:47
|
Build Version : T2.1.0.16695 Firebird 2.1 Beta 2
(writeBuildNum.sh,v 1.16853 2007/09/24 09:35:47 dimitr Exp )
Update of /cvsroot/firebird/firebird2/src/jrd
In directory sc8-pr-cvs17:/tmp/cvs-serv3918
Modified Files:
Tag: B3_0_Transition
btr.cpp common.h inf.cpp mov.cpp mov_proto.h
Log Message:
Cleanup.
Index: btr.cpp
===================================================================
RCS file: /cvsroot/firebird/firebird2/src/jrd/btr.cpp,v
retrieving revision 1.196.2.1
retrieving revision 1.196.2.2
diff -b -U3 -r1.196.2.1 -r1.196.2.2
--- btr.cpp 24 Sep 2007 08:10:19 -0000 1.196.2.1
+++ btr.cpp 24 Sep 2007 09:35:43 -0000 1.196.2.2
@@ -2871,8 +2871,6 @@
length = page->btr_length - (localPointer - (UCHAR*) page);
if (length) {
// Could be overlapping buffers.
- // Use MEMMOVE macro which is memmove() in most platforms, instead
- // of MOVE_FAST which is memcpy() in most platforms.
// memmove() is guaranteed to work non-destructivly on overlapping buffers.
memmove(pointer, localPointer, length);
pointer += length;
Index: common.h
===================================================================
RCS file: /cvsroot/firebird/firebird2/src/jrd/common.h,v
retrieving revision 1.154.2.3
retrieving revision 1.154.2.4
diff -b -U3 -r1.154.2.3 -r1.154.2.4
--- common.h 24 Sep 2007 08:18:43 -0000 1.154.2.3
+++ common.h 24 Sep 2007 09:35:43 -0000 1.154.2.4
@@ -128,11 +128,6 @@
#define IMPLEMENTATION isc_info_db_impl_linux_mipsel /* 71 */
#endif /* mipsel */
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
-
#endif /* LINUX */
/*****************************************************
@@ -228,11 +223,6 @@
#define setreuid(ruid, euid) setuid(euid)
#define setregid(rgid, egid) setgid(egid)
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
-
//format for __LINE__
#define LINEFORMAT "d"
@@ -277,11 +267,6 @@
#define QUADFORMAT "q"
#define MAP_ANNON
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t)length)
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
-
#endif /* Darwin Platforms */
@@ -314,11 +299,6 @@
//#define KILLER_SIGNALS
#define NO_NFS /* no MTAB_OPEN or MTAB_CLOSE in isc_file.c */
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
-
#endif /* FREEBSD */
/*****************************************************
@@ -345,11 +325,6 @@
//#define KILLER_SIGNALS
#define NO_NFS /* no MTAB_OPEN or MTAB_CLOSE in isc_file.c */
-#define MEMMOVE(from, to, length) memmove ((void *)(to), (void *)(from), (size_t) length)
-#define MOVE_FAST(from, to, length) memcpy ((to), (from), (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy ((to), (from), (int) (length))
-#define MOVE_CLEAR(to, length) memset ((to), 0, (int) (length))
-
#endif /* NETBSD */
@@ -391,32 +366,6 @@
#error "need to use SFIO"
#endif
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-/********* Reason for introducing MEMMOVE macro.
-
- void *memcpy( void *s1, const void *s2, size_t n);
- void *memmove( void *s1, const void *s2, size_t n);
-
- The memcpy() function copies n characters from the string pointed to by the
- s2 parameter into the location pointed to by the s1 parameter. When copy-
- ing overlapping strings, the behavior of this function is unreliable.
-
- The memmove() function copies n characters from the string at the location
- pointed to by the s2 parameter to the string at the location pointed to by
- the s1 parameter. Copying takes place as though the n number of characters
- from string s2 are first copied into a temporary location having n bytes
- that do not overlap either of the strings pointed to by s1 and s2. Then, n
- number of characters from the temporary location are copied to the string
- pointed to by s1. Consequently, this operation is nondestructive and
- proceeds from left to right.
- The above text is taken from the Digital UNIX man pages.
-
- For maximum portability, memmove should be used when the memory areas
- indicated by s1 and s2 may overlap, and memcpy used for faster copying
- between non-overlapping areas.
-
-**********/
-
/* The following define is the prefix to go in front of a "d" or "u"
format item in a printf() format string, to indicate that the argument
is an SINT64 or UINT64. */
@@ -450,9 +399,6 @@
#endif /* sparc */
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
#endif /* sun */
@@ -489,11 +435,6 @@
which is too large to fit in a long int. */
#define QUADCONST(n) (n##LL)
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
-
#endif /* hpux */
@@ -510,10 +451,6 @@
//*#define ALIGNMENT 4
#define IMPLEMENTATION isc_info_db_impl_isc_rt_aix /* 35 */
#define IEEE
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
#define SYSCALL_INTERRUPTED(err) (((err) == EINTR) || ((err) == ERESTART)) /* pjpg 20001102 */
#else /* AIX PowerPC */
#define AIX_PPC
@@ -523,10 +460,6 @@
//#define ALIGNMENT 4
#define IMPLEMENTATION isc_info_db_impl_isc_rt_aix /* 35 */
#define IEEE
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
#define SYSCALL_INTERRUPTED(err) (((err) == EINTR) || ((err) == ERESTART)) /* pjpg 20001102 */
#define QUADFORMAT "ll" /* TMC 081700 */
@@ -546,11 +479,6 @@
#define NO_NFS
-#define MOVE_FAST(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (int) (length))
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-
#define SYS_ARG isc_arg_win32
#define SYS_ERR isc_arg_win32
//#define SLONGFORMAT "ld"
@@ -635,10 +563,6 @@
//#define KILLER_SIGNALS
//
#define IMPLEMENTATION isc_info_db_impl_sco_ev /* 59 */
-#define MEMMOVE(from, to, length) memmove ((void *)to, (void *)from, (size_t) length)
-#define MOVE_FAST(from, to, length) memcpy (to, from, (unsigned int) (length))
-#define MOVE_FASTER(from, to, length) memcpy (to, from, (unsigned int) (length))
-#define MOVE_CLEAR(to, length) memset (to, 0, (unsigned int) (length))
// These functions are supported so we don't need the defines
//#define setreuid(ruid, euid) setuid(euid)
@@ -887,22 +811,9 @@
/* data movement and allocation macros */
-#ifndef MOVE_FAST
-#define MOVE_FAST(from, to, length) MOV_fast (from, to, (ULONG) (length))
-#endif
-
-#ifndef MOVE_FASTER
-#define MOVE_FASTER(from, to, length) MOV_faster (from, to, (ULONG) (length))
-#endif
-
-#ifndef MEMMOVE
-/* Use character by character copy function */
-#define MEMMOVE(from, to, length) MOV_fast (from, to, (ULONG) (length))
-#endif
-
-#ifndef MOVE_CLEAR
-#define MOVE_CLEAR(to, length) MOV_fill (to, (ULONG) (length))
-#endif
+#define MOVE_CLEAR(to, length) memset(to, 0, (size_t) (length))
+#define MOVE_FAST(from, to, length) memcpy(to, from, (size_t) (length))
+#define MOVE_FASTER(from, to, length) memcpy(to, from, (size_t) (length))
#ifndef ALLOC_LIB_MEMORY
#define ALLOC_LIB_MEMORY(size) gds__alloc (size)
Index: inf.cpp
===================================================================
RCS file: /cvsroot/firebird/firebird2/src/jrd/inf.cpp,v
retrieving revision 1.73
retrieving revision 1.73.2.1
diff -b -U3 -r1.73 -r1.73.2.1
--- inf.cpp 8 Jun 2007 10:24:54 -0000 1.73
+++ inf.cpp 24 Sep 2007 09:35:43 -0000 1.73.2.1
@@ -829,7 +829,7 @@
STUFF_WORD(ptr, length);
if (length) {
- MEMMOVE(string, ptr, length);
+ memmove(ptr, string, length);
ptr += length;
}
Index: mov.cpp
===================================================================
RCS file: /cvsroot/firebird/firebird2/src/jrd/mov.cpp,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -b -U3 -r1.31.2.1 -r1.31.2.2
--- mov.cpp 24 Sep 2007 08:15:37 -0000 1.31.2.1
+++ mov.cpp 24 Sep 2007 09:35:43 -0000 1.31.2.2
@@ -130,157 +130,6 @@
}
-void MOV_fast(
- const SCHAR* from,
- SCHAR* to, ULONG length)
-{
-/**************************************
- *
- * M O V _ f a s t
- *
- **************************************
- *
- * Functional description
- * Move a byte string as fast as possible.
- *
- **************************************/
- ULONG l = length >> 4;
- if (l)
- do {
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- } while (--l);
-
- if (length &= 15)
- do {
- *to++ = *from++;
- } while (--length);
-}
-
-
-void MOV_faster(const SLONG* from, SLONG* to, ULONG length)
-{
-/**************************************
- *
- * M O V _ f a s t e r
- *
- **************************************
- *
- * Functional description
- * Do a long move, already aligned, as quickly as possible.
- *
- **************************************/
- ULONG l;
-
- fb_assert(!((U_IPTR) to & (sizeof(ULONG) - 1))); /* ULONG alignment required */
- fb_assert(!((U_IPTR) from & (sizeof(ULONG) - 1))); /* ULONG alignment required */
-
-/* copy by chunks of 8 longwords == 32 bytes == 2**5 bytes */
- if (l = (length >> 5)) {
- do {
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- } while (--l);
- length &= (8 * sizeof(ULONG) - 1);
- }
-
-/* Copy by longwords */
- if (l = (length >> 2))
- do
- *to++ = *from++;
- while (--l);
-
-/* Finally, copy any trailing bytes */
- if (l = (length & 3)) {
- UCHAR* p = (UCHAR *) to;
- const UCHAR* q = (UCHAR *) from;
- do
- *p++ = *q++;
- while (--l);
- }
-}
-
-
-void MOV_fill(SLONG* to, ULONG length)
-{
-/**************************************
- *
- * M O V _ f i l l
- *
- **************************************
- *
- * Functional description
- * Clear out a block.
- *
- **************************************/
- ULONG l;
-
-/* If not longword aligned, fill bytewise until it is */
-
- if (l = (((U_IPTR) to) & (sizeof(ULONG) - 1))) {
- l = sizeof(ULONG) - l;
- if (length < l)
- l = length;
- length -= l;
- UCHAR* p = (UCHAR *) to;
- while (l--)
- *p++ = 0;
- to = (SLONG *) p;
- fb_assert(!(((U_IPTR) to) & (sizeof(ULONG) - 1)) /* We're now aligned ULONG */
- || !length); /* Or already completed */
- }
-
-/* Fill in chunks of 8 longwords == 32 bytes == 2**5 bytes */
- if (l = (length >> 5)) {
- do {
- *to++ = 0;
- *to++ = 0;
- *to++ = 0;
- *to++ = 0;
- *to++ = 0;
- *to++ = 0;
- *to++ = 0;
- *to++ = 0;
- } while (--l);
- length &= (8 * sizeof(ULONG) - 1);
- }
-
-/* Fill by longwords */
- if (l = (length >> 2))
- do
- *to++ = 0;
- while (--l);
-
-/* Finally, fill any trailing bytes */
- if (l = (length & 3)) {
- UCHAR* p = (UCHAR *) to;
- do
- *p++ = 0;
- while (--l);
- }
-}
-
-
double MOV_get_double(const dsc* desc)
{
/**************************************
Index: mov_proto.h
===================================================================
RCS file: /cvsroot/firebird/firebird2/src/jrd/mov_proto.h,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -b -U3 -r1.15 -r1.15.2.1
--- mov_proto.h 12 Apr 2007 15:56:30 -0000 1.15
+++ mov_proto.h 24 Sep 2007 09:35:43 -0000 1.15.2.1
@@ -34,9 +34,6 @@
int MOV_compare(const dsc*, const dsc*);
double MOV_date_to_double(const dsc*);
void MOV_double_to_date(double, SLONG[2]);
-void MOV_fast(const SCHAR*, SCHAR*, ULONG);
-void MOV_faster(const SLONG*, SLONG*, ULONG);
-void MOV_fill(SLONG*, ULONG);
double MOV_get_double(const dsc*);
SLONG MOV_get_long(const dsc*, SSHORT);
void MOV_get_metadata_str(const dsc*, TEXT*, USHORT);
|