[ofw] build errors on the trunk

Tzachi Dar tzachid at mellanox.co.il
Sun May 4 05:36:03 PDT 2008


Attached is another patch that removes warnings on fre builds.

Thanks
Tzachi

Index: flint/user/flint.cpp
===================================================================
--- flint/user/flint.cpp	(revision 1124)
+++ flint/user/flint.cpp	(working copy)
@@ -523,13 +523,13 @@
     u_int32_ba(u_int32_t i = 0) :
     _bits(i),
     _rbits(_bits),
-    _sptr(0),
+    _sptr1(0),
     _eptr(31)    {}
 
     u_int32_ba  operator[](u_int32_t idx) {return
range((u_int8_t)idx,(u_int8_t)idx);}
-    u_int32_ba& operator= (u_int32_t i)   {_rbits = ((i << _sptr) &
mask()) | (_rbits & ~mask()); return *this;}
+    u_int32_ba& operator= (u_int32_t i)   {_rbits = ((i << _sptr1) &
mask()) | (_rbits & ~mask()); return *this;}
     u_int32_t*  operator& ()              {return &_bits;}
-    operator    u_int32_t ()              {return((mask() & _rbits) >>
_sptr);}
+    operator    u_int32_t ()              {return((mask() & _rbits) >>
_sptr1);}
 
     u_int32_ba  range     (u_int8_t eptr, 
                            u_int8_t sptr) {return
u_int32_ba(*this,eptr,sptr);}
@@ -538,14 +538,14 @@
     u_int32_ba(u_int32_ba& other, u_int8_t eptr, u_int8_t sptr) :
     _bits(other._bits),
     _rbits(other._bits),
-    _sptr(sptr),
+    _sptr1(sptr),
     _eptr(eptr) {}
 
     u_int32_t  mask       () {
         u_int32_t s_msk = (u_int32_t)-1; // start mask
         u_int32_t e_msk = (u_int32_t)-1; // end mask
 
-        s_msk = (s_msk << _sptr);
+        s_msk = (s_msk << _sptr1);
         e_msk = (_eptr >= (sizeof(_bits)*8-1)) ? e_msk : ~(e_msk <<
(_eptr+1));
 
         return(s_msk & e_msk);
@@ -554,7 +554,7 @@
     u_int32_t  _bits;
     u_int32_t& _rbits;
 
-    u_int8_t   _sptr;
+    u_int8_t   _sptr1;
     u_int8_t   _eptr;
 };
 
@@ -3433,8 +3433,8 @@
                 mac <<= 24;
                 mac |= (old_guids[i+1].l & 0xffffff);
 
-                old_guids[GUIDS+i].h = mac >> 32;
-                old_guids[GUIDS+i].l = mac  & 0xffffffff;
+                old_guids[GUIDS+i].h = u_int32_t(mac >> 32);
+                old_guids[GUIDS+i].l = u_int32_t(mac  & 0xffffffff);
 
                 // printf("-D- Guid " GUID_FORMAT " to MAC
"MAC_FORMAT"\n", old_guids[i+1].h, old_guids[i+1].l,
old_guids[i+GUIDS].h,old_guids[i+GUIDS].l  );
             }
