Revision: 42415
http://brlcad.svn.sourceforge.net/brlcad/?rev=42415&view=rev
Author: brlcad
Date: 2011-01-18 19:55:26 +0000 (Tue, 18 Jan 2011)
Log Message:
-----------
private functions used across commands should be in the _ged_ namespace,
otherwise, they don't need to be declared in ged_private.h and can remain
HIDDEN _cmd_ prefixed. rename _attr_cmpstringp() to _ged_cmpattr() to reflect
that it specifically compares bu_attribute_value_pair objects.
Modified Paths:
--------------
brlcad/trunk/src/libged/attr.c
brlcad/trunk/src/libged/ged.c
brlcad/trunk/src/libged/ged_private.h
Modified: brlcad/trunk/src/libged/attr.c
===================================================================
--- brlcad/trunk/src/libged/attr.c 2011-01-18 18:03:35 UTC (rev 42414)
+++ brlcad/trunk/src/libged/attr.c 2011-01-18 19:55:26 UTC (rev 42415)
@@ -23,18 +23,24 @@
*
*/
+#include "common.h"
+
#include <string.h>
#include "ged.h"
-/* comparison function for the avs->name qsort below -- based on example in
libc: man qsort */
+
+/*
+ * avs attribute comparison function, e.g. for qsort
+ */
int
-_attr_cmpstringp(const void *p1, const void *p2)
+_ged_cmpattr(const void *p1, const void *p2)
{
return strcmp((char * const)((struct bu_attribute_value_pair *)p1)->name,
(char * const)((struct bu_attribute_value_pair *)p2)->name);
}
+
int
ged_attr(struct ged *gedp, int argc, const char *argv[])
{
@@ -81,7 +87,7 @@
}
/* sort attribute-value set array by attribute name */
- qsort(&avs.avp[0], avs.count, sizeof(struct bu_attribute_value_pair),
_attr_cmpstringp);
+ qsort(&avs.avp[0], avs.count, sizeof(struct bu_attribute_value_pair),
_ged_cmpattr);
if (BU_STR_EQUAL(argv[1], "get")) {
if (argc == 3) {
Modified: brlcad/trunk/src/libged/ged.c
===================================================================
--- brlcad/trunk/src/libged/ged.c 2011-01-18 18:03:35 UTC (rev 42414)
+++ brlcad/trunk/src/libged/ged.c 2011-01-18 19:55:26 UTC (rev 42415)
@@ -479,6 +479,7 @@
rt_db_free_internal(&intern);
}
+
/*
* Local Variables:
* mode: C
Modified: brlcad/trunk/src/libged/ged_private.h
===================================================================
--- brlcad/trunk/src/libged/ged_private.h 2011-01-18 18:03:35 UTC (rev
42414)
+++ brlcad/trunk/src/libged/ged_private.h 2011-01-18 19:55:26 UTC (rev
42415)
@@ -111,7 +111,7 @@
extern struct solid _FreeSolid;
/* defined in attr.c */
-BU_EXTERN (int _attr_cmpstringp,
+BU_EXTERN (int _ged_cmpattr,
(const void *p1,
const void *p2));
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits