[Libreoffice-commits] .: codemaker/source registry/inc registry/source
codemaker/source/cppumaker/cpputype.cxx |3 +-- codemaker/source/javamaker/javatype.cxx |5 + registry/inc/registry/types.h |2 +- registry/source/reflread.cxx|9 + registry/source/reflwrit.cxx|3 ++- registry/source/regimpl.cxx |4 +--- 6 files changed, 11 insertions(+), 15 deletions(-) New commits: commit 66a88dc17e91d03a130b21a511ce298dd5a52e12 Author: Stephan Bergmann sberg...@redhat.com Date: Thu Mar 29 12:06:33 2012 +0200 UNO BYTE is signed This is hopefully a better fix for c589fa17b8f3e6ded0d1e04120781eb5d6735bc7 Dalvik enforces byte constants being in range (-128..127). diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 7c0326d..64dad4d 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -1262,8 +1262,7 @@ void CppuType::dumpConstantValue(FileStream o, sal_uInt16 index) o sal_False; break; case RT_TYPE_BYTE: -o (sal_Int8) - sal::static_int_cast sal_Int8 (constValue.m_value.aByte); +o (sal_Int8) constValue.m_value.aByte; break; case RT_TYPE_INT16: o (sal_Int16) constValue.m_value.aShort; diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index f297980..1453122 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -2447,10 +2447,7 @@ void addConstant( rtl::OString( RTL_CONSTASCII_STRINGPARAM(Bad type information))); //TODO } -if (fieldValue.m_value.aByte 0x80) -valueIndex = classFile-addIntegerInfo(fieldValue.m_value.aByte); -else -valueIndex = classFile-addIntegerInfo(-256 + (int) fieldValue.m_value.aByte); +valueIndex = classFile-addIntegerInfo(fieldValue.m_value.aByte); break; case codemaker::UnoType::SORT_SHORT: diff --git a/registry/inc/registry/types.h b/registry/inc/registry/types.h index cee37bb..77ae249 100644 --- a/registry/inc/registry/types.h +++ b/registry/inc/registry/types.h @@ -218,7 +218,7 @@ enum RTValueType { */ union RTConstValueUnion { sal_Bool aBool; -sal_uInt8 aByte; +sal_Int8 aByte; sal_Int16 aShort; sal_uInt16 aUShort; sal_Int32 aLong; diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index cac943f..e8ddab0 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -259,7 +259,7 @@ public: const sal_Char* readUTF8NameConstant(sal_uInt16 index); sal_BoolreadBOOLConstant(sal_uInt16 index); -sal_uInt8 readBYTEConstant(sal_uInt16 index); +sal_Int8readBYTEConstant(sal_uInt16 index); sal_Int16 readINT16Constant(sal_uInt16 index); sal_uInt16 readUINT16Constant(sal_uInt16 index); sal_Int32 readINT32Constant(sal_uInt16 index); @@ -367,15 +367,16 @@ sal_Bool ConstantPool::readBOOLConstant(sal_uInt16 index) return aBool; } -sal_uInt8 ConstantPool::readBYTEConstant(sal_uInt16 index) +sal_Int8 ConstantPool::readBYTEConstant(sal_uInt16 index) { -sal_uInt8 aByte = sal_False; +sal_Int8 aByte = 0; if (m_pIndex (index 0) (index = m_numOfEntries)) { if (readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_TAG) == CP_TAG_CONST_BYTE) { -aByte = readBYTE(m_pIndex[index - 1] + CP_OFFSET_ENTRY_DATA); +aByte = static_cast sal_Int8 ( +readBYTE(m_pIndex[index - 1] + CP_OFFSET_ENTRY_DATA)); } } diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 9fb415a..791a6e4 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -302,7 +302,8 @@ sal_uInt32 CPInfo::toBlop(sal_uInt8* buffer) buff += writeBYTE(buff, (sal_uInt8) m_value.aConst.aBool); break; case CP_TAG_CONST_BYTE: -buff += writeBYTE(buff, m_value.aConst.aByte); +buff += writeBYTE( +buff, static_cast sal_uInt8 (m_value.aConst.aByte)); break; case CP_TAG_CONST_INT16: buff += writeINT16(buff, m_value.aConst.aShort); diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index e82789b..401fb98 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -242,9 +242,7 @@ void dumpType(typereg::Reader const reader, rtl::OString const indent) { break; case RT_TYPE_BYTE: -printf( -byte 0x%02X, -static_cast unsigned int (value.m_value.aByte)); +printf(byte %d, static_cast int (value.m_value.aByte)); break; case RT_TYPE_INT16:
[Libreoffice-commits] .: codemaker/source
codemaker/source/cppumaker/cpputype.cxx | 45 ++-- 1 file changed, 20 insertions(+), 25 deletions(-) New commits: commit df68f63f0b24bae202b6526486d26a8402b16341 Author: Stephan Bergmann sberg...@redhat.com Date: Tue Jan 3 13:51:32 2012 +0100 Leak comprehensive type descriptions to avoid problems at exit. diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 977c8b3..dc238fc 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -715,10 +715,10 @@ void CppuType::dumpComprehensiveGetCppuType(FileStream o) OString sType = m_typeName.copy(m_typeName.lastIndexOf('/') + 1); OString sStaticTypeClass = the + sType + Type; -o indent() struct sStaticTypeClass : public rtl::StaticWithInit ::com::sun::star::uno::Type, sStaticTypeClass \n; +o indent() struct sStaticTypeClass : public rtl::StaticWithInit ::com::sun::star::uno::Type *, sStaticTypeClass \n; o indent() {\n; inc(); -o indent() ::com::sun::star::uno::Type operator()() const\n; +o indent() ::com::sun::star::uno::Type * operator()() const\n; o indent() {\n; inc(); @@ -807,9 +807,8 @@ void CppuType::dumpComprehensiveGetCppuType(FileStream o) o indent() typelib_typedescription_release( pTD );\n indent() // End inline typedescription generation\n\n; -o indent() ::com::sun::star::uno::Type the_staticType( - getTypeClass(m_typeName) , sTypeName );\n; -o indent() return the_staticType;\n; +o indent() return new ::com::sun::star::uno::Type( + getTypeClass(m_typeName) , sTypeName ); // leaked\n; dec(); o indent() }\n; @@ -824,7 +823,7 @@ void CppuType::dumpComprehensiveGetCppuType(FileStream o) o }\n\n; dumpGetCppuTypePreamble(o); -o indent() return detail:: sStaticTypeClass ::get();\n; +o indent() return *detail:: sStaticTypeClass ::get();\n; dumpGetCppuTypePostamble(o); } @@ -1633,10 +1632,10 @@ void InterfaceType::dumpComprehensiveGetCppuType(FileStream o) OString sType = m_typeName.copy(m_typeName.lastIndexOf('/') + 1); OString sStaticTypeClass = the + sType + Type; -o indent() struct sStaticTypeClass : public rtl::StaticWithInit ::com::sun::star::uno::Type, sStaticTypeClass \n; +o indent() struct sStaticTypeClass : public rtl::StaticWithInit ::com::sun::star::uno::Type *, sStaticTypeClass \n; o indent() {\n; inc(); -o indent() ::com::sun::star::uno::Type operator()() const\n; +o indent() ::com::sun::star::uno::Type * operator()() const\n; o indent() {\n; inc(); @@ -1710,10 +1709,8 @@ void InterfaceType::dumpComprehensiveGetCppuType(FileStream o) (typelib_typedescription_release( (typelib_TypeDescription*)pTD );\n\n); -o indent() ::com::sun::star::uno::Type the_staticType( - getTypeClass(m_typeName) , sTypeName );\n; - -o indent() return the_staticType;\n; +o indent() return new ::com::sun::star::uno::Type( + getTypeClass(m_typeName) , sTypeName ); // leaked\n; dec(); @@ -1728,7 +1725,7 @@ void InterfaceType::dumpComprehensiveGetCppuType(FileStream o) o }\n\n; dumpGetCppuTypePreamble(o); -o indent() const ::com::sun::star::uno::Type rRet = detail:: sStaticTypeClass ::get();\n; +o indent() const ::com::sun::star::uno::Type rRet = *detail:: sStaticTypeClass ::get();\n; o indent() // End inline typedescription generation\n; @@ -2915,7 +2912,7 @@ void StructureType::dumpComprehensiveGetCppuType(FileStream out) out indent(); if (isPolymorphic()) dumpTemplateHead(out); -out struct sStaticTypeClass : public rtl::StaticWithInit ::com::sun::star::uno::Type, ; +out struct sStaticTypeClass : public rtl::StaticWithInit ::com::sun::star::uno::Type *, ; out sStaticTypeClass; if (isPolymorphic()) dumpTemplateParameters(out); @@ -2923,7 +2920,7 @@ void StructureType::dumpComprehensiveGetCppuType(FileStream out) out indent() {\n; inc(); -out indent() ::com::sun::star::uno::Type operator()() const\n; +out indent() ::com::sun::star::uno::Type * operator()() const\n; out indent() {\n; inc(); @@ -3050,9 +3047,8 @@ void StructureType::dumpComprehensiveGetCppuType(FileStream out) out indent() ::typelib_typedescription_register(the_newType);\n; out indent() ::typelib_typedescription_release(the_newType);\n; -out indent() ::com::sun::star::uno::Type the_staticType( - getTypeClass(m_typeName) , the_name);\n; -out indent() return the_staticType;\n; +out indent() return new ::com::sun::star::uno::Type( + getTypeClass(m_typeName) , the_name); // leaked\n; dec(); out indent() }\n; dec(); @@ -3065,7 +3061,7 @@
[Libreoffice-commits] .: codemaker/source
codemaker/source/codemaker/global.cxx|8 ++--- codemaker/source/codemaker/unotype.cxx |2 - codemaker/source/cppumaker/cppumaker.cxx |2 - codemaker/source/cppumaker/cpputype.cxx | 46 +++ codemaker/source/cppumaker/includes.cxx |2 - codemaker/source/javamaker/classfile.cxx |8 ++--- codemaker/source/javamaker/javamaker.cxx |2 - 7 files changed, 35 insertions(+), 35 deletions(-) New commits: commit fd866ac8f184c0910883963c9c12b45a239a9227 Author: Olivier Hallot olivier.hal...@alta.org.br Date: Mon Dec 12 18:19:01 2011 -0200 Fix for fdo43460 Part VI getLength() to isEmpty() Part VI Module codemaker diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx index 36d06f0..af87ee8 100644 --- a/codemaker/source/codemaker/global.cxx +++ b/codemaker/source/codemaker/global.cxx @@ -116,7 +116,7 @@ OString createFileNameFromType( const OString destination, fileNameBuf.append(/, 1); OString tmpStr(type); -if (prefix.getLength() 0) +if (!prefix.isEmpty()) { tmpStr = type.replaceAt(type.lastIndexOf('/')+1, 0, prefix); } @@ -298,7 +298,7 @@ FileStream::FileStream() FileStream::FileStream(const OString name, FileAccessMode mode) : m_file(NULL) { -if ( name.getLength() 0 ) +if ( !name.isEmpty() ) { OUString sUrl(convertToFileUrl(name)); #ifdef SAL_UNX @@ -338,7 +338,7 @@ void FileStream::createTempFile(const OString sPath) OUString sTmpPath; OUString sTmpName; -if (sPath.getLength() 0) +if (!sPath.isEmpty()) sTmp = sPath; sTmpPath = convertToFileUrl(sTmp); @@ -364,7 +364,7 @@ void FileStream::createTempFile(const OString sPath) void FileStream::open(const OString name, FileAccessMode mode) { -if ( name.getLength() 0 ) +if ( !name.isEmpty() ) { oslFileError ret = osl_File_E_None; if ((ret = osl_openFile(convertToFileUrl(name).pData, m_file, checkAccessMode(mode))) == osl_File_E_None) diff --git a/codemaker/source/codemaker/unotype.cxx b/codemaker/source/codemaker/unotype.cxx index 0432a29..0ae8e43 100644 --- a/codemaker/source/codemaker/unotype.cxx +++ b/codemaker/source/codemaker/unotype.cxx @@ -56,7 +56,7 @@ codemaker::UnoType::Sort codemaker::UnoType::getSort(rtl::OString const type) } bool codemaker::UnoType::isSequenceType(rtl::OString const type) { -return type.getLength() 0 type[0] == '['; +return !type.isEmpty() type[0] == '['; } rtl::OString codemaker::UnoType::decompose( diff --git a/codemaker/source/cppumaker/cppumaker.cxx b/codemaker/source/cppumaker/cppumaker.cxx index e6cee20..0b9d8c0 100644 --- a/codemaker/source/cppumaker/cppumaker.cxx +++ b/codemaker/source/cppumaker/cppumaker.cxx @@ -202,7 +202,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) } else { tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/'); -if (tmpName.getLength() == 0) +if (tmpName.isEmpty()) tmpName = /; else tmpName.replace('.', '/'); diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index f2007e5..3a436ca 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -253,7 +253,7 @@ sal_Bool CppuType::dumpFile(CppuOptions* pOptions, } OString sFileName = createFileNameFromType(sOutPath, sName, sExtension); -if (sFileName.getLength() == 0) +if (sFileName.isEmpty()) return sal_False; sal_Bool bFileExists = fileExists( sFileName ); @@ -539,7 +539,7 @@ void CppuType::dumpNormalGetCppuType(FileStream o) m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8); } sal_Bool bIsBaseException = sal_False; -if (superType.getLength() 0) +if (!superType.isEmpty()) { if ( superType.equals(com/sun/star/uno/Exception) ) { @@ -599,7 +599,7 @@ void CppuType::dumpNormalGetCppuType(FileStream o) o indent() typelib_static_compound_type_init( the_type, getTypeClass(m_typeName, sal_True) , \ m_typeName.replace('/', '.') \, ; -if ( superType.getLength() 0 || bIsBaseException ) +if ( !superType.isEmpty() || bIsBaseException ) { if ( bIsBaseException ) { @@ -658,7 +658,7 @@ void CppuType::dumpComprehensiveGetCppuType(FileStream o) superType = rtl::OUStringToOString( m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8); } -if (superType.getLength() 0) { +if (!superType.isEmpty()) { o indent() const ::com::sun::star::uno::Type rSuperType = ::cppu::UnoType ; dumpType(o, superType, false, false, false, true); @@ -712,7 +712,7 @@ void