@@ -3724,7 +3724,7 @@
 
         switch (tagId) {
         case II_FwVersion:
-            info->fwVer[0] = __be32_to_cpu(*(p+1)) >> 16;
+            info->fwVer[0] = (u_int16_t)(__be32_to_cpu(*(p+1)) >> 16);
             tmp = __be32_to_cpu(*(p+2));
             info->fwVer[1] = tmp >> 16;
             info->fwVer[2] = tmp & 0xffff;
Index: flint/user/SOURCES
===================================================================
--- flint/user/SOURCES	(revision 1124)
+++ flint/user/SOURCES	(working copy)
@@ -2,6 +2,8 @@
 TARGETTYPE=PROGRAM
 UMTYPE=console
 USE_MSVCRT=1
+USE_STL=1
+USE_NATIVE_EH=1
 
 TRUNK=..\..\..
 !if !defined(EXTERNAL_TOOLS)
@@ -17,11 +19,6 @@
 
 # TODO: Define free and checked.
 TARGETLIBS=\
-!if $(FREEBUILD)
-	$(CRT_LIB_PATH)\msvcprt.lib \
-!else
-	$(CRT_LIB_PATH)\msvcprt.lib \
-!endif	
     $(TARGETPATH)\*\mtcr.lib \
     $(SDK_LIB_PATH)\Ws2_32.lib
 
@@ -34,7 +31,7 @@
 #!endif
 
 		
-SOURCES=..\mflash.c ..\flint.cpp
+SOURCES=mflash.c flint.cpp
 
 INCLUDES=  \
         ..; \
@@ -44,7 +41,7 @@
 	..\..\mtcr\user
 	
 # Could be any special flag needed for this project
-USER_C_FLAGS=$(USER_C_FLAGS) /MD /EHsc
+USER_C_FLAGS=$(USER_C_FLAGS) /MD 
 
 C_DEFINES=$(C_DEFINES) -DWIN32 -D__WIN__ -D__i386__ -DNO_ZLIB
 !if !$(FREEBUILD)
Index: spark/user/SOURCES
===================================================================
--- spark/user/SOURCES	(revision 1124)
+++ spark/user/SOURCES	(working copy)
@@ -3,6 +3,7 @@
 UMTYPE=console
 USE_MSVCRT=1
 USE_STL=1
+USE_NATIVE_EH=1
 
 !if !defined(WINIBHOME)
 WINIBHOME=..\..\..
@@ -30,7 +31,7 @@
 			$(TARGETPATH)\*\mtcr.lib
 !endif
 
-USER_C_FLAGS=$(USER_C_FLAGS) /Ze /EHsc
+USER_C_FLAGS=$(USER_C_FLAGS)  
 
 # TODO:Should I define the __WIN__ manually
 C_DEFINES=$(C_DEFINES) -D__WIN__
Index: spark/user/spark.cpp
===================================================================
--- spark/user/spark.cpp	(revision 1124)
+++ spark/user/spark.cpp	(working copy)
@@ -2590,8 +2590,8 @@
             f.data.clear();
             f.data.resize(8,0);
             
-            ::PatchImgBytes(&f.data[0], guid >> 32);
-            ::PatchImgBytes(&f.data[4], guid & 0xffffffff);
+            ::PatchImgBytes(&f.data[0], (u_int32_t)(guid >> 32));
+            ::PatchImgBytes(&f.data[4], (u_int32_t)(guid &
0xffffffff));
         }
         break;
 
