Revision: 65579
http://sourceforge.net/p/brlcad/code/65579
Author: starseeker
Date: 2015-07-11 22:26:32 +0000 (Sat, 11 Jul 2015)
Log Message:
-----------
Replace a bunch of Tcl string/list manipulations with a sscanf
Modified Paths:
--------------
brlcad/trunk/src/librt/primitives/pipe/pipe.c
Modified: brlcad/trunk/src/librt/primitives/pipe/pipe.c
===================================================================
--- brlcad/trunk/src/librt/primitives/pipe/pipe.c 2015-07-11 21:58:38 UTC
(rev 65578)
+++ brlcad/trunk/src/librt/primitives/pipe/pipe.c 2015-07-11 22:26:32 UTC
(rev 65579)
@@ -4475,12 +4475,10 @@
{
struct rt_pipe_internal *pip;
struct wdb_pipept *ptp;
- Tcl_Obj *obj, *list;
int seg_no;
int num_segs;
int curr_seg;
fastf_t tmp;
- char *v_str;
RT_CK_DB_INTERNAL(intern);
@@ -4541,34 +4539,10 @@
switch (argv[0][0]) {
case 'V':
- obj = Tcl_NewStringObj(argv[1], -1);
- list = Tcl_NewListObj(0, NULL);
- Tcl_ListObjAppendList(brlcad_interp, list, obj);
- v_str = Tcl_GetStringFromObj(list, NULL);
- while (isspace((int)*v_str)) {
- v_str++;
- }
- if (*v_str == '\0') {
+ if (sscanf(argv[1], " %lf %lf %lf ", &(ptp->pp_coord[0]),
&(ptp->pp_coord[1]), &(ptp->pp_coord[2])) != 3) {
bu_vls_printf(logstr, "incomplete vertex specification");
- Tcl_DecrRefCount(list);
return BRLCAD_ERROR;
}
- ptp->pp_coord[0] = atof(v_str);
- v_str = bu_next_token(v_str);
- if (*v_str == '\0') {
- bu_vls_printf(logstr, "incomplete vertex specification");
- Tcl_DecrRefCount(list);
- return BRLCAD_ERROR;
- }
- ptp->pp_coord[1] = atof(v_str);
- v_str = bu_next_token(v_str);
- if (*v_str == '\0') {
- bu_vls_printf(logstr, "incomplete vertex specification");
- Tcl_DecrRefCount(list);
- return BRLCAD_ERROR;
- }
- ptp->pp_coord[2] = atof(v_str);
- Tcl_DecrRefCount(list);
break;
case 'I':
ptp->pp_id = atof(argv[1]);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits