From mint-bounce@lists.fishpool.fi Tue Feb 16 15:59:36 2010 Message-ID: <4B7B066E.90109@freesbee.fr> Date: Tue, 16 Feb 2010 21:56:14 +0100 From: =?ISO-8859-1?Q?Vincent_Rivi=E8re?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: mint@lists.fishpool.fi Subject: [MiNT] [patch] GemLib grect_to_array() Content-Type: multipart/mixed; boundary="------------000704000303010309030106" X-Antivirus: avast! (VPS 100216-1, 16/02/2010), Outbound message X-Antivirus-Status: Clean X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: vincent.riviere@freesbee.fr Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: This is a multi-part message in MIME format. --------------000704000303010309030106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Hello. Here is a patch for the function grect_to_array() in the GemLib. The previous implementation was wrong with GCC 4.x due to the "strict=20 aliasing" feature turned on by default. The fix is obvious. This bug has been detected by Olivier Landemarre. I don't know if this function is used by XaAES, but it may be an explanat= ion=20 for a lot of trouble with GEM programs compiled with GCC 4.x. Please commit. --=20 Vincent Rivi=E8re --------------000704000303010309030106 Content-Type: text/plain; name="rc_grect_to_array.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rc_grect_to_array.patch" diff -aurN -x CVS lib.orig/gemlib/rc_grect_to_array.c lib/gemlib/rc_grect_to_array.c --- lib.orig/gemlib/rc_grect_to_array.c 2003-02-28 21:46:41.000000000 +0100 +++ lib/gemlib/rc_grect_to_array.c 2010-02-16 21:46:29.109375000 +0100 @@ -18,11 +18,10 @@ short * grect_to_array (const GRECT * area, short *array) { - long *p = (long*)array; - - p[0] = p[1] = *(const long*)area; - array[2] += area->g_w -1; - array[3] += area->g_h -1; + array[0] = area->g_x; + array[1] = area->g_y; + array[2] = area->g_x + area->g_w - 1; + array[3] = area->g_y + area->g_h - 1; return array; } --------------000704000303010309030106--