Revision: 56822
http://sourceforge.net/p/brlcad/code/56822
Author: brlcad
Date: 2013-08-14 03:00:46 +0000 (Wed, 14 Aug 2013)
Log Message:
-----------
ws indent style cleanup. simplify 'if (expression)' preferring readability
over brevity, make call and set to var before if ().
Modified Paths:
--------------
brlcad/trunk/src/util/bwrect.c
brlcad/trunk/src/util/pixrect.c
Modified: brlcad/trunk/src/util/bwrect.c
===================================================================
--- brlcad/trunk/src/util/bwrect.c 2013-08-14 02:37:21 UTC (rev 56821)
+++ brlcad/trunk/src/util/bwrect.c 2013-08-14 03:00:46 UTC (rev 56822)
@@ -52,39 +52,39 @@
while ((c = bu_getopt(argc, argv, "s:w:n:S:W:N:x:y:o:h?")) != -1) {
switch (c) {
case 's':
- inx = iny = atoi(bu_optarg);
- break;
+ inx = iny = atoi(bu_optarg);
+ break;
case 'W':
- outx = atoi(bu_optarg);
- break;
+ outx = atoi(bu_optarg);
+ break;
case 'w':
- inx = atoi(bu_optarg);
- break;
+ inx = atoi(bu_optarg);
+ break;
case 'N':
- outy = atoi(bu_optarg);
- break;
+ outy = atoi(bu_optarg);
+ break;
case 'n':
- iny = atoi(bu_optarg);
- break;
+ iny = atoi(bu_optarg);
+ break;
case 'S':
- outy = outx = atoi(bu_optarg);
- break;
+ outy = outx = atoi(bu_optarg);
+ break;
case 'x':
- xorig = atoi(bu_optarg);
- break;
+ xorig = atoi(bu_optarg);
+ break;
case 'y':
- yorig = atoi(bu_optarg);
- break;
+ yorig = atoi(bu_optarg);
+ break;
case 'o':
- out_file = bu_optarg;
- break;
+ out_file = bu_optarg;
+ break;
case 'h' :
default : /* '?' */
- return 0;
+ return 0;
}
}
if (bu_optind >= argc) {
- if (isatty(fileno(stdin))){
+ if (isatty(fileno(stdin))) {
return 0;
}
} else {
@@ -94,7 +94,7 @@
}
- if (!isatty(fileno(stdout)) && out_file!=NULL){
+ if (!isatty(fileno(stdout)) && out_file!=NULL) {
return 0;
}
@@ -105,16 +105,18 @@
return 1;
}
+
int
main(int argc, char **argv)
{
icv_image_t *img;
- if(!get_args(argc, argv)) {
+ if (!get_args(argc, argv)) {
bu_log("%s", usage);
return 1;
}
- if((img = icv_read(in_file, ICV_IMAGE_BW, inx, iny))==NULL)
+ img = icv_read(in_file, ICV_IMAGE_BW, inx, iny);
+ if (img == NULL)
return 1;
icv_rect(img, xorig, yorig, outx, outy);
icv_write(img, out_file , ICV_IMAGE_BW);
Modified: brlcad/trunk/src/util/pixrect.c
===================================================================
--- brlcad/trunk/src/util/pixrect.c 2013-08-14 02:37:21 UTC (rev 56821)
+++ brlcad/trunk/src/util/pixrect.c 2013-08-14 03:00:46 UTC (rev 56822)
@@ -52,42 +52,42 @@
while ((c = bu_getopt(argc, argv, "s:w:n:S:W:N:x:y:o:#:h?")) != -1) {
switch (c) {
case 's':
- inx = iny = atoi(bu_optarg);
- break;
+ inx = iny = atoi(bu_optarg);
+ break;
case 'W':
- outx = atoi(bu_optarg);
- break;
+ outx = atoi(bu_optarg);
+ break;
case 'w':
- inx = atoi(bu_optarg);
- break;
+ inx = atoi(bu_optarg);
+ break;
case 'N':
- outy = atoi(bu_optarg);
- break;
+ outy = atoi(bu_optarg);
+ break;
case 'n':
- iny = atoi(bu_optarg);
- break;
+ iny = atoi(bu_optarg);
+ break;
case 'S':
- outy = outx = atoi(bu_optarg);
- break;
+ outy = outx = atoi(bu_optarg);
+ break;
case 'x':
- xorig = atoi(bu_optarg);
- break;
+ xorig = atoi(bu_optarg);
+ break;
case 'y':
- yorig = atoi(bu_optarg);
- break;
+ yorig = atoi(bu_optarg);
+ break;
case 'o':
- out_file = bu_optarg;
- break;
+ out_file = bu_optarg;
+ break;
case '#' :
- bu_log("pixrect: bytes per pixel is not supported.\n");
- return 0;
+ bu_log("pixrect: bytes per pixel is not supported.\n");
+ return 0;
case 'h' :
default : /* '?' */
- return 0;
+ return 0;
}
}
if (bu_optind >= argc) {
- if (isatty(fileno(stdin))){
+ if (isatty(fileno(stdin))) {
return 0;
}
} else {
@@ -97,7 +97,7 @@
}
- if (!isatty(fileno(stdout)) && out_file!=NULL){
+ if (!isatty(fileno(stdout)) && out_file!=NULL) {
return 0;
}
@@ -108,21 +108,25 @@
return 1;
}
+
int
main(int argc, char **argv)
{
icv_image_t *img;
- if(!get_args(argc, argv)) {
+
+ if (!get_args(argc, argv)) {
bu_log("%s", usage);
return 1;
}
- if((img = icv_read(in_file, ICV_IMAGE_PIX, inx, iny))==NULL)
+ img = icv_read(in_file, ICV_IMAGE_PIX, inx, iny);
+ if (img == NULL)
return 1;
icv_rect(img, xorig, yorig, outx, outy);
icv_write(img, out_file , ICV_IMAGE_PIX);
icv_destroy(img);
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits