From d394a8e5a57e98bead51db0e26bee1fdedd8b2c4 Mon Sep 17 00:00:00 2001 From: jbeich Date: Sun, 21 Jan 2018 02:22:41 +0000 Subject: [PATCH] security/veracrypt: unbreak build with wxWidgets 3.0.3 TextUserInterface.cpp:122:5: error: const_cast from 'const wxScopedWCharBuffer' (aka 'const wxScopedCharTypeBuffer') to 'wchar_t *' is not allowed const_cast (passwordStr.wc_str())[i] = L'X'; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PR: 223758 Submitted by: rozhuk.im@gmail.com Approved by: maintainer timeout (2 months) --- security/veracrypt/Makefile | 1 + .../files/patch-src_Main_TextUserInterface.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 security/veracrypt/files/patch-src_Main_TextUserInterface.cpp diff --git a/security/veracrypt/Makefile b/security/veracrypt/Makefile index 378d74cbfcc5..19b67f80969c 100644 --- a/security/veracrypt/Makefile +++ b/security/veracrypt/Makefile @@ -2,6 +2,7 @@ PORTNAME= veracrypt PORTVERSION= 1.21 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= SF/${PORTNAME}/${PORTNAME:S/v/V/:S/c/C/}%20${PORTVERSION}/ DISTNAME= ${PORTNAME:S/v/V/:S/c/C/}_${PORTVERSION}_Source diff --git a/security/veracrypt/files/patch-src_Main_TextUserInterface.cpp b/security/veracrypt/files/patch-src_Main_TextUserInterface.cpp new file mode 100644 index 000000000000..f82c1140b6db --- /dev/null +++ b/security/veracrypt/files/patch-src_Main_TextUserInterface.cpp @@ -0,0 +1,15 @@ +TextUserInterface.cpp:122:5: error: const_cast from 'const wxScopedWCharBuffer' (aka 'const wxScopedCharTypeBuffer') to 'wchar_t *' is not allowed + const_cast (passwordStr.wc_str())[i] = L'X'; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +--- src/Main/TextUserInterface.cpp.orig 2017-07-09 22:31:19 UTC ++++ src/Main/TextUserInterface.cpp +@@ -119,7 +119,7 @@ namespace VeraCrypt + for (size_t i = 0; i < length && i < VolumePassword::MaxSize; ++i) + { + passwordBuf[i] = (wchar_t) passwordStr[i]; +- const_cast (passwordStr.wc_str())[i] = L'X'; ++ passwordStr[i] = L'X'; + } + + if (verify && verPhase)