From mint-bounce@lists.fishpool.fi  Sun Aug 26 12:49:36 2007
X-Original-To: fnaumann@mail.boerde.de
Delivered-To: fnaumann@mail.boerde.de
Message-ID: <46D13B42.9060002@freesbee.fr>
Date: Sun, 26 Aug 2007 10:35:14 +0200
From: =?ISO-8859-1?Q?Vincent_Rivi=E8re?= <vincent.riviere@freesbee.fr>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
To: Martin Tarenskeen <m.tarenskeen@zonnet.nl>
Cc: Guido Vollbeding <guido@jpegclub.org>,
        MiNT Mailing List <mint@fishpool.com>,
        Atari Running on Any Machine - UML <aranym-user@lists.bobek.cz>
Subject: Re: [MiNT] fixed: compiling img2png
References: <Pine.LNX.4.64.0708181703400.3068@localhost.localdomain> <46CA0B99.C5F36369@jpegclub.org> <Pine.LNX.4.64.0708210943550.6457@localhost.localdomain>
In-Reply-To: <Pine.LNX.4.64.0708210943550.6457@localhost.localdomain>
Content-Type: multipart/mixed;
 boundary="------------050605040608070203010603"
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: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>
X-Virus-Scanned: by amavisd-new at relay.boerde.de
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de
X-Spam-Status: No, hits=-1.0 tagged_above=-50.5 required=7.0 tests=BAYES_00
X-Spam-Level: 

This is a multi-part message in MIME format.
--------------050605040608070203010603
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello.

> gcc34 -I/usr/include -I/usr/include -O2 -Wall   -c -o img2png.o img2png.c
> img2png.c: In function `main':
> img2png.c:112: warning: use of cast expressions as lvalues is deprecated

In GCC 4, use of cast expressions as lvalues (e.g. with ++) is not 
supported anymore. But most of such code can be easily fixed.

I made a quick patch to get imgtools compiling with GCC 4. However, I 
didn't test the resulting executable because I don't have the required 
libraries for linking it. It may work as expected: just try it.

I use GCC 4.2.1, running on Cygwin, and producing executables for MiNT.
It is available here:
http://vincent.riviere.free.fr/soft/m68k-atari-mint/

Hope this will help.

Vincent Riviere

--------------050605040608070203010603
Content-Type: text/plain;
 name="imgtools.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="imgtools.diff"

diff -aurN imgtools/img2png/img2png.c imgtools.new/img2png/img2png.c
--- imgtools/img2png/img2png.c	2007-08-21 11:38:35.000000000 +0200
+++ imgtools.new/img2png/img2png.c	2007-08-26 10:03:05.390625000 +0200
@@ -115,7 +115,7 @@
 
   if (header.ih.headlen >= 11)
   {
-    FGETL(&input.pub, count); *((unsigned long *)p)++ = count;
+    FGETL(&input.pub, count); *((unsigned long *)p) = count; p += 2;
     FGETW(&input.pub, temp); *p++ = temp;
 
     if (count == MKVAL('T','I','M','G'))
diff -aurN imgtools/img2png/imgcodec.h imgtools.new/img2png/imgcodec.h
--- imgtools/img2png/imgcodec.h	1998-05-22 13:33:26.000000000 +0200
+++ imgtools.new/img2png/imgcodec.h	2007-08-26 09:56:07.828125000 +0200
@@ -93,10 +93,10 @@
 
 #define FGETW(fp, dest)   \
   MAKESTMT( if (--(fp)->bytes_left < 0) (*(fp)->data_func)(fp); \
-	    dest = *((unsigned char *)(fp)->pbuf)++; \
+	    dest = *((unsigned char *)(fp)->pbuf); (fp)->pbuf++;\
 	    dest <<= 8; \
 	    if (--(fp)->bytes_left < 0) (*(fp)->data_func)(fp); \
-	    dest |= *((unsigned char *)(fp)->pbuf)++; )
+	    dest |= *((unsigned char *)(fp)->pbuf); (fp)->pbuf++; )
 
 #define FPUTW(fp, wd)   \
   MAKESTMT( *(fp)->pbuf++ = (char)(wd >> 8); \
@@ -107,16 +107,16 @@
 
 #define FGETL(fp, dest)   \
   MAKESTMT( if (--(fp)->bytes_left < 0) (*(fp)->data_func)(fp); \
-	    dest = *((unsigned char *)(fp)->pbuf)++; \
+	    dest = *((unsigned char *)(fp)->pbuf); (fp)->pbuf++; \
 	    dest <<= 8; \
 	    if (--(fp)->bytes_left < 0) (*(fp)->data_func)(fp); \
-	    dest |= *((unsigned char *)(fp)->pbuf)++; \
+	    dest |= *((unsigned char *)(fp)->pbuf); (fp)->pbuf++; \
 	    dest <<= 8; \
 	    if (--(fp)->bytes_left < 0) (*(fp)->data_func)(fp); \
-	    dest |= *((unsigned char *)(fp)->pbuf)++; \
+	    dest |= *((unsigned char *)(fp)->pbuf); (fp)->pbuf++; \
 	    dest <<= 8; \
 	    if (--(fp)->bytes_left < 0) (*(fp)->data_func)(fp); \
-	    dest |= *((unsigned char *)(fp)->pbuf)++; )
+	    dest |= *((unsigned char *)(fp)->pbuf); (fp)->pbuf++; )
 
 /* Prototypes for public library functions. */
 

--------------050605040608070203010603--


