From 5189356d587f51280c9486980d9f5e774338540e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 Jun 2012 20:11:09 +0000 Subject: style cleanup --- intern/bsp/intern/BSP_CSGMesh_CFIterator.h | 4 +- intern/container/intern/CTR_List.cpp | 115 ++++++++++--------------- intern/ghost/intern/GHOST_DisplayManagerNULL.h | 2 +- intern/ghost/intern/GHOST_WindowNULL.h | 26 +++--- intern/ghost/test/multitest/EventToBuf.c | 2 +- intern/memutil/MEM_Allocator.h | 2 +- intern/memutil/MEM_RefCountPtr.h | 2 +- intern/memutil/MEM_SmartPtr.h | 2 +- intern/mikktspace/mikktspace.c | 44 +++++----- intern/raskter/raskter.c | 2 +- intern/utfconv/utfconv.c | 2 +- 11 files changed, 90 insertions(+), 113 deletions(-) (limited to 'intern') diff --git a/intern/bsp/intern/BSP_CSGMesh_CFIterator.h b/intern/bsp/intern/BSP_CSGMesh_CFIterator.h index cadd3df4360..928d04eda20 100644 --- a/intern/bsp/intern/BSP_CSGMesh_CFIterator.h +++ b/intern/bsp/intern/BSP_CSGMesh_CFIterator.h @@ -127,10 +127,10 @@ BSP_CSGMeshVertexIt_Construct( BSP_CSGMesh_VertexIt * v_it = new BSP_CSGMesh_VertexIt; v_it->mesh = mesh; - if( output->num_elements > 0 ) + if ( output->num_elements > 0 ) v_it->pos = &mesh->VertexSet()[0]; output->it = v_it; -}; +} /** diff --git a/intern/container/intern/CTR_List.cpp b/intern/container/intern/CTR_List.cpp index 2fc7b0261ef..c72d3ccf0d8 100644 --- a/intern/container/intern/CTR_List.cpp +++ b/intern/container/intern/CTR_List.cpp @@ -33,118 +33,95 @@ #include "CTR_List.h" -CTR_Link:: -CTR_Link( -) : +CTR_Link::CTR_Link() : m_next(0), m_prev(0) { } -CTR_Link:: -CTR_Link( - CTR_Link *next, - CTR_Link *prev -) : +CTR_Link::CTR_Link(CTR_Link *next, CTR_Link *prev) : m_next(next), m_prev(prev) { } - CTR_Link * -CTR_Link:: -getNext( -) const { +CTR_Link * +CTR_Link::getNext() const +{ return m_next; } - CTR_Link * -CTR_Link:: -getPrev( -) const { +CTR_Link * +CTR_Link::getPrev() const +{ return m_prev; } - bool -CTR_Link:: -isHead( -) const { +bool +CTR_Link::isHead() const +{ return m_prev == 0; } - bool -CTR_Link:: -isTail( -) const { +bool +CTR_Link::isTail() const +{ return m_next == 0; } - void -CTR_Link:: -insertBefore( - CTR_Link *link -) { - m_next = link; - m_prev = link->m_prev; - m_next->m_prev = this; - m_prev->m_next = this; +void +CTR_Link::insertBefore(CTR_Link *link) +{ + m_next = link; + m_prev = link->m_prev; + m_next->m_prev = this; + m_prev->m_next = this; } - void -CTR_Link:: -insertAfter( - CTR_Link *link -) { - m_next = link->m_next; - m_prev = link; - m_next->m_prev = this; - m_prev->m_next = this; +void +CTR_Link::insertAfter(CTR_Link *link) +{ + m_next = link->m_next; + m_prev = link; + m_next->m_prev = this; + m_prev->m_next = this; } - void -CTR_Link:: -remove( -) { - m_next->m_prev = m_prev; - m_prev->m_next = m_next; +void +CTR_Link::remove() +{ + m_next->m_prev = m_prev; + m_prev->m_next = m_next; } -CTR_List:: -CTR_List( -) : +CTR_List::CTR_List() : m_head(&m_tail, 0), m_tail(0, &m_head) { } - CTR_Link * -CTR_List:: -getHead( -) const { +CTR_Link * +CTR_List:: getHead() const +{ return m_head.getNext(); } - CTR_Link * -CTR_List:: -getTail( -) const { +CTR_Link * +CTR_List::getTail() const +{ return m_tail.getPrev(); } - void -CTR_List:: -addHead( - CTR_Link *link -) { +void +CTR_List::addHead(CTR_Link *link) +{ link->insertAfter(&m_head); } - void -CTR_List:: -addTail( - CTR_Link *link -) { +void +CTR_List::addTail(CTR_Link *link) +{ link->insertBefore(&m_tail); } diff --git a/intern/ghost/intern/GHOST_DisplayManagerNULL.h b/intern/ghost/intern/GHOST_DisplayManagerNULL.h index eb116e30d2d..4d5a0b008dc 100644 --- a/intern/ghost/intern/GHOST_DisplayManagerNULL.h +++ b/intern/ghost/intern/GHOST_DisplayManagerNULL.h @@ -41,7 +41,7 @@ public: GHOST_TSuccess getNumDisplaySettings( GHOST_TUns8 display, GHOST_TInt32& numSettings ) const{ return GHOST_kFailure; } GHOST_TSuccess getDisplaySetting( GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting ) const { return GHOST_kFailure; } GHOST_TSuccess getCurrentDisplaySetting( GHOST_TUns8 display, GHOST_DisplaySetting& setting ) const { return getDisplaySetting(display,GHOST_TInt32(0),setting); } - GHOST_TSuccess setCurrentDisplaySetting( GHOST_TUns8 display, const GHOST_DisplaySetting& setting ){ return GHOST_kSuccess; } + GHOST_TSuccess setCurrentDisplaySetting( GHOST_TUns8 display, const GHOST_DisplaySetting& setting ) { return GHOST_kSuccess; } private: GHOST_SystemNULL * m_system; diff --git a/intern/ghost/intern/GHOST_WindowNULL.h b/intern/ghost/intern/GHOST_WindowNULL.h index cde2cb0ba76..dcbb7d2b346 100644 --- a/intern/ghost/intern/GHOST_WindowNULL.h +++ b/intern/ghost/intern/GHOST_WindowNULL.h @@ -60,27 +60,27 @@ public: } protected: - GHOST_TSuccess installDrawingContext( GHOST_TDrawingContextType type ){ return GHOST_kSuccess; } - GHOST_TSuccess removeDrawingContext( ){ return GHOST_kSuccess; } - GHOST_TSuccess setWindowCursorGrab( GHOST_TGrabCursorMode mode ){ return GHOST_kSuccess; } - GHOST_TSuccess setWindowCursorShape( GHOST_TStandardCursor shape ){ return GHOST_kSuccess; } + GHOST_TSuccess installDrawingContext( GHOST_TDrawingContextType type ) { return GHOST_kSuccess; } + GHOST_TSuccess removeDrawingContext( ) { return GHOST_kSuccess; } + GHOST_TSuccess setWindowCursorGrab( GHOST_TGrabCursorMode mode ) { return GHOST_kSuccess; } + GHOST_TSuccess setWindowCursorShape( GHOST_TStandardCursor shape ) { return GHOST_kSuccess; } GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY ) { return GHOST_kSuccess; } - GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color ){ return GHOST_kSuccess; } + GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color ) { return GHOST_kSuccess; } bool getValid( ) const { return true; } - void setTitle( const STR_String& title ){ /* nothing */ } + void setTitle( const STR_String& title ) { /* nothing */ } void getTitle( STR_String& title ) const { title= "untitled"; } void getWindowBounds( GHOST_Rect& bounds ) const { getClientBounds(bounds); } void getClientBounds( GHOST_Rect& bounds ) const { /* nothing */ } - GHOST_TSuccess setClientWidth( GHOST_TUns32 width ){ return GHOST_kFailure; } - GHOST_TSuccess setClientHeight( GHOST_TUns32 height ){ return GHOST_kFailure; } - GHOST_TSuccess setClientSize( GHOST_TUns32 width, GHOST_TUns32 height ){ return GHOST_kFailure; } + GHOST_TSuccess setClientWidth( GHOST_TUns32 width ) { return GHOST_kFailure; } + GHOST_TSuccess setClientHeight( GHOST_TUns32 height ) { return GHOST_kFailure; } + GHOST_TSuccess setClientSize( GHOST_TUns32 width, GHOST_TUns32 height ) { return GHOST_kFailure; } void screenToClient( GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY ) const { outX = inX; outY = inY; } void clientToScreen( GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY ) const { outX = inX; outY = inY; } - GHOST_TSuccess swapBuffers( ){ return GHOST_kFailure; } - GHOST_TSuccess activateDrawingContext( ){ return GHOST_kFailure; } - ~GHOST_WindowNULL( ){ /* nothing */ } - GHOST_TSuccess setWindowCursorVisibility( bool visible ){ return GHOST_kSuccess; } + GHOST_TSuccess swapBuffers( ) { return GHOST_kFailure; } + GHOST_TSuccess activateDrawingContext( ) { return GHOST_kFailure; } + ~GHOST_WindowNULL( ) { /* nothing */ } + GHOST_TSuccess setWindowCursorVisibility( bool visible ) { return GHOST_kSuccess; } GHOST_TSuccess setState(GHOST_TWindowState state) { return GHOST_kSuccess; } GHOST_TWindowState getState() const { return GHOST_kWindowStateNormal; } GHOST_TSuccess invalidate() { return GHOST_kSuccess; } diff --git a/intern/ghost/test/multitest/EventToBuf.c b/intern/ghost/test/multitest/EventToBuf.c index f988f0fb86a..034fbe04447 100644 --- a/intern/ghost/test/multitest/EventToBuf.c +++ b/intern/ghost/test/multitest/EventToBuf.c @@ -36,7 +36,7 @@ char *eventtype_to_string(GHOST_TEventType type) { - switch(type) { + switch (type) { case GHOST_kEventCursorMove: return "CursorMove"; case GHOST_kEventButtonDown: return "ButtonDown"; case GHOST_kEventButtonUp: return "ButtonUp"; diff --git a/intern/memutil/MEM_Allocator.h b/intern/memutil/MEM_Allocator.h index 9541604b680..0020094ebbb 100644 --- a/intern/memutil/MEM_Allocator.h +++ b/intern/memutil/MEM_Allocator.h @@ -72,7 +72,7 @@ struct MEM_Allocator } // __p is not permitted to be a null pointer. - void deallocate(pointer __p, size_type){ + void deallocate(pointer __p, size_type) { MEM_freeN(__p); } diff --git a/intern/memutil/MEM_RefCountPtr.h b/intern/memutil/MEM_RefCountPtr.h index 4f475345076..ffdf927b551 100644 --- a/intern/memutil/MEM_RefCountPtr.h +++ b/intern/memutil/MEM_RefCountPtr.h @@ -98,7 +98,7 @@ * * static * MEM_RefCountPtr - * New(...){ + * New(...) { * return MEM_RefCountPtr output( * new UsefullClass(...) * ); diff --git a/intern/memutil/MEM_SmartPtr.h b/intern/memutil/MEM_SmartPtr.h index 6a0dc1723c4..722a0a8fd3b 100644 --- a/intern/memutil/MEM_SmartPtr.h +++ b/intern/memutil/MEM_SmartPtr.h @@ -119,7 +119,7 @@ public : MEM_SmartPtr( const MEM_SmartPtr &rhs - ){ + ) { m_val = rhs.Release(); } diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index 24c77c439a7..cba4c406759 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -258,7 +258,7 @@ tbool genTangSpace(const SMikkTSpaceContext * pContext, const float fAngularThre { const int verts = pContext->m_pInterface->m_getNumVerticesOfFace(pContext, f); if (verts==3) ++iNrTrianglesIn; - else if(verts==4) iNrTrianglesIn += 2; + else if (verts==4) iNrTrianglesIn += 2; } if (iNrTrianglesIn<=0) return TFALSE; @@ -470,11 +470,11 @@ static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SM const SVec3 vP = GetPosition(pContext, index); if (vMin.x > vP.x) vMin.x = vP.x; - else if(vMax.x < vP.x) vMax.x = vP.x; + else if (vMax.x < vP.x) vMax.x = vP.x; if (vMin.y > vP.y) vMin.y = vP.y; - else if(vMax.y < vP.y) vMax.y = vP.y; + else if (vMax.y < vP.y) vMax.y = vP.y; if (vMin.z > vP.z) vMin.z = vP.z; - else if(vMax.z < vP.z) vMax.z = vP.z; + else if (vMax.z < vP.z) vMax.z = vP.z; } vDim = vsub(vMax,vMin); @@ -485,7 +485,7 @@ static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SM iChannel=1; fMin = vMin.y, fMax=vMax.y; } - else if(vDim.z>vDim.x) + else if (vDim.z>vDim.x) { iChannel=2; fMin = vMin.z, fMax=vMax.z; @@ -590,7 +590,7 @@ static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], cons for (l=(iL_in+1); l<=iR_in; l++) for (c=0; c<3; c++) if (fvMin[c]>pTmpVert[l].vert[c]) fvMin[c]=pTmpVert[l].vert[c]; - else if(fvMax[c]dx && dy>dz) channel=1; - else if(dz>dx) channel=2; + else if (dz>dx) channel=2; fSep = 0.5f*(fvMax[channel]+fvMin[channel]); @@ -626,7 +626,7 @@ static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], cons const SVec3 vT2 = GetTexCoord(pContext, index2); i2rec=i2; - //if(vP==vP2 && vN==vN2 && vT==vT2) + //if (vP==vP2 && vN==vN2 && vT==vT2) if (vP.x==vP2.x && vP.y==vP2.y && vP.z==vP2.z && vN.x==vN2.x && vN.y==vN2.y && vN.z==vN2.z && vT.x==vT2.x && vT.y==vT2.y && vT.z==vT2.z) @@ -812,7 +812,7 @@ static int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_ tbool bQuadDiagIs_02; if (distSQ_02= CalcTexArea(pContext, &piTriListIn[(t+1)*3+0]) ) + else if ( CalcTexArea(pContext, &piTriListIn[t*3+0]) >= CalcTexArea(pContext, &piTriListIn[(t+1)*3+0]) ) bChooseOrientFirstTri = TTRUE; // force match @@ -1142,13 +1142,13 @@ static tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[], const int * pVerts = &piTriListIn[3*iMyTriIndex+0]; int i=-1; if (pVerts[0]==iVertRep) i=0; - else if(pVerts[1]==iVertRep) i=1; - else if(pVerts[2]==iVertRep) i=2; + else if (pVerts[1]==iVertRep) i=1; + else if (pVerts[2]==iVertRep) i=2; assert(i>=0 && i<3); // early out if (pMyTriInfo->AssignedGroup[i] == pGroup) return TTRUE; - else if(pMyTriInfo->AssignedGroup[i]!=NULL) return TFALSE; + else if (pMyTriInfo->AssignedGroup[i]!=NULL) return TFALSE; if ((pMyTriInfo->iFlag&GROUP_WITH_ANY)!=0) { // first to group with a group-with-anything triangle @@ -1232,8 +1232,8 @@ static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], con tbool bFound; SVec3 n, vOs, vOt; if (pTriInfos[f].AssignedGroup[0]==pGroup) index=0; - else if(pTriInfos[f].AssignedGroup[1]==pGroup) index=1; - else if(pTriInfos[f].AssignedGroup[2]==pGroup) index=2; + else if (pTriInfos[f].AssignedGroup[1]==pGroup) index=1; + else if (pTriInfos[f].AssignedGroup[2]==pGroup) index=2; assert(index>=0 && index<3); iVertIndex = piTriListIn[f*3+index]; @@ -1381,8 +1381,8 @@ static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriL float fCos, fAngle, fMagS, fMagT; int i=-1, index=-1, i0=-1, i1=-1, i2=-1; if (piTriListIn[3*f+0]==iVertexRepresentitive) i=0; - else if(piTriListIn[3*f+1]==iVertexRepresentitive) i=1; - else if(piTriListIn[3*f+2]==iVertexRepresentitive) i=2; + else if (piTriListIn[3*f+1]==iVertexRepresentitive) i=1; + else if (piTriListIn[3*f+2]==iVertexRepresentitive) i=2; assert(i>=0 && i<3); // project @@ -1404,8 +1404,8 @@ static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriL v2 = vsub(p2,p1); // project - v1 = vsub(v1, vscale(vdot(n,v1),n)); if( VNotZero(v1) ) v1 = Normalize(v1); - v2 = vsub(v2, vscale(vdot(n,v2),n)); if( VNotZero(v2) ) v2 = Normalize(v2); + v1 = vsub(v1, vscale(vdot(n,v1),n)); if ( VNotZero(v1) ) v1 = Normalize(v1); + v2 = vsub(v2, vscale(vdot(n,v2),n)); if ( VNotZero(v2) ) v2 = Normalize(v2); // weight contribution by the angle // between the two edge vectors @@ -1647,7 +1647,7 @@ static void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int SEdge sTmp; const int iElems = iRight-iLeft+1; if (iElems<2) return; - else if(iElems==2) + else if (iElems==2) { if (pSortBuffer[iLeft].array[channel] > pSortBuffer[iRight].array[channel]) { @@ -1868,8 +1868,8 @@ static void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriLis int iFlag = (1<= 0) && (y_curr < ctx->rb.sizey)) { /* draw the pixels. */ - for (; cpxl <= mpxl; *cpxl++ = 1.0f); + for (; cpxl <= mpxl; *cpxl++ = 1.0f); } } diff --git a/intern/utfconv/utfconv.c b/intern/utfconv/utfconv.c index 189141e487d..a9b2920111d 100644 --- a/intern/utfconv/utfconv.c +++ b/intern/utfconv/utfconv.c @@ -34,7 +34,7 @@ size_t count_utf_8_from_16(const wchar_t *string16) return 0; } - for (i = 0; (u = string16[i]); i++) { + for (i = 0; (u = string16[i]); i++) { if (u < 0x0080) { count += 1; } -- cgit v1.2.3