Parcourir la source

dselect: Define several private functions as static

Guillem Jover il y a 17 ans
Parent
commit
ef091557f0
4 fichiers modifiés avec 21 ajouts et 5 suppressions
  1. 6 0
      ChangeLog
  2. 9 3
      dselect/main.cc
  3. 3 1
      dselect/method.cc
  4. 3 1
      dselect/pkgtop.cc

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2009-01-04  Guillem Jover  <guillem@debian.org>
+
+	* dselect/main.cc (findintable, dme, refreshmenu): Make static.
+	* dselect/method.cc (sthfailed): Likewise.
+	* dselect/pkgtop.cc (pkgprioritystring): Likewise.
+
 2008-12-30  Guillem Jover  <guillem@debian.org>
 
 	* lib/ehandle.c (badusage): Move function to ...

+ 9 - 3
dselect/main.cc

@@ -226,7 +226,9 @@ extern "C" {
     expertmode= 1;
   }
 
-  int findintable(const struct table_t *table, const char *item, const char *tablename) {
+  static int
+  findintable(const struct table_t *table, const char *item, const char *tablename)
+  {
     int i;
 
     for (i= 0;  item && (table[i].name!=NULL); i++)
@@ -359,7 +361,9 @@ urqresult urq_list(void) {
   return urqr_normal;
 }
 
-void dme(int i, int so) {
+static void
+dme(int i, int so)
+{
   char buf[120];
   const menuentry *me= &menuentries[i];
   sprintf(buf," %c %d. %-11.11s %-80.80s ",
@@ -375,7 +379,9 @@ void dme(int i, int so) {
   attrset(A_NORMAL);
 }
 
-int refreshmenu(void) {
+static int
+refreshmenu(void)
+{
   char buf[2048];
   static int l,lockfd;
   static char *lockfile;

+ 3 - 1
dselect/method.cc

@@ -58,7 +58,9 @@ static const char *const methoddirectories[]= {
 static char *methodlockfile= 0;
 static int methlockfd= -1;
 
-void sthfailed(const char * reasoning) {
+static void
+sthfailed(const char * reasoning)
+{
   char buf[2048];
 
   curseson();

+ 3 - 1
dselect/pkgtop.cc

@@ -35,7 +35,9 @@
 #include "dselect.h"
 #include "pkglist.h"
 
-const char *pkgprioritystring(const struct pkginfo *pkg) {
+static const char *
+pkgprioritystring(const struct pkginfo *pkg)
+{
   if (pkg->priority == pkginfo::pri_unset) {
     return 0;
   } else if (pkg->priority == pkginfo::pri_other) {