The following commit has been merged in the master branch:
commit d6a922fd1d61ea1e0448fb262f1a182cd6268346
Author: Guillem Jover <[email protected]>
Date:   Sun Jan 4 17:08:47 2009 +0200

    libdpkg: Make trig argument in some functions const
    
    And we can thus remove a bogus cast.

diff --git a/ChangeLog b/ChangeLog
index f6f598b..a49c2f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-01-04  Guillem Jover  <[email protected]>
 
+       * lib/dpkg-db.h (trig_note_pend_core, trig_note_pend): Make trig
+       argument const.
+       * lib/triglib.c (trig_record_activation): Likewise.
+       (trig_file_activate): Remove now unneeded cast in
+       trig_record_activation call.
+
+2009-01-04  Guillem Jover  <[email protected]>
+
        * lib/myopt.h (MAX_CONFIG_LINE): New macro.
        * lib/myopt.c (myfileopt): Use MAX_CONFIG_LINE instead of
        MAXDIVERTFILENAME.
diff --git a/lib/dpkg-db.h b/lib/dpkg-db.h
index ea758c9..9111bee 100644
--- a/lib/dpkg-db.h
+++ b/lib/dpkg-db.h
@@ -293,8 +293,8 @@ extern struct trig_hooks trigh;
 void trig_file_activate_byname(const char *trig, struct pkginfo *aw);
 void trig_file_activate(struct filenamenode *trig, struct pkginfo *aw);
 
-int trig_note_pend_core(struct pkginfo *pend, char *trig /*not copied!*/);
-int trig_note_pend(struct pkginfo *pend, char *trig /*not copied!*/);
+int trig_note_pend_core(struct pkginfo *pend, const char *trig /*not 
copied!*/);
+int trig_note_pend(struct pkginfo *pend, const char *trig /*not copied!*/);
 int trig_note_aw(struct pkginfo *pend, struct pkginfo *aw);
 void trig_clear_awaiters(struct pkginfo *notpend);
 
diff --git a/lib/triglib.c b/lib/triglib.c
index fd5f0aa..34312bf 100644
--- a/lib/triglib.c
+++ b/lib/triglib.c
@@ -75,7 +75,7 @@ illegal_triggername(const char *p)
 
 /* aw might be NULL, and trig is not copied! */
 static void
-trig_record_activation(struct pkginfo *pend, struct pkginfo *aw, char *trig)
+trig_record_activation(struct pkginfo *pend, struct pkginfo *aw, const char 
*trig)
 {
        if (pend->status < stat_triggersawaited)
                /* Not interested then. */
@@ -97,7 +97,7 @@ trig_record_activation(struct pkginfo *pend, struct pkginfo 
*aw, char *trig)
 
 /* NB that this is also called from fields.c where *pend is a temporary! */
 int
-trig_note_pend_core(struct pkginfo *pend, char *trig /*not copied!*/)
+trig_note_pend_core(struct pkginfo *pend, const char *trig /*not copied!*/)
 {
        struct trigpend *tp;
 
@@ -115,7 +115,7 @@ trig_note_pend_core(struct pkginfo *pend, char *trig /*not 
copied!*/)
 
 /* Returns: 1 for done, 0 for already noted. */
 int
-trig_note_pend(struct pkginfo *pend, char *trig /*not copied!*/)
+trig_note_pend(struct pkginfo *pend, const char *trig /*not copied!*/)
 {
        if (!trig_note_pend_core(pend, trig))
                return 0;
@@ -566,7 +566,7 @@ trig_file_activate(struct filenamenode *trig, struct 
pkginfo *aw)
 
        for (tfi = *trigh.namenode_interested(trig); tfi;
             tfi = tfi->samefile_next)
-               trig_record_activation(tfi->pkg, aw, 
(char*)trigh.namenode_name(trig));
+               trig_record_activation(tfi->pkg, aw, trigh.namenode_name(trig));
 }
 
 static void

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to