From: Michael S. Tsirkin Date: Wed, 5 Jan 2005 10:15:18 +0000 (+0000) Subject: r1473: Add -Wall and fix warnings. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=eb0f2e50c8132ac325919029b4fd897b05df1398;p=~adrianc%2Fmstflint.git r1473: Add -Wall and fix warnings. Detailed diagnostics. --- diff --git a/Makefile b/Makefile index 298234b..06bff0f 100644 --- 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 15ecaf2..48f10b3 100644 --- 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 diff --git a/flint.cpp b/flint.cpp index 98dce63..2fe5e46 100644 --- 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 0aad40b..f23c8f0 100644 --- 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; }