[SCM] Development fot GoFind! branch, master, updated. 956fe808eafc1679f84d4c9d1f12db7423941798
Miriam Ruiz
miriam at debian.org
Sun Nov 23 22:23:39 UTC 2008
The following commit has been merged in the master branch:
commit 26c13222b6aa054471ce68bb8b559694ae75e865
Author: Miriam Ruiz <miriam at debian.org>
Date: Sun Nov 23 20:19:14 2008 +0100
Tidy Shared Object Management Files
diff --git a/dll.cpp b/dll.cpp
index 9be10f5..07ca683 100644
--- a/dll.cpp
+++ b/dll.cpp
@@ -28,8 +28,8 @@
DLLManager::DLLManager( const char *fname )
{
- // Try to open the library now and get any error message.
-
+ // Try to open the library now and get any error message.
+
dlerror(); // Clean previous errors, if any
h=dlopen( fname, RTLD_NOW );
err=dlerror();
@@ -39,47 +39,45 @@ DLLManager::~DLLManager()
{
// close the library if it isn't null
if( h!=0 )
- dlclose(h);
+ dlclose(h);
}
-bool DLLManager::GetSymbol(
- void **v,
- const char *sym_name
- )
+bool DLLManager::GetSymbol(
+ void **v,
+ const char *sym_name
+ )
{
// try extract a symbol from the library
// get any error message is there is any
-
+
if( h!=0 )
{
*v = dlsym( h, sym_name );
- err=dlerror();
- if( err==0 )
- return true;
- else
- return false;
+ err=dlerror();
+ if( err==0 )
+ return true;
+ else
+ return false;
}
else
- {
- return false;
+ {
+ return false;
}
-
}
DLLFactoryBase::DLLFactoryBase(
- const char *fname,
- const char *factory
- ) : DLLManager(fname)
+ const char *fname,
+ const char *factory
+ ) : DLLManager(fname)
{
// try get the factory function if there is no error yet
-
+
factory_func=0;
if( LastError()==0 )
- {
- GetSymbol( (void **)&factory_func, factory ? factory : "factory0" );
+ {
+ GetSymbol( (void **)&factory_func, factory ? factory : "factory0" );
}
-
}
DLLFactoryBase::~DLLFactoryBase()
diff --git a/dll.h b/dll.h
index b4b9790..9821e5d 100644
--- a/dll.h
+++ b/dll.h
@@ -75,13 +75,12 @@ class DLLFactoryBase : public DLLManager
{
public:
DLLFactoryBase(
- const char *fname,
- const char *func_name=0
- );
-
+ const char *fname,
+ const char *func_name=0
+ );
+
virtual ~DLLFactoryBase();
-
- void * (*factory_func)(void);
+ void *(*factory_func)(void);
};
@@ -109,16 +108,16 @@ class DLLFactory : public DLLFactoryBase
{
public:
DLLFactory(
- const char *fname,
- const char *func_name=0
- ) : DLLFactoryBase( fname, func_name )
+ const char *fname,
+ const char *func_name=0
+ ) : DLLFactoryBase( fname, func_name )
{
if( factory_func )
factory = (T *)factory_func();
else
factory = 0;
}
-
+
~DLLFactory()
{
delete factory;
--
Development fot GoFind!
More information about the Pkg-games-commits
mailing list