From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: xls Newsgroups: gmane.emacs.devel Subject: emacs-unicode-2 branch w32select.c patch Date: Thu, 17 Mar 2005 12:07:41 +0800 Message-ID: Reply-To: xls NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1111032693 19804 80.91.229.2 (17 Mar 2005 04:11:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 Mar 2005 04:11:33 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 17 05:11:33 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DBmM3-0002Sx-5X for ged-emacs-devel@m.gmane.org; Thu, 17 Mar 2005 05:11:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBmc7-0004bK-9m for ged-emacs-devel@m.gmane.org; Wed, 16 Mar 2005 23:28:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DBmbT-0004UW-Mz for emacs-devel@gnu.org; Wed, 16 Mar 2005 23:27:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DBmbM-0004PR-2w for emacs-devel@gnu.org; Wed, 16 Mar 2005 23:27:16 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBmbL-0004OL-TX for emacs-devel@gnu.org; Wed, 16 Mar 2005 23:27:16 -0500 Original-Received: from [64.233.184.206] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DBmIP-0000tL-Vn for emacs-devel@gnu.org; Wed, 16 Mar 2005 23:07:42 -0500 Original-Received: by wproxy.gmail.com with SMTP id 40so95066wri for ; Wed, 16 Mar 2005 20:07:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=FAHehTgE1B2pxUkiLooC4qiuXlJM7dgvf076oHSvujmQhW1uoAIDzzSRTM/mgfcgze3w2bqlI6oG11xvCBg2jz0Hs2+x8Gl79WzEkTdzyZqm+P9V3mSrGdR6mMGOAVXcfx4WtoLHNUZX0vg45yZoxkBGXeWSNmOcjAFrIpv6XEw= Original-Received: by 10.54.17.71 with SMTP id 71mr2443049wrq; Wed, 16 Mar 2005 20:07:41 -0800 (PST) Original-Received: by 10.54.20.3 with HTTP; Wed, 16 Mar 2005 20:07:41 -0800 (PST) Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34654 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34654 Hi All, Compilation of latest emacs-unicode-2 branch CVS version of w32select.c (Rev.1.29.2.5) fails because the function "convert_to_handle_as_coded" and "w32-get-clipboard-data" have some stynax error. The following patch fixes that, but i ignore the clipboard-data's eol-type . --- w32select.c.org 2005-03-16 09:05:49.546875000 +0800 +++ w32select.c 2005-03-16 09:06:07.171875000 +0800 @@ -227,37 +227,27 @@ coding.src_multibyte = 1; coding.dst_multibyte = 0; /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in - encode_coding_iso2022 trying to dereference a null pointer. */ - coding.composing = COMPOSITION_DISABLED; - if (coding.type == coding_type_iso2022) - coding.flags |= CODING_FLAG_ISO_SAFE; + encode_coding_iso2022 trying to dereference a null pointer. */ + coding.common_flags &= ~CODING_ANNOTATION_MASK; coding.mode |= CODING_MODE_LAST_BLOCK; - /* Force DOS line-ends. */ - coding.eol_type = CODING_EOL_CRLF; - - if (SYMBOLP (coding.pre_write_conversion) - && !NILP (Ffboundp (coding.pre_write_conversion))) - string = run_pre_post_conversion_on_str (current_text, &coding, 1); - else - string = current_text; - - nbytes = SBYTES (string); - src = SDATA (string); - - bufsize = encoding_buffer_size (&coding, nbytes) +2; + + string = current_text; + encode_coding_string (&coding, string, nbytes); + + bufsize = SBYTES (coding.dst_object)+2; + src = SDATA (coding.dst_object); + /* Add the string terminator. Add two NULs in case we are + producing Unicode here. */ + src[coding.produced] = src[coding.produced+1] = '\0'; + htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, bufsize); - if (htext != NULL) - dst = (unsigned char *) GlobalLock (htext); - + dst = (unsigned char *) GlobalLock (htext); if (dst != NULL) { - encode_coding (&coding, src, dst, nbytes, bufsize-2); - /* Add the string terminator. Add two NULs in case we are - producing Unicode here. */ - dst[coding.produced] = dst[coding.produced+1] = '\0'; + memcpy(dst, src, bufsize); } - + if (dst != NULL) GlobalUnlock (htext); @@ -918,7 +908,7 @@ sequence. */ coding.common_flags &= ~CODING_ANNOTATION_MASK; /* Force DOS line-ends. */ - coding.eol_type = CODING_EOL_CRLF; + /* coding.eol_type = CODING_EOL_CRLF; */ coding.dst_bytes = nbytes * 2; coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);