Description: Fix FTBFS with GCC-11 Fix a comprison error which looked like a copy-paste error. Rename a variable which was ambiguous with another c++ function. Author: Sudip Mukherjee --- Bug-Debian: https://bugs.debian.org/984030 Forwarded: no --- d-itg-2.8.1-r1023.orig/src/ITGDec/ITGDecod.cpp +++ d-itg-2.8.1-r1023/src/ITGDec/ITGDecod.cpp @@ -129,7 +129,7 @@ ofstream outbin; ifstream sendlog; FILE *intxt; FILE *outtxt; -int size, flagfilter, flagwinlin; +int fread_size, flagfilter, flagwinlin; unsigned int flownum; double msbitrate, msjitter, mspktloss, msdelay, mscombinedstats, secfirstline_gl; gestioneFileLog memFile[MaxNumFlow]; @@ -557,10 +557,10 @@ int main(int argc, char *argv[]) } } - size = 1; - while (size > 0) { + fread_size = 1; + while (fread_size > 0) { infos = readline(&inbin, intxt, logintype); - if (size > 0) { + if (fread_size > 0) { mark(); if (flagreconstruct) { struct info *send_info = found((*infos).flowId, (*infos).srcAddr, (*infos).destAddr, (*infos).srcPort, @@ -967,7 +967,7 @@ struct info *readline(ifstream *fbin, FI if (filetype == 0) { - size = fread(infos_loc, sizeof(struct info), 1, ftxt); + fread_size = fread(infos_loc, sizeof(struct info), 1, ftxt); @@ -998,12 +998,12 @@ struct info *readline(ifstream *fbin, FI fscanf(ftxt, "Size>%5u\n", &(*infos_loc).size); if ((*infos_loc).flowId == 0) { printf("\n Error reading input file\n"); - size = 0; + fread_size = 0; } else { - size = 1; + fread_size = 1; } } else - size = 0; + fread_size = 0; } return infos_loc; } @@ -1309,9 +1309,9 @@ void elabsplit(int flagbit, int flagjit, PRINTD(1,"Prima di leggere le info dal file %s con puntantore %p\n", memFile[i].FileName, inputfilec); - size = fread(infos, sizeof(struct info), 1, inputfilec); + fread_size = fread(infos, sizeof(struct info), 1, inputfilec); PRINTD(1,"Info lette dal file %s\n", memFile[i].FileName); - if (size == 0) { + if (fread_size == 0) { if (flagbit) fprintf(outfilebit, "%lf %lf\n", intclosedbit * (double) msbitrate / 1000, tempbitrate * 8 / msbitrate); --- d-itg-2.8.1-r1023.orig/src/ITGSend/ITGSend.cpp +++ d-itg-2.8.1-r1023/src/ITGSend/ITGSend.cpp @@ -1257,7 +1257,7 @@ void *flowParser(void *param) argc -= 3; break; case 'N': - if ((argc < 3) || (argv[h + 2] <= 0)) + if ((argc < 3) || (strtod(argv[h + 2], NULL) <= 0)) ReportErrorAndExit("Protocol Parser", "Invalid pkts per sec", programName, id); flows[id].IntArrivDistro = pdNormal; @@ -1392,7 +1392,7 @@ void *flowParser(void *param) argc -= 3; break; case 'n': - if ((argc < 3) || (argv[h + 2] <= 0)) + if ((argc < 3) || (atoi(argv[h + 2]) <= 0)) ReportErrorAndExit("Protocol Parser", "Invalid pkt size", programName, id); delete flows[id].PktSize; --- d-itg-2.8.1-r1023.orig/src/ITGSend/traffic.cpp +++ d-itg-2.8.1-r1023/src/ITGSend/traffic.cpp @@ -412,7 +412,7 @@ void burstyParser(int &h, char *argv[], argc -= 3; break; case 'N': - if ((argc < 5) || (argv[h + 2] <= 0)) + if ((argc < 5) || (strtod(argv[h + 2], NULL) <= 0)) ReportErrorAndExit("Protocol Parser", "Invalid settings for the On/Off periods", programName, flowId); b = strtod(argv[h + 1], NULL); @@ -538,7 +538,7 @@ void burstyParser(int &h, char *argv[], argc -= 3; break; case 'N': - if ((argc < 3) || (argv[h + 2] <= 0)) + if ((argc < 3) || (strtod(argv[h + 2], NULL) <= 0)) ReportErrorAndExit("Protocol Parser", "Invalid settings for the Off/Off periods", programName, flowId); b = strtod(argv[h + 1], NULL);