From owner-svn-src-all@freebsd.org Sun Jul 31 15:02:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67136BA955C; Sun, 31 Jul 2016 15:02:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4273F1ACA; Sun, 31 Jul 2016 15:02:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6VF2r0L011878; Sun, 31 Jul 2016 15:02:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6VF2rol011877; Sun, 31 Jul 2016 15:02:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607311502.u6VF2rol011877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 31 Jul 2016 15:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303588 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2016 15:02:54 -0000 Author: pfg Date: Sun Jul 31 15:02:53 2016 New Revision: 303588 URL: https://svnweb.freebsd.org/changeset/base/303588 Log: indent(1): Remove dead code relating to unix-style comments. The original indent(1) described unix-style comments as similar to box comments, except the first non-blank character on each line is lined up with the '*' of the "/*" which appears on a line by itself. The code has been turned off for ages and -sc/-nsc make it even less relevant. Reference: https://github.com/pstef/freebsd_indent/commit/89c5fe2c56742d96975bb3ea6b99f28baf9d82f6 Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Jul 31 14:59:44 2016 (r303587) +++ head/usr.bin/indent/pr_comment.c Sun Jul 31 15:02:53 2016 (r303588) @@ -87,10 +87,6 @@ pr_comment(void) char *last_bl; /* points to the last blank in the output * buffer */ char *t_ptr; /* used for moving string */ - int unix_comment; /* tri-state variable used to decide if it is - * a unix-style comment. 0 means only blanks - * since /+*, 1 means regular style comment, 2 - * means unix style comment */ int break_delim = comment_delimiter_on_blankline; int l_just_saw_decl = ps.just_saw_decl; /* @@ -105,9 +101,6 @@ pr_comment(void) * a boxed comment or some other * comment that should not be touched */ ++ps.out_coms; /* keep track of number of comments */ - unix_comment = 1; /* set flag to let us figure out if there is a - * unix-style comment ** DISABLED: use 0 to - * reenable this hack! */ /* Figure where to align and how to treat the comment */ @@ -247,34 +240,6 @@ pr_comment(void) } else { ps.last_nl = 1; - if (unix_comment != 1) { /* we not are in unix_style - * comment */ - if (unix_comment == 0 && s_code == e_code) { - /* - * if it is a UNIX-style comment, ignore the - * requirement that previous line be blank for - * unindention - */ - ps.com_col = (ps.ind_level - ps.unindent_displace) * ps.ind_size + 1; - if (ps.com_col <= 1) - ps.com_col = 2; - } - unix_comment = 2; /* permanently remember that we are in - * this type of comment */ - dump_line(); - ++line_no; - now_col = ps.com_col; - *e_com++ = ' '; - /* - * fix so that the star at the start of the line will line - * up - */ - do /* flush leading white space */ - if (++buf_ptr >= buf_end) - fill_buffer(); - while (*buf_ptr == ' ' || *buf_ptr == '\t'); - break; - } if (*(e_com - 1) == ' ' || *(e_com - 1) == '\t') last_bl = e_com - 1; /* @@ -312,10 +277,6 @@ pr_comment(void) if (++buf_ptr >= buf_end) /* get to next char after * */ fill_buffer(); - if (unix_comment == 0) /* set flag to show we are not in - * unix-style comment */ - unix_comment = 1; - if (*buf_ptr == '/') { /* it is the end!!! */ end_of_comment: if (++buf_ptr >= buf_end) @@ -357,9 +318,6 @@ pr_comment(void) } break; default: /* we have a random char */ - if (unix_comment == 0 && *buf_ptr != ' ' && *buf_ptr != '\t') - unix_comment = 1; /* we are not in unix-style comment */ - *e_com = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer(); @@ -376,7 +334,7 @@ pr_comment(void) /* remember we saw a blank */ ++e_com; - if (now_col > adj_max_col && !ps.box_com && unix_comment == 1 && e_com[-1] > ' ') { + if (now_col > adj_max_col && !ps.box_com && e_com[-1] > ' ') { /* * the comment is too long, it must be broken up */