summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-12-19 14:13:34 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-12-19 14:13:34 +0200
commit44c90ce3f0c5f4686338b4b746b9bece8510d757 (patch)
treea92ba135ac49df627f4b0e0cfa2377c53850ddb2
parent5bd20cf9db51053ff8d72a306e6296c8c744856f (diff)
downloadlibrpm-tizen-44c90ce3f0c5f4686338b4b746b9bece8510d757.tar.gz
librpm-tizen-44c90ce3f0c5f4686338b4b746b9bece8510d757.tar.bz2
librpm-tizen-44c90ce3f0c5f4686338b4b746b9bece8510d757.zip
Const-pedantry here and there...
-rw-r--r--lib/rpmrc.c4
-rw-r--r--lib/transaction.c7
-rw-r--r--rpmdb/header.c8
-rw-r--r--rpmdb/tagname.c8
4 files changed, 14 insertions, 13 deletions
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
index a1533aba8..37d21e740 100644
--- a/lib/rpmrc.c
+++ b/lib/rpmrc.c
@@ -162,8 +162,8 @@ static void rpmRebuildTargetVars(const char **target, const char ** canontarget)
static int optionCompare(const void * a, const void * b)
{
- return xstrcasecmp(((struct rpmOption *) a)->name,
- ((struct rpmOption *) b)->name);
+ return xstrcasecmp(((const struct rpmOption *) a)->name,
+ ((const struct rpmOption *) b)->name);
}
static machCacheEntry
diff --git a/lib/transaction.c b/lib/transaction.c
index 9f400c530..1182a8522 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -653,7 +653,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
int noConfigs = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONFIGS);
int noDocs = (rpmtsFlags(ts) & RPMTRANS_FLAG_NODOCS);
char ** netsharedPaths = NULL;
- const char ** languages;
+ char ** languages;
const char * dn, * bn;
size_t dnlen, bnlen;
char * s;
@@ -675,7 +675,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
if (!(s && *s != '%'))
s = _free(s);
if (s) {
- languages = (const char **) splitString(s, strlen(s), ':');
+ languages = splitString(s, strlen(s), ':');
s = _free(s);
} else
languages = NULL;
@@ -761,7 +761,8 @@ static void skipFiles(const rpmts ts, rpmfi fi)
* Skip i18n language specific files.
*/
if (languages != NULL && fi->flangs != NULL && *fi->flangs[i]) {
- const char **lang, *l, *le;
+ const char *l, *le;
+ char **lang;
for (lang = languages; *lang != NULL; lang++) {
if (!strcmp(*lang, "all"))
break;
diff --git a/rpmdb/header.c b/rpmdb/header.c
index 09f7c032a..24db54558 100644
--- a/rpmdb/header.c
+++ b/rpmdb/header.c
@@ -3126,7 +3126,7 @@ static char * octalFormat(rpm_tagtype_t type, hPTR_t data,
} else {
val = xmalloc(20 + padding);
strcat(formatPrefix, "o");
- sprintf(val, formatPrefix, *((int32_t *) data));
+ sprintf(val, formatPrefix, *((const int32_t *) data));
}
return val;
@@ -3151,7 +3151,7 @@ static char * hexFormat(rpm_tagtype_t type, hPTR_t data,
} else {
val = xmalloc(20 + padding);
strcat(formatPrefix, "x");
- sprintf(val, formatPrefix, *((int32_t *) data));
+ sprintf(val, formatPrefix, *((const int32_t *) data));
}
return val;
@@ -3175,7 +3175,7 @@ static char * realDateFormat(rpm_tagtype_t type, hPTR_t data,
strcat(formatPrefix, "s");
/* this is important if sizeof(int32_t) ! sizeof(time_t) */
- { time_t dateint = *((int32_t *) data);
+ { time_t dateint = *((const int32_t *) data);
tstruct = localtime(&dateint);
}
buf[0] = '\0';
@@ -3236,7 +3236,7 @@ static char * shescapeFormat(rpm_tagtype_t type, hPTR_t data,
if (type == RPM_INT32_TYPE) {
result = xmalloc(padding + 20);
strcat(formatPrefix, "d");
- sprintf(result, formatPrefix, *((int32_t *) data));
+ sprintf(result, formatPrefix, *((const int32_t *) data));
} else {
buf = alloca(strlen(data) + padding + 2);
strcat(formatPrefix, "s");
diff --git a/rpmdb/tagname.c b/rpmdb/tagname.c
index de7f1b549..2e6e20b7b 100644
--- a/rpmdb/tagname.c
+++ b/rpmdb/tagname.c
@@ -31,8 +31,8 @@ struct headerTagIndices_s {
*/
static int tagCmpName(const void * avp, const void * bvp)
{
- headerTagTableEntry a = *(headerTagTableEntry *) avp;
- headerTagTableEntry b = *(headerTagTableEntry *) bvp;
+ headerTagTableEntry a = *(const headerTagTableEntry *) avp;
+ headerTagTableEntry b = *(const headerTagTableEntry *) bvp;
return strcmp(a->name, b->name);
}
@@ -44,8 +44,8 @@ static int tagCmpName(const void * avp, const void * bvp)
*/
static int tagCmpValue(const void * avp, const void * bvp)
{
- headerTagTableEntry a = *(headerTagTableEntry *) avp;
- headerTagTableEntry b = *(headerTagTableEntry *) bvp;
+ headerTagTableEntry a = *(const headerTagTableEntry *) avp;
+ headerTagTableEntry b = *(const headerTagTableEntry *) bvp;
int ret = (a->val - b->val);
/* Make sure that sort is stable, longest name first. */
if (ret == 0)