This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix compilation error in i2c.cxx


Hi all, 

CVS 2005-06-16 had this problem, and I've not seen anything on this list
which suggests i2c has changed.

make[1]: Entering directory `/home/icampbell/devel/ecos/builds/viper/ram.tpm/io/i2c/current'
arm-elf-gcc -c  -I/home/icampbell/devel/ecos/builds/viper/ram.tpm/install/include -I/home/icampbell/devel/ecos/ecos/packages/io/i2c/current -I/home/icampbell/devel/ecos/ecos/packages/io/i2c/current/src -I/home/icampbell/devel/ecos/ecos/packages/io/i2c/current/tests -I. -I/home/icampbell/devel/ecos/ecos/packages/io/i2c/current/src/ -finline-limit=7000 -mcpu=xscale -Wall -Wpointer-arith  -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions   -mapcs-frame -Wp,-MD,src/i2c.tmp -o src/io_i2c_i2c.o /home/icampbell/devel/ecos/ecos/packages/io/i2c/current/src/i2c.cxx
/home/icampbell/devel/ecos/ecos/packages/io/i2c/current/src/i2c.cxx: In constructor `cyg_i2c_init::cyg_i2c_init()':
/home/icampbell/devel/ecos/ecos/packages/io/i2c/current/src/i2c.cxx:100: error: comparison between distinct pointer types `void (*)(const cyg_i2c_bus*)' and `void (*)(cyg_i2c_bus*)' lacks a cast
make[1]: *** [src/i2c.o.d] Error 1
make[1]: Leaving directory `/home/icampbell/devel/ecos/builds/viper/ram.tpm/io/i2c/current'

Fix is to compare against NULL instead of constructing a type specific
NULL explicitly. I guess the " != NULL" could even be dropped entirely
if that is preferable.

Thanks,
Ian.

Index: ecos/packages/io/i2c/current/ChangeLog
===================================================================
--- ecos.orig/packages/io/i2c/current/ChangeLog 2005-05-20 11:15:15.000000000 +0100
+++ ecos/packages/io/i2c/current/ChangeLog      2005-07-15 14:26:56.000000000 +0100
@@ -1,3 +1,7 @@
+2005-07-15  Ian Campbell  <icampbell@icampbell-debian>
+
+       * src/i2c.cxx: Compare pointers against NULL instead of casting 0.
+
 2005-05-11  Bart Veer  <bartv@ecoscentric.com>

        * include/i2c.h: add a CYG_HAL_TABLE_TYPE to the bus data
Index: ecos/packages/io/i2c/current/src/i2c.cxx
===================================================================
--- ecos.orig/packages/io/i2c/current/src/i2c.cxx       2005-07-14 13:57:34.000000000 +0100
+++ ecos/packages/io/i2c/current/src/i2c.cxx    2005-07-15 14:21:57.000000000 +0100
@@ -97,7 +97,7 @@
 #ifdef CYGDBG_USE_ASSERTS
         bus->i2c_current_device = (const cyg_i2c_device*) 0;
 #endif
-        if ((void (*)(const cyg_i2c_bus*))0 != bus->i2c_init_fn) {
+        if (bus->i2c_init_fn != NULL) {
             (*bus->i2c_init_fn)(bus);
         }
     }


-- 
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road,                    Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom       Phone:  +44 (0)1223 411 200


_____________________________________________________________________
The message in this transmission is sent in confidence for the attention of the addressee only and should not be disclosed to any other party. Unauthorised recipients are requested to preserve this confidentiality. Please advise the sender if the addressee is not resident at the receiving end.  Email to and from Arcom is automatically monitored for operational and lawful business reasons.

This message has been virus scanned by MessageLabs.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]