Skip to content

Commit 03fc2cb

Browse files
committed
Disable formatting temporarily for clang-format-18
Clang-format‑18 fails to format: const int(*init_point)[2]; into: const int (*init_point)[2]; Clang-format 20 is known to produce the correct spacing. However, clang-format‑18 is required for CI compatibility with Ubuntu 24.04 LTS, as it ships clang-format version 18 by default.
1 parent 9e605dc commit 03fc2cb

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

apps/spline.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ static void _init_control_point(apps_spline_data_t *spline)
4444
{100, 280},
4545
{280, 100},
4646
};
47-
const int(*init_point)[2];
47+
/* clang-format off */
48+
const int (*init_point)[2];
49+
/* clang-format on */
4850
if (spline->n_points == 4) {
4951
init_point = init_point_cubic;
5052
} else if (spline->n_points == 3) {

src/draw-pixman.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ void twin_fill(twin_pixmap_t *_dst,
158158
pixman_image_t *dst = create_pixman_image_from_twin_pixmap(_dst);
159159
pixman_color_t color;
160160
twin_argb32_to_pixman_color(pixel, &color);
161+
/* clang-format off */
161162
pixman_image_fill_rectangles(
162163
twin_to_pixman_op(operator), dst, &color, 1,
163-
&(pixman_rectangle16_t){left, top, right - left, bottom - top});
164+
&(pixman_rectangle16_t) {left, top, right - left, bottom - top});
165+
/* clang-format on */
164166

165167
twin_pixmap_damage(_dst, left, top, right, bottom);
166168

src/image-gif.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ static table_t *table_new(int key_size)
165165
table->bulk = init_bulk;
166166
table->n_entries = (1 << key_size) + 2;
167167
table->entries = (entry_t *) &table[1];
168-
for (int key = 0; key < (1 << key_size); key++)
169-
table->entries[key] = (entry_t){1, 0xFFF, key};
168+
for (int key = 0; key < (1 << key_size); key++) {
169+
/* clang-format off */
170+
table->entries[key] = (entry_t) {1, 0xFFF, key};
171+
/* clang-format on */
172+
}
170173
}
171174
return table;
172175
}
@@ -190,7 +193,9 @@ static int entry_add(table_t **table_p,
190193
table->entries = (entry_t *) &table[1];
191194
*table_p = table;
192195
}
193-
table->entries[table->n_entries] = (entry_t){length, prefix, suffix};
196+
/* clang-format off */
197+
table->entries[table->n_entries] = (entry_t) {length, prefix, suffix};
198+
/* clang-format on */
194199
table->n_entries++;
195200
if ((table->n_entries & (table->n_entries - 1)) == 0)
196201
return 1;

src/log.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ int log_add_callback(log_func_t fn, void *udata, int level)
115115
{
116116
for (int i = 0; i < MAX_CALLBACKS; i++) {
117117
if (!L.callbacks[i].fn) {
118-
L.callbacks[i] = (callback_t){fn, udata, level};
118+
/* clang-format off */
119+
L.callbacks[i] = (callback_t) {fn, udata, level};
120+
/* clang-format on */
119121
return 0;
120122
}
121123
}

0 commit comments

Comments
 (0)