Kaydet (Commit) ea59fc48 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Resolve unnecessary typedef

Change-Id: Ide89f6082f877046eac0415f23a3e29c5f7f1e65
Reviewed-on: https://gerrit.libreoffice.org/58554
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst ed1e2967
...@@ -125,13 +125,13 @@ inline OctreeNode* ImpNodeCache::ImplGetFreeNode() ...@@ -125,13 +125,13 @@ inline OctreeNode* ImpNodeCache::ImplGetFreeNode()
if ( !pActNode ) if ( !pActNode )
{ {
pActNode = new NODE; pActNode = new OctreeNode;
pActNode->pNextInCache = nullptr; pActNode->pNextInCache = nullptr;
} }
pNode = pActNode; pNode = pActNode;
pActNode = pNode->pNextInCache; pActNode = pNode->pNextInCache;
memset( pNode, 0, sizeof( NODE ) ); memset( pNode, 0, sizeof( OctreeNode ) );
return pNode; return pNode;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define OCTREE_BITS 5 #define OCTREE_BITS 5
#define OCTREE_BITS_1 10 #define OCTREE_BITS_1 10
typedef struct OctreeNode struct OctreeNode
{ {
sal_uLong nCount; sal_uLong nCount;
sal_uLong nRed; sal_uLong nRed;
...@@ -37,7 +37,7 @@ typedef struct OctreeNode ...@@ -37,7 +37,7 @@ typedef struct OctreeNode
OctreeNode* pNextInCache; OctreeNode* pNextInCache;
sal_uInt16 nPalIndex; sal_uInt16 nPalIndex;
bool bLeaf; bool bLeaf;
} NODE; };
class ImpNodeCache; class ImpNodeCache;
class BitmapReadAccess; class BitmapReadAccess;
...@@ -45,19 +45,19 @@ class BitmapReadAccess; ...@@ -45,19 +45,19 @@ class BitmapReadAccess;
class VCL_PLUGIN_PUBLIC Octree class VCL_PLUGIN_PUBLIC Octree
{ {
private: private:
void CreatePalette( NODE* pNode ); void CreatePalette( OctreeNode* pNode );
void GetPalIndex( NODE* pNode ); void GetPalIndex( OctreeNode* pNode );
SAL_DLLPRIVATE void ImplDeleteOctree( NODE** ppNode ); SAL_DLLPRIVATE void ImplDeleteOctree( OctreeNode** ppNode );
SAL_DLLPRIVATE void ImplAdd( NODE** ppNode ); SAL_DLLPRIVATE void ImplAdd( OctreeNode** ppNode );
SAL_DLLPRIVATE void ImplReduce(); SAL_DLLPRIVATE void ImplReduce();
BitmapPalette aPal; BitmapPalette aPal;
sal_uLong nLeafCount; sal_uLong nLeafCount;
sal_uLong nLevel; sal_uLong nLevel;
NODE* pTree; OctreeNode* pTree;
NODE* pReduce[ OCTREE_BITS + 1 ]; OctreeNode* pReduce[ OCTREE_BITS + 1 ];
BitmapColor const * pColor; BitmapColor const * pColor;
std::unique_ptr<ImpNodeCache> pNodeCache; std::unique_ptr<ImpNodeCache> pNodeCache;
const BitmapReadAccess* pAcc; const BitmapReadAccess* pAcc;
......
...@@ -34,7 +34,7 @@ ImpNodeCache::ImpNodeCache( const sal_uLong nInitSize ) : ...@@ -34,7 +34,7 @@ ImpNodeCache::ImpNodeCache( const sal_uLong nInitSize ) :
for( sal_uLong i = 0; i < nSize; i++ ) for( sal_uLong i = 0; i < nSize; i++ )
{ {
OctreeNode* pNewNode = new NODE; OctreeNode* pNewNode = new OctreeNode;
pNewNode->pNextInCache = pActNode; pNewNode->pNextInCache = pActNode;
pActNode = pNewNode; pActNode = pNewNode;
...@@ -62,7 +62,7 @@ Octree::Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors) ...@@ -62,7 +62,7 @@ Octree::Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors)
{ {
sal_uLong nMax(nColors); sal_uLong nMax(nColors);
pNodeCache.reset( new ImpNodeCache( nColors ) ); pNodeCache.reset( new ImpNodeCache( nColors ) );
memset( pReduce, 0, ( OCTREE_BITS + 1 ) * sizeof( NODE* ) ); memset( pReduce, 0, ( OCTREE_BITS + 1 ) * sizeof( OctreeNode* ) );
if( !!*pAcc ) if( !!*pAcc )
{ {
...@@ -114,7 +114,7 @@ Octree::~Octree() ...@@ -114,7 +114,7 @@ Octree::~Octree()
pNodeCache.reset(); pNodeCache.reset();
} }
void Octree::ImplDeleteOctree( NODE** ppNode ) void Octree::ImplDeleteOctree( OctreeNode** ppNode )
{ {
for (OctreeNode* i : (*ppNode)->pChild) for (OctreeNode* i : (*ppNode)->pChild)
{ {
...@@ -126,7 +126,7 @@ void Octree::ImplDeleteOctree( NODE** ppNode ) ...@@ -126,7 +126,7 @@ void Octree::ImplDeleteOctree( NODE** ppNode )
*ppNode = nullptr; *ppNode = nullptr;
} }
void Octree::ImplAdd( NODE** ppNode ) void Octree::ImplAdd( OctreeNode** ppNode )
{ {
// possibly generate new nodes // possibly generate new nodes
if( !*ppNode ) if( !*ppNode )
...@@ -166,7 +166,7 @@ void Octree::ImplAdd( NODE** ppNode ) ...@@ -166,7 +166,7 @@ void Octree::ImplAdd( NODE** ppNode )
void Octree::ImplReduce() void Octree::ImplReduce()
{ {
sal_uLong i; sal_uLong i;
NODE* pNode; OctreeNode* pNode;
sal_uLong nRedSum = 0; sal_uLong nRedSum = 0;
sal_uLong nGreenSum = 0; sal_uLong nGreenSum = 0;
sal_uLong nBlueSum = 0; sal_uLong nBlueSum = 0;
...@@ -181,7 +181,7 @@ void Octree::ImplReduce() ...@@ -181,7 +181,7 @@ void Octree::ImplReduce()
{ {
if ( pNode->pChild[ i ] ) if ( pNode->pChild[ i ] )
{ {
NODE* pChild = pNode->pChild[ i ]; OctreeNode* pChild = pNode->pChild[ i ];
nRedSum += pChild->nRed; nRedSum += pChild->nRed;
nGreenSum += pChild->nGreen; nGreenSum += pChild->nGreen;
...@@ -201,7 +201,7 @@ void Octree::ImplReduce() ...@@ -201,7 +201,7 @@ void Octree::ImplReduce()
nLeafCount -= --nChildren; nLeafCount -= --nChildren;
} }
void Octree::CreatePalette( NODE* pNode ) void Octree::CreatePalette( OctreeNode* pNode )
{ {
if( pNode->bLeaf ) if( pNode->bLeaf )
{ {
...@@ -216,7 +216,7 @@ void Octree::CreatePalette( NODE* pNode ) ...@@ -216,7 +216,7 @@ void Octree::CreatePalette( NODE* pNode )
} }
void Octree::GetPalIndex( NODE* pNode ) void Octree::GetPalIndex( OctreeNode* pNode )
{ {
if ( pNode->bLeaf ) if ( pNode->bLeaf )
nPalIndex = pNode->nPalIndex; nPalIndex = pNode->nPalIndex;
......
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