Mailinglist Archive: zypp-commit (171 mails)

< Previous Next >
[zypp-commit] <sat-solver> master : - fix coding style a bit
  • From: Michael Schroeder <mls@xxxxxxx>
  • Date: Tue, 16 Jun 2009 19:06:39 +0200
  • Message-id: <E1MGc7j-0004K8-8z@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit e21d5f36b8adc3e6ffcb667868f7d7ca97268bf8
Author: Michael Schroeder <mls@xxxxxxx>
Date: Tue Jun 16 19:06:39 2009 +0200

- fix coding style a bit
---
src/repo.c | 4 ++--
src/repo_helix.c | 49 +++++++++++++++++++++++--------------------------
src/repodata.c | 2 +-
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;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages