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
This commit is contained in:
Markus Scherer 2016-03-07 20:26:37 +00:00
parent c2b7ab12bc
commit 7db1c41417
18 changed files with 146 additions and 59 deletions

View file

@ -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> lookupTable(perGlyphTable, success, offset);
LEReferenceTo<LookupTableBase> lookupTable(perGlyphTable, success, offset);
if(LE_FAILURE(success)) return newGlyph;
le_int16 format = SWAPW(lookupTable->format);

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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;

View file

@ -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

View file

@ -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 LEReferenceTo<MorphSubtableHead
stateArrayOffset = SWAPL(stHeader->stateArrayOffset);
entryTableOffset = SWAPL(stHeader->entryTableOffset);
classTable = LEReferenceTo<LookupTable>(stHeader, success, classTableOffset);
classTable = LEReferenceTo<LookupTableBase>(stHeader, success, classTableOffset);
format = SWAPW(classTable->format);
stateArray = LEReferenceToArrayOf<EntryTableIndex2>(stHeader, success, stateArrayOffset, LE_UNBOUNDED_ARRAY);

View file

@ -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<LookupTable> classTable;
LEReferenceTo<LookupTableBase> classTable;
LEReferenceToArrayOf<EntryTableIndex2> stateArray;
LEReferenceTo<MorphStateTableHeader2> stateTableHeader;
LEReferenceTo<StateTableHeader2> stHeader; // for convenience

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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 {

View file

@ -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 */
U_CDECL_END
#endif /* ! UTIL_H */

View file

@ -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 "\"%&'()*+,-./:;<=>?_"

View file

@ -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,