Kaydet (Commit) 73ecb924 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 42d494e7
......@@ -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) : \
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment