code refactoring 40/241440/1
authorHermet Park <chuneon.park@samsung.com>
Thu, 20 Aug 2020 07:16:46 +0000 (16:16 +0900)
committerHermet Park <chuneon.park@samsung.com>
Thu, 20 Aug 2020 07:16:46 +0000 (16:16 +0900)
remove unnecessary condition.
implementation won't be included multiple times not like headers.

Thus this condition is unnecessary.

Change-Id: Id37e675c40ce7213a06c950da8e5ca17ff7245c9

26 files changed:
src/lib/gl_engine/tvgGlRenderer.cpp
src/lib/sw_engine/tvgSwFill.cpp
src/lib/sw_engine/tvgSwMath.cpp
src/lib/sw_engine/tvgSwRaster.cpp
src/lib/sw_engine/tvgSwRenderer.cpp
src/lib/sw_engine/tvgSwRle.cpp
src/lib/sw_engine/tvgSwShape.cpp
src/lib/sw_engine/tvgSwStroke.cpp
src/lib/tvgBezier.cpp
src/lib/tvgCanvas.cpp
src/lib/tvgFill.cpp
src/lib/tvgGlCanvas.cpp
src/lib/tvgInitializer.cpp
src/lib/tvgLinearGradient.cpp
src/lib/tvgLoaderMgr.cpp
src/lib/tvgPaint.cpp
src/lib/tvgPicture.cpp
src/lib/tvgRadialGradient.cpp
src/lib/tvgRender.cpp
src/lib/tvgScene.cpp
src/lib/tvgShape.cpp
src/lib/tvgSwCanvas.cpp
src/loaders/svg/tvgSimpleXmlParser.cpp
src/loaders/svg/tvgSvgLoader.cpp
src/loaders/svg/tvgSvgPath.cpp
src/loaders/svg/tvgSvgSceneBuilder.cpp

index a295ed6..f6b31d4 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
-#ifndef _TVG_GL_RENDERER_CPP_
-#define _TVG_GL_RENDERER_CPP_
-
 #include "tvgGlShaderSrc.h"
 #include "tvgGlGpuBuffer.h"
 #include "tvgGlGeometry.h"
@@ -216,6 +212,4 @@ void GlRenderer::drawPrimitive(GlGeometry& geometry, float r, float g, float b,
     geometry.draw(mVertexAttrLoc, primitiveIndex, flag);
     geometry.disableVertex(mVertexAttrLoc);
 
-}
-
-#endif /* _TVG_GL_RENDERER_CPP_ */
+}
\ No newline at end of file
index 72e702b..91a064d 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SW_FILL_CPP_
-#define _TVG_SW_FILL_CPP_
-
 #include "tvgSwCommon.h"
 
 
@@ -314,6 +311,4 @@ void fillFree(SwFill* fill)
     if (fill->ctable) free(fill->ctable);
 
     free(fill);
-}
-
-#endif /* _TVG_SW_FILL_CPP_ */
\ No newline at end of file
+}
\ No newline at end of file
index b3cf477..56ce40f 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SW_MATH_H_
-#define _TVG_SW_MATH_H_
-
 #include "tvgSwCommon.h"
 
 
@@ -417,5 +414,4 @@ SwFixed mathDiff(SwFixed angle1, SwFixed angle2)
     if (delta > SW_ANGLE_PI) delta -= SW_ANGLE_2PI;
 
     return delta;
-}
-#endif /* _TVG_SW_MATH_H_ */
\ No newline at end of file
+}
\ No newline at end of file
index 3fec524..7b5b986 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SW_RASTER_CPP_
-#define _TVG_SW_RASTER_CPP_
-
 #include "tvgSwCommon.h"
 
 /************************************************************************/
@@ -369,6 +366,4 @@ bool rasterClear(SwSurface* surface)
         }
     }
     return true;
-}
-
-#endif /* _TVG_SW_RASTER_CPP_ */
\ No newline at end of file
+}
\ No newline at end of file
index b173ce4..1a1e0bf 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SW_RENDERER_CPP_
-#define _TVG_SW_RENDERER_CPP_
-
 #include "tvgSwCommon.h"
 #include "tvgSwRenderer.h"
 
