From 0d89ac85cd382ad06ac16fc94110400e7b0e36d2 Mon Sep 17 00:00:00 2001 From: Hu Zheng Date: Wed, 28 Mar 2007 05:53:57 +0000 Subject: [PATCH] add 64bit fix --- zhcon-0.2.6-64bit-fix.patch | 51 +++++++++++++++++++++++++++++++++++++ zhcon.spec | 2 ++ 2 files changed, 53 insertions(+) create mode 100644 zhcon-0.2.6-64bit-fix.patch diff --git a/zhcon-0.2.6-64bit-fix.patch b/zhcon-0.2.6-64bit-fix.patch new file mode 100644 index 0000000..067bb8c --- /dev/null +++ b/zhcon-0.2.6-64bit-fix.patch @@ -0,0 +1,51 @@ +diff -r -u zhcon-0.2.5.orig/src/winime.cpp zhcon-0.2.5.new/src/winime.cpp +--- zhcon-0.2.5.orig/src/winime.cpp 2007-03-28 13:33:26.000000000 +0800 ++++ zhcon-0.2.5.new/src/winime.cpp 2007-03-28 13:42:41.000000000 +0800 +@@ -74,7 +74,7 @@ + return false; + } + //add a word to candilist then push rp forward +-void WinIme::AddCandilist(char *&rp,unsigned int& buflen) { ++void WinIme::AddCandilist(char *&rp,unsigned long& buflen) { + assert(mpList->mCount < 10); + assert(!IsHzCode1(*rp)); //*rp is last matched latter + +@@ -163,7 +163,7 @@ + count--; + break; + } +- AddCandilist(t,(unsigned int&)buflen); ++ AddCandilist(t,(unsigned long&)buflen); + } //search next word + else { + if (len == 1) //special for first char +@@ -250,7 +250,7 @@ + + if (p == (char *) 0xffffffff) + found = false; +- p = (unsigned int) p + mpText; ++ p = (unsigned long) p + mpText; + } //2nd level index + else if (mNum == 1) { + int l = strlen(mHead.mCodeSet); +@@ -271,7 +271,7 @@ + if (p == (char *) 0xffffffff) + found = false; + +- p = (unsigned int) p + mpText; ++ p = (unsigned long) p + mpText; + } else if (mNum < mHead.mMaxCodes) { + p = mpOffset[mNum - 1]; + if (p == (char *) 0xffffffff) +diff -r -u zhcon-0.2.5.orig/src/winime.h zhcon-0.2.5.new/src/winime.h +--- zhcon-0.2.5.orig/src/winime.h 2007-03-28 13:33:26.000000000 +0800 ++++ zhcon-0.2.5.new/src/winime.h 2007-03-28 13:42:45.000000000 +0800 +@@ -69,7 +69,7 @@ + return c >= 0xA1 && c <= 0xFE; + } + +- void AddCandilist(char*& p,unsigned& buflen); ++ void AddCandilist(char*& p,unsigned long& buflen); + void SkipNext(char*& rp); + int MatchWord(char* p, int len, int offset); + bool IsGB2312(char* p); diff --git a/zhcon.spec b/zhcon.spec index a44fde3..42cfdb0 100644 --- a/zhcon.spec +++ b/zhcon.spec @@ -10,6 +10,7 @@ Patch0: http://downloads.sourceforge.net/%{name}/%{name}-0.2.5-to-0.2.6.diff.gz Patch1: zhcon-0.2.6-path.patch Patch2: zhcon-0.2.6-path-define.patch Patch3: zhcon-0.2.6-flags.patch +Patch4: zhcon-0.2.6-64bit-fix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Buildrequires: autoconf automake @@ -32,6 +33,7 @@ zhcon是一个工作在Linux控制台下的多内码中文平台。 %patch1 -p1 -b .instpath %patch2 -p1 -b .path_define %patch3 -p1 -b .flags +%patch4 -p1 -b .64bit_fix iconv -f GB2312 -t UTF-8 ChangeLog -o ChangeLog.utf && mv -f ChangeLog.utf ChangeLog ( cd doc; tar -zxf html.tar.gz; chmod 755 manual)