Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11676 - in /trunk/sat-solver/applayer: applayer.c applayer.h
  • From: kkaempf@xxxxxxxxxxxxxxxx
  • Date: Thu, 13 Nov 2008 11:54:11 -0000
  • Message-id: <20081113115411.9BF1F3A0FA@xxxxxxxxxxxxxxxx>
Author: kkaempf
Date: Thu Nov 13 12:54:11 2008
New Revision: 11676

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11676&view=rev
Log:
rename pool_size to pool_count to be in sync with Repo functions

Modified:
trunk/sat-solver/applayer/applayer.c
trunk/sat-solver/applayer/applayer.h

Modified: trunk/sat-solver/applayer/applayer.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/applayer.c?rev=11676&r1=11675&r2=11676&view=diff
==============================================================================
--- trunk/sat-solver/applayer/applayer.c (original)
+++ trunk/sat-solver/applayer/applayer.c Thu Nov 13 12:54:11 2008
@@ -25,13 +25,25 @@
}

unsigned int
-pool_size( Pool *pool )
+pool_count( Pool *pool )
{
- /* decrease by one since Id 0 is reserved
- * decrease by one since Id 1 is the system solvable and not
+ Solvable *s;
+ Id p;
+ int count = 0;
+ /* skip Id 0 since it is reserved
+ * skip Id 1 since it is the system solvable and not
* accessible to the outside
*/
- return pool->nsolvables - 1 - 1;
+ for (p = 2, s = pool->solvables + p; p < pool->nsolvables; p++, s++)
+ {
+ if (!s)
+ continue;
+ if (!s->name)
+ continue;
+ ++count;
+ }
+
+ return count;
}

void
@@ -39,9 +51,11 @@
{
Solvable *s;
Id p;
- /* skip Id 0 and Id 1, see pool_size() above */
+ /* skip Id 0 and Id 1, see pool_count() above */
for (p = 2, s = pool->solvables + p; p < pool->nsolvables; p++, s++)
{
+ if (!s)
+ continue;
if (!s->name)
continue;
if (callback( xsolvable_new( pool, p ), user_data ) )

Modified: trunk/sat-solver/applayer/applayer.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/applayer/applayer.h?rev=11676&r1=11675&r2=11676&view=diff
==============================================================================
--- trunk/sat-solver/applayer/applayer.h (original)
+++ trunk/sat-solver/applayer/applayer.h Thu Nov 13 12:54:11 2008
@@ -32,7 +32,7 @@
*
*/

-unsigned int pool_size( Pool *pool );
+unsigned int pool_count( Pool *pool );
void pool_xsolvables_iterate( Pool *pool, int (*callback)(const XSolvable *xs,
void *user_data), void *user_data);

#endif /* SATSOLVER_APPLAYER_H */

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages