]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
r1473: Add -Wall and fix warnings.
authorMichael S. Tsirkin <mst@mellanox.co.il>
Wed, 5 Jan 2005 10:15:18 +0000 (10:15 +0000)
committerMichael S. Tsirkin <mst@mellanox.co.il>
Wed, 5 Jan 2005 10:15:18 +0000 (10:15 +0000)
Detailed diagnostics.

Makefile
README
flint.cpp
mtcr.h

index 298234bfa6d67a9cf625d5f1692cc6608a5a66b8..06bff0fd8143b9cace63c0b37200d45e77e8e18c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
 mstflint: flint.cpp mtcr.h
-       $(CXX) -g -I. -fno-exceptions -O2 flint.cpp -o mstflint
+       $(CXX) -g -I. -fno-exceptions -Wall -O2 flint.cpp -o mstflint
 clean:
        rm -f mstflint
diff --git a/README b/README
index 15ecaf2b199806b4fec20f61f3026fec671bb5bb..48f10b30db230cf77d6db5492df00b3743948909 100644 (file)
--- a/README
+++ b/README
@@ -31,7 +31,7 @@ mstflint: A BURNING FIRMWARE APPLICATION
     b) Compilation should end with no error messages.
         For example:
        >make
-       g++ -g -I. -O2 -fno-exceptions flint.cpp -o mstflint
+       g++ -g -I. -Wall -O2 -fno-exceptions flint.cpp -o mstflint
 
     c) An executable mstflint will be generated in the current directory
        This is the mstflint utility that can be used to burn and examine
index 98dce6332fcc6fd6c8417f27c4bf2ab75e0096d3..2fe5e46d6e850affe4045287d3fa8dae734bc4c2 100644 (file)
--- a/flint.cpp
+++ b/flint.cpp
@@ -564,12 +564,12 @@ private:
                                    void*     data, 
                                    int       cnt,
                                    bool      noerase  = false, 
-                                   bool      noverify = false)  = NULL;
+                                   bool      noverify = false)  = 0;
 
-       //virtual bool unlock_bypass (bool      unlock)            = NULL;
-       virtual bool erase_sector  (u_int32_t addr)              = NULL;
+       //virtual bool unlock_bypass (bool      unlock)            = 0;
+       virtual bool erase_sector  (u_int32_t addr)              = 0;
 
-       virtual bool reset          ()                           = NULL;
+       virtual bool reset          ()                           = 0;
 
     protected:
 
@@ -859,7 +859,7 @@ u_int32_t FImage::get_sector_size()
 
 
 ////////////////////////////////////////////////////////////////////////
-Flash::Flash() : curr_sector(0xffffffff), _mf(0), _curr_bank(0xffffffff), _cmd_set(NULL)
+Flash::Flash() : curr_sector(0xffffffff), _mf(0), _curr_bank(0xffffffff), _cmd_set(0)
 {
     char *use_scr_p = getenv("FLINT_USE_SCRATCHPAD");
 
diff --git a/mtcr.h b/mtcr.h
index 0aad40be9f248e2eac45cff85263baddd2b1f73b..f23c8f001f44dd667be497858edc37fe432ae8d5 100644 (file)
--- a/mtcr.h
+++ b/mtcr.h
@@ -142,10 +142,12 @@ mfind(const char* name, off_t* offset_p )
       unsigned dfn, vend;
 
       cnt = sscanf(buf,
-#ifdef HAVE_LONG_ADDRESS
+#ifdef HAVE_LONG_LONG_ADDRESS
             "%x %x %x %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx",
-#else
+#elsif HAVA_LONG_ADDRESS
             "%x %x %x %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx",
+#else
+            "%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x",
 #endif
             &dfn,
             &vend,
@@ -166,7 +168,9 @@ mfind(const char* name, off_t* offset_p )
             &rom_size);
       if (cnt != 9 && cnt != 10 && cnt != 17)
       {
-        fprintf(stderr,"proc: parse error (read only %d items)", cnt);
+        fprintf(stderr,"proc: parse error (read only %d items)\n", cnt);
+        fprintf(stderr,"the offending line in " "/proc/bus/pci/devices" " is "
+                       "\"%.*s\"\n", sizeof(buf), buf);
         goto error;
       }
       bus = dfn >> 8U;
@@ -185,7 +189,9 @@ mfind(const char* name, off_t* offset_p )
 
   if (cnt != 17 || size[1] != 0 || size[0] != 0x100000)
   {
-        fprintf(stderr,"proc: unexpected size values\n");
+        fprintf(stderr,"proc: unexpected region size values.\n");
+        fprintf(stderr,"the offending line in " "/proc/bus/pci/devices" " is "
+                       "\"%.*s\"\n", sizeof(buf), buf);
         goto error;
   }