summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2009-06-16 19:06:39 +0200
committerMichael Schroeder <mls@suse.de>2009-06-16 19:06:39 +0200
commit2d1b4a12344645f222c2e54bec4558f914f0b5eb (patch)
treed6e865d1c95e7cbbd58e04407d3ca0db4484a60a
parentd2770956cb4c6e113c9f2ac05415831cae297bbc (diff)
downloadlibsolv-2d1b4a12344645f222c2e54bec4558f914f0b5eb.tar.gz
libsolv-2d1b4a12344645f222c2e54bec4558f914f0b5eb.tar.bz2
libsolv-2d1b4a12344645f222c2e54bec4558f914f0b5eb.zip
- fix coding style a bit
-rw-r--r--src/repo.c4
-rw-r--r--src/repo_helix.c49
-rw-r--r--src/repodata.c2
3 files changed, 26 insertions, 29 deletions
diff --git a/src/repo.c b/src/repo.c
index 4a72485..58632eb 100644
--- a/src/repo.c
+++ b/src/repo.c
@@ -340,7 +340,7 @@ repo_sidedata_extend(Repo *repo, void *b, size_t size, Id p, int count)
{
int d = repo->start - p;
b = sat_extend(b, n, d, size, REPO_SIDEDATA_BLOCK);
- memmove((char*)b + d * size, b, n * size);
+ memmove((char *)b + d * size, b, n * size);
memset(b, 0, d * size);
n += d;
}
@@ -348,7 +348,7 @@ repo_sidedata_extend(Repo *repo, void *b, size_t size, Id p, int count)
{
int d = p + count - repo->end;
b = sat_extend(b, n, d, size, REPO_SIDEDATA_BLOCK);
- memset((char*)b + n * size, 0, d * size);
+ memset((char *)b + n * size, 0, d * size);
}
return b;
}
diff --git a/src/repo_helix.c b/src/repo_helix.c
index ebeff07..fcff7c9 100644
--- a/src/repo_helix.c
+++ b/src/repo_helix.c
@@ -530,15 +530,15 @@ startElement(void *userData, const char *name, const char **atts)
}
}
-static const char* findKernelFlavor(Parsedata *pd, Solvable *s)
+static const char *findKernelFlavor(Parsedata *pd, Solvable *s)
{
Pool *pool = pd->pool;
-
- Id pid, *pidp = 0;
+ Id pid, *pidp;
if (s->provides)
{
- for (pidp = pd->repo->idarraydata + s->provides; pidp && (pid = *pidp++) != 0; )
+ pidp = pd->repo->idarraydata + s->provides;
+ while ((pid = *pidp++) != 0)
{
Reldep *prd;
const char *depname;
@@ -547,32 +547,29 @@ static const char* findKernelFlavor(Parsedata *pd, Solvable *s)
continue; /* wrong provides name */
prd = GETRELDEP(pool, pid);
depname = id2str(pool, prd->name);
- if (!strncmp(depname, "kernel-", strlen("kernel-")))
- {
- return depname + strlen("kernel-");
- }
+ if (!strncmp(depname, "kernel-", 7))
+ return depname + 7;
}
}
- if (!s->requires)
- return 0;
-
- for (pidp = pd->repo->idarraydata + s->requires ; pidp && (pid = *pidp++) != 0; )
+ if (s->requires)
{
- const char *depname = 0;
-
- if (!ISRELDEP(pid))
- {
- depname = id2str(pool, pid);
- }
- else
+ pidp = pd->repo->idarraydata + s->requires;
+ while ((pid = *pidp++) != 0)
{
- Reldep *prd = GETRELDEP(pool, pid);
- depname = id2str(pool, prd->name);
- }
- if (!strncmp(depname, "kernel-", strlen("kernel-")))
- {
- return depname + strlen("kernel-");
+ const char *depname;
+
+ if (!ISRELDEP(pid))
+ {
+ depname = id2str(pool, pid);
+ }
+ else
+ {
+ Reldep *prd = GETRELDEP(pool, pid);
+ depname = id2str(pool, prd->name);
+ }
+ if (!strncmp(depname, "kernel-", 7))
+ return depname + 7;
}
}
@@ -594,7 +591,7 @@ endElement(void *userData, const char *name)
Pool *pool = pd->pool;
Solvable *s = pd->solvable;
Id evr;
- unsigned int t=0;
+ unsigned int t = 0;
if (pd->depth != pd->statedepth)
{
diff --git a/src/repodata.c b/src/repodata.c
index 887da4d..fdb7e3a 100644
--- a/src/repodata.c
+++ b/src/repodata.c
@@ -452,7 +452,7 @@ maybe_load_repodata(Repodata *data, Id keyname)
}
}
-static inline unsigned char*
+static inline unsigned char *
solvid2data(Repodata *data, Id solvid, Id *schemap)
{
unsigned char *dp = data->incoredata;