(file) Return to dinstance.cpp CVS log (file) (dir) Up to [OMI] / omi / micxx

Diff for /omi/micxx/dinstance.cpp between version 1.2 and 1.3

version 1.2, 2015/04/20 18:10:13 version 1.3, 2015/04/20 18:19:53
Line 25 
Line 25 
 #include "dinstance.h" #include "dinstance.h"
 #include <cctype> #include <cctype>
 #include <base/instance.h> #include <base/instance.h>
 #include <base/strings.h>  #include <pal/strings.h>
 #include <base/naming.h> #include <base/naming.h>
 #include <base/schemadecl.h> #include <base/schemadecl.h>
 #include <base/helpers.h> #include <base/helpers.h>
   #include <pal/format.h>
  
 // ATTN: work on object size reduction of this module. // ATTN: work on object size reduction of this module.
  
Line 49 
Line 50 
  
     while (p != end)     while (p != end)
     {     {
         if ((*p)->code == code && Zcasecmp((*p)->name, name) == 0)          if ((*p)->code == code && Tcscasecmp((*p)->name, name) == 0)
             return (MI_Uint32)(p - start);             return (MI_Uint32)(p - start);
         p++;         p++;
     }     }
Line 65 
Line 66 
     if (h->u.refs != 1)     if (h->u.refs != 1)
     {     {
         MI_Instance* self = m_self;         MI_Instance* self = m_self;
   
   //
   // Suppressing a false-positive for 28931 - Unused assignment of variable 'r'
   //
   #ifdef _MSC_VER
   #pragma prefast(push)
   #pragma prefast (disable: 28931)
   #endif
   
         MI_Result r = MI_Instance_Clone(self, &m_self);         MI_Result r = MI_Instance_Clone(self, &m_self);
         DEBUG_ASSERT(r == MI_RESULT_OK);         DEBUG_ASSERT(r == MI_RESULT_OK);
         __MI_Instance_Unref(self);         __MI_Instance_Unref(self);
         MI_UNUSED(r);         MI_UNUSED(r);
   
   #ifdef _MSC_VER
   #pragma prefast(pop)
   #endif
     }     }
 } }
  
Line 158 
Line 172 
  
 String DInstance::GetNamespace() const String DInstance::GetNamespace() const
 { {
     const MI_Char* nameSpace;      const MI_Char* nameSpace = NULL;
   
   //
   // Suppressing a false-positive for 28931 - Unused assignment of variable 'r'
   //
   #ifdef _MSC_VER
   #pragma prefast(push)
   #pragma prefast (disable: 28931)
   #endif
   
     MI_Result r = MI_Instance_GetNameSpace(m_self, &nameSpace);     MI_Result r = MI_Instance_GetNameSpace(m_self, &nameSpace);
     DEBUG_ASSERT(r == MI_RESULT_OK);     DEBUG_ASSERT(r == MI_RESULT_OK);
     MI_UNUSED(r);     MI_UNUSED(r);
  
   #ifdef _MSC_VER
   #pragma prefast(pop)
   #endif
   
     return String(nameSpace);     return String(nameSpace);
 } }
  
