Skip to content

Commit d2f15c8

Browse files
committed
Minor code clean-up and reformatting.
1 parent e810667 commit d2f15c8

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

src/common/presets.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of darktable,
3-
Copyright (C) 2019-2023 darktable developers.
3+
Copyright (C) 2019-2025 darktable developers.
44
55
darktable is free software: you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -35,7 +35,8 @@
3535
#include <inttypes.h>
3636
#include <sqlite3.h>
3737

38-
static char *dt_preset_encode(sqlite3_stmt *stmt, int row)
38+
static char *_preset_encode(sqlite3_stmt *stmt,
39+
const int row)
3940
{
4041
const int32_t len = sqlite3_column_bytes(stmt, row);
4142
char *vparams = dt_exif_xmp_encode
@@ -128,7 +129,7 @@ void dt_presets_save_to_file(const int rowid,
128129
xmlTextWriterWriteFormatElement(writer, BAD_CAST "description", "%s", description);
129130
xmlTextWriterWriteFormatElement(writer, BAD_CAST "operation", "%s", operation);
130131
xmlTextWriterWriteFormatElement(writer, BAD_CAST "op_params", "%s",
131-
dt_preset_encode(stmt, 0));
132+
_preset_encode(stmt, 0));
132133
xmlTextWriterWriteFormatElement(writer, BAD_CAST "op_version", "%d", op_version);
133134
xmlTextWriterWriteFormatElement(writer, BAD_CAST "enabled", "%d", enabled);
134135
xmlTextWriterWriteFormatElement(writer, BAD_CAST "autoapply", "%d", autoapply);
@@ -146,7 +147,7 @@ void dt_presets_save_to_file(const int rowid,
146147
xmlTextWriterWriteFormatElement(writer, BAD_CAST "focal_length_max", "%d",
147148
focal_length_max);
148149
xmlTextWriterWriteFormatElement(writer, BAD_CAST "blendop_params", "%s",
149-
dt_preset_encode(stmt, 1));
150+
_preset_encode(stmt, 1));
150151
xmlTextWriterWriteFormatElement(writer, BAD_CAST "blendop_version", "%d",
151152
blendop_version);
152153
xmlTextWriterWriteFormatElement(writer, BAD_CAST "multi_priority", "%d",

src/libs/snapshots.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of darktable,
3-
Copyright (C) 2011-2024 darktable developers.
3+
Copyright (C) 2011-2025 darktable developers.
44
55
darktable is free software: you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -128,7 +128,8 @@ enum _lib_snapshot_button_items
128128
_SNAPSHOT_BUTTON_ENTRY,
129129
} _lib_snapshot_button_items;
130130

131-
static GtkWidget *_lib_snapshot_button_get_item(GtkWidget *button, const int num)
131+
static GtkWidget *_lib_snapshot_button_get_item(GtkWidget *button,
132+
const int num)
132133
{
133134
GtkWidget *cont = gtk_bin_get_child(GTK_BIN(button));
134135
GList *items = gtk_container_get_children(GTK_CONTAINER(cont));
@@ -419,7 +420,8 @@ int button_pressed(struct dt_lib_module_t *self,
419420
_lib_snapshot_rotation_cnt++;
420421

421422
d->vertical = !d->vertical;
422-
gtk_orientable_set_orientation(GTK_ORIENTABLE(gtk_widget_get_parent(dt_ui_snapshot(darktable.gui->ui))), d->vertical ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
423+
gtk_orientable_set_orientation(GTK_ORIENTABLE(gtk_widget_get_parent(dt_ui_snapshot(darktable.gui->ui))),
424+
d->vertical ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
423425
if(_lib_snapshot_rotation_cnt % 2) d->inverted = !d->inverted;
424426
if(d->sidebyside)
425427
d->snap_requested = TRUE;
@@ -536,7 +538,8 @@ static gboolean _lib_button_button_pressed_callback(GtkWidget *widget,
536538
return gtk_widget_has_focus(d->snapshot[index].entry);
537539
}
538540

539-
static void _init_snapshot_entry(dt_lib_module_t *self, dt_lib_snapshot_t *s)
541+
static void _init_snapshot_entry(dt_lib_module_t *self,
542+
dt_lib_snapshot_t *s)
540543
{
541544
/* create snapshot button */
542545
s->button = gtk_toggle_button_new();
@@ -687,7 +690,8 @@ static void _signal_image_removed(gpointer instance,
687690
}
688691
}
689692

690-
static void _signal_image_changed(gpointer instance, dt_lib_module_t *self)
693+
static void _signal_image_changed(gpointer instance,
694+
dt_lib_module_t *self)
691695
{
692696
dt_lib_snapshots_t *d = self->data;
693697

@@ -942,7 +946,8 @@ static int _lib_snapshots_get_activated(dt_lib_module_t *self, GtkWidget *widget
942946
return -1;
943947
}
944948

945-
static void _lib_snapshots_toggled_callback(GtkToggleButton *widget, dt_lib_module_t *self)
949+
static void _lib_snapshots_toggled_callback(GtkToggleButton *widget,
950+
dt_lib_module_t *self)
946951
{
947952
dt_lib_snapshots_t *d = self->data;
948953

@@ -971,7 +976,8 @@ static void _lib_snapshots_toggled_callback(GtkToggleButton *widget, dt_lib_modu
971976
dt_control_queue_redraw_center();
972977
}
973978

974-
static void _lib_snapshots_restore_callback(GtkButton *widget, dt_lib_module_t *self)
979+
static void _lib_snapshots_restore_callback(GtkButton *widget,
980+
dt_lib_module_t *self)
975981
{
976982
dt_lib_snapshots_t *d = self->data;
977983

0 commit comments

Comments
 (0)