[Rpm-maint] [PATCH] Removed useless 'xx' integer usage.

Rakesh Pandit rakesh.pandit at gmail.com
Thu Apr 23 21:04:23 UTC 2009


headerNVR and rpmtsSetNotifyCallback always return 0.

Link: http://rakesh.fedorapeople.org/rpm/0002-Removed-useless-xx-integer-usage.patch
Removed useless 'xx' integer usage.

-- 
rakesh

>From e0f4e1ffe0d92bce0fb828f57f4e2bbd5f4833fb Mon Sep 17 00:00:00 2001
From: Rakesh Pandit <rakesh at fedoraproject.org>
Date: Fri, 24 Apr 2009 02:24:29 +0530
Subject: [PATCH] Removed useless 'xx' integer usage.

---
 lib/rpminstall.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index c953a21..c6b5e36 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -104,7 +104,6 @@ void * rpmShowProgress(const void * arg,
     void * rc = NULL;
     const char * filename = (const char *)key;
     static FD_t fd = NULL;
-    int xx;

     switch (what) {
     case RPMCALLBACK_INST_OPEN_FILE:
@@ -116,7 +115,7 @@ void * rpmShowProgress(const void * arg,
 	    rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), filename,
 			Fstrerror(fd));
 	    if (fd != NULL) {
-		xx = Fclose(fd);
+		Fclose(fd);
 		fd = NULL;
 	    }
 	} else
@@ -128,7 +127,7 @@ void * rpmShowProgress(const void * arg,
 	/* FIX: still necessary? */
 	fd = fdFree(fd, RPMDBG_M("persist (showProgress)"));
 	if (fd != NULL) {
-	    xx = Fclose(fd);
+	    Fclose(fd);
 	    fd = NULL;
 	}
 	break;
@@ -208,11 +207,11 @@ void * rpmShowProgress(const void * arg,
 static void setNotifyFlag(struct rpmInstallArguments_s * ia,
 			  rpmts ts)
 {
-    int notifyFlags, xx;
+    int notifyFlags;

     notifyFlags = ia->installInterfaceFlags | (rpmIsVerbose() ?
INSTALL_LABEL : 0 );
-    xx = rpmtsSetNotifyCallback(ts,
-				rpmShowProgress, (void *) ((long)notifyFlags));
+    rpmtsSetNotifyCallback(ts,
+			   rpmShowProgress, (void *) ((long)notifyFlags));
 }

 struct rpmEIU {
@@ -292,7 +291,7 @@ static int rpmcliTransaction(rpmts ts, struct
rpmInstallArguments_s * ia,

 static int tryReadManifest(struct rpmEIU * eiu)
 {
-    int rc, xx;
+    int rc;

     /* Try to read a package manifest. */
     FD_t fd = Fopen(*eiu->fnp, "r.fpio");
@@ -300,7 +299,7 @@ static int tryReadManifest(struct rpmEIU * eiu)
         rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), *eiu->fnp,
 	       Fstrerror(fd));
 	if (fd != NULL) {
-	    xx = Fclose(fd);
+	    Fclose(fd);
 	    fd = NULL;
 	}
 	eiu->numFailed++; *eiu->fnp = NULL;
@@ -312,7 +311,7 @@ static int tryReadManifest(struct rpmEIU * eiu)
     if (rc != RPMRC_OK)
         rpmlog(RPMLOG_ERR, _("%s: not an rpm package (or package
manifest): %s\n"),
 	       *eiu->fnp, Fstrerror(fd));
-    xx = Fclose(fd);
+    Fclose(fd);
     fd = NULL;

     if (rc != RPMRC_OK)
@@ -395,7 +394,6 @@ int rpmInstall(rpmts ts, struct
rpmInstallArguments_s * ia, ARGV_t fileArgv)
     char * fileURL = NULL;
     rpmVSFlags vsflags, ovsflags;
     int rc;
-    int xx;
     int i;

     if (fileArgv == NULL) goto exit;
@@ -546,7 +544,7 @@ restart:
 		rpmtdFreeData(&prefixes);
 	    } else {
 		const char * name;
-		xx = headerNVR(eiu->h, &name, NULL, NULL);
+		headerNVR(eiu->h, &name, NULL, NULL);
 		rpmlog(RPMLOG_ERR,
 			       _("package %s is not relocatable\n"), name);
 		eiu->numFailed++;
-- 
1.6.0.6


More information about the Rpm-maint mailing list