@@ -185,6 +182,4 @@ SwRenderer* SwRenderer::inst()
 {
     //We know renderer type, avoid dynamic_cast for performance.
     return static_cast<SwRenderer*>(RenderInitializer::inst(renderInit));
-}
-
-#endif /* _TVG_SW_RENDERER_CPP_ */
\ No newline at end of file
+}
\ No newline at end of file
index c9aa6ae..37a860f 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SW_RLE_H_
-#define _TVG_SW_RLE_H_
-
 #include <setjmp.h>
 #include <limits.h>
 #include <memory.h>
@@ -754,6 +751,4 @@ void rleFree(SwRleData* rle)
     if (!rle) return;
     if (rle->spans) free(rle->spans);
     free(rle);
-}
-
-#endif /* _TVG_SW_RLE_H_ */
+}
\ No newline at end of file
index f14d3b6..d0a8f96 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SW_SHAPE_H_
-#define _TVG_SW_SHAPE_H_
-
 #include "tvgSwCommon.h"
 
 /************************************************************************/
@@ -672,7 +669,4 @@ void shapeDelFill(SwShape* shape)
     if (!shape->fill) return;
     fillFree(shape->fill);
     shape->fill = nullptr;
-}
-
-
-#endif /* _TVG_SW_SHAPE_H_ */
+}
\ No newline at end of file
index 8400237..08754f8 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SW_STROKER_H_
-#define _TVG_SW_STROKER_H_
-
 #include "tvgSwCommon.h"
 
 
@@ -924,6 +921,4 @@ SwOutline* strokeExportOutline(SwStroke* stroke)
     _exportBorderOutline(*stroke, outline, 1);  //right
 
     return outline;
-}
-
-#endif /* _TVG_SW_STROKER_H_ */
+}
\ No newline at end of file
index 0ed4ed2..db4d58b 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_BEZIER_CPP_
-#define _TVG_BEZIER_CPP_
-
 #include "tvgCommon.h"
 
 
@@ -143,7 +140,4 @@ void bezSplitAt(const Bezier& cur, float at, Bezier& left, Bezier& right)
     bezSplitLeft(right, t, left);
 }
 
-
-}
-
-#endif //_TVG_BEZIER_CPP_
+}
\ No newline at end of file
index 7e7250a..957940c 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_CANVAS_CPP_
-#define _TVG_CANVAS_CPP_
-
 #include "tvgCommon.h"
 #include "tvgCanvasImpl.h"
 
@@ -75,6 +72,4 @@ Result Canvas::sync() noexcept
     if (IMPL->renderer->flush()) return Result::Success;
 
     return Result::InsufficientCondition;
-}
-
-#endif /* _TVG_CANVAS_CPP_ */
+}
\ No newline at end of file
index d1240f0..cc1a13b 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_FILL_CPP_
-#define _TVG_FILL_CPP_
-
 #include "tvgCommon.h"
 
 
@@ -99,6 +96,4 @@ Result Fill::spread(FillSpread s) noexcept
 FillSpread Fill::spread() const noexcept
 {
     return IMPL->spread;
-}
-
-#endif /* _TVG_FILL_CPP_ */
\ No newline at end of file
+}
\ No newline at end of file
index e1b5c3c..7f267a4 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_GLCANVAS_CPP_
-#define _TVG_GLCANVAS_CPP_
-
 #include "tvgCommon.h"
 #include "tvgCanvasImpl.h"
 
@@ -84,7 +81,4 @@ unique_ptr<GlCanvas> GlCanvas::gen() noexcept
     return unique_ptr<GlCanvas>(new GlCanvas);
 #endif
     return nullptr;
-}
-
-
-#endif /* _TVG_GLCANVAS_CPP_ */
+}
\ No newline at end of file
index 3367603..2185c0f 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_INITIALIZER_CPP_
-#define _TVG_INITIALIZER_CPP_
-
 #include "tvgCommon.h"
 #include "tvgLoaderMgr.h"
 
