Revision: 54520
http://brlcad.svn.sourceforge.net/brlcad/?rev=54520&view=rev
Author: carlmoore
Date: 2013-03-01 20:54:40 +0000 (Fri, 01 Mar 2013)
Log Message:
-----------
for cell-fb, add 'cell-fb: ' to error messages, fold 2 lines into 1, fix
options-list spacing, shorten usage statement
Modified Paths:
--------------
brlcad/trunk/src/fb/cell-fb.c
Modified: brlcad/trunk/src/fb/cell-fb.c
===================================================================
--- brlcad/trunk/src/fb/cell-fb.c 2013-03-01 20:32:16 UTC (rev 54519)
+++ brlcad/trunk/src/fb/cell-fb.c 2013-03-01 20:54:40 UTC (rev 54520)
@@ -126,8 +126,6 @@
/* Global variables */
static char *usage[] = {
"",
- "cell-fb",
- "",
"Usage: cell-fb [options] [file]",
"Options:",
" -C Use first 3 fields as r, g, and b",
@@ -137,7 +135,7 @@
" -S n Set frame-buffer height and width to `n' pixels",
" -W n Set frame-buffer width to `n' pixels",
" -X n Set local debug flag to hex value `n' (default is 0)",
- " -a \"h v\" Print pixel coords of point",
+ " -a \"h v\" Print pixel coords of point",
" -b n Ignore values not equal to `n'",
" -c n Assume cell size of `n' user units (default is 100)",
" -d \"m n\" Expect input in interval [m, n] (default is [0, 1])",
@@ -262,7 +260,7 @@
grid = (Cell *) bu_realloc((char *) grid,
sizeof(Cell) * maxcells, "grid");
if (debug_flag & CFB_DBG_MEM)
- bu_log("maxcells increased to %ld\n", maxcells);
+ bu_log("cell-fb: maxcells increased to %ld\n", maxcells);
gp = grid + ncells;
}
/* Process any non-data (i.e. view-header) lines */
@@ -321,7 +319,7 @@
FILE *infp;
if ((infp = fopen("/dev/tty", "rb")) == NULL) {
- bu_log("Cannot open /dev/tty for reading\n");
+ bu_log("cell-fb: Cannot open /dev/tty for reading\n");
return 0;
}
bu_log("Another view follows. Display ? [y/n](y) ");
@@ -448,7 +446,7 @@
buf = (unsigned char *) bu_malloc(sizeof(RGBpixel) * fb_width,
"line of frame buffer");
if (debug_flag & CFB_DBG_MEM)
- bu_log("buf = %p... %d pixels @ %d bytes/pixel\n",
+ bu_log("buf = %p... %d pixels @ %lu bytes/pixel\n",
(void *)buf, fb_width, sizeof(RGBpixel));
for (gp = grid; gp < ep; gp++) {
@@ -635,7 +633,7 @@
&lo_red, &lo_grn, &lo_blu,
&hi_red, &hi_grn, &hi_blu)
< 3) {
- bu_log("Invalid color-mapping: '%s'\n",
+ bu_log("cell-fb: Invalid color-mapping: '%s'\n",
bu_optarg);
return 0;
}
@@ -653,31 +651,31 @@
break;
case 'N':
if (sscanf(bu_optarg, "%d", &fb_height) < 1) {
- bu_log("Invalid frame-buffer height: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid frame-buffer height: '%s'\n",
bu_optarg);
return 0;
}
if (fb_height < -1) {
- bu_log("Frame-buffer height out of range: %d\n", fb_height);
+ bu_log("cell-fb: Frame-buffer height out of range: %d\n",
fb_height);
return 0;
}
break;
case 'W':
if (sscanf(bu_optarg, "%d", &fb_width) < 1) {
- bu_log("Invalid frame-buffer width: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid frame-buffer width: '%s'\n",
bu_optarg);
return 0;
}
if (fb_width < -1) {
- bu_log("Frame-buffer width out of range: %d\n", fb_width);
+ bu_log("cell-fb: Frame-buffer width out of range: %d\n",
fb_width);
return 0;
}
break;
case 'S':
if (sscanf(bu_optarg, "%d", &fb_height) < 1) {
- bu_log("Invalid frame-buffer dimension: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid frame-buffer dimension: '%s'\n",
bu_optarg);
return 0;
}
if (fb_height < -1) {
- bu_log("Frame-buffer dimensions out of range: %d\n",
+ bu_log("cell-fb: Frame-buffer dimensions out of range:
%d\n",
fb_height);
return 0;
}
@@ -685,7 +683,7 @@
break;
case 'X':
if (sscanf(bu_optarg, "%x", &debug_flag) < 1) {
- bu_log("Invalid debug flag: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid debug flag: '%s'\n", bu_optarg);
return 0;
}
break;
@@ -696,7 +694,7 @@
struct locrec *lrp;
if (sscanf(bu_optarg, "%lf %lf", &scan[0], &scan[1]) != 2) {
- bu_log("Invalid grid-plane location: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid grid-plane location: '%s'\n",
bu_optarg);
return 0;
}
/* double to fastf_t */
@@ -708,24 +706,24 @@
break;
case 'b':
if (sscanf(bu_optarg, "%lf", &bool_val) != 1) {
- bu_log("Invalid boolean value: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid boolean value: '%s'\n", bu_optarg);
return 0;
}
boolean_flag = 1;
break;
case 'c':
if (sscanf(bu_optarg, "%lf", &cell_size) != 1) {
- bu_log("Invalid cell size: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid cell size: '%s'\n", bu_optarg);
return 0;
}
if (cell_size <= 0) {
- bu_log("Cell size out of range: %lf\n", cell_size);
+ bu_log("cell-fb: Cell size out of range: %lf\n", cell_size);
return 0;
}
break;
case 'd':
if (sscanf(bu_optarg, "%lf %lf", &dom_min, &dom_max) < 2) {
- bu_log("Invalid domain for input: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid domain for input: '%s'\n",
bu_optarg);
return 0;
}
if (dom_min >= dom_max) {
@@ -740,7 +738,7 @@
break;
case 'f':
if (sscanf(bu_optarg, "%d", &field) != 1) {
- bu_log("Invalid field: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid field: '%s'\n", bu_optarg);
return 0;
}
break;
@@ -759,7 +757,7 @@
break;
case 'l':
if (sscanf(bu_optarg, "%lf%lf", &az, &el) != 2) {
- bu_log("Invalid view: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid view: '%s'\n", bu_optarg);
return 0;
}
log_flag = 1;
@@ -774,8 +772,7 @@
if (sscanf(bu_optarg, "%lf %d %d %d", &value, &red, &grn, &blu)
< 4) {
- bu_log("Invalid color-mapping: '%s'\n",
- bu_optarg);
+ bu_log("cell-fb: Invalid color-mapping: '%s'\n", bu_optarg);
return 0;
}
value *= 10.0;
@@ -795,7 +792,7 @@
case 2: break;
case 1: yorigin = xorigin; break;
default:
- bu_log("Invalid offset: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid offset: '%s'\n", bu_optarg);
return 0;
}
break;
@@ -804,13 +801,13 @@
case 2: break;
case 1: hgt = wid; break;
default:
- bu_log("Invalid cell scale: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid cell scale: '%s'\n",
bu_optarg);
return 0;
}
break;
case 'v':
if (sscanf(bu_optarg, "%d", &view_flag) < 1) {
- bu_log("Invalid view number: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid view number: '%s'\n", bu_optarg);
return 0;
}
if (view_flag == 0)
@@ -818,7 +815,7 @@
break;
case 'x':
if (sscanf(bu_optarg, "%x", (unsigned int *)&bu_debug) < 1) {
- bu_log("Invalid debug flag: '%s'\n", bu_optarg);
+ bu_log("cell-fb: Invalid debug flag: '%s'\n", bu_optarg);
return 0;
}
break;
@@ -948,7 +945,7 @@
}
grid = (Cell *) bu_malloc(sizeof(Cell) * maxcells, "grid");
if (debug_flag & CFB_DBG_MEM)
- bu_log("grid = %p... %ld cells @ %d bytes/cell\n",
+ bu_log("grid = %p... %ld cells @ %lu bytes/cell\n",
(void *)grid, maxcells, sizeof(Cell));
do {
struct locrec *lrp;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits