Fix some compiling warnings.

Signed-off-by: Yi Zou <[email protected]>
---

 hbaapi2.2.patch |  112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 110 insertions(+), 2 deletions(-)

diff --git a/hbaapi2.2.patch b/hbaapi2.2.patch
index 83a25f6..e6bf526 100644
--- a/hbaapi2.2.patch
+++ b/hbaapi2.2.patch
@@ -1,5 +1,5 @@
 --- HBAAPILIB.c        2010-01-21 16:46:34.000000000 -0800
-+++ HBAAPILIB.c        2010-01-21 16:51:13.000000000 -0800
++++ HBAAPILIB.c        2010-01-21 17:20:26.000000000 -0800
 @@ -37,8 +37,12 @@
   */
  #define HBAAPI_EXPORTS
@@ -13,7 +13,43 @@
  #endif
  #include <stdio.h>
  #include <time.h>
-@@ -859,8 +863,15 @@
+@@ -381,7 +385,7 @@
+     HBA_ALLADAPTERSCALLBACK_ELEM      **lap;
+     HBA_ALLADAPTERSCALLBACK_ELEM      *allcbp;
+     HBA_ADAPTERCALLBACK_ELEM          *cbp;
+-    HBARemoveCallbackFunc             registeredfunc;
++    HBARemoveCallbackFunc             registeredfunc = NULL;
+     HBA_VENDORCALLBACK_ELEM           *vhlp;
+     HBA_VENDORCALLBACK_ELEM           *vnext;
+     int                                       found;
+@@ -395,7 +399,7 @@
+     GRAB_MUTEX(&_hbaapi_APSE_mutex);
+     GRAB_MUTEX(&_hbaapi_TE_mutex);
+     GRAB_MUTEX(&_hbaapi_LE_mutex);
+-    for(listp = cb_lists_array, found = 0; found == 0, *listp != NULL; 
listp++) {
++    for(listp = cb_lists_array, found = 0; *listp != NULL; listp++) {
+       lastp = *listp;
+       for(cbp=**listp; cbp != NULL; cbp = cbp->next) {
+           if(cbhandle != (HBA_CALLBACKHANDLE)cbp) {
+@@ -455,6 +459,7 @@
+     return(status);
+ }
+ 
++#if defined(USESYSLOG) || defined(USELOGFILE)
+ static char wwn_str1[17];
+ static char wwn_str2[17];
+ static char wwn_str3[17];
+@@ -471,8 +476,8 @@
+     }
+     return(buf);
+ }
++#endif
+ 
+-
+ #ifdef WIN32
+ BOOL APIENTRY
+ DllMain( HANDLE hModule,
+@@ -859,8 +864,15 @@
      InitializeCriticalSection(&_hbaapi_LE_mutex);
  #endif
  
@@ -31,3 +67,75 @@
  }
  
  HBA_STATUS
+@@ -1048,7 +1060,7 @@
+           if(adapt_infop == NULL) {
+ #ifndef WIN32
+               fprintf(stderr,
+-                      "HBA_GetNumberOfAdapters: calloc failed on sizeof:%d\n",
++                      "HBA_GetNumberOfAdapters: calloc failed on 
sizeof:%ld\n",
+                       sizeof(HBA_ADAPTER_INFO));
+ #endif
+               RELEASE_MUTEX(&_hbaapi_AL_mutex);
+@@ -1359,7 +1371,7 @@
+     if(cbp == NULL) {
+ #ifndef WIN32
+       fprintf(stderr,
+-              "HBA_RegisterForAdapterAddEvents: calloc failed for %d bytes\n",
++              "HBA_RegisterForAdapterAddEvents: calloc failed for %ld 
bytes\n",
+               sizeof(HBA_ALLADAPTERSCALLBACK_ELEM));
+ #endif
+       return HBA_STATUS_ERROR;
+@@ -1399,7 +1411,7 @@
+ #ifndef WIN32
+           fprintf(stderr,
+                   "HBA_RegisterForAdapterAddEvents: "
+-                  "calloc failed for %d bytes\n",
++                  "calloc failed for %ld bytes\n",
+                   sizeof(HBA_VENDORCALLBACK_ELEM));
+ #endif
+           freevendorhandlelist(vendorhandlelist);
+@@ -1535,7 +1547,7 @@
+     if(acbp == NULL) {
+ #ifndef WIN32
+       fprintf(stderr,
+-              "HBA_RegisterForAdapterEvents: calloc failed for %d bytes\n",
++              "HBA_RegisterForAdapterEvents: calloc failed for %ld bytes\n",
+               sizeof(HBA_ADAPTERCALLBACK_ELEM));
+ #endif
+       RELEASE_MUTEX_RETURN(&_hbaapi_LL_mutex, HBA_STATUS_ERROR);
+@@ -1627,7 +1639,7 @@
+ #ifndef WIN32
+       fprintf(stderr,
+               "HBA_RegisterForAdapterPortEvents: "
+-              "calloc failed for %d bytes\n",
++              "calloc failed for %ld bytes\n",
+               sizeof(HBA_ADAPTERCALLBACK_ELEM));
+ #endif
+       RELEASE_MUTEX_RETURN(&_hbaapi_LL_mutex, HBA_STATUS_ERROR);
+@@ -1720,7 +1732,7 @@
+ #ifndef WIN32
+       fprintf(stderr,
+               "HBA_RegisterForAdapterPortStatEvents: "
+-              "calloc failed for %d bytes\n",
++              "calloc failed for %ld bytes\n",
+               sizeof(HBA_ADAPTERCALLBACK_ELEM));
+ #endif
+       RELEASE_MUTEX_RETURN(&_hbaapi_LL_mutex, HBA_STATUS_ERROR);
+@@ -1817,7 +1829,7 @@
+     if(acbp == NULL) {
+ #ifndef WIN32
+       fprintf(stderr,
+-              "HBA_RegisterForTargetEvents: calloc failed for %d bytes\n",
++              "HBA_RegisterForTargetEvents: calloc failed for %ld bytes\n",
+               sizeof(HBA_ADAPTERCALLBACK_ELEM));
+ #endif
+       RELEASE_MUTEX_RETURN(&_hbaapi_LL_mutex, HBA_STATUS_ERROR);
+@@ -1912,7 +1924,7 @@
+     if(acbp == NULL) {
+ #ifndef WIN32
+       fprintf(stderr,
+-              "HBA_RegisterForLinkEvents: calloc failed for %d bytes\n",
++              "HBA_RegisterForLinkEvents: calloc failed for %ld bytes\n",
+               sizeof(HBA_ADAPTERCALLBACK_ELEM));
+ #endif
+       RELEASE_MUTEX_RETURN(&_hbaapi_LL_mutex, HBA_STATUS_ERROR);

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to