[Reproducible-commits] [dpkg] 18/32: libdpkg: Remove varbuf terminate() method
Jérémy Bobbio
lunar at moszumanska.debian.org
Fri Nov 6 14:02:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.
commit 931d9ade22f16c406769fe90e8397b3b53d15aa8
Author: Guillem Jover <guillem at debian.org>
Date: Sat Oct 17 04:27:40 2015 +0200
libdpkg: Remove varbuf terminate() method
The string() method already NUL terminates the buffer, so there is never
any need to explicitly terminate it beforehand.
---
dselect/methlist.cc | 1 -
dselect/pkginfo.cc | 4 +---
dselect/pkgsublist.cc | 1 -
lib/dpkg/varbuf.h | 10 +---------
4 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/dselect/methlist.cc b/dselect/methlist.cc
index 2eed984..5fe1361 100644
--- a/dselect/methlist.cc
+++ b/dselect/methlist.cc
@@ -206,7 +206,6 @@ void methodlist::redrawinfo() {
itd_description();
- whatinfovb.terminate();
int y,x;
getyx(infopad, y,x);
if (x) y++;
diff --git a/dselect/pkginfo.cc b/dselect/pkginfo.cc
index 70d9f8a..7c4ca86 100644
--- a/dselect/pkginfo.cc
+++ b/dselect/pkginfo.cc
@@ -139,7 +139,6 @@ void packagelist::itd_statuscontrol() {
} else {
varbuf vb;
varbufrecord(&vb,table[cursorline]->pkg,&table[cursorline]->pkg->installed);
- vb.terminate();
debug(dbg_general, "packagelist[%p]::idt_statuscontrol(); '%s'",
this, vb.string());
waddstr(infopad,vb.string());
@@ -155,7 +154,6 @@ void packagelist::itd_availablecontrol() {
} else {
varbuf vb;
varbufrecord(&vb,table[cursorline]->pkg,&table[cursorline]->pkg->available);
- vb.terminate();
debug(dbg_general, "packagelist[%p]::idt_availablecontrol(); '%s'",
this, vb.string());
waddstr(infopad,vb.string());
@@ -177,7 +175,7 @@ void packagelist::redrawinfo() {
this, (int)(currentinfo - baseinfo));
(this->*currentinfo->display)();
- whatinfovb.terminate();
+
int y,x;
getyx(infopad, y,x);
if (x) y++;
diff --git a/dselect/pkgsublist.cc b/dselect/pkgsublist.cc
index 4e9bac5..283864b 100644
--- a/dselect/pkgsublist.cc
+++ b/dselect/pkgsublist.cc
@@ -76,7 +76,6 @@ void packagelist::add(pkginfo *pkg, const char *extrainfo, showpriority showimp)
add(pkg); if (!pkg->clientdata) return;
if (pkg->clientdata->dpriority < showimp) pkg->clientdata->dpriority= showimp;
pkg->clientdata->relations(extrainfo);
- pkg->clientdata->relations.terminate();
}
bool
diff --git a/lib/dpkg/varbuf.h b/lib/dpkg/varbuf.h
index ebadf08..a6991f8 100644
--- a/lib/dpkg/varbuf.h
+++ b/lib/dpkg/varbuf.h
@@ -64,7 +64,6 @@ struct varbuf {
void destroy();
void operator()(int c);
void operator()(const char *s);
- void terminate(void/*to shut 2.6.3 up*/);
const char *string();
#endif
};
@@ -144,17 +143,10 @@ varbuf::operator()(const char *s)
varbuf_add_str(this, s);
}
-inline void
-varbuf::terminate(void/*to shut 2.6.3 up*/)
-{
- varbuf_end_str(this);
-}
-
inline const char *
varbuf::string()
{
- terminate();
- return buf;
+ return varbuf_get_str(this);
}
#endif
--
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