From c8715dea0bb80d81c8d37ec833bc33036e12aa3e Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Tue, 9 Aug 2022 14:13:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3linux=E4=B8=8B=E6=B1=89?= =?UTF-8?q?=E7=8E=8BOCR=E5=BA=93=E5=8A=A0=E8=BD=BD=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/imgfmt/HGPdfImpl.cpp | 15 ++------------- modules/imgproc/HGOCRHanvon.cpp | 13 +------------ 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/modules/imgfmt/HGPdfImpl.cpp b/modules/imgfmt/HGPdfImpl.cpp index 3c27d46a..d608c8da 100644 --- a/modules/imgfmt/HGPdfImpl.cpp +++ b/modules/imgfmt/HGPdfImpl.cpp @@ -6,17 +6,6 @@ #include #include -template -dst_type union_cast(src_type src) -{ - union { - src_type s; - dst_type d; - }u; - u.s = src; - return u.d; -} - HGPdfReaderImpl::HGPdfReaderImpl() { m_dll = NULL; @@ -63,7 +52,7 @@ HGResult HGPdfReaderImpl::Open(const HGChar* fileName) assert(NULL == m_dll); HGChar moduleName[256]; - HGBase_GetModuleName(union_cast(&HGPdfReaderImpl::Open), moduleName, 256); + HGBase_GetModuleName((void *)HGImgFmt_OpenPdfReader, moduleName, 256); HGChar dllPath[256]; HGBase_GetFilePath(moduleName, dllPath, 256); @@ -561,7 +550,7 @@ HGResult HGPdfImageWriterImpl::Open(const HGChar* fileName) assert(NULL == m_dll); HGChar moduleName[256]; - HGBase_GetModuleName(union_cast(&HGPdfImageWriterImpl::Open), moduleName, 256); + HGBase_GetModuleName((void*)HGImgFmt_OpenPdfImageWriter, moduleName, 256); HGChar dllPath[256]; HGBase_GetFilePath(moduleName, dllPath, 256); diff --git a/modules/imgproc/HGOCRHanvon.cpp b/modules/imgproc/HGOCRHanvon.cpp index c1e55d01..eb451b6f 100644 --- a/modules/imgproc/HGOCRHanvon.cpp +++ b/modules/imgproc/HGOCRHanvon.cpp @@ -6,17 +6,6 @@ #include "../base/HGInfo.h" #include "../imgfmt/HGBmp.h" -template -dst_type union_cast(src_type src) -{ - union { - src_type s; - dst_type d; - }u; - u.s = src; - return u.d; -} - HGUInt HGOCRHanvon::m_refCount = 0; HGOCRHanvon::HGOCRHanvon() @@ -40,7 +29,7 @@ HGResult HGOCRHanvon::Init() assert(NULL == m_dll); HGChar moduleName[256]; - HGBase_GetModuleName(union_cast(&HGOCRHanvon::Init), moduleName, 256); + HGBase_GetModuleName((void *)HGImgProc_CreateOCRMgr, moduleName, 256); HGChar dllPath[256]; HGBase_GetFilePath(moduleName, dllPath, 256);