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.
This commit is contained in:
Ell 2018-11-14 10:58:58 -05:00
parent 115fc174f2
commit 05a4437d9a
3 changed files with 29 additions and 38 deletions

View File

@ -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 */

View File

@ -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);
typedef void (* GimpParallelRunAsyncFunc) (GimpAsync *async,
gpointer user_data);
void gimp_parallel_init (Gimp *gimp);
void gimp_parallel_exit (Gimp *gimp);
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);
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

View File

@ -914,7 +914,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))