@@ -107,6 +104,4 @@ Result Initializer::threads(uint32_t cnt) noexcept
 uint32_t Initializer::threads() noexcept
 {
     return threadCnt;
-}
-
-#endif /* _TVG_INITIALIZER_CPP_ */
+}
\ No newline at end of file
index bd2dbc1..a76239e 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_LINEAR_GRADIENT_CPP_
-#define _TVG_LINEAR_GRADIENT_CPP_
-
 #include "tvgCommon.h"
 
 /************************************************************************/
@@ -77,6 +74,4 @@ Result LinearGradient::linear(float* x1, float* y1, float* x2, float* y2) const
 unique_ptr<LinearGradient> LinearGradient::gen() noexcept
 {
     return unique_ptr<LinearGradient>(new LinearGradient);
-}
-
-#endif /* _TVG_LINEAR_GRADIENT_CPP_ */
\ No newline at end of file
+}
\ No newline at end of file
index 5e59a44..6ec3213 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_LOADER_MGR_CPP_
-#define _TVG_LOADER_MGR_CPP_
-
 #include "tvgCommon.h"
 
 #ifdef THORVG_SVG_LOADER_SUPPORT
@@ -56,6 +53,4 @@ unique_ptr<Loader> LoaderMgr::loader()
     return unique_ptr<SvgLoader>(new SvgLoader);
 #endif
     return nullptr;
-}
-
-#endif //_TVG_LOADER_MGR_CPP_
\ No newline at end of file
+}
\ No newline at end of file
index 7984ac0..3105e27 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_PAINT_CPP_
-#define _TVG_PAINT_CPP_
-
 #include "tvgCommon.h"
 
 /************************************************************************/
@@ -74,6 +71,4 @@ Result Paint::bounds(float* x, float* y, float* w, float* h) const noexcept
 {
     if (IMPL->bounds(x, y, w, h)) return Result::Success;
     return Result::InsufficientCondition;
-}
-
-#endif //_TVG_PAINT_CPP_
\ No newline at end of file
+}
\ No newline at end of file
index 7083692..7c20a37 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_PICTURE_CPP_
-#define _TVG_PICTURE_CPP_
-
 #include "tvgPictureImpl.h"
 
 /************************************************************************/
@@ -65,6 +62,4 @@ Result Picture::viewbox(float* x, float* y, float* w, float* h) const noexcept
 {
     if (IMPL->viewbox(x, y, w, h)) return Result::Success;
     return Result::InsufficientCondition;
-}
-
-#endif /* _TVG_PICTURE_CPP_ */
\ No newline at end of file
+}
\ No newline at end of file
index 9f123bf..92e934e 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_RADIAL_GRADIENT_CPP_
-#define _TVG_RADIAL_GRADIENT_CPP_
-
 #include "tvgCommon.h"
 
 /************************************************************************/
@@ -74,6 +71,4 @@ Result RadialGradient::radial(float* cx, float* cy, float* radius) const noexcep
 unique_ptr<RadialGradient> RadialGradient::gen() noexcept
 {
     return unique_ptr<RadialGradient>(new RadialGradient);
-}
-
-#endif /* _TVG_RADIAL_GRADIENT_CPP_ */
\ No newline at end of file
+}
\ No newline at end of file
index 30bc906..10a23e8 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_RENDER_CPP_
-#define _TVG_RENDER_CPP_
-
 #include "tvgCommon.h"
 
 /************************************************************************/
