Skip to content

Commit

Permalink
Lets get rid of all redundant struct declarations in function parameters
Browse files Browse the repository at this point in the history
A few additional formattings ...
  • Loading branch information
jenshannoschwalm authored and TurboGit committed Oct 21, 2024
1 parent a10aab3 commit a618a60
Show file tree
Hide file tree
Showing 75 changed files with 798 additions and 786 deletions.
42 changes: 23 additions & 19 deletions src/iop/atrous.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const char *aliases()
return _("sharpness|acutance|local contrast|clarity");
}

const char **description(struct dt_iop_module_t *self)
const char **description(dt_iop_module_t *self)
{
return dt_iop_set_description(self, _("add or remove local contrast, sharpness, acutance"),
_("corrective and creative"),
Expand Down Expand Up @@ -272,8 +272,8 @@ static int get_scales(float (*thrs)[4],

/* just process the supplied image buffer, upstream
* default_process_tiling() does the rest */
static void process_wavelets(struct dt_iop_module_t *self,
struct dt_dev_pixelpipe_iop_t *piece,
static void process_wavelets(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
const void *const i,
void *const o,
const dt_iop_roi_t *const roi_in,
Expand Down Expand Up @@ -347,8 +347,8 @@ static void process_wavelets(struct dt_iop_module_t *self,
return;
}

void process(struct dt_iop_module_t *self,
struct dt_dev_pixelpipe_iop_t *piece,
void process(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
const void *const i,
void *const o,
const dt_iop_roi_t *const roi_in,
Expand All @@ -362,8 +362,12 @@ void process(struct dt_iop_module_t *self,
#ifdef USE_NEW_CL
/* this version is adapted to the new global tiling mechanism. it no
* longer does tiling by itself. */
int process_cl(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out,
const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out)
int process_cl(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
cl_mem dev_in,
cl_mem dev_out,
const dt_iop_roi_t *const roi_in,
const dt_iop_roi_t *const roi_out)
{
dt_iop_atrous_data_t *d = piece->data;
dt_aligned_pixel_t thrs[MAX_NUM_SCALES];
Expand Down Expand Up @@ -485,7 +489,7 @@ int process_cl(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, cl_m
#else // ======== old, memory-hungry implementation ========================================================

/* this version is adapted to the new global tiling mechanism. it no longer does tiling by itself. */
int process_cl(struct dt_iop_module_t *self,
int process_cl(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
cl_mem dev_in, cl_mem dev_out,
const dt_iop_roi_t *const roi_in,
Expand Down Expand Up @@ -619,11 +623,11 @@ int process_cl(struct dt_iop_module_t *self,

#endif // HAVE_OPENCL

void tiling_callback(struct dt_iop_module_t *self,
struct dt_dev_pixelpipe_iop_t *piece,
void tiling_callback(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
const dt_iop_roi_t *roi_in,
const dt_iop_roi_t *roi_out,
struct dt_develop_tiling_t *tiling)
dt_develop_tiling_t *tiling)
{
dt_iop_atrous_data_t *d = piece->data;
dt_aligned_pixel_t thrs[MAX_NUM_SCALES];
Expand Down Expand Up @@ -698,7 +702,7 @@ static inline void _apply_mix(dt_iop_module_t *self,
*y = fminf(1.0f, fmaxf(0.0f, py + (mix - 1.0f) * (py - dp->y[ch][k])));
}

void commit_params(struct dt_iop_module_t *self,
void commit_params(dt_iop_module_t *self,
dt_iop_params_t *params,
dt_dev_pixelpipe_t *pipe,
dt_dev_pixelpipe_iop_t *piece)
Expand Down Expand Up @@ -733,7 +737,7 @@ void commit_params(struct dt_iop_module_t *self,
d->octaves = MIN(BANDS, l);
}

void init_pipe(struct dt_iop_module_t *self,
void init_pipe(dt_iop_module_t *self,
dt_dev_pixelpipe_t *pipe,
dt_dev_pixelpipe_iop_t *piece)
{
Expand All @@ -756,7 +760,7 @@ void init_pipe(struct dt_iop_module_t *self,
d->octaves = MIN(BANDS, l);
}

void cleanup_pipe(struct dt_iop_module_t *self,
void cleanup_pipe(dt_iop_module_t *self,
dt_dev_pixelpipe_t *pipe,
dt_dev_pixelpipe_iop_t *piece)
{
Expand Down Expand Up @@ -1068,7 +1072,7 @@ static void reset_mix(dt_iop_module_t *self)
gtk_widget_queue_draw(GTK_WIDGET(g->area));
}

void gui_update(struct dt_iop_module_t *self)
void gui_update(dt_iop_module_t *self)
{
reset_mix(self);
}
Expand Down Expand Up @@ -1761,7 +1765,7 @@ const dt_action_def_t _action_def_equalizer
_action_elements_equalizer,
_action_fallbacks_equalizer };

void gui_init(struct dt_iop_module_t *self)
void gui_init(dt_iop_module_t *self)
{
dt_iop_atrous_gui_data_t *g = IOP_GUI_ALLOC(atrous);
const dt_iop_atrous_params_t *const p = self->default_params;
Expand Down Expand Up @@ -1800,8 +1804,8 @@ void gui_init(struct dt_iop_module_t *self)

// graph
g->area = GTK_DRAWING_AREA(dt_ui_resize_wrap
(NULL,
0,
(NULL,
0,
"plugins/darkroom/atrous/graphheight"));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->area), TRUE, TRUE, 0);

Expand All @@ -1828,7 +1832,7 @@ void gui_init(struct dt_iop_module_t *self)
g_signal_connect(G_OBJECT(g->mix), "value-changed", G_CALLBACK(mix_callback), self);
}

void gui_cleanup(struct dt_iop_module_t *self)
void gui_cleanup(dt_iop_module_t *self)
{
dt_iop_atrous_gui_data_t *g = self->gui_data;
dt_conf_set_int("plugins/darkroom/atrous/gui_channel", g->channel);
Expand Down
41 changes: 20 additions & 21 deletions src/iop/basecurve.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ const char *name()
return _("base curve");
}

const char **description(struct dt_iop_module_t *self)
const char **description(dt_iop_module_t *self)
{
return dt_iop_set_description
(self,
Expand Down Expand Up @@ -587,7 +587,7 @@ static float exposure_increment(float stops, int e, float fusion, float bias)

#ifdef HAVE_OPENCL
static
int gauss_blur_cl(struct dt_iop_module_t *self,
int gauss_blur_cl(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
cl_mem dev_in,
cl_mem dev_out,
Expand All @@ -614,7 +614,7 @@ int gauss_blur_cl(struct dt_iop_module_t *self,
}

static
int gauss_expand_cl(struct dt_iop_module_t *self,
int gauss_expand_cl(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
cl_mem dev_in,
cl_mem dev_out,
Expand All @@ -636,7 +636,7 @@ int gauss_expand_cl(struct dt_iop_module_t *self,


static
int gauss_reduce_cl(struct dt_iop_module_t *self,
int gauss_reduce_cl(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
cl_mem dev_in,
cl_mem dev_coarse,
Expand Down Expand Up @@ -677,7 +677,7 @@ int gauss_reduce_cl(struct dt_iop_module_t *self,
}

static
int process_cl_fusion(struct dt_iop_module_t *self,
int process_cl_fusion(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
cl_mem dev_in,
cl_mem dev_out,
Expand Down Expand Up @@ -923,7 +923,7 @@ int process_cl_fusion(struct dt_iop_module_t *self,
}

static
int process_cl_lut(struct dt_iop_module_t *self,
int process_cl_lut(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
cl_mem dev_in,
cl_mem dev_out,
Expand Down Expand Up @@ -988,7 +988,7 @@ int process_cl_lut(struct dt_iop_module_t *self,
return err;
}

int process_cl(struct dt_iop_module_t *self,
int process_cl(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
cl_mem dev_in, cl_mem dev_out,
const dt_iop_roi_t *const roi_in,
Expand All @@ -1004,11 +1004,11 @@ int process_cl(struct dt_iop_module_t *self,

#endif

void tiling_callback(struct dt_iop_module_t *self,
struct dt_dev_pixelpipe_iop_t *piece,
void tiling_callback(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
const dt_iop_roi_t *roi_in,
const dt_iop_roi_t *roi_out,
struct dt_develop_tiling_t *tiling)
dt_develop_tiling_t *tiling)
{
dt_iop_basecurve_data_t *const d = piece->data;

Expand Down Expand Up @@ -1231,7 +1231,7 @@ static inline void gauss_reduce(
}
}

void process_fusion(struct dt_iop_module_t *self,
void process_fusion(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
const void *const ivoid,
void *const ovoid,
Expand Down Expand Up @@ -1403,7 +1403,7 @@ void process_fusion(struct dt_iop_module_t *self,
free(comb);
}

void process_lut(struct dt_iop_module_t *self,
void process_lut(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
const void *const ivoid,
void *const ovoid,
Expand All @@ -1429,7 +1429,7 @@ void process_lut(struct dt_iop_module_t *self,
}


void process(struct dt_iop_module_t *self,
void process(dt_iop_module_t *self,
dt_dev_pixelpipe_iop_t *piece,
const void *const ivoid,
void *const ovoid,
Expand All @@ -1445,7 +1445,7 @@ void process(struct dt_iop_module_t *self,
process_lut(self, piece, ivoid, ovoid, roi_in, roi_out);
}

void commit_params(struct dt_iop_module_t *self,
void commit_params(dt_iop_module_t *self,
dt_iop_params_t *p1,
dt_dev_pixelpipe_t *pipe,
dt_dev_pixelpipe_iop_t *piece)
Expand Down Expand Up @@ -1491,7 +1491,7 @@ void commit_params(struct dt_iop_module_t *self,
dt_iop_estimate_exp(x, y, 4, d->unbounded_coeffs);
}

void init_pipe(struct dt_iop_module_t *self,
void init_pipe(dt_iop_module_t *self,
dt_dev_pixelpipe_t *pipe,
dt_dev_pixelpipe_iop_t *piece)
{
Expand All @@ -1500,7 +1500,7 @@ void init_pipe(struct dt_iop_module_t *self,
self->commit_params(self, self->default_params, pipe, piece);
}

void cleanup_pipe(struct dt_iop_module_t *self,
void cleanup_pipe(dt_iop_module_t *self,
dt_dev_pixelpipe_t *pipe,
dt_dev_pixelpipe_iop_t *piece)
{
Expand All @@ -1511,7 +1511,7 @@ void cleanup_pipe(struct dt_iop_module_t *self,
piece->data = NULL;
}

void gui_update(struct dt_iop_module_t *self)
void gui_update(dt_iop_module_t *self)
{
dt_iop_basecurve_params_t *p = self->params;
dt_iop_basecurve_gui_data_t *g = self->gui_data;
Expand Down Expand Up @@ -1541,8 +1541,7 @@ void init(dt_iop_module_t *module)
void init_global(dt_iop_module_so_t *module)
{
const int program = 18; // basecurve.cl, from programs.conf
dt_iop_basecurve_global_data_t *gd
= (dt_iop_basecurve_global_data_t *)malloc(sizeof(dt_iop_basecurve_global_data_t));
dt_iop_basecurve_global_data_t *gd = malloc(sizeof(dt_iop_basecurve_global_data_t));
module->data = gd;
gd->kernel_basecurve_lut = dt_opencl_create_kernel(program, "basecurve_lut");
gd->kernel_basecurve_zero = dt_opencl_create_kernel(program, "basecurve_zero");
Expand Down Expand Up @@ -2125,7 +2124,7 @@ static void logbase_callback(GtkWidget *slider, dt_iop_module_t *self)
gtk_widget_queue_draw(GTK_WIDGET(g->area));
}

void gui_init(struct dt_iop_module_t *self)
void gui_init(dt_iop_module_t *self)
{
dt_iop_basecurve_gui_data_t *g = IOP_GUI_ALLOC(basecurve);
const dt_iop_basecurve_params_t *const p = self->default_params;
Expand Down Expand Up @@ -2188,7 +2187,7 @@ void gui_init(struct dt_iop_module_t *self)
g_signal_connect(G_OBJECT(g->area), "key-press-event", G_CALLBACK(dt_iop_basecurve_key_press), self);
}

void gui_cleanup(struct dt_iop_module_t *self)
void gui_cleanup(dt_iop_module_t *self)
{
dt_iop_basecurve_gui_data_t *g = self->gui_data;
dt_draw_curve_destroy(g->minmax_curve);
Expand Down
Loading

0 comments on commit a618a60

Please sign in to comment.