From nobody Fri May 17 06:54:10 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554086778746399.48650284699636; Sun, 31 Mar 2019 19:46:18 -0700 (PDT) Received: from localhost ([127.0.0.1]:53825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAmxX-0005ZM-Hu for importer@patchew.org; Sun, 31 Mar 2019 22:46:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAmvr-0004oM-Kn for qemu-devel@nongnu.org; Sun, 31 Mar 2019 22:44:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAmvq-000120-Fp for qemu-devel@nongnu.org; Sun, 31 Mar 2019 22:44:19 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:39937) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAmvq-00011F-4p; Sun, 31 Mar 2019 22:44:18 -0400 Received: by mail-wr1-x42a.google.com with SMTP id h4so9802000wre.7; Sun, 31 Mar 2019 19:44:17 -0700 (PDT) Received: from ninjatsu.lan (host-2-103-80-5.as13285.net. [2.103.80.5]) by smtp.gmail.com with ESMTPSA id s189sm13627048wmf.45.2019.03.31.19.44.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 Mar 2019 19:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mmoYwXAvxBngo9UYLtD0IUN1Cc3w90XyrY4QAQCwS7s=; b=gQy9C0/NV04h/1oAKO3j6YBkuW97buMWyiRMNnwtjHP6zf5H6HE2QRWNAsBDVstLwZ Zr7NRFnow1JCUEHGAPxAPFAAOzlF9Lr9YMeZttFvK4lkf7ttYaFmElOVr7I7aqpQa6nQ 8n4dNR7WPE0SZwdo3dUtFE4o7UPYu7SmN4QTX909wfFghWWNQfF1WfvQK5BdDk2aW9pS rTxEiGnSf1Nh1G5CwZ+0UrNkXHcmvH5hXhl6AEUL4XcTteU/OAL4LszpDViYm0sNsWbh I6bGwTQPPGfGPgVZocgWpXtzhKTR5o0D3J2CqC+oSGcvwYkThEjI30lYNI/QbxtS23NG Zlqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mmoYwXAvxBngo9UYLtD0IUN1Cc3w90XyrY4QAQCwS7s=; b=NmvF9LLn8oGoV9/VUmL+de0Q1zgbtliqNqhn9ceJh4zvHDlzaTO32qhQK2qQEtGv+H Ok8HuQC/C4t/aAlXzTKsIwszKxT/w8KXgFCqlfMfte2qAbdXjqBjyzM2unYya8LUggsE 1b24velf7ihqRGi/X3wE/5v/cmjWryn/OBz8D0K5T4O3DyR0XEMrsk8FvPaqyEHFtV+i c6oKwEWqoKpz6blfpCdP7QCOsXL3PASqG0oE65dMmDS68fISYIw+glbxTeJEdugIdgsE OcWiRYsEZ8UjZEHtO7GH09ODEFLPWvfB+fdKKQ+dxe6ZM8+cy8llXTzW11ZDXo16Sp9c FZfw== X-Gm-Message-State: APjAAAVsuI8yhEkjRkAVGeh427dEVVmvJVKr6dismPBhdOEqhvtvWRH8 B8MTI2CBKldpsA4DLB1MsJwZxG8= X-Google-Smtp-Source: APXvYqz1QZ+cmtBkVQybgFH1fh+rS7mHfyZHTRNO1pUcWYWV3fna9I63sWIKl6JM9aOIDW4191wvOA== X-Received: by 2002:a5d:68cd:: with SMTP id p13mr39802002wrw.22.1554086655851; Sun, 31 Mar 2019 19:44:15 -0700 (PDT) From: Jules Irenge To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 03:44:05 +0100 Message-Id: <20190401024406.10819-2-jbi.octave@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190401024406.10819-1-jbi.octave@gmail.com> References: <20190401024406.10819-1-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a Subject: [Qemu-devel] [PATCH v2 1/2] util/readline: add a space to fix errors by checkpatch tool X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" util/readline: add a space to fix errors reported by checkpatch.pl tool "ERROR: space required before the open parenthesis" "ERROR: space required after that ..." within "util/redline.c" file Signed-off-by: Jules Irenge Reviewed-by: Thomas Huth --- util/readline.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/util/readline.c b/util/readline.c index ec91ee0fea..db399d3948 100644 --- a/util/readline.c +++ b/util/readline.c @@ -48,13 +48,13 @@ static void readline_update(ReadLineState *rs) =20 if (rs->cmd_buf_size !=3D rs->last_cmd_buf_size || memcmp(rs->cmd_buf, rs->last_cmd_buf, rs->cmd_buf_size) !=3D 0) { - for(i =3D 0; i < rs->last_cmd_buf_index; i++) { + for (i =3D 0; i < rs->last_cmd_buf_index; i++) { rs->printf_func(rs->opaque, "\033[D"); } rs->cmd_buf[rs->cmd_buf_size] =3D '\0'; if (rs->read_password) { len =3D strlen(rs->cmd_buf); - for(i =3D 0; i < len; i++) + for (i =3D 0; i < len; i++) rs->printf_func(rs->opaque, "*"); } else { rs->printf_func(rs->opaque, "%s", rs->cmd_buf); @@ -67,12 +67,12 @@ static void readline_update(ReadLineState *rs) if (rs->cmd_buf_index !=3D rs->last_cmd_buf_index) { delta =3D rs->cmd_buf_index - rs->last_cmd_buf_index; if (delta > 0) { - for(i =3D 0;i < delta; i++) { + for (i =3D 0; i < delta; i++) { rs->printf_func(rs->opaque, "\033[C"); } } else { delta =3D -delta; - for(i =3D 0;i < delta; i++) { + for (i =3D 0; i < delta; i++) { rs->printf_func(rs->opaque, "\033[D"); } } @@ -301,7 +301,7 @@ static void readline_completion(ReadLineState *rs) return; if (rs->nb_completions =3D=3D 1) { len =3D strlen(rs->completions[0]); - for(i =3D rs->completion_index; i < len; i++) { + for (i =3D rs->completion_index; i < len; i++) { readline_insert_char(rs, rs->completions[0][i]); } /* extra space for next argument. XXX: make it more generic */ @@ -312,15 +312,15 @@ static void readline_completion(ReadLineState *rs) completion_comp); rs->printf_func(rs->opaque, "\n"); max_width =3D 0; - max_prefix =3D 0;=09 - for(i =3D 0; i < rs->nb_completions; i++) { + max_prefix =3D 0; + for (i =3D 0; i < rs->nb_completions; i++) { len =3D strlen(rs->completions[i]); - if (i=3D=3D0) { + if (i =3D=3D 0) { max_prefix =3D len; } else { if (len < max_prefix) max_prefix =3D len; - for(j=3D0; jcompletions[i][j] !=3D rs->completions[0][j]) max_prefix =3D j; } @@ -328,8 +328,8 @@ static void readline_completion(ReadLineState *rs) if (len > max_width) max_width =3D len; } - if (max_prefix > 0)=20 - for(i =3D rs->completion_index; i < max_prefix; i++) { + if (max_prefix > 0) + for (i =3D rs->completion_index; i < max_prefix; i++) { readline_insert_char(rs, rs->completions[0][i]); } max_width +=3D 2; @@ -339,7 +339,7 @@ static void readline_completion(ReadLineState *rs) max_width =3D 80; nb_cols =3D 80 / max_width; j =3D 0; - for(i =3D 0; i < rs->nb_completions; i++) { + for (i =3D 0; i < rs->nb_completions; i++) { rs->printf_func(rs->opaque, "%-*s", max_width, rs->completions= [i]); if (++j =3D=3D nb_cols || i =3D=3D (rs->nb_completions - 1)) { rs->printf_func(rs->opaque, "\n"); @@ -362,9 +362,9 @@ static void readline_clear_screen(ReadLineState *rs) /* return true if command handled */ void readline_handle_byte(ReadLineState *rs, int ch) { - switch(rs->esc_state) { + switch (rs->esc_state) { case IS_NORM: - switch(ch) { + switch (ch) { case 1: readline_bol(rs); break; @@ -425,7 +425,7 @@ void readline_handle_byte(ReadLineState *rs, int ch) } break; case IS_CSI: - switch(ch) { + switch (ch) { case 'A': case 'F': readline_up_char(rs); @@ -444,7 +444,7 @@ void readline_handle_byte(ReadLineState *rs, int ch) rs->esc_param =3D rs->esc_param * 10 + (ch - '0'); goto the_end; case '~': - switch(rs->esc_param) { + switch (rs->esc_param) { case 1: readline_bol(rs); break; @@ -463,7 +463,7 @@ void readline_handle_byte(ReadLineState *rs, int ch) the_end: break; case IS_SS3: - switch(ch) { + switch (ch) { case 'F': readline_eol(rs); break; --=20 2.20.1 From nobody Fri May 17 06:54:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554086885673956.0148421752665; Sun, 31 Mar 2019 19:48:05 -0700 (PDT) Received: from localhost ([127.0.0.1]:54283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAmzU-0007F9-Mr for importer@patchew.org; Sun, 31 Mar 2019 22:48:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAmvr-0004oN-NJ for qemu-devel@nongnu.org; Sun, 31 Mar 2019 22:44:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAmvq-000126-HZ for qemu-devel@nongnu.org; Sun, 31 Mar 2019 22:44:19 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:33351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAmvq-00011i-9J; Sun, 31 Mar 2019 22:44:18 -0400 Received: by mail-wr1-x432.google.com with SMTP id q1so9843611wrp.0; Sun, 31 Mar 2019 19:44:18 -0700 (PDT) Received: from ninjatsu.lan (host-2-103-80-5.as13285.net. [2.103.80.5]) by smtp.gmail.com with ESMTPSA id s189sm13627048wmf.45.2019.03.31.19.44.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 Mar 2019 19:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oc5KkzGTUSXzkK5jWJPTEx/xxqpOEDMbdCroayzZBdc=; b=dQpUfINarQjUCrKMwfxwyS+/qp0mOArh9ShPC+GZjBUyXgXO7YxOgG2zsOQfGE83rK M0Yk+kE2f7bbOO4SYUyKlXwc4JFX+5X2AYrnx89VQF1Ah8FpIyUCtU5BPT//ZsvFvrc8 iNsrtIW1I0EvHfZi1qgPwTV63S8bkgPI7yqRbxGT5bWjiQMJ5KybTV3pLg/EpDq+YZjJ Ec+XGKFxHPjcHcX78mD9sKrzPFKS/cGBGcdq3lfK8/jrcf9/bknhCeVY1vxTHIb3RgCC iH4OfdeghYmxAzi/IJmsMScU643WlKaUNsGE33xFvBTX39Or9SwlOg14X909MrI0V3hA MTPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oc5KkzGTUSXzkK5jWJPTEx/xxqpOEDMbdCroayzZBdc=; b=VM8ntKWm1/tDEkhe+5Ed7PVXA78Uq4LhR7c5eo5/zQEmiG2GU2oaBmfitwNj9gz0JV SS07ZXmI6uUCZ00D3eudVJEC1uwBBQmhlCAndS2jGzJwKuSJ99ESNUREK71d5tWzfv/Z mF+wZhwzsvUJS1dXH2BfZlwH/fybCr12BcAOFLRR66Hu3HCZurGkcaAI0XTv198kJCZ/ Dju6Ei1QtXHDxk+qOi/XsMQLilolfWGNrGUBqsGmJAg6qLt11SwTzv6O3rRcsUXzhnc/ fZXQqpQEp/+7KvBCiudZGmQaAUIqmQMaFSKzKCZsHGa2qIw5qQkqX1q2dS+R63MNmmxo sN/A== X-Gm-Message-State: APjAAAV6NwE45VSjbOOWCjFprceZrxc/VBO8eUMT/ibeu/gVrvMX4khO ElIwXL7oUYOHAQtbCWAMoEAL/y0= X-Google-Smtp-Source: APXvYqztYncETqygIuZTHOcD9Z1KPImXbDDNEksI6Fc34s2oNIil82zhTicq7/3KsUX91EtkBe7phw== X-Received: by 2002:a5d:4750:: with SMTP id o16mr39284748wrs.206.1554086656961; Sun, 31 Mar 2019 19:44:16 -0700 (PDT) From: Jules Irenge To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 03:44:06 +0100 Message-Id: <20190401024406.10819-3-jbi.octave@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190401024406.10819-1-jbi.octave@gmail.com> References: <20190401024406.10819-1-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 Subject: [Qemu-devel] [PATCH v2 2/2] util: readline: replace tab indent by four spaces to fix checkpatch errors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Replace tab indent by four spaces to fix errors issued by checkpatch.pl tool "ERROR: code indent should never use tabs" within "util/readline.c" file. Signed-off-by: Jules Irenge Reviewed-by: Thomas Huth --- util/readline.c | 98 ++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/util/readline.c b/util/readline.c index db399d3948..3eb5a66dfc 100644 --- a/util/readline.c +++ b/util/readline.c @@ -179,20 +179,20 @@ static void readline_up_char(ReadLineState *rs) int idx; =20 if (rs->hist_entry =3D=3D 0) - return; + return; if (rs->hist_entry =3D=3D -1) { - /* Find latest entry */ - for (idx =3D 0; idx < READLINE_MAX_CMDS; idx++) { - if (rs->history[idx] =3D=3D NULL) - break; - } - rs->hist_entry =3D idx; + /* Find latest entry */ + for (idx =3D 0; idx < READLINE_MAX_CMDS; idx++) { + if (rs->history[idx] =3D=3D NULL) + break; + } + rs->hist_entry =3D idx; } rs->hist_entry--; if (rs->hist_entry >=3D 0) { - pstrcpy(rs->cmd_buf, sizeof(rs->cmd_buf), + pstrcpy(rs->cmd_buf, sizeof(rs->cmd_buf), rs->history[rs->hist_entry]); - rs->cmd_buf_index =3D rs->cmd_buf_size =3D strlen(rs->cmd_buf); + rs->cmd_buf_index =3D rs->cmd_buf_size =3D strlen(rs->cmd_buf); } } =20 @@ -202,11 +202,11 @@ static void readline_down_char(ReadLineState *rs) return; if (rs->hist_entry < READLINE_MAX_CMDS - 1 && rs->history[++rs->hist_entry] !=3D NULL) { - pstrcpy(rs->cmd_buf, sizeof(rs->cmd_buf), + pstrcpy(rs->cmd_buf, sizeof(rs->cmd_buf), rs->history[rs->hist_entry]); } else { rs->cmd_buf[0] =3D 0; - rs->hist_entry =3D -1; + rs->hist_entry =3D -1; } rs->cmd_buf_index =3D rs->cmd_buf_size =3D strlen(rs->cmd_buf); } @@ -217,42 +217,42 @@ static void readline_hist_add(ReadLineState *rs, cons= t char *cmdline) int idx; =20 if (cmdline[0] =3D=3D '\0') - return; + return; new_entry =3D NULL; if (rs->hist_entry !=3D -1) { - /* We were editing an existing history entry: replace it */ - hist_entry =3D rs->history[rs->hist_entry]; - idx =3D rs->hist_entry; - if (strcmp(hist_entry, cmdline) =3D=3D 0) { - goto same_entry; - } + /* We were editing an existing history entry: replace it */ + hist_entry =3D rs->history[rs->hist_entry]; + idx =3D rs->hist_entry; + if (strcmp(hist_entry, cmdline) =3D=3D 0) { + goto same_entry; + } } /* Search cmdline in history buffers */ for (idx =3D 0; idx < READLINE_MAX_CMDS; idx++) { - hist_entry =3D rs->history[idx]; - if (hist_entry =3D=3D NULL) - break; - if (strcmp(hist_entry, cmdline) =3D=3D 0) { - same_entry: - new_entry =3D hist_entry; - /* Put this entry at the end of history */ - memmove(&rs->history[idx], &rs->history[idx + 1], - (READLINE_MAX_CMDS - (idx + 1)) * sizeof(char *)); - rs->history[READLINE_MAX_CMDS - 1] =3D NULL; - for (; idx < READLINE_MAX_CMDS; idx++) { - if (rs->history[idx] =3D=3D NULL) - break; - } - break; - } + hist_entry =3D rs->history[idx]; + if (hist_entry =3D=3D NULL) + break; + if (strcmp(hist_entry, cmdline) =3D=3D 0) { + same_entry: + new_entry =3D hist_entry; + /* Put this entry at the end of history */ + memmove(&rs->history[idx], &rs->history[idx + 1], + (READLINE_MAX_CMDS - (idx + 1)) * sizeof(char *)); + rs->history[READLINE_MAX_CMDS - 1] =3D NULL; + for (; idx < READLINE_MAX_CMDS; idx++) { + if (rs->history[idx] =3D=3D NULL) + break; + } + break; + } } if (idx =3D=3D READLINE_MAX_CMDS) { - /* Need to get one free slot */ + /* Need to get one free slot */ g_free(rs->history[0]); - memmove(rs->history, &rs->history[1], - (READLINE_MAX_CMDS - 1) * sizeof(char *)); - rs->history[READLINE_MAX_CMDS - 1] =3D NULL; - idx =3D READLINE_MAX_CMDS - 1; + memmove(rs->history, &rs->history[1], + (READLINE_MAX_CMDS - 1) * sizeof(char *)); + rs->history[READLINE_MAX_CMDS - 1] =3D NULL; + idx =3D READLINE_MAX_CMDS - 1; } if (new_entry =3D=3D NULL) new_entry =3D g_strdup(cmdline); @@ -403,9 +403,9 @@ void readline_handle_byte(ReadLineState *rs, int ch) case 8: readline_backspace(rs); break; - case 155: + case 155: rs->esc_state =3D IS_CSI; - break; + break; default: if (ch >=3D 32) { readline_insert_char(rs, ch); @@ -426,14 +426,14 @@ void readline_handle_byte(ReadLineState *rs, int ch) break; case IS_CSI: switch (ch) { - case 'A': - case 'F': - readline_up_char(rs); - break; - case 'B': - case 'E': - readline_down_char(rs); - break; + case 'A': + case 'F': + readline_up_char(rs); + break; + case 'B': + case 'E': + readline_down_char(rs); + break; case 'D': readline_backward_char(rs); break; --=20 2.20.1