Line 186 
Line 213 
  
     for (i = 0; i < count; i++)     for (i = 0; i < count; i++)
     {     {
         const MI_Char* tmpName;          const MI_Char* tmpName = NULL;
         MI_Result r;         MI_Result r;
         r = MI_Instance_GetElementAt(m_self, i, &tmpName, NULL, NULL, NULL);         r = MI_Instance_GetElementAt(m_self, i, &tmpName, NULL, NULL, NULL);
  
Line 210 
Line 237 
 bool DInstance::GetName(Uint32 index, String& name) const bool DInstance::GetName(Uint32 index, String& name) const
 { {
     MI_Result r;     MI_Result r;
     const MI_Char* tmpName;      const MI_Char* tmpName = NULL;
     r = MI_Instance_GetElementAt(m_self, index, &tmpName, NULL, NULL, NULL);     r = MI_Instance_GetElementAt(m_self, index, &tmpName, NULL, NULL, NULL);
     if (r != MI_RESULT_OK)     if (r != MI_RESULT_OK)
         return false;         return false;
Line 240 
Line 267 
     bool showNulls) const     bool showNulls) const
 { {
     MI_Result r = Instance_Print(m_self, os, level,     MI_Result r = Instance_Print(m_self, os, level,
         showNulls ? MI_TRUE : MI_FALSE);          showNulls ? MI_TRUE : MI_FALSE, MI_FALSE);
     DEBUG_ASSERT(r == MI_RESULT_OK);     DEBUG_ASSERT(r == MI_RESULT_OK);
     MI_UNUSED(r);     MI_UNUSED(r);
 } }
Line 252 
Line 279 
  
 DInstance::DInstance(MI_Instance* self, DInstance::CloneTag) DInstance::DInstance(MI_Instance* self, DInstance::CloneTag)
 { {
       //
       // Suppressing a false-positive for 28931 - Unused assignment of variable 'r'
       //
   #ifdef _MSC_VER
   #pragma prefast(push)
   #pragma prefast (disable: 28931)
   #endif
   
     MI_Result r = MI_Instance_Clone(self, &m_self);     MI_Result r = MI_Instance_Clone(self, &m_self);
     DEBUG_ASSERT(r == MI_RESULT_OK);     DEBUG_ASSERT(r == MI_RESULT_OK);
     MI_UNUSED(r);     MI_UNUSED(r);
   
   #ifdef _MSC_VER
   #pragma prefast(pop)
   #endif
 } }
  
 bool DInstance::AddValue( bool DInstance::AddValue(
Line 870 
Line 909 
 { {
     if (!sinst.m_instance)     if (!sinst.m_instance)
     {     {
         TRACE;  
         return false;         return false;
     }     }
  
Line 878 
Line 916 
  
     if (!cd)     if (!cd)
     {     {
         TRACE;  
         return false;         return false;
     }     }
  
Line 887 
Line 924 
  
     if (MI_Instance_GetElementCount(dinst.m_self, &count) != MI_RESULT_OK)     if (MI_Instance_GetElementCount(dinst.m_self, &count) != MI_RESULT_OK)
     {     {
         TRACE;  
         return false;         return false;
     }     }
  
     // For each property in the dynamic instance.     // For each property in the dynamic instance.
     for (Uint32 i = 0; i < count; i++)     for (Uint32 i = 0; i < count; i++)
     {     {
         const MI_Char* name;          const MI_Char* name = NULL;
         MI_Value value;         MI_Value value;
         MI_Type type;         MI_Type type;
         MI_Uint32 flags;         MI_Uint32 flags;
Line 903 
Line 939 
         if (MI_Instance_GetElementAt(         if (MI_Instance_GetElementAt(
             dinst.m_self, i, &name, &value, &type, &flags) != MI_RESULT_OK)             dinst.m_self, i, &name, &value, &type, &flags) != MI_RESULT_OK)
         {         {
             TRACE;  
             return false;             return false;
         }         }
  
Line 917 
Line 952 
                 if (ignoreUnknownProperties)                 if (ignoreUnknownProperties)
                     continue;                     continue;
  
                 TRACE;  
                 return false;                 return false;
             }             }
  
Line 1087 
Line 1121 
                     {                     {
                         if (!value.instance)                         if (!value.instance)
                         {                         {
                             TRACE;  
                             return false;                             return false;
                         }                         }
  
Line 1096 
Line 1129 
  
                         if (!tcd)                         if (!tcd)
                         {                         {
                             TRACE;  
                             return false;                             return false;
                         }                         }
  
Line 1107 
Line 1139 
                         if (!DynamicToStatic(tdinst, keysOnly,                         if (!DynamicToStatic(tdinst, keysOnly,
                             ignoreUnknownProperties, x))                             ignoreUnknownProperties, x))
                         {                         {
                             TRACE;  
                             return false;                             return false;
                         }                         }
  
Line 1209 
Line 1240 
                     {                     {
                         if (!value.instancea.data)                         if (!value.instancea.data)
                         {                         {
                             TRACE;  
                             return false;                             return false;
                         }                         }
  
Line 1218 
Line 1248 
  
                         if (!tcd)                         if (!tcd)
                         {                         {
                             TRACE;  
                             return false;                             return false;
                         }                         }
  
Line 1228 
Line 1257 
                         {                         {
                             if (!value.instancea.data[j])                             if (!value.instancea.data[j])
                             {                             {
                                 TRACE;  
                                 return false;                                 return false;
                             }                             }
  
Line 1238 
Line 1266 
                             if (!DynamicToStatic(tdinst, keysOnly,                             if (!DynamicToStatic(tdinst, keysOnly,
                                 ignoreUnknownProperties, x))                                 ignoreUnknownProperties, x))
                             {                             {
                                 TRACE;  
                                 return false;                                 return false;
                             }                             }
  
Line 1642 
Line 1669 
     // Reject if static instance has no internal instance.     // Reject if static instance has no internal instance.
     if (!sinst.m_instance)     if (!sinst.m_instance)
     {     {
         TRACE;  
         return false;         return false;
     }     }
  
Line 1650 
Line 1676 
     const MI_ClassDecl* cd = sinst.m_instance->classDecl;     const MI_ClassDecl* cd = sinst.m_instance->classDecl;
     if (!cd)     if (!cd)
     {     {
         TRACE;  
         return false;         return false;
     }     }
  


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

ViewCVS 0.9.2