Revision: 54164
http://brlcad.svn.sourceforge.net/brlcad/?rev=54164&view=rev
Author: brlcad
Date: 2013-01-11 19:59:25 +0000 (Fri, 11 Jan 2013)
Log Message:
-----------
deconditionalize the function declarations and validate all parameters. avoids
undocumented need for checking if w or h are less than zero, which is unclear
what that would even mean anyways.
Modified Paths:
--------------
brlcad/trunk/src/libfb/tcl.c
Modified: brlcad/trunk/src/libfb/tcl.c
===================================================================
--- brlcad/trunk/src/libfb/tcl.c 2013-01-11 19:37:22 UTC (rev 54163)
+++ brlcad/trunk/src/libfb/tcl.c 2013-01-11 19:59:25 UTC (rev 54164)
@@ -281,14 +281,10 @@
void
-#if !defined(IF_X) && !defined(IF_WGL) && !defined(IF_OGL) && !defined(IF_TK)
-fb_configureWindow(FBIO *ifp, int UNUSED(width), int UNUSED(height))
-#else
fb_configureWindow(FBIO *ifp, int width, int height)
-#endif
{
/* unknown/unset framebuffer */
- if (!ifp || !ifp->if_name) {
+ if (!ifp || !ifp->if_name || width < 0 || height < 0) {
return;
}
@@ -319,23 +315,24 @@
int
-#if !defined(IF_X) && !defined(IF_WGL) && !defined(IF_OGL) && !defined(IF_TK)
-fb_refresh(FBIO *ifp, int UNUSED(x), int UNUSED(y), int w, int h)
-#else
fb_refresh(FBIO *ifp, int x, int y, int w, int h)
-#endif
{
int status=0;
-#if 1
- if (w == 0 || h == 0)
- return TCL_OK;
-#else
- if (w <= 0 || h <= 0) {
+ /* what does negative mean? */
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+ if (w < 0)
+ w = 0;
+ if (h < 0)
+ h = 0;
+
+ if (w == 0 || h == 0) {
/* nothing to refresh */
return TCL_OK;
}
-#endif
if (!ifp || !ifp->if_name) {
/* unset/unknown framebuffer */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits