Revision: 55314
          http://sourceforge.net/p/brlcad/code/55314
Author:   carlmoore
Date:     2013-05-07 16:26:46 +0000 (Tue, 07 May 2013)
Log Message:
-----------
implement 'progname' in output statements, and be concerned with cosmetic stuff 
(looking like umod.c as much as possible)

Modified Paths:
--------------
    brlcad/trunk/src/sig/smod.c

Modified: brlcad/trunk/src/sig/smod.c
===================================================================
--- brlcad/trunk/src/sig/smod.c 2013-05-07 16:18:09 UTC (rev 55313)
+++ brlcad/trunk/src/sig/smod.c 2013-05-07 16:26:46 UTC (rev 55314)
@@ -38,15 +38,15 @@
 #include "vmath.h"
 
 
+char *progname = "smod";
+
+
 #define ADD 1
 #define MULT 2
 #define ABS 3
 #define POW 4
 #define BUFLEN 65536
 
-
-char *progname = "(noname)";
-
 int numop = 0;         /* number of operations */
 int op[256];           /* operations */
 double val[256];               /* arguments to operations */
@@ -81,7 +81,7 @@
                op[ numop ] = MULT;
                d = atof(bu_optarg);
                if (ZERO(d)) {
-                   bu_exit(2, "smod: divide by zero!\n");
+                   bu_exit(2, "%s: divide by zero!\n",progname);
                }
                val[ numop++ ] = 1.0 / d;
                break;
@@ -97,7 +97,7 @@
                op[ numop ] = POW;
                d = atof(bu_optarg);
                if (ZERO(d)) {
-                   bu_exit(2, "smod: zero root!\n");
+                   bu_exit(2, "%s: zero root!\n",progname);
                }
                val[ numop++ ] = 1.0 / d;
                break;
@@ -117,8 +117,8 @@
        ifname = bu_realpath(file_name, NULL);
        if (freopen(ifname, "r", stdin) == NULL) {
            fprintf(stderr,
-                         "smod: cannot open \"%s(canonical %s)\" for 
reading\n",
-                         file_name,ifname);
+                         "%s: cannot open \"%s(canonical %s)\" for reading\n",
+                         progname,file_name,ifname);
            bu_free(ifname,"ifname alloc from bu_realpath");
            return 0;
        }
@@ -126,7 +126,7 @@
     }
 
     if (argc > ++bu_optind)
-       fprintf(stderr, "smod: excess argument(s) ignored\n");
+       fprintf(stderr, "%s: excess argument(s) ignored\n",progname);
 
     return 1;          /* OK */
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to