Skip to contentSkip to conversation

Fix the compiling warnings

PATCH New Bing Zhao 1 participant 1 message Apr 3, 2018

lore
Share & tools
lore

Bing Zhao

author
#0 lore raw

PATCH v2 1/1 Fix the compiling warnings

AT, fix the compiling the warnings/errors in the first patch.

---
 app/cli-functions.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
app/cli-functions.c +9 -4
index 1bddbbe..486c78a 100644
@@ -901,7 +901,7 @@ rte_memcpy_perf(unsigned int cnt, unsigned int kb, int flag)
 	uint64_t start_time, total_time;
 	uint64_t total_bits, bits_per_tick;
 	unsigned int i;
-	void *(*cpy)(void *, const void *, size_t);
+	/* void *(*cpy)(void *, const void *, size_t); */
 
 	kb *= 1024;
 
@@ -911,11 +911,16 @@ rte_memcpy_perf(unsigned int cnt, unsigned int kb, int flag)
 	src = RTE_PTR_ALIGN(buf[0], RTE_CACHE_LINE_SIZE);
 	dst = RTE_PTR_ALIGN(buf[1], RTE_CACHE_LINE_SIZE);
 
-	cpy = (flag)? rte_memcpy : memcpy;
+	/* cpy = (flag)? rte_memcpy : memcpy; */
 
 	start_time = rte_get_tsc_cycles();
-	for(i = 0; i < cnt; i++)
-		cpy(dst, src, kb);
+	if (flag) {
+		for (i=0; i<cnt; i++)
+			rte_memcpy(dst, src, kb);
+	} else {
+		for (i=0; i<cnt; i++)
+			memcpy(dst, src, kb);
+	}
 	total_time = rte_get_tsc_cycles() - start_time;
 
 	total_bits = ((uint64_t)cnt * (uint64_t)kb) * 8L;
Signature · 1 line
2.11.0.windows.1