Revision: 42473
http://brlcad.svn.sourceforge.net/brlcad/?rev=42473&view=rev
Author: brlcad
Date: 2011-01-20 01:09:05 +0000 (Thu, 20 Jan 2011)
Log Message:
-----------
there doesn't seem to be any clear reason why load_dynamic_shader() takes the
length of the shader name given it only prints the length for diagnostic
purposes. remove the mlen parameter.
Modified Paths:
--------------
brlcad/trunk/include/shadefuncs.h
brlcad/trunk/src/liboptical/material.c
brlcad/trunk/src/liboptical/sh_stack.c
Modified: brlcad/trunk/include/shadefuncs.h
===================================================================
--- brlcad/trunk/include/shadefuncs.h 2011-01-20 01:00:11 UTC (rev 42472)
+++ brlcad/trunk/include/shadefuncs.h 2011-01-20 01:09:05 UTC (rev 42473)
@@ -86,9 +86,13 @@
OPTICAL_EXPORT BU_EXTERN(void mlib_free,
(struct region *rp));
-OPTICAL_EXPORT BU_EXTERN(struct mfuncs *load_dynamic_shader,
- (const char *material,
- const int mlen));
+/**
+ * L O A D _ D Y N A M I C _ S H A D E R
+ *
+ * Given a shader/material name, try to find a DSO to supply the
+ * shader.
+ */
+OPTICAL_EXPORT BU_EXTERN(struct mfuncs *load_dynamic_shader, (const char
*material));
#endif
/** @} */
Modified: brlcad/trunk/src/liboptical/material.c
===================================================================
--- brlcad/trunk/src/liboptical/material.c 2011-01-20 01:00:11 UTC (rev
42472)
+++ brlcad/trunk/src/liboptical/material.c 2011-01-20 01:09:05 UTC (rev
42473)
@@ -125,14 +125,8 @@
}
-/**
- * L O A D _ D Y N A M I C _ S H A D E R
- *
- * Given a shader/material name, try to find a DSO to supply the
- * shader.
- */
struct mfuncs *
-load_dynamic_shader(const char *material, const int mlen)
+load_dynamic_shader(const char *material)
{
struct mfuncs *shader_mfuncs = (struct mfuncs *)NULL;
char libname[MAXPATHLEN];
@@ -141,17 +135,16 @@
int old_rdebug = R_DEBUG;
char sh_name[128]; /* XXX constants are bogus */
- if (mlen < sizeof(sh_name)) {
+ if (strlen(material) < sizeof(sh_name)) {
bu_strlcpy(sh_name, material, sizeof(sh_name));
} else {
bu_log("shader name too long \"%s\" %d > %d\n",
- material, mlen, sizeof(sh_name));
+ material, strlen(material), sizeof(sh_name));
return (struct mfuncs *)NULL;
}
- /* rdebug |= RDEBUG_MATERIAL; */
if (R_DEBUG&RDEBUG_MATERIAL)
- bu_log("load_dynamic_shader(\"%s\", %d)\n", sh_name, mlen);
+ bu_log("load_dynamic_shader(\"%s\")\n", sh_name);
cwd = getcwd((char *)NULL, (size_t)MAXPATHLEN);
@@ -262,7 +255,7 @@
bu_log("Shader \"%s\"... ", material);
- if ((mfp_new = load_dynamic_shader(material, mlen))) {
+ if ((mfp_new = load_dynamic_shader(material))) {
mlib_add_shader(headp, mfp_new);
bu_log("retrying\n");
goto retry;
Modified: brlcad/trunk/src/liboptical/sh_stack.c
===================================================================
--- brlcad/trunk/src/liboptical/sh_stack.c 2011-01-20 01:00:11 UTC (rev
42472)
+++ brlcad/trunk/src/liboptical/sh_stack.c 2011-01-20 01:09:05 UTC (rev
42473)
@@ -163,7 +163,7 @@
bu_log("Shader \"%s\"... ", matname);
- if ((mfp_new = load_dynamic_shader(matname, strlen(matname)))) {
+ if ((mfp_new = load_dynamic_shader(matname))) {
mlib_add_shader(headp, mfp_new);
goto retry;
}
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