ccessor : public CESCI2Command (protected +@@ -211,7 +211,7 @@ class CESCI2Accessor : public CESCI2Command (protected ESErrorCode _SetColorMatrix( ES_COLOR_MATRIX& matrix ); ESErrorCode SetColorMatrix( ESFloatArray arColorMatrix ); bool IsSkewCorrectionSupported(); @@ -18,21 +18,34 @@ ESErrorCode SetSkewCorrectionEnabled( bool bSkewCorrectionEnabled ); ESAny GetSupportedThreshold(); ESNumber GetThreshold(); -@@ -226,7 +226,7 @@ class CESCI2Accessor : public CESCI2Command (protected - ESNumber GetGammaScale(); - ESErrorCode SetGammaScale( ESNumber nGammaScale ); +@@ -241,7 +241,7 @@ class CESCI2Accessor : public CESCI2Command (protected + virtual bool IsSkipImageEnabled(); + virtual ESErrorCode SetSkipImageEnabled( bool nDetectBlankPageLevel ); ESAny GetSupportedBackGroundRemoval(); - ESNumber GetBackGroundRemoval(); + virtual ESNumber GetBackGroundRemoval() override; ESErrorCode SetBackGroundRemoval( ESNumber nBackGroundRemoval ); - ESAny GetSupportedJPEGQuality(); - ESNumber GetJPEGQuality(); -@@ -235,7 +235,7 @@ class CESCI2Accessor : public CESCI2Command (protected + ESErrorCode DoAutoFocus(ESFloat* pfOutFocus); + bool IsAutoFocusSupported(); +@@ -257,10 +257,10 @@ class CESCI2Accessor : public CESCI2Command (protected ESQuietMode GetQuietMode(); ESErrorCode SetQuietMode( ESNumber nQuietMode); bool IsAutoCroppingSupported(); - bool IsAutoCroppingEnabled(); + virtual bool IsAutoCroppingEnabled() override; ESErrorCode SetAutoCroppingEnabled( bool bAutoCroppingEnabled ); + bool IsAutoCroppingInscribedSupported(); +- bool IsAutoCroppingInscribedEnabled(); ++ bool IsAutoCroppingInscribedEnabled() override; + ESErrorCode SetAutoCroppingInscribedEnabled( bool bAutoCroppingEnabled ); ESAny GetCroppableResolutions(); ESAny GetSupportedCroppingSizes(); +@@ -516,7 +516,7 @@ class CESCI2Accessor : public CESCI2Command (protected + bool IsRetardRollerNearendSupported(); + ESNumber GetRetardRollerNearend(); + ESAny GetSupportedCapability(const UInt32& key); +- ENUM_ES_HASH_TYPE GetMaintenanceHashType(); ++ ENUM_ES_HASH_TYPE GetMaintenanceHashType() override; + private : + template + void ForeachAnyArrayValue(const ESAny &anyValue, Function func) { diff --git a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Command_ESCI2_ESCI2Command.h b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Command_ESCI2_ESCI2Command.h new file mode 100644 index 000000000000..2d68179508cb --- /dev/null +++ b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Command_ESCI2_ESCI2Command.h @@ -0,0 +1,11 @@ +--- src/ES2Command/Src/Command/ESCI2/ESCI2Command.h.orig 2024-09-12 07:10:31 UTC ++++ src/ES2Command/Src/Command/ESCI2/ESCI2Command.h +@@ -59,7 +59,7 @@ class CESCI2Command : public CCommandBase (protected) + virtual bool IsFeedTypeADF() = 0; + virtual bool IsAdfLoadSupported() = 0 ; + virtual bool IsAutoCroppingEnabled() = 0; +- virtual bool IsAutoCroppingInscribedEnabled() = 0; ++ virtual bool IsAutoCroppingInscribedEnabled() = 0; + virtual bool IsSkewCorrectionEnabled() =0; + virtual ESNumber GetBackGroundRemoval() = 0; + private: diff --git a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_ipc_ipcInterfaceImpl.cpp b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_ipc_ipcInterfaceImpl.cpp index d930216e6727..9c675a4cdc9f 100644 --- a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_ipc_ipcInterfaceImpl.cpp +++ b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_ipc_ipcInterfaceImpl.cpp @@ -1,6 +1,17 @@ ---- src/ES2Command/Src/Interface/ipc/ipcInterfaceImpl.cpp.orig 2021-11-25 00:56:54 UTC +--- src/ES2Command/Src/Interface/ipc/ipcInterfaceImpl.cpp.orig 2024-09-12 07:10:32 UTC +++ src/ES2Command/Src/Interface/ipc/ipcInterfaceImpl.cpp -@@ -307,7 +307,7 @@ bool IPCInterfaceImpl::recv_reply(uint32_t* token) +@@ -129,7 +129,9 @@ ESErrorCode IPCInterfaceImpl::Open() + if(!ES_IsExistFile(dat_file)){ + FILE *fp; + fp = fopen(dat_file.c_str(),"w"); +- fclose(fp); ++ if (fp) { ++ fclose(fp); ++ } + } + interrupt_.reset(new ipc_interrupt(delegate_, dat_file, IPC_SHARED_ID, IPC_SEMAHORE_KEY)); + interrupt_->start(); +@@ -305,7 +307,7 @@ bool IPCInterfaceImpl::recv_reply(uint32_t* token) if (placeholder) delete [] placeholder; if (token) *token = hdr_token(hdr); if (hdr_error(hdr) || n < 0) { diff --git a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_usb_usbInterfaceImpl.cpp b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_usb_usbInterfaceImpl.cpp index b7225c97f1b8..acaeeb6465e7 100644 --- a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_usb_usbInterfaceImpl.cpp +++ b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_usb_usbInterfaceImpl.cpp @@ -1,12 +1,12 @@ ---- src/ES2Command/Src/Interface/usb/usbInterfaceImpl.cpp.orig 2021-11-25 00:56:54 UTC +--- src/ES2Command/Src/Interface/usb/usbInterfaceImpl.cpp.orig 2024-09-12 07:10:32 UTC +++ src/ES2Command/Src/Interface/usb/usbInterfaceImpl.cpp -@@ -46,7 +46,8 @@ USBInterfaceImpl::USBInterfaceImpl() +@@ -34,7 +34,8 @@ USBInterfaceImpl::USBInterfaceImpl() sm_ctx = nullptr; throw std::runtime_error("unable to initialise USB support"); } - libusb_set_debug(sm_ctx, 3); -+ // XXX this cannot be left enabled as the debug messages go to stdout which is where the scan image data goes -+ //libusb_set_debug(sm_ctx, 3); ++ // XXX this cannot be left enabled as the debug messages go to stdout which is where the scan image data goes ++ // libusb_set_debug(sm_ctx, 3); } ++sm_nConnectionCount; } diff --git a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_usb_usbInterfaceImpl.h b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_usb_usbInterfaceImpl.h index 247cabd4050e..4956c421b9d4 100644 --- a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_usb_usbInterfaceImpl.h +++ b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Interface_usb_usbInterfaceImpl.h @@ -1,10 +1,9 @@ ---- src/ES2Command/Src/Interface/usb/usbInterfaceImpl.h.orig 2021-11-25 00:56:54 UTC +--- src/ES2Command/Src/Interface/usb/usbInterfaceImpl.h.orig 2024-09-12 07:10:32 UTC +++ src/ES2Command/Src/Interface/usb/usbInterfaceImpl.h -@@ -20,8 +20,11 @@ - // usbInterfaceImpl.h -- template and derived ESC/I ESC/I-2 protocol commands +@@ -18,7 +18,11 @@ #pragma once -- + +#if __FreeBSD__ +#include +#else @@ -12,4 +11,4 @@ +#endif #include "../interfaceImpl.h" #include "../interface.h" - class USBInterfaceImpl : public IInterfaceImpl + #include "CommonUtility/ESCommonTypedef.h" diff --git a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Utils_ESAccessor.h b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Utils_ESAccessor.h index cac14405aa0a..2a2cac695411 100644 --- a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Utils_ESAccessor.h +++ b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Utils_ESAccessor.h @@ -1,6 +1,6 @@ ---- src/ES2Command/Src/Utils/ESAccessor.h.orig 2021-11-25 00:56:55 UTC +--- src/ES2Command/Src/Utils/ESAccessor.h.orig 2024-09-12 07:10:32 UTC +++ src/ES2Command/Src/Utils/ESAccessor.h -@@ -177,7 +177,7 @@ class CESAccessor{ (protected) +@@ -174,7 +174,7 @@ class CESAccessor{ (protected) { } CSetterFunc(const CSetterFunc& rhs) diff --git a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Utils_semaphore.hpp b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Utils_semaphore.hpp index 680ae4f57ab8..9fa181c6ed5d 100644 --- a/graphics/epsonscan2/files/patch-src_ES2Command_Src_Utils_semaphore.hpp +++ b/graphics/epsonscan2/files/patch-src_ES2Command_Src_Utils_semaphore.hpp @@ -1,6 +1,6 @@ ---- src/ES2Command/Src/Utils/semaphore.hpp.orig 2021-11-25 00:56:55 UTC +--- src/ES2Command/Src/Utils/semaphore.hpp.orig 2024-09-12 07:10:32 UTC +++ src/ES2Command/Src/Utils/semaphore.hpp -@@ -23,6 +23,10 @@ +@@ -20,6 +20,10 @@ #include #include @@ -11,7 +11,7 @@ #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) #else union semun { -@@ -88,9 +92,26 @@ class semaphore (public) +@@ -85,9 +89,26 @@ class semaphore (public) } int wait(int timeout_s) { @@ -38,7 +38,7 @@ operations[0].sem_flg = SEM_UNDO; struct timespec time{}; time.tv_sec = timeout_s; -@@ -98,6 +119,7 @@ class semaphore (public) +@@ -95,6 +116,7 @@ class semaphore (public) return errno; } return 0; @@ -46,7 +46,7 @@ } void lock() { -@@ -128,6 +150,14 @@ class semaphore (public) +@@ -125,6 +147,14 @@ class semaphore (public) } int wait_and_lock(int timeout_s) { @@ -61,7 +61,7 @@ sembuf operations[2]; operations[0].sem_num = 0; operations[0].sem_op = WAIT; -@@ -141,6 +171,7 @@ class semaphore (public) +@@ -138,6 +168,7 @@ class semaphore (public) return errno; } return 0; diff --git a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_IO_FKDestination.h b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_IO_FKDestination.h index 49ec9593d64d..e857f4093e83 100644 --- a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_IO_FKDestination.h +++ b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_IO_FKDestination.h @@ -1,6 +1,6 @@ ---- src/ES2FileFormat/Header/IO/FKDestination.h.orig 2021-11-25 00:56:57 UTC +--- src/ES2FileFormat/Header/IO/FKDestination.h.orig 2024-09-12 07:10:33 UTC +++ src/ES2FileFormat/Header/IO/FKDestination.h -@@ -33,12 +33,12 @@ class CFKDestination : public IFKDestination (private) +@@ -30,12 +30,12 @@ class CFKDestination : public IFKDestination (public) public: CFKDestination(); ~CFKDestination(); @@ -12,11 +12,11 @@ - ES_CMN_FUNCS::BUFFER::IESBuffer& GetSource(); - void SetDelegate(IFKDestinationDelegate* piDelegate){ + ES_CMN_FUNCS::BUFFER::IESBuffer& GetSource() override; -+ void SetDelegate(IFKDestinationDelegate* piDelegate) override { ++ void SetDelegate(IFKDestinationDelegate* piDelegate) override{ m_pcDelegate = piDelegate ; } void SetUserData(const ESImageInfo& dictImageInfo){ -@@ -50,10 +50,10 @@ class CFKDestination : public IFKDestination (private) +@@ -47,10 +47,10 @@ class CFKDestination : public IFKDestination (public) virtual void SetUserDataAsJson(ES_CHAR_CPTR pszUserDataAsJson) override; virtual void GetUserDataAsJson(IESResultString& pszUserDataAsJson) override; static IFKDestination* CreateAndInitInstanceWithType( FKDestinationType eType, ES_CMN_FUNCS::BUFFER::IESBuffer& cSource ); @@ -26,7 +26,7 @@ + void NotifyDidEndReceivingForImageInfo( ES_CHAR_CPTR pszImageInfoAsJson ) override; void NotifyReceiveImageData( ES_CMN_FUNCS::BUFFER::IESBuffer& cData, ES_CHAR_CPTR pszImageInfoAsJson ) override; - void Destroy(){ -+ void Destroy() override { ++ void Destroy() override{ delete this; } }; diff --git a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_IO_FKSource.h b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_IO_FKSource.h index c6dddcda8f9f..593711bfdbdc 100644 --- a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_IO_FKSource.h +++ b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_IO_FKSource.h @@ -1,6 +1,6 @@ ---- src/ES2FileFormat/Header/IO/FKSource.h.orig 2021-11-25 00:56:57 UTC +--- src/ES2FileFormat/Header/IO/FKSource.h.orig 2024-09-12 07:10:33 UTC +++ src/ES2FileFormat/Header/IO/FKSource.h -@@ -40,7 +40,7 @@ class CFKSource : public IFKSource (public) +@@ -37,7 +37,7 @@ class CFKSource : public IFKSource (public) { return m_bFull; } diff --git a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_Reader_FKReader.h b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_Reader_FKReader.h index 13ac013b39c3..1a7afda4663f 100644 --- a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_Reader_FKReader.h +++ b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Header_Reader_FKReader.h @@ -1,6 +1,6 @@ ---- src/ES2FileFormat/Header/Reader/FKReader.h.orig 2021-11-25 00:56:57 UTC +--- src/ES2FileFormat/Header/Reader/FKReader.h.orig 2024-09-12 07:10:33 UTC +++ src/ES2FileFormat/Header/Reader/FKReader.h -@@ -42,21 +42,21 @@ class CFKReader : public IFKReader (public) +@@ -39,21 +39,21 @@ class CFKReader : public IFKReader (public) m_nValidImageHeight = nHeight; m_bReadOnlyValidData = bReadOnlyValidData; } @@ -28,7 +28,7 @@ + virtual BOOL OpenReaderWithOptionAsJson( ES_CHAR_CPTR pszOptionAsJson, ENUM_FK_ERROR_CODE& eError ) override = 0; + virtual BOOL AppendSourceToReader( IFKSource* pcSource, ENUM_FK_ERROR_CODE& eError ) override = 0; + virtual BOOL CloseReaderWithOptionAsJson( ES_CHAR_CPTR pszOptionAsJson, ENUM_FK_ERROR_CODE& eError ) override = 0; -+ void Destroy() override { ++ void Destroy() override{ delete this; } }; diff --git a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_PnmUtil_FKPnmUtil.cpp b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_PnmUtil_FKPnmUtil.cpp index f0df1a08cec3..7701c8577475 100644 --- a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_PnmUtil_FKPnmUtil.cpp +++ b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_PnmUtil_FKPnmUtil.cpp @@ -1,11 +1,11 @@ ---- src/ES2FileFormat/Source/PnmUtil/FKPnmUtil.cpp.orig 2022-02-17 18:20:53 UTC +--- src/ES2FileFormat/Source/PnmUtil/FKPnmUtil.cpp.orig 2024-09-12 07:10:33 UTC +++ src/ES2FileFormat/Source/PnmUtil/FKPnmUtil.cpp -@@ -137,7 +137,7 @@ BOOL CFKPnmEncodeUtil::StartEncodingWithData(IFKDestin +@@ -134,7 +134,7 @@ BOOL CFKPnmEncodeUtil::StartEncodingWithData(IFKDestin ES_ErrorBailWithAction(m_cData.AllocBuffer(nHeaderSize + 4), BAIL, this, eError = kFKMemError, ES_STRING("memory alloc error")); } - memcpy(m_cData.GetBufferPtr(), m_pnmHeader.c_str(), sizeof(m_pnmHeader.c_str())); -+ memcpy(m_cData.GetBufferPtr(), m_pnmHeader.c_str(), strlen(m_pnmHeader.c_str())+1); ++ memcpy(m_cData.GetBufferPtr(), m_pnmHeader.c_str(), strlen(m_pnmHeader.c_str())); m_rowBytes = ES_IMAGE_INFO::GetESImageBytesPerRow(imageInfo); pDest->NotifyDidBeginReceivingForImageInfo(m_strImageJson.c_str()); if (pDest->GetFKDestinationType() == kFKDestinationTypeEmpty){ diff --git a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_TiffUtil_FKTiffEncodeUtil.cpp b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_TiffUtil_FKTiffEncodeUtil.cpp new file mode 100644 index 000000000000..0f981a5e001b --- /dev/null +++ b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_TiffUtil_FKTiffEncodeUtil.cpp @@ -0,0 +1,22 @@ +--- src/ES2FileFormat/Source/TiffUtil/FKTiffEncodeUtil.cpp.orig 2024-09-12 07:10:33 UTC ++++ src/ES2FileFormat/Source/TiffUtil/FKTiffEncodeUtil.cpp +@@ -192,8 +192,8 @@ BAIL:; + BAIL:; + return errorCode == kFKNoError; + } +-BOOL FKTiffEncodeUtil::StartWithPath(ESString& path, ESImageInfo& imageInfo, uint32 compression, +- BOOL appendMode, ESString& iccProfilePath, ENUM_FK_ERROR_CODE& eError,uint32 un32JpegQuality) ++BOOL FKTiffEncodeUtil::StartWithPath(ESString& path, ESImageInfo& imageInfo, uint32_t compression, ++ BOOL appendMode, ESString& iccProfilePath, ENUM_FK_ERROR_CODE& eError,uint32_t un32JpegQuality) + { + eError = kFKNoError; + if (m_bStarted || !OpenOutFileWithPath(&path, appendMode)){ +@@ -210,7 +210,7 @@ BOOL FKTiffEncodeUtil::StartWithPath(ESString& path, E + m_nSamplesPerPixel = samplesPerPixel; + m_nBytesPerLine = ES_IMAGE_INFO::GetESImageBytesPerRow(imageInfo); + m_nCompressionType = compression; +- uint32 colorSpace = GetTiffColorSpace(samplesPerPixel, compression); ++ uint32_t colorSpace = GetTiffColorSpace(samplesPerPixel, compression); + if (TIFFSetField(m_pOutFile, TIFFTAG_IMAGEWIDTH, imageWidth) != 1) { + ES_ErrorBailWithAction(FALSE, BAIL, this, eError = kFKTiffSetFieldError, ES_STRING("TIFFSetField TIFFTAG_IMAGEWIDTH fails")); + } diff --git a/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_TiffUtil_FKTiffEncodeUtil.h b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_TiffUtil_FKTiffEncodeUtil.h new file mode 100644 index 000000000000..2b981aa00a3a --- /dev/null +++ b/graphics/epsonscan2/files/patch-src_ES2FileFormat_Source_TiffUtil_FKTiffEncodeUtil.h @@ -0,0 +1,13 @@ +--- src/ES2FileFormat/Source/TiffUtil/FKTiffEncodeUtil.h.orig 2024-09-12 07:10:33 UTC ++++ src/ES2FileFormat/Source/TiffUtil/FKTiffEncodeUtil.h +@@ -25,8 +25,8 @@ class FKTiffEncodeUtil (public) + public: + FKTiffEncodeUtil(); + virtual ~FKTiffEncodeUtil(); +- BOOL StartWithPath(ESString& path, ESImageInfo& imageInfo, uint32 compression, BOOL appendMode, +- ESString& iccProfilePath, ENUM_FK_ERROR_CODE& eError,uint32 un32JpegQuality); ++ BOOL StartWithPath(ESString& path, ESImageInfo& imageInfo, uint32_t compression, BOOL appendMode, ++ ESString& iccProfilePath, ENUM_FK_ERROR_CODE& eError,uint32_t un32JpegQuality); + virtual BOOL WriteScanlinesWithData(const ES_CMN_FUNCS::BUFFER::IESBuffer& cData, ENUM_FK_ERROR_CODE& eError); + virtual BOOL FinalizeAndReturnError(ENUM_FK_ERROR_CODE& eError); + protected: diff --git a/graphics/epsonscan2/files/patch-src_Platform.cpp b/graphics/epsonscan2/files/patch-src_Platform.cpp index 0e2bdc96e935..ea517ecd15b4 100644 --- a/graphics/epsonscan2/files/patch-src_Platform.cpp +++ b/graphics/epsonscan2/files/patch-src_Platform.cpp @@ -1,6 +1,6 @@ ---- src/Platform.cpp.orig 2021-11-25 00:56:59 UTC +--- src/Platform.cpp.orig 2024-09-12 07:10:37 UTC +++ src/Platform.cpp -@@ -22,6 +22,10 @@ +@@ -19,6 +19,10 @@ #include "Platform.h" #include "CommonUtility/utils/PathUtils.h" #include @@ -11,7 +11,7 @@ #ifndef WIN32 errno_t fopen_s( FILE** pFile, -@@ -105,7 +109,7 @@ DWORD WaitForSingleObject( +@@ -102,7 +106,7 @@ DWORD ES2WaitForSingleObject( case THREAD_HANDLE_ID: { LPTHREAD_HANDLE hThreadHandle = (LPTHREAD_HANDLE) hHandle; @@ -20,7 +20,7 @@ return WAIT_OBJECT_0; } int thread_status = 0; -@@ -121,7 +125,7 @@ DWORD WaitForSingleObject( +@@ -118,7 +122,7 @@ DWORD ES2WaitForSingleObject( { intptr_t lRet = (intptr_t)pStatus; hThreadHandle->dwThreadStatus = (DWORD)lRet; @@ -29,8 +29,8 @@ } } while (EBUSY == thread_status); -@@ -180,7 +184,7 @@ BOOL CloseHandle(HANDLE hObject) - WaitForSingleObject(hObject, INFINITE); +@@ -177,7 +181,7 @@ BOOL CloseHandle(HANDLE hObject) + ES2WaitForSingleObject(hObject, INFINITE); LPTHREAD_HANDLE pThreadHandle = (LPTHREAD_HANDLE)hObject; pThreadHandle->dwThreadStatus = 0; - pThreadHandle->threadID = (int)NULL; @@ -38,19 +38,7 @@ #endif } break; -@@ -347,7 +351,11 @@ DWORD GetModuleFileName(LPTSTR lpFilename, DWORD buf_s - { - DWORD dwRet = 0; - memset(lpFilename, 0, buf_size); -+#ifdef __FreeBSD__ -+ readlink( "/proc/curproc/file", lpFilename, buf_size - 1 ); -+#else - readlink( "/proc/self/exe", lpFilename, buf_size - 1 ); -+#endif - dwRet = (DWORD)strlen(lpFilename); - return dwRet; - } -@@ -397,14 +405,14 @@ errno_t strcat_s( +@@ -325,14 +329,14 @@ errno_t strcat_s( } if (NULL == strSource) { diff --git a/graphics/epsonscan2/files/patch-src_SaneWrapper_backend.cpp b/graphics/epsonscan2/files/patch-src_SaneWrapper_backend.cpp index fdcae3361eca..284ff9fe2498 100644 --- a/graphics/epsonscan2/files/patch-src_SaneWrapper_backend.cpp +++ b/graphics/epsonscan2/files/patch-src_SaneWrapper_backend.cpp @@ -1,37 +1,18 @@ ---- src/SaneWrapper/backend.cpp.orig 2021-11-25 00:56:59 UTC +--- src/SaneWrapper/backend.cpp.orig 2024-09-12 07:10:44 UTC +++ src/SaneWrapper/backend.cpp -@@ -220,7 +220,8 @@ sane_open (SANE_String_Const device_name, SANE_Handle - { - return SANE_STATUS_INVAL; - } -- ((Epson_Scanner*)handle)->out_buffer = NULL; -+ // XXX next causes a SEGV on FreeBSD because out_buffer is not yet allocated -+ //((Epson_Scanner*)handle)->out_buffer = NULL; - if (!epson_backend->sane_dev) - { - const SANE_Device **dev = NULL; -@@ -355,6 +356,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Paramete - unsigned int nSize = 100; - unsigned char* tmp_buf = (unsigned char*)::malloc(nSize); - SDIChar* output_path; +@@ -406,6 +406,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Paramete *** 848 LINES SKIPPED ***