diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-04-08 12:35:36 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-04-08 12:35:36 +0300 |
commit | 2bb4618fa107dc6b02a4eb64e42d0021eca2a9e9 (patch) | |
tree | cc0fa74fffc0ea2f71806a43017f725090219ecc /rpmdb | |
parent | 6f619206fd13c6f0d90f143ec829312da4f81c48 (diff) | |
download | librpm-tizen-2bb4618fa107dc6b02a4eb64e42d0021eca2a9e9.tar.gz librpm-tizen-2bb4618fa107dc6b02a4eb64e42d0021eca2a9e9.tar.bz2 librpm-tizen-2bb4618fa107dc6b02a4eb64e42d0021eca2a9e9.zip |
Eliminate four copy-paste versions of nibble(), stick to rpmstring.h
- the one in signature.c wasn't even used...
Diffstat (limited to 'rpmdb')
-rw-r--r-- | rpmdb/rpmdb.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index d00cdfa3a..6f96ade01 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -87,22 +87,6 @@ static inline pbm_set * PBM_REALLOC(pbm_set ** sp, int * odp, int nd) return *sp; } -/** - * Convert hex to binary nibble. - * @param c hex character - * @return binary nibble - */ -static inline unsigned char nibble(char c) -{ - if (c >= '0' && c <= '9') - return (c - '0'); - if (c >= 'A' && c <= 'F') - return (c - 'A') + 10; - if (c >= 'a' && c <= 'f') - return (c - 'a') + 10; - return 0; -} - #ifdef DYING /** * Check key for printable characters. @@ -2574,7 +2558,7 @@ if (dbiByteSwapped(dbi) == 1) s = rpmvals[i]; t = bin; for (j = 0; j < 16; j++, t++, s += 2) - *t = (nibble(s[0]) << 4) | nibble(s[1]); + *t = (rnibble(s[0]) << 4) | rnibble(s[1]); key->data = bin; key->size = 16; break; @@ -2977,7 +2961,7 @@ data->size = 0; s = rpmvals[i]; t = bin; for (j = 0; j < 16; j++, t++, s += 2) - *t = (nibble(s[0]) << 4) | nibble(s[1]); + *t = (rnibble(s[0]) << 4) | rnibble(s[1]); key->data = bin; key->size = 16; break; |