case nsIDataType::TYPE_ID:
case nsIDataType::VTYPE_ID:
static nsresult ToString(const nsDiscriminatedUnion& data,                          nsACString & outString){    char* ptr;    switch(data.mType)    {    // all the stuff we don't handle...    case nsIDataType::TYPE_ASTRING:    case nsIDataType::TYPE_CHAR_STR:    case nsIDataType::TYPE_WCHAR_STR:    case nsIDataType::TYPE_STRING_SIZE_IS:    case nsIDataType::TYPE_WSTRING_SIZE_IS:    case nsIDataType::TYPE_WCHAR:                NS_ERROR("ToString being called for a string type - screwy logic!");        // fall through...        // XXX We might want stringified versions of these... ???        case nsIDataType::TYPE_VOID:            case nsIDataType::TYPE_EMPTY:    case nsIDataType::TYPE_ARRAY:            case nsIDataType::TYPE_INTERFACE:            case nsIDataType::TYPE_INTERFACE_IS:            default:        return NS_ERROR_CANNOT_CONVERT_DATA;    // nsID has its own text formater.    case nsIDataType::TYPE_ID:                ptr = data.mIDValue.ToString();        if(!ptr)            return NS_ERROR_OUT_OF_MEMORY;        outString.Assign(ptr);        nsMemory::Free(ptr);        return NS_OK;    // the rest can be PR_smprintf'd and use common code.#define CASE__SMPRINTF_NUMBER(type_, format_, cast_, member_)                 \    case nsIDataType :: type_ :                                               \        ptr = PR_smprintf( format_ , (cast_) data . member_ );                \        break;    CASE__SMPRINTF_NUMBER(TYPE_INT8,   "%d",   int,      mInt8Value)    CASE__SMPRINTF_NUMBER(TYPE_INT16,  "%d",   int,      mInt16Value)    CASE__SMPRINTF_NUMBER(TYPE_INT32,  "%d",   int,      mInt32Value)    CASE__SMPRINTF_NUMBER(TYPE_INT64,  "%lld", PRInt64,  mInt64Value)     CASE__SMPRINTF_NUMBER(TYPE_UINT8,  "%u",   unsigned, mUint8Value)    CASE__SMPRINTF_NUMBER(TYPE_UINT16, "%u",   unsigned, mUint16Value)    CASE__SMPRINTF_NUMBER(TYPE_UINT32, "%u",   unsigned, mUint32Value)    CASE__SMPRINTF_NUMBER(TYPE_UINT64, "%llu", PRInt64,  mUint64Value)    CASE__SMPRINTF_NUMBER(TYPE_FLOAT,  "%f",   float,    mFloatValue)    CASE__SMPRINTF_NUMBER(TYPE_DOUBLE, "%f",   double,   mDoubleValue)    // XXX Would we rather print "true" / "false" ?    CASE__SMPRINTF_NUMBER(TYPE_BOOL,   "%d",   int,      mBoolValue)    CASE__SMPRINTF_NUMBER(TYPE_CHAR,   "%c",   char,     mCharValue)#undef CASE__SMPRINTF_NUMBER    }    if(!ptr)        return NS_ERROR_OUT_OF_MEMORY;    outString.Assign(ptr);    PR_smprintf_free(ptr);    return NS_OK;}