@@ -3610,7 +3610,7 @@
             else if (!strcmp(av[i], "-is3_i2c")) {
                 NEXT("-is3_i2c");
                 char* ep;
-                is3I2cSlave = strtoul(av[i], &ep, 16);
+                is3I2cSlave = (u_int8_t)strtoul(av[i], &ep, 16);
                 if (*ep) {
                     SETERR(("Bad argument for %s flag (%s). Expecting a
hexadecimal integer.", av[i-1], av[i]));
                 }
@@ -3618,7 +3618,7 @@
             else if (!strcmp(av[i], "-pe_i2c") || !strcmp(av[i],
"-pe")) {
                 NEXT("-pe_i2c");
                 char* ep;
-                userPrimaryI2cAddr = strtoul(av[i], &ep, 16);
+                userPrimaryI2cAddr = (u_int8_t)strtoul(av[i], &ep, 16);
                 if (*ep) {
                     SETERR(("Bad argument for %s flag (%s). Expecting a
hexadecimal integer.", av[i-1], av[i]));
                 }
@@ -3626,7 +3626,7 @@
             else if (!strcmp(av[i], "-se_i2c") || !strcmp(av[i], "-se")
) {
                 NEXT(av[i]);
                 char* ep;
-                userSecondaryI2cAddr = strtoul(av[i], &ep, 16);
+                userSecondaryI2cAddr = (u_int8_t)strtoul(av[i], &ep,
16);
                 if (*ep) {
                     SETERR(("Bad argument for %s flag (%s). Expecting a
hexadecimal integer.", av[i-1], av[i]));
                 } 

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Tzachi Dar
> Sent: Sunday, May 04, 2008 10:16 AM
> To: Sean Hefty; ofw at lists.openfabrics.org
> Subject: RE: [ofw] build errors on the trunk
> 
> The following patch fixes WSD and flint.
> 
> Index: inc/openib.def
> ===================================================================
> --- inc/openib.def	(revision 1120)
> +++ inc/openib.def	(working copy)
> @@ -2,7 +2,7 @@
>  
>  # Allow overriding the company name.
>  !IF !DEFINED(IB_COMPANYNAME)
> -IB_COMPANYNAME="""OpenFabrics\x20Alliance"""
> +IB_COMPANYNAME="""OpenFabrics\40Alliance"""
>  !ENDIF
>  
>  # Allow overriding the product name.
> Index: tools/flint/user/flint.cpp
> ===================================================================
> --- tools/flint/user/flint.cpp	(revision 1120)
> +++ tools/flint/user/flint.cpp	(working copy)
> @@ -523,13 +523,13 @@
>      u_int32_ba(u_int32_t i = 0) :
>      _bits(i),
>      _rbits(_bits),
> -    _sptr(0),
> +    _sptr1(0),
>      _eptr(31)    {}
>  
>      u_int32_ba  operator[](u_int32_t idx) {return 
> range((u_int8_t)idx,(u_int8_t)idx);}
> -    u_int32_ba& operator= (u_int32_t i)   {_rbits = ((i << _sptr) &
> mask()) | (_rbits & ~mask()); return *this;}
> +    u_int32_ba& operator= (u_int32_t i)   {_rbits = ((i << _sptr1) &
> mask()) | (_rbits & ~mask()); return *this;}
>      u_int32_t*  operator& ()              {return &_bits;}
> -    operator    u_int32_t ()              {return((mask() & 
> _rbits) >>
> _sptr);}
> +    operator    u_int32_t ()              {return((mask() & 
> _rbits) >>
> _sptr1);}
>  
>      u_int32_ba  range     (u_int8_t eptr, 
>                             u_int8_t sptr) {return 
> u_int32_ba(*this,eptr,sptr);} @@ -538,14 +538,14 @@
>      u_int32_ba(u_int32_ba& other, u_int8_t eptr, u_int8_t sptr) :
>      _bits(other._bits),
>      _rbits(other._bits),
> -    _sptr(sptr),
> +    _sptr1(sptr),
>      _eptr(eptr) {}
>  
>      u_int32_t  mask       () {
>          u_int32_t s_msk = (u_int32_t)-1; // start mask
>          u_int32_t e_msk = (u_int32_t)-1; // end mask
>  
> -        s_msk = (s_msk << _sptr);
> +        s_msk = (s_msk << _sptr1);
>          e_msk = (_eptr >= (sizeof(_bits)*8-1)) ? e_msk : 
> ~(e_msk << (_eptr+1));
>  
>          return(s_msk & e_msk);
> @@ -554,7 +554,7 @@
>      u_int32_t  _bits;
>      u_int32_t& _rbits;
>  
> -    u_int8_t   _sptr;
> +    u_int8_t   _sptr1;
>      u_int8_t   _eptr;
>  };
>  
> Index: tools/flint/user/SOURCES
> ===================================================================
> --- tools/flint/user/SOURCES	(revision 1120)
> +++ tools/flint/user/SOURCES	(working copy)
> @@ -2,6 +2,7 @@
>  TARGETTYPE=PROGRAM
>  UMTYPE=console
>  USE_MSVCRT=1
> +USE_STL=1
>  
>  TRUNK=..\..\..
>  !if !defined(EXTERNAL_TOOLS)
> @@ -17,11 +18,6 @@
>  
>  # TODO: Define free and checked.
>  TARGETLIBS=\
> -!if $(FREEBUILD)
> -	$(CRT_LIB_PATH)\msvcprt.lib \
> -!else
> -	$(CRT_LIB_PATH)\msvcprt.lib \
> -!endif	
>      $(TARGETPATH)\*\mtcr.lib \
>      $(SDK_LIB_PATH)\Ws2_32.lib
>   
> 
> > -----Original Message-----
> > From: ofw-bounces at lists.openfabrics.org 
> > [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Sean Hefty
> > Sent: Friday, May 02, 2008 10:08 PM
> > To: ofw at lists.openfabrics.org
> > Subject: [ofw] build errors on the trunk
> > 
> > After updating to WDK 6001.18001, I get the attached build 
> errors and 
> > warnings when trying to build from the trunk.
> > 
> > - Sean
> > 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tools.patch
Type: application/octet-stream
Size: 5924 bytes
Desc: tools.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080504/261f8a96/attachment.obj>


More information about the ofw mailing list