From owner-svn-src-head@freebsd.org Wed Feb 15 17:33:04 2017 Return-Path: Delivered-To: svn-src-head@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 EBB11CE0B0C; Wed, 15 Feb 2017 17:33:04 +0000 (UTC) (envelope-from rpokala@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 9695015FE; Wed, 15 Feb 2017 17:33:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FHX3vj050833; Wed, 15 Feb 2017 17:33:03 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FHX3Fl050832; Wed, 15 Feb 2017 17:33:03 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201702151733.v1FHX3Fl050832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 15 Feb 2017 17:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313777 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 17:33:05 -0000 Author: rpokala Date: Wed Feb 15 17:33:03 2017 New Revision: 313777 URL: https://svnweb.freebsd.org/changeset/base/313777 Log: Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error: sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and put it in the proper order. This fixes the immedate issue w/ vt(4), but all three then fail on different issues. Reviewed by: emaste Modified: head/sys/dev/vt/vt_buf.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Wed Feb 15 16:55:24 2017 (r313776) +++ head/sys/dev/vt/vt_buf.c Wed Feb 15 17:33:03 2017 (r313777) @@ -55,10 +55,10 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", " } while (0) #ifndef SC_NO_CUTPASTE +static int vtbuf_htw(const struct vt_buf *vb, int row); static int vtbuf_wth(const struct vt_buf *vb, int row); static int vtbuf_in_this_range(int begin, int test, int end, int sz); #endif -static int vtbuf_htw(const struct vt_buf *vb, int row); /* * line4 @@ -161,6 +161,21 @@ vthistory_getpos(const struct vt_buf *vb } #ifndef SC_NO_CUTPASTE /* Only mouse support use it now. */ +/* Translate history row to current view row number. */ +static int +vtbuf_htw(const struct vt_buf *vb, int row) +{ + + /* + * total 1000 rows. + * History offset roffset winrow + * 205 200 ((205 - 200 + 1000) % 1000) = 5 + * 90 990 ((90 - 990 + 1000) % 1000) = 100 + */ + return ((row - vb->vb_roffset + vb->vb_history_size) % + vb->vb_history_size); +} + /* Translate current view row number to history row. */ static int vtbuf_wth(const struct vt_buf *vb, int row) @@ -192,21 +207,6 @@ vtbuf_in_this_range(int begin, int test, } #endif -/* Translate history row to current view row number. */ -static int -vtbuf_htw(const struct vt_buf *vb, int row) -{ - - /* - * total 1000 rows. - * History offset roffset winrow - * 205 200 ((205 - 200 + 1000) % 1000) = 5 - * 90 990 ((90 - 990 + 1000) % 1000) = 100 - */ - return ((row - vb->vb_roffset + vb->vb_history_size) % - vb->vb_history_size); -} - int vtbuf_iscursor(const struct vt_buf *vb, int row, int col) {