[gimp/gimp-2-10] app: more gimp-parallel fixes



commit 79a44eda6d5d4957b883826d506d77e79a61278b
Author: Ell <ell_se yahoo com>
Date:   Wed Nov 14 10:58:58 2018 -0500

    app: more gimp-parallel fixes
    
    Fix indentation in gimp-parallel.{cc,h}.
    
    Remove unused typedefs in gimp-parallel.h.
    
    s/Gimp/Gegl/ in function-type cast in gimphistogram.c.
    
    (cherry picked from commit 05a4437d9aaf73b040c3a9c1b13fcad1ec0b77f5)

 app/core/gimp-parallel.cc | 32 ++++++++++++++++----------------
 app/core/gimp-parallel.h  | 39 +++++++++++++++------------------------
 app/core/gimphistogram.c  |  2 +-
 3 files changed, 32 insertions(+), 41 deletions(-)
---
diff --git a/app/core/gimp-parallel.cc b/app/core/gimp-parallel.cc
index 78a989e770..777dd0d43a 100644
--- a/app/core/gimp-parallel.cc
+++ b/app/core/gimp-parallel.cc
@@ -70,29 +70,29 @@ typedef struct
 
 /*  local function prototypes  */
 
-static void                       gimp_parallel_notify_num_processors    (GimpGeglConfig               
*config);
+static void                       gimp_parallel_notify_num_processors   (GimpGeglConfig             *config);
 
-static void                       gimp_parallel_set_n_threads            (gint                          
n_threads,
-                                                                          gboolean                      
finish_tasks);
+static void                       gimp_parallel_set_n_threads           (gint                        
n_threads,
+                                                                         gboolean                    
finish_tasks);
 
-static void                       gimp_parallel_run_async_set_n_threads  (gint                          
n_threads,
-                                                                          gboolean                      
finish_tasks);
-static gpointer                   gimp_parallel_run_async_thread_func    (GimpParallelRunAsyncThread   
*thread);
-static void                       gimp_parallel_run_async_enqueue_task   (GimpParallelRunAsyncTask     
*task);
-static GimpParallelRunAsyncTask * gimp_parallel_run_async_dequeue_task   (void);
-static gboolean                   gimp_parallel_run_async_execute_task   (GimpParallelRunAsyncTask     
*task);
-static void                       gimp_parallel_run_async_abort_task     (GimpParallelRunAsyncTask     
*task);
-static void                       gimp_parallel_run_async_cancel         (GimpAsync                    
*async);
+static void                       gimp_parallel_run_async_set_n_threads (gint                        
n_threads,
+                                                                         gboolean                    
finish_tasks);
+static gpointer                   gimp_parallel_run_async_thread_func   (GimpParallelRunAsyncThread *thread);
+static void                       gimp_parallel_run_async_enqueue_task  (GimpParallelRunAsyncTask   *task);
+static GimpParallelRunAsyncTask * gimp_parallel_run_async_dequeue_task  (void);
+static gboolean                   gimp_parallel_run_async_execute_task  (GimpParallelRunAsyncTask   *task);
+static void                       gimp_parallel_run_async_abort_task    (GimpParallelRunAsyncTask   *task);
+static void                       gimp_parallel_run_async_cancel        (GimpAsync                  *async);
 
 
 /*  local variables  */
 
-static gint                         gimp_parallel_run_async_n_threads = 0;
-static GimpParallelRunAsyncThread   gimp_parallel_run_async_threads[GIMP_PARALLEL_RUN_ASYNC_MAX_THREADS];
+static gint                       gimp_parallel_run_async_n_threads = 0;
+static GimpParallelRunAsyncThread gimp_parallel_run_async_threads[GIMP_PARALLEL_RUN_ASYNC_MAX_THREADS];
 
-static GMutex                       gimp_parallel_run_async_mutex;
-static GCond                        gimp_parallel_run_async_cond;
-static GQueue                       gimp_parallel_run_async_queue = G_QUEUE_INIT;
+static GMutex                     gimp_parallel_run_async_mutex;
+static GCond                      gimp_parallel_run_async_cond;
+static GQueue                     gimp_parallel_run_async_queue = G_QUEUE_INIT;
 
 
 /*  public functions  */
diff --git a/app/core/gimp-parallel.h b/app/core/gimp-parallel.h
index 2ffa6dc6c5..c538778462 100644
--- a/app/core/gimp-parallel.h
+++ b/app/core/gimp-parallel.h
@@ -22,30 +22,21 @@
 #define __GIMP_PARALLEL_H__
 
 
-typedef void (* GimpParallelRunAsyncFunc)        (GimpAsync            *async,
-                                                  gpointer              user_data);
-
-typedef void (* GimpParallelDistributeFunc)      (gint                 i,
-                                                  gint                 n,
-                                                  gpointer             user_data);
-typedef void (* GimpParallelDistributeRangeFunc) (gsize                offset,
-                                                  gsize                size,
-                                                  gpointer             user_data);
-typedef void (* GimpParallelDistributeAreaFunc)  (const GeglRectangle *area,
-                                                  gpointer             user_data);
-
-
-void        gimp_parallel_init                  (Gimp                            *gimp);
-void        gimp_parallel_exit                  (Gimp                            *gimp);
-
-GimpAsync * gimp_parallel_run_async             (GimpParallelRunAsyncFunc         func,
-                                                 gpointer                         user_data);
-GimpAsync * gimp_parallel_run_async_full        (gint                             priority,
-                                                 GimpParallelRunAsyncFunc         func,
-                                                 gpointer                         user_data,
-                                                 GDestroyNotify                   user_data_destroy_func);
-GimpAsync * gimp_parallel_run_async_independent (GimpParallelRunAsyncFunc         func,
-                                                 gpointer                         user_data);
+typedef void (* GimpParallelRunAsyncFunc) (GimpAsync *async,
+                                           gpointer   user_data);
+
+
+void        gimp_parallel_init                  (Gimp                     *gimp);
+void        gimp_parallel_exit                  (Gimp                     *gimp);
+
+GimpAsync * gimp_parallel_run_async             (GimpParallelRunAsyncFunc  func,
+                                                 gpointer                  user_data);
+GimpAsync * gimp_parallel_run_async_full        (gint                      priority,
+                                                 GimpParallelRunAsyncFunc  func,
+                                                 gpointer                  user_data,
+                                                 GDestroyNotify            user_data_destroy_func);
+GimpAsync * gimp_parallel_run_async_independent (GimpParallelRunAsyncFunc  func,
+                                                 gpointer                  user_data);
 
 
 #ifdef __cplusplus
diff --git a/app/core/gimphistogram.c b/app/core/gimphistogram.c
index bc919a6c22..221bbf2ba9 100644
--- a/app/core/gimphistogram.c
+++ b/app/core/gimphistogram.c
@@ -948,7 +948,7 @@ gimp_histogram_calculate_internal (GimpAsync        *async,
 
   gegl_parallel_distribute_area (
     &context->buffer_rect, PIXELS_PER_THREAD, GEGL_SPLIT_STRATEGY_AUTO,
-    (GimpParallelDistributeAreaFunc) gimp_histogram_calculate_area,
+    (GeglParallelDistributeAreaFunc) gimp_histogram_calculate_area,
     &data);
 
   if (! async || ! gimp_async_is_canceled (async))


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