diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-04-08 21:56:59 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-04-11 14:32:29 +0200 |
commit | 662035ed6334711d053cb4a7b2d37ff95c1f6838 (patch) | |
tree | 656c001199db6014f473bc54e19742541100e331 /vcl | |
parent | b5d7b60fe3c0befb07ba739b0168bfc17851667f (diff) |
Don't get excited about "inline"
Change-Id: I4f067bd60706814b4d2cc6057a0342696021ad75
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 37 | ||||
-rw-r--r-- | vcl/source/fontsubset/ttcr.cxx | 25 |
2 files changed, 23 insertions, 39 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 69d3fefbcfd6..cee73c0e1bbd 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -131,21 +131,14 @@ static const sal_uInt32 T_otto = 0x4f54544f; /* 'OTTO' */ #define T_gsub 0x47535542 #define T_CFF 0x43464620 -/*- inline functions */ -#ifdef __GNUC__ -#define _inline static __inline__ -#else -#define _inline static -#endif - -_inline void *smalloc(size_t size) +static void *smalloc(size_t size) { void *res = malloc(size); assert(res != nullptr); return res; } -_inline void *scalloc(size_t n, size_t size) +static void *scalloc(size_t n, size_t size) { void *res = calloc(n, size); assert(res != nullptr); @@ -153,7 +146,7 @@ _inline void *scalloc(size_t n, size_t size) } /*- Data access macros for data stored in big-endian or little-endian format */ -_inline sal_Int16 GetInt16(const sal_uInt8 *ptr, size_t offset, int bigendian) +static sal_Int16 GetInt16(const sal_uInt8 *ptr, size_t offset, int bigendian) { sal_Int16 t; assert(ptr != nullptr); @@ -167,7 +160,7 @@ _inline sal_Int16 GetInt16(const sal_uInt8 *ptr, size_t offset, int bigendian) return t; } -_inline sal_uInt16 GetUInt16(const sal_uInt8 *ptr, size_t offset, int bigendian) +static sal_uInt16 GetUInt16(const sal_uInt8 *ptr, size_t offset, int bigendian) { sal_uInt16 t; assert(ptr != nullptr); @@ -181,7 +174,7 @@ _inline sal_uInt16 GetUInt16(const sal_uInt8 *ptr, size_t offset, int bigendian) return t; } -_inline sal_Int32 GetInt32(const sal_uInt8 *ptr, size_t offset, int bigendian) +static sal_Int32 GetInt32(const sal_uInt8 *ptr, size_t offset, int bigendian) { sal_Int32 t; assert(ptr != nullptr); @@ -197,7 +190,7 @@ _inline sal_Int32 GetInt32(const sal_uInt8 *ptr, size_t offset, int bigendian) return t; } -_inline sal_uInt32 GetUInt32(const sal_uInt8 *ptr, size_t offset, int bigendian) +static sal_uInt32 GetUInt32(const sal_uInt8 *ptr, size_t offset, int bigendian) { sal_uInt32 t; assert(ptr != nullptr); @@ -225,7 +218,7 @@ static sal_uInt32 Int32FromMOTA(sal_uInt32 a) { } #endif -_inline F16Dot16 fixedMul(F16Dot16 a, F16Dot16 b) +static F16Dot16 fixedMul(F16Dot16 a, F16Dot16 b) { unsigned int a1, b1; unsigned int a2, b2; @@ -251,7 +244,7 @@ _inline F16Dot16 fixedMul(F16Dot16 a, F16Dot16 b) return sign ? -res : res; } -_inline F16Dot16 fixedDiv(F16Dot16 a, F16Dot16 b) +static F16Dot16 fixedDiv(F16Dot16 a, F16Dot16 b) { unsigned int f, r; F16Dot16 res; @@ -278,7 +271,7 @@ _inline F16Dot16 fixedDiv(F16Dot16 a, F16Dot16 b) /*- returns a * b / c -*/ /* XXX provide a real implementation that preserves accuracy */ -_inline F16Dot16 fixedMulDiv(F16Dot16 a, F16Dot16 b, F16Dot16 c) +static F16Dot16 fixedMulDiv(F16Dot16 a, F16Dot16 b, F16Dot16 c) { F16Dot16 res; @@ -287,17 +280,17 @@ _inline F16Dot16 fixedMulDiv(F16Dot16 a, F16Dot16 b, F16Dot16 c) } /*- Translate units from TT to PS (standard 1/1000) -*/ -_inline int XUnits(int unitsPerEm, int n) +static int XUnits(int unitsPerEm, int n) { return (n * 1000) / unitsPerEm; } -_inline const sal_uInt8* getTable( TrueTypeFont *ttf, sal_uInt32 ord) +static const sal_uInt8* getTable( TrueTypeFont *ttf, sal_uInt32 ord) { return ttf->tables[ord]; } -_inline sal_uInt32 getTableSize(TrueTypeFont *ttf, sal_uInt32 ord) +static sal_uInt32 getTableSize(TrueTypeFont *ttf, sal_uInt32 ord) { return ttf->tlens[ord]; } @@ -324,18 +317,18 @@ static bool HexFmtFlush(HexFmt *_this) return bRet; } -_inline void HexFmtOpenString(HexFmt *_this) +static void HexFmtOpenString(HexFmt *_this) { fputs("<\n", _this->o); } -_inline void HexFmtCloseString(HexFmt *_this) +static void HexFmtCloseString(HexFmt *_this) { HexFmtFlush(_this); fputs("00\n>\n", _this->o); } -_inline void HexFmtDispose(HexFmt *_this) +static void HexFmtDispose(HexFmt *_this) { HexFmtFlush(_this); free(_this); diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx index 49311603569d..0708b2e77268 100644 --- a/vcl/source/fontsubset/ttcr.cxx +++ b/vcl/source/fontsubset/ttcr.cxx @@ -64,17 +64,8 @@ typedef struct { sal_uInt8 *data; } TableEntry; -/* - * this is a duplicate code from sft.c but it is left here for performance reasons - */ -#ifdef __GNUC__ -#define _inline static __inline__ -#else -#define _inline static -#endif - /*- Data access macros for data stored in big-endian or little-endian format */ -_inline sal_Int16 GetInt16( const sal_uInt8* ptr, sal_uInt32 offset, int bigendian) +static sal_Int16 GetInt16( const sal_uInt8* ptr, sal_uInt32 offset, int bigendian) { sal_Int16 t; assert(ptr != nullptr); @@ -88,7 +79,7 @@ _inline sal_Int16 GetInt16( const sal_uInt8* ptr, sal_uInt32 offset, int bigendi return t; } -_inline sal_uInt16 GetUInt16( const sal_uInt8* ptr, sal_uInt32 offset, int bigendian) +static sal_uInt16 GetUInt16( const sal_uInt8* ptr, sal_uInt32 offset, int bigendian) { sal_uInt16 t; assert(ptr != nullptr); @@ -102,7 +93,7 @@ _inline sal_uInt16 GetUInt16( const sal_uInt8* ptr, sal_uInt32 offset, int bigen return t; } -_inline void PutInt16(sal_Int16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian) +static void PutInt16(sal_Int16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian) { assert(ptr != nullptr); @@ -115,7 +106,7 @@ _inline void PutInt16(sal_Int16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bige } } -_inline void PutUInt16(sal_uInt16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian) +static void PutUInt16(sal_uInt16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian) { assert(ptr != nullptr); @@ -128,7 +119,7 @@ _inline void PutUInt16(sal_uInt16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bi } } -_inline void PutUInt32(sal_uInt32 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian) +static void PutUInt32(sal_uInt32 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian) { assert(ptr != nullptr); @@ -180,14 +171,14 @@ static sal_uInt32 CheckSum(sal_uInt32 *ptr, sal_uInt32 length) return sum; } -_inline void *smalloc(sal_uInt32 size) +static void *smalloc(sal_uInt32 size) { void *res = malloc(size); assert(res != nullptr); return res; } -_inline void *scalloc(sal_uInt32 n, sal_uInt32 size) +static void *scalloc(sal_uInt32 n, sal_uInt32 size) { void *res = calloc(n, size); assert(res != nullptr); @@ -1522,7 +1513,7 @@ extern "C" } #ifdef TEST_TTCR -_inline sal_uInt32 mkTag(sal_uInt8 a, sal_uInt8 b, sal_uInt8 c, sal_uInt8 d) { +static sal_uInt32 mkTag(sal_uInt8 a, sal_uInt8 b, sal_uInt8 c, sal_uInt8 d) { return (a << 24) | (b << 16) | (c << 8) | d; } |