This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=3ed7438c4c9f8180774e5b4fbefe7d3fc4483b18

commit 3ed7438c4c9f8180774e5b4fbefe7d3fc4483b18
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Jul 23 02:45:43 2024 +0200

    dselect: Switch from operator() to operator+=
    
    These are very confusing as they resemble constructors.
    
    Changelog: internal
---
 dselect/baselist.cc   |  2 +-
 dselect/methlist.cc   |  2 +-
 dselect/methparse.cc  |  6 +++---
 dselect/pkgdepcon.cc  |  4 ++--
 dselect/pkginfo.cc    | 11 +++++------
 dselect/pkgsublist.cc | 34 +++++++++++++++++-----------------
 6 files changed, 29 insertions(+), 30 deletions(-)

diff --git a/dselect/baselist.cc b/dselect/baselist.cc
index cb40ddeea..c7d2c6565 100644
--- a/dselect/baselist.cc
+++ b/dselect/baselist.cc
@@ -284,7 +284,7 @@ baselist::baselist(keybindings *kb) {
 }
 
 void baselist::itd_keys() {
-  whatinfovb(_("Keybindings"));
+  whatinfovb += _("Keybindings");
 
   const int givek= xmax/3;
   bindings->describestart();
diff --git a/dselect/methlist.cc b/dselect/methlist.cc
index 7a742a253..ed59385c3 100644
--- a/dselect/methlist.cc
+++ b/dselect/methlist.cc
@@ -187,7 +187,7 @@ quitaction methodlist::display() {
 }
 
 void methodlist::itd_description() {
-  whatinfovb(_("Explanation"));
+  whatinfovb += _("Explanation");
 
   wattrset(infopad, part_attr[info_head]);
   waddstr(infopad, table[cursorline]->name);
diff --git a/dselect/methparse.cc b/dselect/methparse.cc
index 8e98cf78d..3d5a4ea7b 100644
--- a/dselect/methparse.cc
+++ b/dselect/methparse.cc
@@ -154,7 +154,7 @@ void readmethods(const char *pathbase, dselect_option 
**optionspp, int *nread) {
       do {
         if (!c_isdigit(c))
           badmethod(pathbuf, _("non-digit where digit wanted"));
-        vb(c);
+        vb += c;
         c= fgetc(names);
         if (c == EOF)
           eofmethod(pathbuf, names, _("end of file in index string"));
@@ -174,7 +174,7 @@ void readmethods(const char *pathbase, dselect_option 
**optionspp, int *nread) {
       do {
         if (!c_isalnum(c) && c != '_')
           badmethod(pathbuf, _("non-alphanum in option name"));
-        vb(c);
+        vb += c;
         c= fgetc(names);
         if (c == EOF)
           eofmethod(pathbuf, names, _("end of file in option name"));
@@ -189,7 +189,7 @@ void readmethods(const char *pathbase, dselect_option 
**optionspp, int *nread) {
       } while (c_isspace(c));
       vb.reset();
       do {
-        vb(c);
+        vb += c;
         c= fgetc(names);
         if (c == EOF)
           eofmethod(pathbuf, names, _("end of file in summary - missing 
newline"));
diff --git a/dselect/pkgdepcon.cc b/dselect/pkgdepcon.cc
index eeb9e8bb7..b37241f2b 100644
--- a/dselect/pkgdepcon.cc
+++ b/dselect/pkgdepcon.cc
@@ -228,8 +228,8 @@ int packagelist::resolvedepcon(dependency *depends) {
     varbuf pkg_names;
 
     for (possi = depends->list; possi; possi = possi->next) {
-      pkg_names(' ');
-      pkg_names(possi->ed->name);
+      pkg_names += ' ';
+      pkg_names += possi->ed->name;
     }
 
     debug(dbg_depcon,
diff --git a/dselect/pkginfo.cc b/dselect/pkginfo.cc
index 2240f330b..d4eb904a0 100644
--- a/dselect/pkginfo.cc
+++ b/dselect/pkginfo.cc
@@ -80,8 +80,7 @@ const packagelist::infotype *const packagelist::baseinfo= 
infoinfos;
 
 void packagelist::severalinfoblurb()
 {
-  varbuf vb;
-  vb(_("The line you have highlighted represents many packages; "
+  varbuf vb(_("The line you have highlighted represents many packages; "
      "if you ask to install, remove, hold, etc. it you will affect all "
      "the packages which match the criterion shown.\n"
      "\n"
@@ -94,7 +93,7 @@ void packagelist::severalinfoblurb()
 }
 
 void packagelist::itd_relations() {
-  whatinfovb(_("Interrelationships"));
+  whatinfovb += _("Interrelationships");
 
   if (table[cursorline]->pkg->set->name) {
     debug(dbg_general, "packagelist[%p]::idt_relations(); '%s'",
@@ -106,7 +105,7 @@ void packagelist::itd_relations() {
 }
 
 void packagelist::itd_description() {
-  whatinfovb(_("Description"));
+  whatinfovb += _("Description");
 
   if (table[cursorline]->pkg->set->name) {
     const char *m= table[cursorline]->pkg->available.description;
@@ -132,7 +131,7 @@ void packagelist::itd_description() {
 }
 
 void packagelist::itd_statuscontrol() {
-  whatinfovb(_("Installed control file information"));
+  whatinfovb += _("Installed control file information");
 
   werase(infopad);
   if (!table[cursorline]->pkg->set->name) {
@@ -148,7 +147,7 @@ void packagelist::itd_statuscontrol() {
 }
 
 void packagelist::itd_availablecontrol() {
-  whatinfovb(_("Available control file information"));
+  whatinfovb += _("Available control file information");
 
   werase(infopad);
   if (!table[cursorline]->pkg->set->name) {
diff --git a/dselect/pkgsublist.cc b/dselect/pkgsublist.cc
index ceb71495a..b56b05407 100644
--- a/dselect/pkgsublist.cc
+++ b/dselect/pkgsublist.cc
@@ -74,7 +74,7 @@ void packagelist::add(pkginfo *pkg, const char *extrainfo, 
showpriority showimp)
         this, pkg_name(pkg, pnaw_always), showimp);
   add(pkg);  if (!pkg->clientdata) return;
   if (pkg->clientdata->dpriority < showimp) pkg->clientdata->dpriority= 
showimp;
-  pkg->clientdata->relations(extrainfo);
+  pkg->clientdata->relations += extrainfo;
 }
 
 bool
@@ -109,8 +109,8 @@ void packagelist::addunavailable(deppossi *possi) {
               pkg_name(possi->up->up, pnaw_always));
 
   varbuf& vb= possi->up->up->clientdata->relations;
-  vb(possi->ed->name);
-  vb(_(" does not appear to be available\n"));
+  vb += possi->ed->name;
+  vb += _(" does not appear to be available\n");
 }
 
 bool
@@ -123,41 +123,41 @@ packagelist::add(dependency *depends, showpriority 
displayimportance)
 
   const char *comma= "";
   varbuf depinfo;
-  depinfo(depends->up->set->name);
-  depinfo(' ');
-  depinfo(gettext(relatestrings[depends->type]));
-  depinfo(' ');
+  depinfo += depends->up->set->name;
+  depinfo += ' ';
+  depinfo += gettext(relatestrings[depends->type]);
+  depinfo += ' ';
   deppossi *possi;
   for (possi=depends->list;
        possi;
        possi=possi->next, comma=(possi && possi->next ? ", " : _(" or "))) {
-    depinfo(comma);
-    depinfo(possi->ed->name);
+    depinfo += comma;
+    depinfo += possi->ed->name;
     if (possi->verrel != DPKG_RELATION_NONE) {
       switch (possi->verrel) {
       case DPKG_RELATION_LE:
-        depinfo(" (<= ");
+        depinfo += " (<= ";
         break;
       case DPKG_RELATION_GE:
-        depinfo(" (>= ");
+        depinfo += " (>= ";
         break;
       case DPKG_RELATION_LT:
-        depinfo(" (<< ");
+        depinfo += " (<< ";
         break;
       case DPKG_RELATION_GT:
-        depinfo(" (>> ");
+        depinfo += " (>> ";
         break;
       case DPKG_RELATION_EQ:
-        depinfo(" (= ");
+        depinfo += " (= ";
         break;
       default:
         internerr("unknown dpkg_relation %d", possi->verrel);
       }
-      depinfo(versiondescribe(&possi->version, vdew_nonambig));
-      depinfo(")");
+      depinfo += versiondescribe(&possi->version, vdew_nonambig);
+      depinfo += ")";
     }
   }
-  depinfo('\n');
+  depinfo += '\n';
   add(depends->up, depinfo.str(), displayimportance);
   for (possi=depends->list; possi; possi=possi->next) {
     add(&possi->ed->pkg, depinfo.str(), displayimportance);

-- 
Dpkg.Org's dpkg

Reply via email to