[dpkg] 123/187: dselect: Move C++ support code into its own file
Reiner Herrmann
reiner at reiner-h.de
Sun Nov 6 12:46:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
deki-guest pushed a commit to branch master
in repository dpkg.
commit 2ca60a4d810dac811613e2c17bb0c28fc523dad4
Author: Guillem Jover <guillem at debian.org>
Date: Wed Sep 7 04:37:25 2016 +0200
dselect: Move C++ support code into its own file
---
debian/changelog | 1 +
dselect/Makefile.am | 1 +
dselect/cxx-support.cc | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
dselect/main.cc | 21 --------------------
4 files changed, 55 insertions(+), 21 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 2c479ab..80b2582 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -40,6 +40,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
the vsnprintf() call on the emergency buffer truncates the output.
* Fix free() on uninitialized pointer in error_context_errmsg_format() in
libdpkg. Regression introduced in dpkg 1.18.7. Closes: #842004
+ * Move C++ support code into its own file.
* Architecture support:
- Add support for AIX operating system.
* Portability:
diff --git a/dselect/Makefile.am b/dselect/Makefile.am
index 885dbbc..9c14f86 100644
--- a/dselect/Makefile.am
+++ b/dselect/Makefile.am
@@ -22,6 +22,7 @@ AM_CXXFLAGS = \
bin_PROGRAMS = dselect
dselect_SOURCES = \
+ cxx-support.cc \
dselect.h \
dselect-curses.h \
basecmds.cc \
diff --git a/dselect/cxx-support.cc b/dselect/cxx-support.cc
new file mode 100644
index 0000000..235a4a7
--- /dev/null
+++ b/dselect/cxx-support.cc
@@ -0,0 +1,53 @@
+/*
+ * dselect - Debian package maintenance user interface
+ * cxx-support.cc - C++ support code for dselect
+ *
+ * Copyright © 1994-1996 Ian Jackson <ijackson at chiark.greenend.org.uk>
+ * Copyright © 2006-2015 Guillem Jover <guillem at debian.org>
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include <compat.h>
+
+#include <sys/types.h>
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include <dpkg/dpkg.h>
+
+extern void *
+operator new(size_t size) DPKG_ATTR_THROW(std::bad_alloc)
+{
+ void *p;
+
+ p = m_malloc(size);
+ assert(p);
+
+ return p;
+}
+
+extern void
+operator delete(void *p) DPKG_ATTR_NOEXCEPT
+{
+ free(p);
+}
+
+extern void
+operator delete(void *p, size_t size) DPKG_ATTR_NOEXCEPT
+{
+ free(p);
+}
diff --git a/dselect/main.cc b/dselect/main.cc
index 9808774..55ced33 100644
--- a/dselect/main.cc
+++ b/dselect/main.cc
@@ -354,27 +354,6 @@ void cursesoff() {
cursesareon = false;
}
-extern void *
-operator new(size_t size) DPKG_ATTR_THROW(std::bad_alloc)
-{
- void *p;
- p= m_malloc(size);
- assert(p);
- return p;
-}
-
-extern void
-operator delete(void *p) DPKG_ATTR_NOEXCEPT
-{
- free(p);
-}
-
-extern void
-operator delete(void *p, size_t size) DPKG_ATTR_NOEXCEPT
-{
- free(p);
-}
-
urqresult urq_list(void) {
modstatdb_open((modstatdb_rw)(msdbrw_writeifposs |
msdbrw_available_readonly));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list