From: Markus Scherer Date: Mon, 7 Mar 2016 20:26:37 +0000 (+0000) Subject: ICU-12141 checking layout, layoutex, tools & tests now too; added some includes;... X-Git-Tag: milestone-59-0-1~546 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7db1c41417769b9297e5a2c6759777986efe92c9;p=icu ICU-12141 checking layout, layoutex, tools & tests now too; added some includes; renamed one of the two struct LookupTable in the layout engine X-SVN-Rev: 38500 --- diff --git a/icu4c/source/layout/ContextualGlyphSubstProc2.cpp b/icu4c/source/layout/ContextualGlyphSubstProc2.cpp index ba7bd36f916..5aea8ec97d7 100644 --- a/icu4c/source/layout/ContextualGlyphSubstProc2.cpp +++ b/icu4c/source/layout/ContextualGlyphSubstProc2.cpp @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. and others 1998-2016 - All Rights Reserved * */ @@ -77,7 +77,7 @@ TTGlyphID ContextualGlyphSubstitutionProcessor2::lookup(le_uint32 offset, LEGlyp { TTGlyphID newGlyph = 0xFFFF; if(LE_FAILURE(success)) return newGlyph; - LEReferenceTo lookupTable(perGlyphTable, success, offset); + LEReferenceTo lookupTable(perGlyphTable, success, offset); if(LE_FAILURE(success)) return newGlyph; le_int16 format = SWAPW(lookupTable->format); diff --git a/icu4c/source/layout/ContextualGlyphSubstitution.h b/icu4c/source/layout/ContextualGlyphSubstitution.h index 4ecc8ade8a9..be3a00af667 100644 --- a/icu4c/source/layout/ContextualGlyphSubstitution.h +++ b/icu4c/source/layout/ContextualGlyphSubstitution.h @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. and others 1998-2016 - All Rights Reserved * */ @@ -14,8 +14,9 @@ #include "LETypes.h" #include "LayoutTables.h" -#include "StateTables.h" +#include "MorphStateTables.h" #include "MorphTables.h" +#include "StateTables.h" U_NAMESPACE_BEGIN diff --git a/icu4c/source/layout/KhmerLayoutEngine.h b/icu4c/source/layout/KhmerLayoutEngine.h index 28023a81d56..3626b70bd7c 100644 --- a/icu4c/source/layout/KhmerLayoutEngine.h +++ b/icu4c/source/layout/KhmerLayoutEngine.h @@ -1,7 +1,6 @@ - /* * - * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2016 - All Rights Reserved * * This file is a modification of the ICU file IndicLayoutEngine.h * by Jens Herden and Javier Sola for Khmer language @@ -11,20 +10,20 @@ #ifndef __KHMERLAYOUTENGINE_H #define __KHMERLAYOUTENGINE_H -// #include "LETypes.h" -// #include "LEFontInstance.h" -// #include "LEGlyphFilter.h" -// #include "LayoutEngine.h" -// #include "OpenTypeLayoutEngine.h" +#include "LETypes.h" +#include "LEFontInstance.h" +#include "LEGlyphFilter.h" +#include "LayoutEngine.h" +#include "OpenTypeLayoutEngine.h" -// #include "GlyphSubstitutionTables.h" -// #include "GlyphDefinitionTables.h" -// #include "GlyphPositioningTables.h" +#include "GlyphSubstitutionTables.h" +#include "GlyphDefinitionTables.h" +#include "GlyphPositioningTables.h" U_NAMESPACE_BEGIN -// class MPreFixups; -// class LEGlyphStorage; +class MPreFixups; +class LEGlyphStorage; /** * This class implements OpenType layout for Khmer OpenType fonts, as @@ -128,4 +127,3 @@ protected: U_NAMESPACE_END #endif - diff --git a/icu4c/source/layout/LookupProcessor.h b/icu4c/source/layout/LookupProcessor.h index 11bc9c36e55..a9c5ab480df 100644 --- a/icu4c/source/layout/LookupProcessor.h +++ b/icu4c/source/layout/LookupProcessor.h @@ -1,7 +1,7 @@ /* * %W% %E% * - * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2016 - All Rights Reserved * */ @@ -17,8 +17,7 @@ #include "LEFontInstance.h" #include "OpenTypeTables.h" #include "LETableReference.h" -//#include "Lookups.h" -//#include "Features.h" +#include "Lookups.h" U_NAMESPACE_BEGIN @@ -30,7 +29,6 @@ struct FeatureTable; struct FeatureListTable; struct GlyphDefinitionTableHeader; struct LookupSubtable; -struct LookupTable; class LookupProcessor : public UMemory { public: diff --git a/icu4c/source/layout/LookupTables.h b/icu4c/source/layout/LookupTables.h index 4d810756b37..2054740c9ff 100644 --- a/icu4c/source/layout/LookupTables.h +++ b/icu4c/source/layout/LookupTables.h @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2016 - All Rights Reserved * */ @@ -15,6 +15,7 @@ #include "LETypes.h" #include "LayoutTables.h" #include "LETableReference.h" +#include "Lookups.h" U_NAMESPACE_BEGIN @@ -29,7 +30,8 @@ enum LookupTableFormat typedef le_int16 LookupValue; -struct LookupTable +// Different from struct LookupTable in Lookups.h. +struct LookupTableBase { le_int16 format; }; @@ -47,7 +49,7 @@ struct LookupSingle LookupValue value; }; -struct BinarySearchLookupTable : LookupTable +struct BinarySearchLookupTable : LookupTableBase { le_int16 unitSize; le_int16 nUnits; @@ -60,7 +62,7 @@ struct BinarySearchLookupTable : LookupTable const LookupSingle *lookupSingle(const LETableReference &base, const LookupSingle *entries, LEGlyphID glyph, LEErrorCode &success) const; }; -struct SimpleArrayLookupTable : LookupTable +struct SimpleArrayLookupTable : LookupTableBase { LookupValue valueArray[ANY_NUMBER]; }; @@ -84,7 +86,7 @@ struct SingleTableLookupTable : BinarySearchLookupTable }; LE_VAR_ARRAY(SingleTableLookupTable, entries) -struct TrimmedArrayLookupTable : LookupTable +struct TrimmedArrayLookupTable : LookupTableBase { TTGlyphID firstGlyph; TTGlyphID glyphCount; diff --git a/icu4c/source/layout/NonContextualGlyphSubst.h b/icu4c/source/layout/NonContextualGlyphSubst.h index 2a8285079b3..82ba57040b8 100644 --- a/icu4c/source/layout/NonContextualGlyphSubst.h +++ b/icu4c/source/layout/NonContextualGlyphSubst.h @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. and others 1998-2016 - All Rights Reserved * */ @@ -20,14 +20,13 @@ U_NAMESPACE_BEGIN struct NonContextualGlyphSubstitutionHeader : MorphSubtableHeader { - LookupTable table; + LookupTableBase table; }; struct NonContextualGlyphSubstitutionHeader2 : MorphSubtableHeader2 { - LookupTable table; + LookupTableBase table; }; U_NAMESPACE_END #endif - diff --git a/icu4c/source/layout/StateTableProcessor2.cpp b/icu4c/source/layout/StateTableProcessor2.cpp index 88621f374f4..df94aedbc57 100644 --- a/icu4c/source/layout/StateTableProcessor2.cpp +++ b/icu4c/source/layout/StateTableProcessor2.cpp @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. and others 1998-2014 - All Rights Reserved + * (C) Copyright IBM Corp. and others 1998-2016 - All Rights Reserved * */ @@ -41,7 +41,7 @@ StateTableProcessor2::StateTableProcessor2(const LEReferenceTostateArrayOffset); entryTableOffset = SWAPL(stHeader->entryTableOffset); - classTable = LEReferenceTo(stHeader, success, classTableOffset); + classTable = LEReferenceTo(stHeader, success, classTableOffset); format = SWAPW(classTable->format); stateArray = LEReferenceToArrayOf(stHeader, success, stateArrayOffset, LE_UNBOUNDED_ARRAY); diff --git a/icu4c/source/layout/StateTableProcessor2.h b/icu4c/source/layout/StateTableProcessor2.h index 4f967455509..13e5445ef95 100644 --- a/icu4c/source/layout/StateTableProcessor2.h +++ b/icu4c/source/layout/StateTableProcessor2.h @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. and others 1998-2016 - All Rights Reserved * */ @@ -46,7 +46,7 @@ protected: le_uint32 stateArrayOffset; le_uint32 entryTableOffset; - LEReferenceTo classTable; + LEReferenceTo classTable; LEReferenceToArrayOf stateArray; LEReferenceTo stateTableHeader; LEReferenceTo stHeader; // for convenience diff --git a/icu4c/source/layout/StateTables.h b/icu4c/source/layout/StateTables.h index 5f00a5b7163..8635d1dcdee 100644 --- a/icu4c/source/layout/StateTables.h +++ b/icu4c/source/layout/StateTables.h @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. and others 1998-2016 - All Rights Reserved * */ @@ -14,6 +14,7 @@ #include "LETypes.h" #include "LayoutTables.h" +#include "LETableReference.h" U_NAMESPACE_BEGIN diff --git a/icu4c/source/layout/TibetanLayoutEngine.h b/icu4c/source/layout/TibetanLayoutEngine.h index cf7d1fa728a..3ca9918fc68 100644 --- a/icu4c/source/layout/TibetanLayoutEngine.h +++ b/icu4c/source/layout/TibetanLayoutEngine.h @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2016 - All Rights Reserved * * Developed at DIT - Government of Bhutan * @@ -16,20 +16,20 @@ #ifndef __TIBETANLAYOUTENGINE_H #define __TIBETANLAYOUTENGINE_H -// #include "LETypes.h" -// #include "LEFontInstance.h" -// #include "LEGlyphFilter.h" -// #include "LayoutEngine.h" -// #include "OpenTypeLayoutEngine.h" +#include "LETypes.h" +#include "LEFontInstance.h" +#include "LEGlyphFilter.h" +#include "LayoutEngine.h" +#include "OpenTypeLayoutEngine.h" -// #include "GlyphSubstitutionTables.h" -// #include "GlyphDefinitionTables.h" -// #include "GlyphPositioningTables.h" +#include "GlyphSubstitutionTables.h" +#include "GlyphDefinitionTables.h" +#include "GlyphPositioningTables.h" U_NAMESPACE_BEGIN -// class MPreFixups; -// class LEGlyphStorage; +class MPreFixups; +class LEGlyphStorage; /** * This class implements OpenType layout for Dzongkha and Tibetan OpenType fonts @@ -128,4 +128,3 @@ protected: U_NAMESPACE_END #endif - diff --git a/icu4c/source/layout/TibetanReordering.h b/icu4c/source/layout/TibetanReordering.h index 246db5947b2..6e68b8fa865 100644 --- a/icu4c/source/layout/TibetanReordering.h +++ b/icu4c/source/layout/TibetanReordering.h @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2016 - All Rights Reserved * * Developed at DIT - Government of Bhutan * @@ -21,8 +21,8 @@ * \internal */ -// #include "LETypes.h" -// #include "OpenTypeTables.h" +#include "LETypes.h" +#include "OpenTypeTables.h" U_NAMESPACE_BEGIN diff --git a/icu4c/source/test/hdrtst/testinternalheaders.sh b/icu4c/source/test/hdrtst/testinternalheaders.sh index d267edcd11d..db24056d8af 100755 --- a/icu4c/source/test/hdrtst/testinternalheaders.sh +++ b/icu4c/source/test/hdrtst/testinternalheaders.sh @@ -2,9 +2,13 @@ # and others. All rights reserved. # # Run this script from $ICU_ROOT/src/source/ +# ~/svn.icu/trunk/src/source$ test/hdrtst/testinternalheaders.sh +CC=clang CXX=clang++ +# Runtime libraries + for file in `ls common/*.h`; do echo $file echo '#include "'$file'"' > ht_temp.cpp ; @@ -26,4 +30,80 @@ for file in `ls io/*.h`; do $CXX -c -I common -I i18n -I io -O0 ht_temp.cpp ; done ; +# layout is deprecated, but layoutex is not. + +for file in `ls layout/*.h`; do + echo $file + echo '#include "'$file'"' > ht_temp.cpp ; + echo 'void noop() {}' >> ht_temp.cpp ; + $CXX -c -I common -I i18n -I io -O0 ht_temp.cpp ; +done ; + +# -I . for includes of layout/*.h +for file in `ls layoutex/*.h`; do + echo $file + echo '#include "'$file'"' > ht_temp.cpp ; + echo 'void noop() {}' >> ht_temp.cpp ; + $CXX -c -I common -I i18n -I io -I layout -I . -I layoutex -O0 ht_temp.cpp ; +done ; + +# Tools + +for file in `ls tools/toolutil/*.h`; do + echo $file + echo '#include "'$file'"' > ht_temp.cpp ; + echo 'void noop() {}' >> ht_temp.cpp ; + $CXX -c -I common -I i18n -I io -I tools/toolutil -O0 ht_temp.cpp ; +done ; + +# Exclude tzcode: tools/tzcode/private.h uses an argument "new" in a function declaration. +# Markus sent an email to the tz list on 20160307 requesting that it be renamed. +# We don't want to patch it, and don't want to spend the time for this script here +# to know about C-only header files. + +for tool in genccode gencmn gencolusb gennorm2 genren gentest icupkg icuswap pkgdata \ + genbrk gencfu gencnval gendict genrb gensprep icuinfo makeconv memcheck; do + for file in `ls tools/$tool/*.h`; do + echo $file + echo '#include "'$file'"' > ht_temp.cpp ; + echo 'void noop() {}' >> ht_temp.cpp ; + $CXX -c -I common -I i18n -I io -I tools/toolutil -I tools/$tool -O0 ht_temp.cpp ; + done ; +done ; + +# Tests + +for file in `ls tools/ctestfw/unicode/*.h`; do + echo $file + echo '#include "'$file'"' > ht_temp.cpp ; + echo 'void noop() {}' >> ht_temp.cpp ; + $CXX -c -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -O0 ht_temp.cpp ; +done ; + +# C not C++ for cintltst +for file in `ls tools/cintltst/*.h`; do + echo $file + echo '#include "'$file'"' > ht_temp.cpp ; + echo 'void noop() {}' >> ht_temp.cpp ; + $CC -c -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -I test/cintltst -O0 ht_temp.cpp ; +done ; + +for test in intltest iotest testmap thaitest; do + for file in `ls test/$test/*.h`; do + echo $file + echo '#include "'$file'"' > ht_temp.cpp ; + echo 'void noop() {}' >> ht_temp.cpp ; + $CXX -c -I common -I i18n -I io -I tools/toolutil -I tools/ctestfw -I test/$test -O0 ht_temp.cpp ; + done ; +done ; + +for file in `ls test/letest/*.h`; do + echo $file + echo '#include "'$file'"' > ht_temp.cpp ; + echo 'void noop() {}' >> ht_temp.cpp ; + $CXX -c -I common -I i18n -I io -I layout -I . -I layoutex -I tools/toolutil -I tools/ctestfw -I test/letest -O0 ht_temp.cpp ; +done ; + +# TODO: perf/*/*.h + rm ht_temp.cpp ht_temp.o diff --git a/icu4c/source/test/intltest/rbbitst.h b/icu4c/source/test/intltest/rbbitst.h index a05bef377a2..48b4aa2199f 100644 --- a/icu4c/source/test/intltest/rbbitst.h +++ b/icu4c/source/test/intltest/rbbitst.h @@ -1,5 +1,5 @@ /************************************************************************* - * Copyright (c) 1999-2014, International Business Machines + * Copyright (c) 1999-2016, International Business Machines * Corporation and others. All Rights Reserved. ************************************************************************* * Date Name Description @@ -17,7 +17,7 @@ #include "intltest.h" #include "unicode/brkiter.h" - +#include "unicode/rbbi.h" class Enumeration; class BITestData; diff --git a/icu4c/source/tools/genrb/errmsg.h b/icu4c/source/tools/genrb/errmsg.h index 190a61ebe17..19dfee8d858 100644 --- a/icu4c/source/tools/genrb/errmsg.h +++ b/icu4c/source/tools/genrb/errmsg.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1998-2011, International Business Machines +* Copyright (C) 1998-2016, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -18,6 +18,8 @@ #ifndef ERROR_H #define ERROR_H 1 +#include "unicode/utypes.h" + U_CDECL_BEGIN extern const char *gCurrentFileName; diff --git a/icu4c/source/tools/genrb/prscmnts.h b/icu4c/source/tools/genrb/prscmnts.h index c4f27054567..35dd9e92d29 100644 --- a/icu4c/source/tools/genrb/prscmnts.h +++ b/icu4c/source/tools/genrb/prscmnts.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1998-2003, International Business Machines +* Copyright (C) 1998-2016, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -19,6 +19,8 @@ #ifndef PRSCMNTS_H #define PRSCMNTS_H 1 +#include "unicode/utypes.h" + #if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when no RegularExpressions are available */ enum UParseCommentsOption { diff --git a/icu4c/source/tools/genrb/rbutil.h b/icu4c/source/tools/genrb/rbutil.h index b059bfa00d4..3f055a848c8 100644 --- a/icu4c/source/tools/genrb/rbutil.h +++ b/icu4c/source/tools/genrb/rbutil.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1998-2005, International Business Machines +* Copyright (C) 1998-2016, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -18,11 +18,14 @@ #ifndef UTIL_H #define UTIL_H 1 +#include "unicode/utypes.h" + U_CDECL_BEGIN void get_dirname(char *dirname, const char *filename); void get_basename(char *basename, const char *filename); int32_t itostr(char * buffer, int32_t i, uint32_t radix, int32_t pad); + U_CDECL_END -#endif /* ! UTIL_H */ +#endif /* ! UTIL_H */ diff --git a/icu4c/source/tools/toolutil/pkg_icu.h b/icu4c/source/tools/toolutil/pkg_icu.h index 8451f8d550f..50f3f51c96d 100644 --- a/icu4c/source/tools/toolutil/pkg_icu.h +++ b/icu4c/source/tools/toolutil/pkg_icu.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (C) 2008-2012, International Business Machines + * Copyright (C) 2008-2016, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* */ @@ -8,6 +8,7 @@ #define __PKG_ICU_H__ #include "unicode/utypes.h" +#include "package.h" #define U_PKG_RESERVED_CHARS "\"%&'()*+,-./:;<=>?_" diff --git a/icu4c/source/tools/toolutil/pkg_imp.h b/icu4c/source/tools/toolutil/pkg_imp.h index 0b0c2b740f8..45ddc4c0912 100644 --- a/icu4c/source/tools/toolutil/pkg_imp.h +++ b/icu4c/source/tools/toolutil/pkg_imp.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2005, International Business Machines +* Copyright (C) 2005-2016, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -20,6 +20,7 @@ #define __PKG_IMP_H__ #include "unicode/utypes.h" +#include "unicode/udata.h" /* * Read an ICU data item with any platform type,