From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73892A034C; Wed, 9 Nov 2022 20:15:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72DBA410DE; Wed, 9 Nov 2022 20:14:56 +0100 (CET) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id BE3D4410DE for ; Wed, 9 Nov 2022 20:14:55 +0100 (CET) Received: by mail-pj1-f46.google.com with SMTP id d13-20020a17090a3b0d00b00213519dfe4aso2841707pjc.2 for ; Wed, 09 Nov 2022 11:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ac5Ru+4OKqvdwqyupYsZlWG2/rQ7YLAQ869MdSC+FrQ=; b=jcu2zjlF+jQTSYg9+KfUZ/f6skMU5WN7LybUPlmFO9fEqBCvia9sStJjj8ds1ffsIx bk5SH1z62/zVIvb/OVE7esi+2Ng0sIESfKCrUXTEMhCoRUKl1EmIlpmVrhHsFJY8ouk1 xj/kJqEdSyVJYqxlRMBJ5twNa5bCFRLIdSMaaroYrcxgGKC3vb2LxEEECPYaw9WQ1h5v ADZxK5vhOXForkTJ0UMmTQJANdvf5NI4z3sttQcDBCkyvPyo+G1j1LC6f7YfZ6gyKuQ7 tge6onQGKqsThQ9tnA/W+ZNDLt1t7sCDtZx4r4jVORyfdxFOW3lqDuGbcG6Td4P1Jzcy 5tBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ac5Ru+4OKqvdwqyupYsZlWG2/rQ7YLAQ869MdSC+FrQ=; b=Gp4EUmCgEDldx2rnO9jsiug9wJB1r+9ZaIJqXyPGzuYAMYbQihzvrsm/sKM29pRJx2 /LRLpI9rOBnMtNhxYn9RVI1ZH6MSk2Plz+zDxWNcot+uqcL80Vct/+zzQaMlSSBOp/i6 EjECsGPzVu34wpFX4PAyzwXvzvR4CK2p2tRVswszkPW6fMSkmEJdHRMgbCAUqdwRbxT0 vpO0Du6PKxY22IY6rcNA9yaj9yVE2+Wz5beJDMbfwNWZEJUWQDDmYFugB8e8hybJULR+ fbjthMg+w08RVi0TgsOEgW0jNzx1Plrcht6WJq2dmMToTMufmlllcT9TlhZqp/MIW9dY SQKw== X-Gm-Message-State: ACrzQf3CckRC71S5xvao+SRB+KrKfKGVLfhw4j1/r0lPt1FfdQl4cj5r xtoqNVJfx7rUGhF2nni4xdcwyi/oAcmMnA== X-Google-Smtp-Source: AMsMyM40vNdx2Y7kpmOVGwzmJPFbwDrn5HxSM8RA4q+Y6Wixpq6LmYd2mBOufCzLmYjjLXpHS6xZww== X-Received: by 2002:a17:90b:2d8e:b0:213:d517:f40f with SMTP id sj14-20020a17090b2d8e00b00213d517f40fmr55689976pjb.5.1668021294504; Wed, 09 Nov 2022 11:14:54 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id gn16-20020a17090ac79000b002130c269b6fsm1586698pjb.1.2022.11.09.11.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 11:14:52 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz Subject: [PATCH 02/14] cmdline: fix whitespace Date: Wed, 9 Nov 2022 11:14:33 -0800 Message-Id: <20221109191445.140320-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221109191445.140320-1-stephen@networkplumber.org> References: <20221109191445.140320-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add space after keywords. Remove unnecessary spaces in if expressions. Signed-off-by: Stephen Hemminger --- lib/cmdline/cmdline_parse_string.c | 10 +++++----- lib/cmdline/cmdline_rdline.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/cmdline/cmdline_parse_string.c b/lib/cmdline/cmdline_parse_string.c index d756638905a2..0b53d0c800cc 100644 --- a/lib/cmdline/cmdline_parse_string.c +++ b/lib/cmdline/cmdline_parse_string.c @@ -77,16 +77,16 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res, continue; } - if ( strncmp(buf, str, token_len) ) { + if (strncmp(buf, str, token_len)) { continue; } - if ( !cmdline_isendoftoken(*(buf+token_len)) ) { + if (!cmdline_isendoftoken(*(buf+token_len))) { continue; } break; - } while ( (str = get_next_token(str)) != NULL ); + } while ( (str = get_next_token(str)) != NULL); if (!str) return -1; @@ -108,7 +108,7 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res, /* unspecified string (unknown single token) */ else { token_len = 0; - while(!cmdline_isendoftoken(buf[token_len]) && + while (!cmdline_isendoftoken(buf[token_len]) && token_len < (STR_TOKEN_SIZE-1)) token_len++; @@ -149,7 +149,7 @@ int cmdline_complete_get_nb_string(cmdline_parse_token_hdr_t *tk) return 0; str = sd->str; - while( (str = get_next_token(str)) != NULL ) { + while ((str = get_next_token(str)) != NULL) { ret++; } return ret; diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c index 5cf723a0126a..28fc54cdfebf 100644 --- a/lib/cmdline/cmdline_rdline.c +++ b/lib/cmdline/cmdline_rdline.c @@ -301,7 +301,7 @@ rdline_char_in(struct rdline *rdl, char c) /* delete 1 char from the left */ case CMDLINE_KEY_BKSPACE: case CMDLINE_KEY_BKSPACE2: - if(!cirbuf_del_tail_safe(&rdl->left)) { + if (!cirbuf_del_tail_safe(&rdl->left)) { rdline_puts(rdl, vt100_bs); display_right_buffer(rdl, 1); } @@ -354,7 +354,7 @@ rdline_char_in(struct rdline *rdl, char c) /* paste contents of kill buffer to the left side of caret */ case CMDLINE_KEY_CTRL_Y: i=0; - while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) < + while (CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) < RDLINE_BUF_SIZE && i < rdl->kill_size) { cirbuf_add_tail(&rdl->left, rdl->kill_buf[i]); @@ -404,7 +404,7 @@ rdline_char_in(struct rdline *rdl, char c) /* add chars */ if (ret == RDLINE_RES_COMPLETE) { i=0; - while(CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) < + while (CIRBUF_GET_LEN(&rdl->right) + CIRBUF_GET_LEN(&rdl->left) < RDLINE_BUF_SIZE && i < tmp_size) { cirbuf_add_tail(&rdl->left, tmp_buf[i]); -- 2.35.1