diff options
Diffstat (limited to 'apt-pkg/contrib/gpgv.cc')
| -rw-r--r-- | apt-pkg/contrib/gpgv.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 225acae88..c5ea19aa8 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -28,15 +28,6 @@ #include <apti18n.h> /*}}}*/ -// syntactic sugar to wrap a raw pointer with a custom deleter in a std::unique_ptr -static std::unique_ptr<char, decltype(&free)> make_unique_char(void *const str = nullptr) -{ - return {static_cast<char *>(str), &free}; -} -static std::unique_ptr<FILE, decltype(&fclose)> make_unique_FILE(std::string const &filename, char const *const mode) -{ - return {fopen(filename.c_str(), mode), &fclose}; -} class LineBuffer /*{{{*/ { @@ -207,9 +198,9 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG, } enum { DETACHED, CLEARSIGNED } releaseSignature = (FileGPG != File) ? DETACHED : CLEARSIGNED; - auto sig = make_unique_char(); - auto data = make_unique_char(); - auto conf = make_unique_char(); + std::unique_ptr<char, FreeDeleter> sig; + std::unique_ptr<char, FreeDeleter> data; + std::unique_ptr<char, FreeDeleter> conf; // Dump the configuration so apt-key picks up the correct Dir values { |
