summaryrefslogtreecommitdiff
path: root/tools/ivythroughput.cpp
diff options
context:
space:
mode:
authorbustico2013-06-20 08:38:59 +0000
committerbustico2013-06-20 08:38:59 +0000
commitbd89957287441872706432d1e283091b4e5cdbc8 (patch)
tree6590870a01cdd3314201efd5aaba69c61d4c0bb3 /tools/ivythroughput.cpp
parent15afc0c41a75c7180d981e77c7673dfefc3d8913 (diff)
downloadivy-c-bd89957287441872706432d1e283091b4e5cdbc8.zip
ivy-c-bd89957287441872706432d1e283091b4e5cdbc8.tar.gz
ivy-c-bd89957287441872706432d1e283091b4e5cdbc8.tar.bz2
ivy-c-bd89957287441872706432d1e283091b4e5cdbc8.tar.xz
fix compilation warning
Diffstat (limited to 'tools/ivythroughput.cpp')
-rw-r--r--tools/ivythroughput.cpp40
1 files changed, 35 insertions, 5 deletions
diff --git a/tools/ivythroughput.cpp b/tools/ivythroughput.cpp
index 7d6136f..e1734d5 100644
--- a/tools/ivythroughput.cpp
+++ b/tools/ivythroughput.cpp
@@ -261,7 +261,7 @@ void emetteur (const char* bus, KindOfTest kod, int testDuration,
// double origin = currentTime();
- IvySetBindCallback (binCB, (void *) (regexpSize+2));
+ IvySetBindCallback (binCB, (void *) (regexpSize+2l));
IvyBindMsg (recepteurReadyCB, (void *) &messages,
"^IvyThroughputReceive_(\\d+)\\s+Ready");
@@ -281,6 +281,10 @@ void emetteur (const char* bus, KindOfTest kod, int testDuration,
# | | | __/ | (__ | __/ | | \ |_ | __/ | |_| | | |
# |_| \___| \___| \___| |_| \__| \___| \__,_| |_|
*/
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-security"
+#endif
void recepteur_tp (const char* bus, KindOfTest kod, unsigned int inst,
const ListOfString& regexps, unsigned int exitAfter)
{
@@ -301,7 +305,7 @@ void recepteur_tp (const char* bus, KindOfTest kod, unsigned int inst,
debugInt++;
string reg = *iter;
if (regexpAreUniq) { ((reg += "(") += stream.str()) += ")?";}
- IvyBindMsg (recepteurCB, (void *) inst, reg.c_str());
+ IvyBindMsg (recepteurCB, (void *) long(inst), reg.c_str());
}
IvyBindMsg (startOfSeqCB, NULL, "^start(OfSequence)");
IvyBindMsg (endOfSeqCB, NULL, "^end(OfSequence)");
@@ -309,13 +313,16 @@ void recepteur_tp (const char* bus, KindOfTest kod, unsigned int inst,
if (kod == memoryLeak2) {
TimerRepeatAfter (1, exitAfter*1000, exitCB, NULL);
} else if (kod == disconnect) {
- TimerRepeatAfter (1, exitAfter*1000/3, doNothingAndSuicideCB, (void *) exitAfter);
+ TimerRepeatAfter (1, exitAfter*1000/3, doNothingAndSuicideCB, (void *) long(exitAfter));
}
//usleep (inst * 50 * 1000);
IvyStart (bus);
IvyMainLoop ();
}
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
void recepteur_ml (const char* bus, KindOfTest kod, unsigned int inst,
const ListOfString& regexps)
@@ -339,7 +346,15 @@ void recepteur_ml (const char* bus, KindOfTest kod, unsigned int inst,
debugInt++;
string reg = *iter;
if (regexpAreUniq) { (reg += " ") += stream.str();}
- bindIdList.push_back (IvyBindMsg (recepteurCB, (void *) inst, reg.c_str()));
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+ bindIdList.push_back (IvyBindMsg (recepteurCB, (void *) long(inst), reg.c_str()));
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
+
}
IvyBindMsg (startOfSeqCB, NULL, "^start(OfSequence)");
IvyBindMsg (endOfSeqCB, NULL, "^end(OfSequence)");
@@ -540,7 +555,14 @@ void sendAllMessageCB (TimerId id, void *user_data, unsigned long delta)
IvySendMsg ("startOfSequence");
ListOfString::iterator iter;
for (iter=messages->begin(); iter != messages->end(); iter++) {
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-security"
+#endif
envoyes += IvySendMsg ((*iter).c_str());
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
}
IvySendMsg ("endOfSequence");
@@ -619,7 +641,15 @@ void desabonneEtReabonneCB (TimerId id, void *user_data, unsigned long delta)
ListOfString::const_iterator iter2;
for (iter2=mds->regexps->begin(); iter2 != mds->regexps->end(); iter2++) {
string reg = *iter2;
- mds->bindIdList->push_back (IvyBindMsg (recepteurCB, (void *) mds->inst, reg.c_str()));
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+ mds->bindIdList->push_back (IvyBindMsg (recepteurCB, (void *) long(mds->inst),
+ reg.c_str()));
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
}
// CHANGE REGEXP