Author: mlandres
Date: Mon Jun 18 23:57:39 2007
New Revision: 5779
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5779&view=rev
Log:
fix gcc-4.2 errors, warnings, add -D_FILE_OFFSET_BITS=64 and -O3
Modified:
trunk/libzypp/CMakeLists.txt
trunk/libzypp/devel/devel.ma/AOUT.cc
trunk/libzypp/zypp/cache/CacheStore.cc
trunk/libzypp/zypp/cache/schema/mkarray.c
trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp
trunk/libzypp/zypp/repo/RepoType.cc
trunk/libzypp/zypp/repo/yum/ResourceType.cc
Modified: trunk/libzypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/CMakeLists.txt?rev=5779&r1=5778&r2=5779&view=diff
==============================================================================
--- trunk/libzypp/CMakeLists.txt (original)
+++ trunk/libzypp/CMakeLists.txt Mon Jun 18 23:57:39 2007
@@ -1,8 +1,5 @@
PROJECT(libzypp)
-SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Woverloaded-virtual" )
-SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall " )
-
# Library
IF ( DEFINED LIB )
SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
@@ -30,7 +27,9 @@
SET( PACKAGE "libzypp" )
SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
-ADD_DEFINITIONS( -g )
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 -Wall -Woverloaded-virtual" )
+SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -Wall" )
+ADD_DEFINITIONS( -D_FILE_OFFSET_BITS=64 )
ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
SET( LIBZYPP_VERSION_INFO "${LIBZYPP_SO_FIRST}.${LIBZYPP_AGE}.${LIBZYPP_PATCH}" )
Modified: trunk/libzypp/devel/devel.ma/AOUT.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/AOUT.cc?rev=5779&r1=5778&r2=5779&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/AOUT.cc (original)
+++ trunk/libzypp/devel/devel.ma/AOUT.cc Mon Jun 18 23:57:39 2007
@@ -1,86 +1,36 @@
-#if 0
-#include "Tools.h"
+#include <iostream>
+#include "zypp/base/Logger.h"
+#include "zypp/base/LogTools.h"
+#include "zypp/base/Function.h"
+#include "zypp/base/IOStream.h"
+#include "zypp/base/InputStream.h"
+#include "zypp/ProgressData.h"
-#include "zypp/base/Sysconfig.h"
+#include "zypp/base/Random.h"
+
+#include
using std::endl;
using namespace zypp;
-namespace sysconfig = base::sysconfig;
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-
-
-/******************************************************************
-**
-** FUNCTION NAME : main
-** FUNCTION TYPE : int
-*/
+
+void action( int i_r )
+{
+ unsigned sec = base::random( 3 );
+ sleep( sec );
+ MIL << "Action " << i_r << " (" << sec << ")" << endl;
+}
+
+
int main( int argc, char * argv[] )
{
- DBG << "===[START]==========================================" << endl;
+ INT << "===[START]==========================================" << endl;
- Capability f( CapFactory().parse( Resolvable::Kind( "package" ), "filesystem(foo)" ) );
- Capability e( CapFactory().filesystemEvalCap() );
+ for ( unsigned i = 0; i < 5; ++i )
+ {
+ new boost::thread( bind( action, i ) );
+ }
- MIL << f << endl;
- MIL << e << endl;
- MIL << f.matches( e ) << endl;
- MIL << e.matches( f ) << endl;
-
- DBG << "===[END]============================================" << endl;
- zypp::base::LogControl::instance().logNothing();
- return 0;
+ INT << "===[END]============================================" << endl << endl;
+ return ( 0 );
}
-#endif
-
- #include <iostream>
- #include "zypp/base/Logger.h"
- #include "zypp/base/IOStream.h"
- #include "zypp/base/InputStream.h"
- #include "zypp/ProgressData.h"
-
- using namespace zypp;
-
- // Defined in ProgressData.h:
- // Initialize ProgressData from an InputStream.
- //
- // ProgressData makeProgressData( const InputStream & input_r )
- // {
- // ProgressData ret;
- // ret.name( input_r.name() );
- // if ( input_r.size() > 0 )
- // ret.range( input_r.size() );
- // return ret;
- // }
-
- void simpleParser( const InputStream & input_r,
- const ProgressData::ReceiverFnc & fnc_r = ProgressData::ReceiverFnc() )
- {
- ProgressData ticks( makeProgressData( input_r ) );
- ticks.sendTo( fnc_r );
- ticks.toMin(); // start sending min (0)
-
- iostr::EachLine line( input_r );
- for( ; line; line.next() )
- {
- /* process the line */
-
- if ( ! ticks.set( input_r.stream().tellg() ) )
- return; // user requested abort
- }
-
- ticks.toMax(); // take care 100% are reported on success
- }
-
- int main( int argc, char * argv[] )
- {
- simpleParser( "packages" );
- simpleParser( "packages.gz" );
- return ( 0 );
- }
Modified: trunk/libzypp/zypp/cache/CacheStore.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/CacheStore.cc?rev=5779&r1=5778&r2=5779&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/CacheStore.cc (original)
+++ trunk/libzypp/zypp/cache/CacheStore.cc Mon Jun 18 23:57:39 2007
@@ -399,6 +399,7 @@
//! \todo maybe appendChangelog(const data::RecordId & resolvable_id, Changelog changelog) will be needed
//! for inserting the changelog using in-memory record id of corresponding resolvable.
//! (first, we'll see how fast is the inserting without remembering those ids)
+ return data::noRecordId;
}
RecordId CacheStore::consumeFilelist( const data::RecordId & repository_id,
@@ -406,6 +407,7 @@
const data::Filenames & filenames )
{
//! \todo maybe consumeFilelist(const data::RecordId & resolvable_id, data::Filenames &) will be needed
+ return data::noRecordId;
}
RecordId CacheStore::appendResolvable( const RecordId &repository_id,
Modified: trunk/libzypp/zypp/cache/schema/mkarray.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/schema/mkarray.c?rev=5779&r1=5778&r2=5779&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/schema/mkarray.c (original)
+++ trunk/libzypp/zypp/cache/schema/mkarray.c Mon Jun 18 23:57:39 2007
@@ -15,7 +15,7 @@
#include
#include
-static
+static int
mkarray(filename, file, ofile, varname)
char *filename;
FILE *file;
@@ -23,7 +23,7 @@
char *varname;
{
char buf[BUFSIZ];
- size_t i, rsize, tsize=0;
+ size_t rsize, tsize=0;
int done=0, line=8, status=EXIT_SUCCESS;
fprintf(ofile, "/*\n");
@@ -71,7 +71,7 @@
if(8!=line) fputc('\n', ofile);
fputs("};\n\n", ofile);
- fprintf(ofile, "size_t _%s_size=%d;\n", varname, tsize);
+ fprintf(ofile, "size_t _%s_size=%d;\n", varname, (int)tsize);
fprintf(ofile, "size_t *%s_size=&_%s_size;\n", varname, varname);
if(ferror(ofile)) {
@@ -86,11 +86,11 @@
return status;
}
+int
main(argc, argv)
char *argv[];
{
char *filename, *ofilename, *varname;
- FILE *file;
int status=EXIT_SUCCESS;
--argc;
Modified: trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp?rev=5779&r1=5778&r2=5779&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp (original)
+++ trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp Mon Jun 18 23:57:39 2007
@@ -41,7 +41,8 @@
sqlite3_command::sqlite3_command(sqlite3_connection &con, const wchar_t *sql) : con(con),refs(0)
{
const wchar_t *tail=NULL;
- if (sqlite3_prepare16(con.db, sql, -1, &this->stmt, (const void**)&tail)!=SQLITE_OK)
+ const wchar_t **tmpptr=&tail;
+ if (sqlite3_prepare16(con.db, sql, -1, &this->stmt, (const void**)tmpptr)!=SQLITE_OK)
SQLITE3X_THROW(database_error(con));
this->argc=sqlite3_column_count(this->stmt);
@@ -59,7 +60,8 @@
sqlite3_command::sqlite3_command(sqlite3_connection &con, const std::wstring &sql) : con(con),refs(0)
{
const wchar_t *tail=NULL;
- if (sqlite3_prepare16(con.db, sql.data(), (int)sql.length()*2, &this->stmt, (const void**)&tail)!=SQLITE_OK)
+ const wchar_t **tmpptr=&tail;
+ if (sqlite3_prepare16(con.db, sql.data(), (int)sql.length()*2, &this->stmt, (const void**)tmpptr)!=SQLITE_OK)
SQLITE3X_THROW(database_error(con));
this->argc=sqlite3_column_count(this->stmt);
Modified: trunk/libzypp/zypp/repo/RepoType.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/RepoType.cc?rev=5779&r1=5778&r2=5779&view=diff
==============================================================================
--- trunk/libzypp/zypp/repo/RepoType.cc (original)
+++ trunk/libzypp/zypp/repo/RepoType.cc Mon Jun 18 23:57:39 2007
@@ -7,6 +7,7 @@
| |
\---------------------------------------------------------------------*/
+#include <iostream>
#include <map>
#include "zypp/base/Exception.h"
#include "RepoType.h"
Modified: trunk/libzypp/zypp/repo/yum/ResourceType.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/yum/ResourceType.cc?rev=5779&r1=5778&r2=5779&view=diff
==============================================================================
--- trunk/libzypp/zypp/repo/yum/ResourceType.cc (original)
+++ trunk/libzypp/zypp/repo/yum/ResourceType.cc Mon Jun 18 23:57:39 2007
@@ -7,6 +7,7 @@
| |
\---------------------------------------------------------------------*/
+#include <iostream>
#include <map>
#include "zypp/base/Exception.h"
#include "ResourceType.h"
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org