]> git.buserror.net Git - polintos/scott/priv.git/blobdiff - lib/c++/orb.cc
Initial struct marshalling.
[polintos/scott/priv.git] / lib / c++ / orb.cc
index a6158bf9ebcf0c23824e28e6adcf34f671b55e10..64df51756c86939a8106b11d8bad6137533bd617 100644 (file)
@@ -7,8 +7,7 @@ namespace RunTime {
 
        // This function could be made to do a binary search if we can
        // manage to somehow sort the IFaceTables...
-       uintptr_t downcast(::System::_i_Object *obj,
-                          const unsigned long *new_guid)
+       uintptr_t downcast(::System::_i_Object *obj, const GUID *new_guid)
        {
                if (!obj)
                        return 0;
@@ -19,7 +18,7 @@ namespace RunTime {
                        unsupported_long_size();
 
                IFaceTable *tbl = obj->info->concrete_IFaceTable;
-               unsigned long new_guid_first = *new_guid;
+               unsigned long new_guid_first = new_guid->l[0];
                
                // This doesn't use guids_equal(), as that would eliminate the
                // ability to cache the first word of new_guid.  The compiler
@@ -29,15 +28,15 @@ namespace RunTime {
                // behaves.
                
                while (true) {
-                       if (tbl->info->guid[0] == new_guid_first &&
-                           tbl->info->guid[1] == new_guid[1] &&
+                       if (tbl->info->guid->l[0] == new_guid_first &&
+                           tbl->info->guid->l[1] == new_guid->l[1] &&
                            (sizeof(long) == 8 ||
-                            (tbl->info->guid[2] == new_guid[2] &&
-                             tbl->info->guid[3] == new_guid[3])))
+                            (tbl->info->guid->l[2] == new_guid->l[2] &&
+                             tbl->info->guid->l[3] == new_guid->l[3])))
                                break;                          
 
                        tbl++;
-                       if (__builtin_expect(!tbl->info->guid, 0))
+                       if (__builtin_expect(!tbl->info->guid->l[0], 0))
                                return 0;
                }
        
@@ -49,6 +48,8 @@ namespace RunTime {
                return ptr;
        };
 
+//     ::System::Object create_wrapper(
+
        namespace Priv {
                typedef void (*MethodEntry)(ParamInfoBlock *pib);
 
@@ -58,14 +59,14 @@ namespace RunTime {
                };
 
                typedef ::Util::RadixTree<Object, ID, 6> ObjTable;
-               ObjTable objtable;
+//             ObjTable objtable;
 
                unsigned long get_pc()
                {
                        return reinterpret_cast<unsigned long>(__builtin_return_address(0));
                }
 
-               void exception_to_array(::System::VStruct *ex, Array<uint8_t> *ar)
+               void exception_to_array(::System::VStruct *ex, Array<uint8_t, ORBMM> *ar)
                {
                        // FIXME: marshall struct
                }
@@ -94,7 +95,7 @@ namespace RunTime {
 extern "C" void abort();
 
 extern "C" void handle_message(::System::RunTime::ParamInfoBlock *pib,
-                               ::System::RunTime::Array<uint8_t> *ex_arr)
+                               ::System::RunTime::Array<uint8_t, ::System::RunTime::ORBMM> *ex_arr)
 {
        try {
                ::System::RunTime::Priv::handle_message(pib);