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.
This commit is contained in:
iceman1001 2016-01-15 12:43:29 +01:00
parent c2d2a5a6b5
commit 43d3f76921
4 changed files with 14 additions and 11 deletions

View file

@ -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));

View file

@ -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;

View file

@ -87,7 +87,7 @@ 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);
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]);
}
@ -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);

View file

@ -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;