Browse Source

Bugfix: Build hexdump.c into the project normally like everything else

Luke Dashjr 12 years ago
parent
commit
8996b5d358
4 changed files with 8 additions and 4 deletions
  1. 1 2
      Makefile.am
  2. 1 1
      driver-avalon.c
  3. 4 1
      hexdump.c
  4. 2 0
      logging.h

+ 1 - 2
Makefile.am

@@ -6,7 +6,6 @@ EXTRA_DIST	= example.conf m4/gnulib-cache.m4 linux-usb-bfgminer \
 		  API.class API.java api-example.c windows-build.txt \
 		  bitstreams/* README.FPGA README.RPC README.scrypt \
 		  README.GPU \
-		  hexdump.c \
                   api-example.py
 
 SUBDIRS		= lib ccan
@@ -119,7 +118,7 @@ bfgminer_SOURCES += driver-cairnsmore.c
 endif
 
 if HAS_AVALON
-bfgminer_SOURCES += driver-avalon.c driver-avalon.h
+bfgminer_SOURCES += driver-avalon.c driver-avalon.h hexdump.c
 endif
 
 if HAS_MODMINER

+ 1 - 1
driver-avalon.c

@@ -38,7 +38,7 @@
 #include "miner.h"
 #include "fpgautils.h"
 #include "driver-avalon.h"
-#include "hexdump.c"
+#include "logging.h"
 #include "util.h"
 
 static int option_offset = -1;

+ 4 - 1
hexdump.c

@@ -19,6 +19,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "logging.h"
+
 #define hex_print(p) applog(LOG_DEBUG, "%s", p)
 
 static char nibble[] = {
@@ -27,8 +29,9 @@ static char nibble[] = {
 
 #define BYTES_PER_LINE 0x10
 
-void hexdump(const uint8_t *p, unsigned int len)
+void hexdump(const void *vp, unsigned int len)
 {
+	const unsigned char *p = vp;
 	unsigned int i, addr;
 	unsigned int wordlen = sizeof(void*);
 	unsigned char v, line[BYTES_PER_LINE * 5];

+ 2 - 0
logging.h

@@ -43,4 +43,6 @@ extern void log_notice(const char *fmt, ...) FORMAT_SYNTAX_CHECK(printf, 1, 2);
 extern void log_info(const char *fmt, ...) FORMAT_SYNTAX_CHECK(printf, 1, 2);
 extern void log_debug(const char *fmt, ...) FORMAT_SYNTAX_CHECK(printf, 1, 2);
 
+extern void hexdump(const void *, unsigned int len);
+
 #endif /* __LOGGING_H__ */