Merge pull request #67 from phdussud/master

Fix gcc 10.2 error messages.
This commit is contained in:
Gwenhael Goavec-Merou 2020-12-13 15:08:57 +01:00 committed by GitHub
commit 2dcc8e43b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 21 additions and 16 deletions

View File

@ -37,6 +37,7 @@ Anlogic::Anlogic(Jtag *jtag, const std::string &filename,
bool flash_wr, bool sram_wr, bool verbose):
Device(jtag, filename, verbose), _svf(_jtag, _verbose)
{
(void)flash_wr;
if (_filename != "") {
if (_file_extension == "svf")
_mode = Device::MEM_MODE;

View File

@ -112,7 +112,7 @@ int AnlogicBitParser::parse()
data.resize(size_data);
_fd.read(reinterpret_cast<char *>(&(data[0])), size_data);
int pos = 0;
unsigned int pos = 0;
std::vector<std::vector<uint8_t>> blocks;
do {
uint16_t len = (data[pos++] << 8);

View File

@ -76,9 +76,9 @@ typedef struct {
} target_cable_t;
#define JTAG_BOARD(_name, _cable, _rst, _done) \
{_name, {"", _cable, _rst, _done, COMM_JTAG, {}}}
{_name, {"", _cable, _rst, _done, COMM_JTAG, {}, {}}}
#define JTAG_BITBANG_BOARD(_name, _cable, _rst, _done, _tms, _tck, _tdi, _tdo) \
{_name, {"", _cable, _rst, _done, COMM_JTAG, { _tms, _tck, _tdi, _tdo }}}
{_name, {"", _cable, _rst, _done, COMM_JTAG, { _tms, _tck, _tdi, _tdo }, {}}}
#define SPI_BOARD(_name, _manufacturer, _cable, _rst, _done, _cs, _sck, _si, _so, _holdn, _wpn) \
{_name, {_manufacturer, _cable, _rst, _done, COMM_SPI, {}, \
{_cs, _sck, _so, _si, _holdn, _wpn}}}

View File

@ -9,13 +9,13 @@
/*!
* \brief define type of communication
*/
enum {
enum communication_type {
MODE_ANLOGICCABLE = 0, /*! JTAG probe from Anlogic */
MODE_FTDI_BITBANG = 1, /*! used with ft232RL/ft231x */
MODE_FTDI_SERIAL = 2, /*! ft2232, ft232H */
MODE_DIRTYJTAG = 3, /*! JTAG probe firmware for STM32F1 */
MODE_USBBLASTER = 4 /*! JTAG probe firmware for USBBLASTER */
} communication_type_t;
MODE_USBBLASTER = 4, /*! JTAG probe firmware for USBBLASTER */
};
typedef struct {
int type;

View File

@ -203,7 +203,7 @@ void EPCQ::dumpJICFile(char *jic_file, char *out_file, size_t max_len)
fseek(jic, offset, SEEK_SET);
FILE *out = fopen(out_file, "w");
for (i=0; i < max_len && (1 == fread(&c, 1, 1, jic)); i++) {
fprintf(out, "%lx %x\n", i, c);
fprintf(out, "%zx %x\n", i, c);
}
fclose(jic);
fclose(out);

View File

@ -74,7 +74,7 @@ int FsParser::parse()
parseHeader();
_fd.seekg(0, _fd.beg);
int max = 0;
size_t max = 0;
while (1) {
std::getline(_fd, buffer, '\n');
@ -84,8 +84,8 @@ int FsParser::parse()
continue;
vectTmp.push_back(buffer);
/* needed to determine data used for checksum */
if ((int)buffer.size() > max)
max = (int) buffer.size();
if (buffer.size() > max)
max = buffer.size();
}
/* we know each data size finished with 6 x 0xff
@ -167,7 +167,7 @@ int FsParser::parse()
for (auto &&line: vectTmp) {
/* store bit for checksum */
if ((int)line.size() == max)
if (line.size() == max)
tmp += line.substr(padding, addr_length);
}
@ -175,7 +175,7 @@ int FsParser::parse()
uint32_t sum = 0;
uint32_t max_pos = (idcode == 0) ? tmp.size() : addr_length * nb_line;
for (int pos = 0; pos < max_pos; pos+=16) {
for (uint32_t pos = 0; pos < max_pos; pos+=16) {
int16_t data16 = 0;
for (int offset = 0; offset < 16; offset ++) {
uint16_t val = (tmp[pos+offset] == '1'?1:0);

View File

@ -26,7 +26,7 @@ FTDIpp_MPSSE::FTDIpp_MPSSE(const mpsse_bit_config &cable, const string &dev,
_interface(cable.interface),
_clkHZ(clkHZ), _buffer_size(2*32768), _num(0)
{
sprintf(_product, "");
strcpy(_product, "");
if (!dev.empty()) {
if (!search_with_dev(dev)) {
cerr << "No cable found" << endl;

View File

@ -66,6 +66,9 @@ FtdiSpi::FtdiSpi(int vid, int pid, unsigned char interface, uint32_t clkHZ,
bool verbose):
FTDIpp_MPSSE(bit_conf, "", "", clkHZ, verbose)
{
(void)pid;
(void)vid;
(void)interface;
setMode(0);
setCSmode(SPI_CS_AUTO);
setEndianness(SPI_MSB_FIRST);

View File

@ -309,7 +309,7 @@ int JedParser::parse()
int size = 0;
for (size_t i = 0; i < _data_list.size(); i++) {
if (_verbose) {
printf("area[%ld] %d %d ", i, _data_list[i].offset, _data_list[i].len);
printf("area[%zd] %d %d ", i, _data_list[i].offset, _data_list[i].len);
printf("%s\n", _data_list[i].associatedPrevNote.c_str());
}
size += _data_list[i].len;
@ -331,7 +331,7 @@ int JedParser::parse()
}
if (_verbose)
printf("array size %ld\n", _data_list[0].data.size());
printf("array size %zd\n", _data_list[0].data.size());
if (_fuse_count != size) {
cerr << "Not all fuses are programmed" << endl;

View File

@ -71,6 +71,7 @@ Lattice::Lattice(Jtag *jtag, const string filename,
bool flash_wr, bool sram_wr, bool verbose):
Device(jtag, filename, verbose), _fpga_family(UNKNOWN_FAMILY)
{
(void)sram_wr;
if (_filename != "") {
if (_file_extension == "jed" || _file_extension == "mcs") {
_mode = Device::FLASH_MODE;
@ -899,7 +900,7 @@ bool Lattice::Verify(std::vector<std::string> data, bool unlock)
_jtag->shiftDR(tx_buf, rx_buf, 16*8, Jtag::PAUSE_DR);
for (size_t i = 0; i < data[line].size(); i++) {
if (rx_buf[i] != (unsigned char)data[line][i]) {
printf("%3lu %3lu %02x -> %02x\n", line, i,
printf("%3zu %3zu %02x -> %02x\n", line, i,
rx_buf[i], (unsigned char)data[line][i]);
failure = true;
}