From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 31E95A0696 for ; Thu, 4 Apr 2019 11:59:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 062681B118; Thu, 4 Apr 2019 11:59:57 +0200 (CEST) Received: from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147]) by dpdk.org (Postfix) with ESMTP id 8B5751B107 for ; Thu, 4 Apr 2019 11:59:54 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x349xqnW026617; Thu, 4 Apr 2019 18:59:52 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id A56A4EA8453; Thu, 4 Apr 2019 18:59:52 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 8AD00EA8385; Thu, 4 Apr 2019 18:59:52 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Thu, 4 Apr 2019 18:57:38 +0900 Message-Id: <1554371860-18206-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554371860-18206-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1554371860-18206-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable Subject: [spp] [PATCH 1/3] spp_nfv: remove declaration in for loop X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa For some environment, declaration in for loop cause an error. error: ‘for’ loop initial declarations are only allowed in C99 mode This update is move this declaration from. Signed-off-by: Yasufumi Ogawa --- src/nfv/main.c | 2 +- src/nfv/nfv_status.c | 4 ++-- src/nfv/nfv_utils.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nfv/main.c b/src/nfv/main.c index 4ecc553..fbcef0c 100644 --- a/src/nfv/main.c +++ b/src/nfv/main.c @@ -248,7 +248,7 @@ main(int argc, char *argv[]) lcore_id_used[lcore_id] = 1; } sprintf(log_msg, "Used lcores: "); - for (int i = 0; i < RTE_MAX_LCORE; i++) { + for (i = 0; i < RTE_MAX_LCORE; i++) { if (lcore_id_used[i] == 1) sprintf(log_msg + strlen(log_msg), "%d ", i); } diff --git a/src/nfv/nfv_status.c b/src/nfv/nfv_status.c index a3ad597..d29e083 100644 --- a/src/nfv/nfv_status.c +++ b/src/nfv/nfv_status.c @@ -54,9 +54,9 @@ int append_lcore_info_json(char *str, uint8_t lcore_id_used[RTE_MAX_LCORE]) { - + int i; sprintf(str + strlen(str), "\"lcores\":["); - for (int i = 0; i < RTE_MAX_LCORE; i++) { + for (i = 0; i < RTE_MAX_LCORE; i++) { if (lcore_id_used[i] == 1) sprintf(str + strlen(str), "%d,", i); } diff --git a/src/nfv/nfv_utils.h b/src/nfv/nfv_utils.h index aca5f13..9d4f9dd 100644 --- a/src/nfv/nfv_utils.h +++ b/src/nfv/nfv_utils.h @@ -107,7 +107,8 @@ forward_array_reset(void) /* Return a type of port as a enum member of porttype_map structure. */ static enum port_type get_port_type(char *portname) { - for (int i = 0; portmap[i].port_name != NULL; i++) { + int i; + for (i = 0; portmap[i].port_name != NULL; i++) { const char *port_name = portmap[i].port_name; if (strncmp(portname, port_name, strlen(port_name)) == 0) return portmap[i].port_type; -- 2.7.4