@@ -118,6 +115,4 @@ RenderTransform::RenderTransform(const RenderTransform* lhs, const RenderTransfo
     m.e31 = lhs->m.e31 * rhs->m.e11 + lhs->m.e32 * rhs->m.e21 + lhs->m.e33 * rhs->m.e31;
     m.e32 = lhs->m.e31 * rhs->m.e12 + lhs->m.e32 * rhs->m.e22 + lhs->m.e33 * rhs->m.e32;
     m.e33 = lhs->m.e31 * rhs->m.e13 + lhs->m.e32 * rhs->m.e23 + lhs->m.e33 * rhs->m.e33;
-}
-
-#endif //_TVG_RENDER_CPP_
+}
\ No newline at end of file
index 9120e00..df7362f 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SCENE_CPP_
-#define _TVG_SCENE_CPP_
-
 #include "tvgSceneImpl.h"
 
 /************************************************************************/
@@ -60,6 +57,4 @@ Result Scene::reserve(uint32_t size) noexcept
     IMPL->paints.reserve(size);
 
     return Result::Success;
-}
-
-#endif /* _TVG_SCENE_CPP_ */
\ No newline at end of file
+}
\ No newline at end of file
index c688ffc..8db945d 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SHAPE_CPP_
-#define _TVG_SHAPE_CPP_
-
 #include <limits>
 
 #include "tvgShapeImpl.h"
@@ -405,7 +402,4 @@ StrokeJoin Shape::strokeJoin() const noexcept
     if (!IMPL->stroke) return StrokeJoin::Bevel;
 
     return IMPL->stroke->join;
-}
-
-
-#endif //_TVG_SHAPE_CPP_
+}
\ No newline at end of file
index 5d280fd..b56beb4 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SWCANVAS_CPP_
-#define _TVG_SWCANVAS_CPP_
-
 #include "tvgCommon.h"
 #include "tvgCanvasImpl.h"
 
@@ -83,6 +80,4 @@ unique_ptr<SwCanvas> SwCanvas::gen() noexcept
     return unique_ptr<SwCanvas>(new SwCanvas);
 #endif
     return nullptr;
-}
-
-#endif /* _TVG_SWCANVAS_CPP_ */
+}
\ No newline at end of file
index 932d071..76200ae 100644 (file)
@@ -364,5 +364,4 @@ const char* simpleXmlFindAttributesTag(const char* buf, unsigned bufLength)
     }
 
     return nullptr;
-}
-
+}
\ No newline at end of file
index f1d9432..b174300 100644 (file)
@@ -19,9 +19,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef _TVG_SVG_LOADER_CPP_
-#define _TVG_SVG_LOADER_CPP_
-
 #include <stddef.h>
 #include <fstream>
 #include "tvgSvgLoader.h"
@@ -2391,6 +2388,4 @@ bool SvgLoader::close()
 unique_ptr<Scene> SvgLoader::data()
 {
     return move(root);
-}
-
-#endif //_TVG_SVG_LOADER_CPP_
+}
\ No newline at end of file
index 2d3b86a..c9b90fe 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
-#ifndef __TVG_SVG_PATH_CPP_
-#define __TVG_SVG_PATH_CPP_
-
 #include "tvgSvgPath.h"
 
 
@@ -500,6 +496,4 @@ tuple<vector<PathCommand>, vector<Point>> svgPathToTvgPath(const char* svgPath)
     if (curLocale) free(curLocale);
 
    return make_tuple(cmds, pts);
-}
-
-#endif //__TVG_SVG_PATH_CPP_
+}
\ No newline at end of file
index faea2ec..5496ae8 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
-#ifndef _TVG_SVG_SCENE_BUILDER_CPP_
-#define _TVG_SVG_SCENE_BUILDER_CPP_
-
-
 #include "tvgSvgSceneBuilder.h"
 
 unique_ptr<LinearGradient> _applyLinearGradientProperty(SvgStyleGradient* g, Shape* vg, float rx, float ry, float rw, float rh)
@@ -374,7 +369,4 @@ unique_ptr<Scene> SvgSceneBuilder::build(SvgNode* node)
     viewBox.h = node->node.doc.vh;
     preserveAspect = node->node.doc.preserveAspect;
     return _sceneBuildHelper(node, viewBox.x, viewBox.y, viewBox.w, viewBox.h, 255);
-}
-
-
-#endif //_TVG_SVG_SCENE_BUILDER_CPP_
+}
\ No newline at end of file