Parcourir la source

dpkg: Rename newconff_append() to filenamenode_queue_push()

The function is not conffile specific, so let's make that clear.
Rename also the local variables to make sense in the new context.
Guillem Jover il y a 11 ans
Parent
commit
bbe34bf13e
3 fichiers modifiés avec 13 ajouts et 13 suppressions
  1. 9 9
      src/archives.c
  2. 2 2
      src/main.h
  3. 2 2
      src/unpack.c

+ 9 - 9
src/archives.c

@@ -1759,17 +1759,17 @@ wanttoinstall(struct pkginfo *pkg)
 }
 
 struct fileinlist *
-newconff_append(struct filenamenode_queue *queue,
-                struct filenamenode *namenode)
+filenamenode_queue_push(struct filenamenode_queue *queue,
+                        struct filenamenode *namenode)
 {
-  struct fileinlist *newconff;
+  struct fileinlist *node;
 
-  newconff= m_malloc(sizeof(struct fileinlist));
-  newconff->next = NULL;
-  newconff->namenode= namenode;
+  node = m_malloc(sizeof(*node));
+  node->next = NULL;
+  node->namenode = namenode;
 
-  *queue->tail = newconff;
-  queue->tail = &newconff->next;
+  *queue->tail = node;
+  queue->tail = &node->next;
 
-  return newconff;
+  return node;
 }

+ 2 - 2
src/main.h

@@ -152,8 +152,8 @@ void process_archive(const char *filename);
 bool wanttoinstall(struct pkginfo *pkg);
 
 struct fileinlist *
-newconff_append(struct filenamenode_queue *queue,
-                struct filenamenode *namenode);
+filenamenode_queue_push(struct filenamenode_queue *queue,
+                        struct filenamenode *namenode);
 
 /* from update.c */
 

+ 2 - 2
src/unpack.c

@@ -639,7 +639,7 @@ void process_archive(const char *filename) {
       *p = '\0';
       namenode= findnamenode(conffilenamebuf, 0);
       namenode->oldhash= NEWCONFFILEFLAG;
-      newconff = newconff_append(&newconffiles, namenode);
+      newconff = filenamenode_queue_push(&newconffiles, namenode);
 
       /* Let's see if any packages have this file. If they do we
        * check to see if they listed it as a conffile, and if they did
@@ -1104,7 +1104,7 @@ void process_archive(const char *filename) {
 	  debug(dbg_eachfile, "process_archive: old conff %s"
 		" is disappearing", namenode->name);
 	  namenode->flags |= fnnf_obs_conff;
-	  newconff_append(&newconffiles, namenode);
+	  filenamenode_queue_push(&newconffiles, namenode);
 	  addfiletolist(&tc, namenode);
 	}
 	continue;