From owner-p4-projects@FreeBSD.ORG Tue Dec 4 19:40:06 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 32070406; Tue, 4 Dec 2012 19:40:06 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E60AA404 for ; Tue, 4 Dec 2012 19:40:05 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id CB9E98FC17 for ; Tue, 4 Dec 2012 19:40:05 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id qB4Je5pu025608 for ; Tue, 4 Dec 2012 19:40:05 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id qB4Je51f025605 for perforce@freebsd.org; Tue, 4 Dec 2012 19:40:05 GMT (envelope-from brooks@freebsd.org) Date: Tue, 4 Dec 2012 19:40:05 GMT Message-Id: <201212041940.qB4Je51f025605@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219878 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 19:40:06 -0000 http://p4web.freebsd.org/@@219878?ac=10 Change 219878 by brooks@brooks_zenith on 2012/12/04 19:39:56 Fix selection of Cheri and Visible in the config dialog. Contrary to my sleep deprived mind's opinion, the first three positive integers are 1, 2, and 3, not 1, 2, and 4. Clean up the code that assembles the dialog by using alread computed values rather than somewhat mysterious sums. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#16 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#16 (text+ko) ==== @@ -254,7 +254,7 @@ fb_render_text("Sandbox", 2, black, white, textbuf, f_width * CD_SB_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH, CD_BORDER_WIDTH + (0 * f_height), + sb_startc, cfg_startr + (0 * f_height), textbuf, f_width * CD_SB_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_SB_COLS, f_height); @@ -262,7 +262,7 @@ fb_render_text(text, 2, black, white, textbuf, f_width * CD_SB_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH, CD_BORDER_WIDTH + (1 * f_height), + sb_startc, cfg_startr + (1 * f_height), textbuf, f_width * CD_SB_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_SB_COLS, f_height); @@ -270,7 +270,7 @@ fb_render_text(text, 2, black, white, textbuf, f_width * CD_SB_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH, CD_BORDER_WIDTH + (2 * f_height), + sb_startc, cfg_startr + (2 * f_height), textbuf, f_width * CD_SB_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_SB_COLS, f_height); @@ -278,7 +278,7 @@ fb_render_text(text, 2, black, white, textbuf, f_width * CD_SB_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH, CD_BORDER_WIDTH + (3 * f_height), + sb_startc, cfg_startr + (3 * f_height), textbuf, f_width * CD_SB_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_SB_COLS, f_height); @@ -286,15 +286,14 @@ fb_render_text(text, 2, black, white, textbuf, f_width * CD_SB_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH, CD_BORDER_WIDTH + (5 * f_height), + sb_startc, cfg_startr + (5 * f_height), textbuf, f_width * CD_SB_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height); fb_render_text("Resolution", 2, black, white, textbuf, f_width * CD_RES_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH + (f_width * CD_SB_COLS) + CD_GAP, - CD_BORDER_WIDTH + (0 * f_height), + res_startc, cfg_startr + (0 * f_height), textbuf, f_width * CD_RES_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height); @@ -302,8 +301,7 @@ fb_render_text(text, 2, black, white, textbuf, f_width * CD_RES_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH + (f_width * CD_SB_COLS) + CD_GAP, - CD_BORDER_WIDTH + (1 * f_height), + res_startc, cfg_startr + (1 * f_height), textbuf, f_width * CD_RES_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height); @@ -311,8 +309,7 @@ fb_render_text(text, 2, black, white, textbuf, f_width * CD_RES_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH + (f_width * CD_SB_COLS) + CD_GAP, - CD_BORDER_WIDTH + (2 * f_height), + res_startc, cfg_startr + (2 * f_height), textbuf, f_width * CD_RES_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height); @@ -320,8 +317,7 @@ fb_render_text(text, 2, black, white, textbuf, f_width * CD_RES_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH + (f_width * CD_SB_COLS) + CD_GAP, - CD_BORDER_WIDTH + (3 * f_height), + res_startc, cfg_startr + (3 * f_height), textbuf, f_width * CD_RES_COLS, f_height); fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height); @@ -330,8 +326,7 @@ fb_render_text(text, 2, black, white, textbuf, f_width * CD_RES_COLS, f_height); fb_composite(dbuf, d_width, d_height, - CD_BORDER_WIDTH + (f_width * CD_SB_COLS) + CD_GAP, - CD_BORDER_WIDTH + (4 * f_height), + res_startc, cfg_startr + (4 * f_height), textbuf, f_width * CD_RES_COLS, f_height); fb_post_region(dbuf, d_x, d_y, d_width, d_height); @@ -350,7 +345,7 @@ case TSG_SOUTH: goto done; case TSG_CLICK: - row = (ts->ts_y1 - d_y - cfg_startr) / f_height; + row = (ts->ts_y1 - (d_y + cfg_startr)) / f_height; if ((uint)ts->ts_x1 > d_x + sb_startc && (uint)ts->ts_x1 < d_x + sb_endc) { switch (row) { @@ -368,14 +363,14 @@ goto repaint; } break; - case 4: + case 3: if (sb != SB_CHERI) { changed = 1; sb = SB_CHERI; goto repaint; } break; - case 6: + case 5: changed = 1; sb_vis = sb_vis ? 0 : 1; goto repaint;