PERFORCE change 219878 for review

Brooks Davis brooks at FreeBSD.org
Tue Dec 4 19:40:06 UTC 2012


http://p4web.freebsd.org/@@219878?ac=10

Change 219878 by brooks at 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;


More information about the p4-projects mailing list