Hello community, here is the log from the commit of package mhash checked in at Tue Apr 18 16:09:11 CEST 2006. -------- --- mhash/mhash.changes 2006-01-27 02:12:59.000000000 +0100 +++ STABLE/mhash/mhash.changes 2006-04-18 15:12:40.000000000 +0200 @@ -1,0 +2,5 @@ +Tue Apr 18 15:12:18 CEST 2006 - ro@suse.de + +- use stdfns.c from 0.9.6 to fix bigendian platforms + +------------------------------------------------------------------- New: ---- mhash-0.9.4a-stdfns.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mhash.spec ++++++ --- /var/tmp/diff_new_pack.Trlsod/_old 2006-04-18 16:08:05.000000000 +0200 +++ /var/tmp/diff_new_pack.Trlsod/_new 2006-04-18 16:08:05.000000000 +0200 @@ -5,14 +5,14 @@ # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # -# Please submit bugfixes or comments via http://bugs.opensuse.org +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: mhash Version: 0.9.4a -Release: 3 +Release: 11 Autoreqprov: on Group: Development/Libraries/C and C++ License: GPL @@ -23,6 +23,7 @@ Patch1: %{name}-%{version}-uninitialized.diff Patch2: %{name}-%{version}-include.diff Patch3: %{name}-%{version}-comparison.diff +Patch4: %{name}-%{version}-stdfns.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -59,6 +60,7 @@ %patch1 %patch2 %patch3 +%patch4 %build %{suse_update_config -f .} @@ -98,6 +100,8 @@ %{_libdir}/libmhash.*so %changelog -n mhash +* Tue Apr 18 2006 - ro@suse.de +- use stdfns.c from 0.9.6 to fix bigendian platforms * Fri Jan 27 2006 - mls@suse.de - converted neededforbuild to BuildRequires * Wed Jan 25 2006 - mjancar@suse.cz ++++++ mhash-0.9.4a-stdfns.diff ++++++ --- lib/stdfns.c +++ lib/stdfns.c @@ -85,18 +85,33 @@ WIN32DLL_DEFINE void -mutils_memset(void *s, __const mutils_word8 c, const mutils_word32 n) +mutils_memset(void *s, __const mutils_word8 c, __const mutils_word32 n) { - mutils_word8 *stmp = (mutils_word8 *) s; + mutils_word8 *stmp; + mutils_word32 *ltmp = (mutils_word32 *) s; + mutils_word32 lump; mutils_word32 i; + mutils_word32 words; + mutils_word32 remainder; if ((s == NULL) || (n == 0)) { return; } + lump = (c << 24) + (c << 16) + (c << 8) + c; - for (i = 0; i < n; i++, stmp++) + words = n >> 2; + remainder = n - (words << 2); + + for (i = 0; i < words; i++, ltmp++) + { + *ltmp = lump; + } + + stmp = (mutils_word8 *) ltmp; + + for (i = 0; i < remainder; i++, stmp++) { *stmp = c; } @@ -104,31 +119,48 @@ WIN32DLL_DEFINE void -mutils_memcpy(void *dest, __const void *src, const mutils_word32 n) +mutils_memcpy(void *dest, __const void *src, __const mutils_word32 n) { mutils_word8 *ptr1; mutils_word8 *ptr2; + mutils_word32 *bigptr1; + mutils_word32 *bigptr2; mutils_word32 i; + mutils_word32 words; + mutils_word32 remainder; if ((dest == NULL) || (src == NULL) || (n == 0)) { return; } - ptr1 = (mutils_word8 *) dest; - ptr2 = (mutils_word8 *) src; + words = n >> 2; + remainder = n - (words << 2); + + bigptr1 = (mutils_word32 *) dest; + bigptr2 = (mutils_word32 *) src; + + for (i = 0; i < words; i ++, bigptr1++, bigptr2++) + { + *bigptr1 = *bigptr2; + } + + ptr1 = (mutils_word8 *) bigptr1; + ptr2 = (mutils_word8 *) bigptr2; - for (i = 0; i < n; i++, ptr1++, ptr2++) + for (i = 0; i < remainder; i++, ptr1++, ptr2++) { *ptr1 = *ptr2; } } #define MIX32(a) \ - (((mutils_word32)((mutils_word8 *)(a))[0]) | \ - (((mutils_word32)((mutils_word8 *)(a))[1]) << 8)| \ - (((mutils_word32)((mutils_word8 *)(a))[2]) << 16)| \ - (((mutils_word32)((mutils_word8 *)(a))[3]) << 24)) + ((mutils_word32) \ + (((a & (mutils_word32) 0x000000ffU) << 24) | \ + ((a & (mutils_word32) 0x0000ff00U) << 8) | \ + ((a & (mutils_word32) 0x00ff0000U) >> 8) | \ + ((a & (mutils_word32) 0xff000000U) >> 24)) \ + ) /* Byte swap a 32bit integer @@ -193,16 +225,31 @@ mutils_word8 *ptr1; mutils_word8 *ptr2; mutils_word32 i; + mutils_word32 *bigptr1; + mutils_word32 *bigptr2; + mutils_word32 words; + mutils_word32 remainder; if ((dest == NULL) || (src == NULL) || (n == 0)) { return; } - ptr1 = (mutils_word8 *) dest; - ptr2 = (mutils_word8 *) src; + bigptr1 = (mutils_word32 *) dest; + bigptr2 = (mutils_word32 *) src; + + words = n >> 2; + remainder = n - (words << 2); - for (i = 0; i < n; i++, ptr1++, ptr2++) + for (i = 0; i < words; i++, bigptr1++, bigptr2++) + { + *bigptr1 = *bigptr2; + } + + ptr1 = (mutils_word8 *) bigptr1; + ptr2 = (mutils_word8 *) bigptr2; + + for (i = 0; i < remainder; i++, ptr1++, ptr2++) { *ptr1 = *ptr2; } @@ -387,6 +434,11 @@ mutils_val2char(mutils_word8 x) { mutils_word8 out; + mutils_word8 out2; + + static mutils_word8 *table = "0123456789abcdef"; + + out2 = *(table + x); switch(x) { @@ -407,6 +459,12 @@ case 0xe : { out = 'e'; break; } case 0xf : { out = 'f'; break; } } + + if (out2 != out) + { + printf("ERROR!\n"); + exit(1); + } return(out); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de