getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] r4605 - in /trunk/getfem/src: dal_singleton.cc dal_stat


From: andriy . andreykiv
Subject: [Getfem-commits] r4605 - in /trunk/getfem/src: dal_singleton.cc dal_static_stored_objects.cc getfem/dal_singleton.h getfem/getfem_omp.h
Date: Fri, 11 Apr 2014 17:03:30 -0000

Author: andrico
Date: Fri Apr 11 19:03:29 2014
New Revision: 4605

URL: http://svn.gna.org/viewcvs/getfem?rev=4605&view=rev
Log:
cleaned up signed unsigned warnings

Modified:
    trunk/getfem/src/dal_singleton.cc
    trunk/getfem/src/dal_static_stored_objects.cc
    trunk/getfem/src/getfem/dal_singleton.h
    trunk/getfem/src/getfem/getfem_omp.h

Modified: trunk/getfem/src/dal_singleton.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/dal_singleton.cc?rev=4605&r1=4604&r2=4605&view=diff
==============================================================================
--- trunk/getfem/src/dal_singleton.cc   (original)
+++ trunk/getfem/src/dal_singleton.cc   Fri Apr 11 19:03:29 2014
@@ -44,7 +44,7 @@
     manager().lst.thrd_cast().push_back(p);
        }
 
-       void singletons_manager::register_new_singleton(singleton_instance_base 
*p, int ithread) 
+       void singletons_manager::register_new_singleton(singleton_instance_base 
*p, size_t ithread) 
   {    
     manager().lst(ithread).push_back(p);
        }

Modified: trunk/getfem/src/dal_static_stored_objects.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/dal_static_stored_objects.cc?rev=4605&r1=4604&r2=4605&view=diff
==============================================================================
--- trunk/getfem/src/dal_static_stored_objects.cc       (original)
+++ trunk/getfem/src/dal_static_stored_objects.cc       Fri Apr 11 19:03:29 2014
@@ -43,7 +43,7 @@
   // a specific thread
   pstatic_stored_object_key key_of_stored_object(pstatic_stored_object o, 
size_t thread) 
   {
-    stored_key_tab& stored_keys = 
dal::singleton<stored_key_tab>::instance(int(thread));
+    stored_key_tab& stored_keys = 
dal::singleton<stored_key_tab>::instance(thread);
     stored_key_tab::iterator it = stored_keys.find(o);
     if (it != stored_keys.end()) return it->second;
     return 0;
@@ -79,7 +79,7 @@
 
   // Test if an object is stored (in any of the thread's storage).
   bool exists_stored_object_all_threads(pstatic_stored_object o) {
-    for(int thread = 0; thread < int(getfem::num_threads()); thread++){
+    for(size_t thread = 0; thread < getfem::num_threads(); thread++){
       stored_key_tab& stored_keys = 
dal::singleton<stored_key_tab>::instance(thread);
       if (stored_keys.find(o) != stored_keys.end()) return true;
     }
@@ -101,7 +101,7 @@
   /* Search for an object in the storage of all threads*/
   pstatic_stored_object
     search_stored_object_all_threads(pstatic_stored_object_key k) {
-      for(int thread = 0; thread<int(getfem::num_threads());thread++){
+      for(size_t thread = 0; thread<getfem::num_threads();thread++){
         stored_object_tab& stored_objects
           = dal::singleton<stored_object_tab>::instance(thread);
         stored_object_tab::iterator it
@@ -135,7 +135,7 @@
     pstatic_stored_object_key k = key_of_stored_object(o);
     if (k) 
     {
-      for(int thread = 0; thread<int(getfem::num_threads());thread++)
+      for(size_t thread = 0; thread<getfem::num_threads();thread++)
       {
         if (thread == this_thread()) continue;
         stored_object_tab& stored_objects
@@ -371,7 +371,7 @@
 
   // List the stored objects for debugging purpose
   void list_stored_objects(std::ostream &ost) {
-    for(int thread=0; thread<int(getfem::num_threads());thread++)
+    for(size_t thread=0; thread<getfem::num_threads();thread++)
     {
       stored_key_tab& stored_keys = 
dal::singleton<stored_key_tab>::instance(thread);
       if (stored_keys.begin() == stored_keys.end())

Modified: trunk/getfem/src/getfem/dal_singleton.h
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/dal_singleton.h?rev=4605&r1=4604&r2=4605&view=diff
==============================================================================
--- trunk/getfem/src/getfem/dal_singleton.h     (original)
+++ trunk/getfem/src/getfem/dal_singleton.h     Fri Apr 11 19:03:29 2014
@@ -73,7 +73,7 @@
 
   public:
     static void register_new_singleton(singleton_instance_base *p);
-    static void register_new_singleton(singleton_instance_base *p, int 
ithread);
+    static void register_new_singleton(singleton_instance_base *p, size_t 
ithread);
     ~singletons_manager();
   private:
     singletons_manager();
@@ -91,7 +91,7 @@
       return pointer;
     }
     static T*& instance_pointer() { return omp_distro_pointer( )->thrd_cast(); 
}
-    static T*& instance_pointer(int ithread) { return (*omp_distro_pointer( 
))(ithread);}
+    static T*& instance_pointer(size_t ithread) { return (*omp_distro_pointer( 
))(ithread);}
 
   public:
 
@@ -109,7 +109,7 @@
     }
 
     /**Instance from thread ithread*/
-    inline static T& instance(int ithread) 
+    inline static T& instance(size_t ithread) 
     { 
       T*& tinstance_ = instance_pointer(ithread);
       if (!tinstance_) {
@@ -158,10 +158,10 @@
     }
     inline static const T& const_instance() { return instance(); }
 
-    inline static T& instance(int ithread) { 
+    inline static T& instance(size_t ithread) { 
       return singleton_instance<T,LEV>::instance(ithread);
     }
-    inline static const T& const_instance(int ithread) { return 
instance(ithread); }
+    inline static const T& const_instance(size_t ithread) { return 
instance(ithread); }
 
 
   protected:

Modified: trunk/getfem/src/getfem/getfem_omp.h
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_omp.h?rev=4605&r1=4604&r2=4605&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_omp.h        (original)
+++ trunk/getfem/src/getfem/getfem_omp.h        Fri Apr 11 19:03:29 2014
@@ -153,7 +153,7 @@
   public:
     typedef std::vector<T> VEC;
     omp_distribute() : thread_values(num_threads()) {}
-    omp_distribute(int n, const T& value) : 
+    omp_distribute(size_t n, const T& value) : 
       thread_values(num_threads(), std::vector<T>(n,value)){}
     operator VEC& (){return thread_values[this_thread()];}
     operator const VEC& () const 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]