- fix coding style a bit
authorMichael Schroeder <mls@suse.de>
Tue, 16 Jun 2009 17:06:39 +0000 (19:06 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 16 Jun 2009 17:06:39 +0000 (19:06 +0200)
src/repo.c
src/repo_helix.c
src/repodata.c

index 4a72485..58632eb 100644 (file)
@@ -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;
 }
index ebeff07..fcff7c9 100644 (file)
@@ -530,15 +530,15 @@ startElement(void *userData, const char *name, const char **atts)
     }
 }
 
-static const charfindKernelFlavor(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)
     {
index 887da4d..fdb7e3a 100644 (file)
@@ -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;