From 73ecb924379b8e665ee94235a353403c5d29eae6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 13 Apr 2014 16:39:43 +0300 Subject: Use --switch=2 --readonly-tables gperf options The --switch option saves about one megabyte of code (or data), and the --readonly-tables seems like a good idea in general. Change-Id: I19419e2cb9bb76dea4547512572b689883c41d8d --- oox/CustomTarget_generated.mk | 2 +- oox/source/token/tokenmap.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'oox') diff --git a/oox/CustomTarget_generated.mk b/oox/CustomTarget_generated.mk index efe08abdb7ac..1e7408ae2507 100644 --- a/oox/CustomTarget_generated.mk +++ b/oox/CustomTarget_generated.mk @@ -25,7 +25,7 @@ $(oox_MISC)/vmlexport-shape-types.cxx : \ $(oox_INC)/tokenhash.inc : $(oox_MISC)/tokenhash.gperf $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,GPF,1) - $(GPERF) --compare-strncmp $< | sed -e 's/(char\*)0/(char\*)0, 0/g' | grep -v '^#line' > $@ + $(GPERF) --compare-strncmp --switch=2 --readonly-tables $< | sed -e 's/(char\*)0/(char\*)0, 0/g' | grep -v '^#line' > $@ define oox_GenTarget $(oox_MISC)/$(2)ids.inc $(oox_INC)/$(2)names.inc $(if $(3),$(oox_MISC)/$(3)) $(if $(4),$(oox_INC)/$(4)names.inc) : \ diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx index 6c1d4b378394..3ee6b69e23ab 100644 --- a/oox/source/token/tokenmap.cxx +++ b/oox/source/token/tokenmap.cxx @@ -73,7 +73,7 @@ TokenMap::TokenMap() : { // check that the getIdentifier <-> getToken roundtrip works OString aUtf8Name = OUStringToOString( maTokenNames[ nToken ].maUniName, RTL_TEXTENCODING_UTF8 ); - struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() ); + const struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() ); bOk = pToken && (pToken->nToken == nToken); OSL_ENSURE( bOk, OStringBuffer( "TokenMap::TokenMap - token list broken, #" ). append( nToken ).append( ", '" ).append( aUtf8Name ).append( '\'' ).getStr() ); @@ -82,7 +82,7 @@ TokenMap::TokenMap() : for (unsigned char c = 'a'; c <= 'z'; c++) { - struct xmltoken* pToken = Perfect_Hash::in_word_set( + const struct xmltoken* pToken = Perfect_Hash::in_word_set( reinterpret_cast< const char* >( &c ), 1 ); mnAlphaTokens[ c - 'a' ] = pToken ? pToken->nToken : XML_TOKEN_INVALID; } @@ -102,7 +102,7 @@ OUString TokenMap::getUnicodeTokenName( sal_Int32 nToken ) const sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const { OString aUtf8Name = OUStringToOString( rUnicodeName, RTL_TEXTENCODING_UTF8 ); - struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() ); + const struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() ); return pToken ? pToken->nToken : XML_TOKEN_INVALID; } @@ -115,7 +115,7 @@ Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const sal_Int32 TokenMap::getTokenPerfectHash( const char *pStr, sal_Int32 nLength ) const { - struct xmltoken* pToken = Perfect_Hash::in_word_set( pStr, nLength ); + const struct xmltoken* pToken = Perfect_Hash::in_word_set( pStr, nLength ); return pToken ? pToken->nToken : XML_TOKEN_INVALID; } -- cgit