From: iceman1001 <iceman@iuse.se>
Date: Fri, 15 Jan 2016 11:43:29 +0000 (+0100)
Subject: FIX: this should remove some warnings while compiling on linux and when running Travi... 
X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/43d3f76921db4456cb18f6df8d5f1dcf1cb0dc0e

FIX: this should remove some warnings while compiling on linux and when running Travis-CI in a docker container.
some format specifier for uint64_t
and getting the git history in the perl script.
---

diff --git a/client/cmdhfmfhard.c b/client/cmdhfmfhard.c
index 169b40cf..130cf230 100644
--- a/client/cmdhfmfhard.c
+++ b/client/cmdhfmfhard.c
@@ -1292,7 +1292,7 @@ static void generate_candidates(uint16_t sum_a0, uint16_t sum_a8)
 			}
 		}
 	}
-	printf("Number of possible keys with Sum(a0) = %d: %lld (2^%1.1f)\n", sum_a0, maximum_states, log(maximum_states)/log(2.0));
+	printf("Number of possible keys with Sum(a0) = %d: %ll (2^%1.1f)\n", sum_a0, maximum_states, log(maximum_states)/log(2.0));
 	
 	init_statelist_cache();
 	
@@ -1341,7 +1341,7 @@ static void generate_candidates(uint16_t sum_a0, uint16_t sum_a8)
 	for (statelist_t *sl = candidates; sl != NULL; sl = sl->next) {
 		maximum_states += (uint64_t)sl->len[ODD_STATE] * sl->len[EVEN_STATE];
 	}
-	printf("Number of remaining possible keys: %lld (2^%1.1f)\n", maximum_states, log(maximum_states)/log(2.0));
+	printf("Number of remaining possible keys: %ll (2^%1.1f)\n", maximum_states, log(maximum_states)/log(2.0));
 	if (write_stats) {
 		if (maximum_states != 0) {
 			fprintf(fstats, "%1.1f;", log(maximum_states)/log(2.0));
@@ -1462,10 +1462,10 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc
 	PrintAndLog("Time for generating key candidates list: %1.0f seconds", (float)(clock() - start_time)/CLOCKS_PER_SEC);
 	
 	brute_force();
-		free_nonces_memory();
-		free_statelist_cache();
-		free_candidates_memory(candidates);
-		candidates = NULL;
+	free_nonces_memory();
+	free_statelist_cache();
+	free_candidates_memory(candidates);
+	candidates = NULL;
 	}
 	
 	return 0;
diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c
index f3c754ff..ebf84950 100644
--- a/client/cmdlfem4x.c
+++ b/client/cmdlfem4x.c
@@ -58,7 +58,8 @@ int CmdEM410xRead(const char *Cmd)
 		return 0;
 	}
 	char id[12] = {0x00};
-	sprintf(id, "%010llx",lo);
+	//sprintf(id, "%010llx",lo);
+	 sprintf(id, "%010" PRIu64 ", lo);	
 	
 	global_em410xId = id;
 	return 1;
diff --git a/client/fpga_compress.c b/client/fpga_compress.c
index 814167ad..3d5ba7ca 100644
--- a/client/fpga_compress.c
+++ b/client/fpga_compress.c
@@ -87,8 +87,8 @@ int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile)
 	do {
 
 		if (i >= num_infiles * FPGA_CONFIG_SIZE) {
-			fprintf(stderr, "Input files too big (total > %lu bytes). These are probably not PM3 FPGA config files.\n", num_infiles*FPGA_CONFIG_SIZE);
-		for(uint16_t j = 0; j < num_infiles; j++) {
+			fprintf(stderr, "Input files too big (total > %d bytes). These are probably not PM3 FPGA config files.\n", num_infiles*FPGA_CONFIG_SIZE);
+			for(uint16_t j = 0; j < num_infiles; j++) {
 				fclose(infile[j]);
 			}
 			return(EXIT_FAILURE);
@@ -138,7 +138,7 @@ int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile)
 		ret = deflate(&compressed_fpga_stream, Z_FINISH);
 	}
 	
-	fprintf(stderr, "compressed %lu input bytes to %lu output bytes\n", i, compressed_fpga_stream.total_out);
+	fprintf(stderr, "compressed %lu input bytes to %u output bytes\n", i, compressed_fpga_stream.total_out);
 
 	if (ret != Z_STREAM_END) {
 		fprintf(stderr, "Error in deflate(): %d %s\n", ret, compressed_fpga_stream.msg);
diff --git a/tools/mkversion.pl b/tools/mkversion.pl
index e12dd447..fe6ee0c7 100644
--- a/tools/mkversion.pl
+++ b/tools/mkversion.pl
@@ -5,12 +5,14 @@
 # -- Henryk Plötz <henryk@ploetzli.ch> 2009-09-28
 # Modified april 2014 because of the move to github. 
 # --- Martin Holst Swende <martin@swende.se>
-
+# Modified january 2016 to work with Travis-CI
+# --- iceman <iceman@iuse.se>
 
 # Clear environment locale so that git will not use localized strings
 $ENV{'LC_ALL'} = "C";
 $ENV{'LANG'} = "C";
 
+my $githistory = `git fetch --all`;
 my $gitversion = `git describe --dirty`;
 my $gitbranch = `git rev-parse --abbrev-ref HEAD`;
 my $clean = 2;