summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-12-14 12:54:35 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-12-14 12:54:35 +0200
commit0c8401abff5eef9d94ae9f124a7ccf639b12acbd (patch)
tree340e55157d6f4fb2f36724d936873e847b6b2574
parent8946859700432de2f8462b672a7d3d3790b09a76 (diff)
downloadrpm-0c8401abff5eef9d94ae9f124a7ccf639b12acbd.tar.gz
rpm-0c8401abff5eef9d94ae9f124a7ccf639b12acbd.tar.bz2
rpm-0c8401abff5eef9d94ae9f124a7ccf639b12acbd.zip
Yet more type-pedantry...
- use rpm_tag_t for signature tag types too - size_t, not rpm_count_t in signature generation - add couple of explicit casts to rpmpgp.h to avoid spurious noise from inlined functions
-rw-r--r--lib/signature.c16
-rw-r--r--lib/signature.h2
-rw-r--r--rpmio/rpmpgp.h4
3 files changed, 11 insertions, 11 deletions
diff --git a/lib/signature.c b/lib/signature.c
index 1da1a78f1..c465cd8ff 100644
--- a/lib/signature.c
+++ b/lib/signature.c
@@ -342,7 +342,7 @@ Header rpmFreeSignature(Header sigh)
* @param passPhrase private key pass phrase
* @return 0 on success, 1 on failure
*/
-static int makePGPSignature(const char * file, int32_t * sigTagp,
+static int makePGPSignature(const char * file, rpm_tag_t * sigTagp,
uint8_t ** pktp, size_t * pktlenp,
const char * passPhrase)
{
@@ -473,7 +473,7 @@ static int makePGPSignature(const char * file, int32_t * sigTagp,
* @param passPhrase private key pass phrase
* @return 0 on success, 1 on failure
*/
-static int makeGPGSignature(const char * file, int32_t * sigTagp,
+static int makeGPGSignature(const char * file, rpm_tag_t * sigTagp,
uint8_t ** pktp, size_t * pktlenp,
const char * passPhrase)
{
@@ -608,13 +608,13 @@ static int makeGPGSignature(const char * file, int32_t * sigTagp,
* @param passPhrase private key pass phrase
* @return 0 on success, -1 on failure
*/
-static int makeHDRSignature(Header sigh, const char * file, int32_t sigTag,
+static int makeHDRSignature(Header sigh, const char * file, rpm_tag_t sigTag,
const char * passPhrase)
{
Header h = NULL;
FD_t fd = NULL;
uint8_t * pkt;
- rpm_count_t pktlen;
+ size_t pktlen;
const char * fn = NULL;
const char * SHA1 = NULL;
int ret = -1; /* assume failure. */
@@ -711,12 +711,12 @@ exit:
return ret;
}
-int rpmAddSignature(Header sigh, const char * file, int32_t sigTag,
+int rpmAddSignature(Header sigh, const char * file, rpm_tag_t sigTag,
const char * passPhrase)
{
struct stat st;
uint8_t * pkt;
- rpm_count_t pktlen;
+ size_t pktlen;
int ret = -1; /* assume failure. */
switch (sigTag) {
@@ -764,7 +764,7 @@ int rpmAddSignature(Header sigh, const char * file, int32_t sigTag,
return ret;
}
-static int checkPassPhrase(const char * passPhrase, const int sigTag)
+static int checkPassPhrase(const char * passPhrase, const rpm_tag_t sigTag)
{
int passPhrasePipe[2];
int pid, status;
@@ -861,7 +861,7 @@ static int checkPassPhrase(const char * passPhrase, const int sigTag)
return ((!WIFEXITED(status) || WEXITSTATUS(status)) ? 1 : 0);
}
-char * rpmGetPassPhrase(const char * prompt, const int sigTag)
+char * rpmGetPassPhrase(const char * prompt, const rpm_tag_t sigTag)
{
char *pass = NULL;
int aok = 0;
diff --git a/lib/signature.h b/lib/signature.h
index 213156e27..d02580cbb 100644
--- a/lib/signature.h
+++ b/lib/signature.h
@@ -65,7 +65,7 @@ int rpmWriteSignature(FD_t fd, Header h);
* @return 0 on success, -1 on failure
*/
int rpmAddSignature(Header sigh, const char * file,
- int32_t sigTag, const char * passPhrase);
+ rpm_tag_t sigTag, const char * passPhrase);
/******************************************************************/
diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h
index 30e3b9b3f..7730b6d56 100644
--- a/rpmio/rpmpgp.h
+++ b/rpmio/rpmpgp.h
@@ -999,7 +999,7 @@ size_t pgpLen(const uint8_t *s, size_t * lenp)
(*lenp) = ((((unsigned)s[0]) - 192) << 8) + s[1] + 192;
return 2;
} else {
- (*lenp) = pgpGrab(s+1, 4);
+ (*lenp) = pgpGrab(s+1, (size_t) 4);
return 5;
}
}
@@ -1074,7 +1074,7 @@ const char * pgpMpiStr(const uint8_t *p)
{
static char prbuf[8*BUFSIZ]; /* XXX ick */
char *t = prbuf;
- sprintf(t, "[%4u]: ", pgpGrab(p, 2));
+ sprintf(t, "[%4u]: ", pgpGrab(p, (size_t) 2));
t += strlen(t);
t = pgpHexCvt(t, p+2, pgpMpiLen(p)-2);
return prbuf;