Revision: 76894
          http://sourceforge.net/p/brlcad/code/76894
Author:   starseeker
Date:     2020-08-22 22:23:10 +0000 (Sat, 22 Aug 2020)
Log Message:
-----------
Don't special case in fb_open, just add the built-in fb interfaces to the map.

Modified Paths:
--------------
    brlcad/trunk/src/libdm/dm_init.cpp
    brlcad/trunk/src/libdm/dm_plugins.cpp

Modified: brlcad/trunk/src/libdm/dm_init.cpp
===================================================================
--- brlcad/trunk/src/libdm/dm_init.cpp  2020-08-22 16:17:52 UTC (rev 76893)
+++ brlcad/trunk/src/libdm/dm_init.cpp  2020-08-22 22:23:10 UTC (rev 76894)
@@ -170,6 +170,17 @@
     }
 
     dm_backends = (void *)&dm_map;
+
+    // Populate the built-in if_* backends
+    std::string nullkey("/dev/null");
+    fb_map[nullkey] = &fb_null_interface;
+    std::string debugkey("/dev/debug");
+    fb_map[debugkey] = &debug_interface;
+    std::string memkey("/dev/mem");
+    fb_map[memkey] = &memory_interface;
+    std::string stackkey("/dev/stack");
+    fb_map[stackkey] = &stk_interface;
+
     fb_backends = (void *)&fb_map;
 }
 

Modified: brlcad/trunk/src/libdm/dm_plugins.cpp
===================================================================
--- brlcad/trunk/src/libdm/dm_plugins.cpp       2020-08-22 16:17:52 UTC (rev 
76893)
+++ brlcad/trunk/src/libdm/dm_plugins.cpp       2020-08-22 22:23:10 UTC (rev 
76894)
@@ -364,16 +364,6 @@
         }
     }
 
-    /* If we have a /dev/mem or a /dev/stack request, those interfaces are 
built in */
-    if (BU_STR_EQUAL(file, "/dev/mem")) {
-       *ifp->i = *memory_interface.i;        /* struct copy */
-       goto found_interface;
-    }
-    if (BU_STR_EQUAL(file, "/dev/stack")) {
-       *ifp->i = *stk_interface.i;        /* struct copy */
-       goto found_interface;
-    }
-
     /*
      * Determine what type of hardware the device name refers to.
      *

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to