Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5357 - in /branches/SuSE-Linux-10_2-Branch/backend/src/dbsource: DbProductImpl.cc DbSourceImpl.cc
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Thu, 12 Apr 2007 12:47:26 -0000
  • Message-id: <20070412124726.E54E9236B9@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Thu Apr 12 14:47:26 2007
New Revision: 5357

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5357&view=rev
Log:

- check for null strings here
- fix cast


Modified:
    branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc
    branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc

Modified: branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc?rev=5357&r1=5356&r2=5357&view=diff
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc Thu Apr 12 14:47:26 2007
@@ -57,22 +57,16 @@
   if (text != NULL)
     _category = text;
 
-  const char *dist_name = 0;
-  const char *dist_ver = 0;
-  const char *dist_rel = 0;
-  const char *dist_epoch = 0;
+  const char *dist_name = reinterpret_cast<const char *>(sqlite3_column_text( handle, 12 ));
+  const char *dist_ver = reinterpret_cast<const char *>(sqlite3_column_text( handle, 13 ));
+  const char *dist_rel = reinterpret_cast<const char *>(sqlite3_column_text( handle, 14 ));
+  int dist_epoch = sqlite3_column_int( handle, 15 );
   
-  dist_name = (const char *) sqlite3_column_text( handle, 12 );
-  dist_ver = (const char *) sqlite3_column_text( handle, 13 );
-  dist_rel = (const char *) sqlite3_column_text( handle, 14 );
-  dist_epoch = (const char *) sqlite3_column_int( handle, 15 );
+#define CHECKED_STRING(X)  ( (X == NULL) ? "" : X )
+  
+  _distribution_name = CHECKED_STRING(dist_name);
+  _distribution_edition = Edition( CHECKED_STRING(dist_ver), CHECKED_STRING(dist_rel), dist_epoch);
   
-  if ( dist_name && dist_ver && dist_rel && dist_epoch )
-  {
-    _distribution_name = dist_name;
-    _distribution_edition = Edition( dist_ver, dist_rel, dist_epoch);
-  }
-
   return;
 }
 

Modified: branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc?rev=5357&r1=5356&r2=5357&view=diff
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc Thu Apr 12 14:47:26 2007
@@ -932,6 +932,7 @@
       Product::Ptr product = detail::makeResolvableFromImpl( dataCollect, impl );
       _store.insert( product );
       XXX << "Product[" << id << "] " << *product << endl;
+      MIL << "Product created with dist: " << product->distributionName() << " | " <<  product->distributionEdition() << endl;
       if ( _idmap != 0)
         (*_idmap)[id] = product;
     }

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

< Previous Next >
This Thread
  • No further messages