summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
authorK.Takata <kentkt@csc.jp>2021-06-02 13:28:16 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-02 13:28:16 +0200
commiteeec2548785b2dd245a31ab25d7bde0f88ea1a6d (patch)
tree533236c436888fd7a072c4d94a75279158f9c8a5 /src/gui_gtk_x11.c
parentb54abeeafb074248597878a874fed9a66b114c06 (diff)
patch 8.2.2922: computing array length is done in various waysv8.2.2922
Problem: Computing array length is done in various ways. Solution: Use ARRAY_LENGTH everywhere. (Ken Takata, closes #8305)
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 249b20877a..1a3eadad72 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -134,7 +134,7 @@ static const GtkTargetEntry selection_targets[] =
{"TEXT", 0, TARGET_TEXT},
{"STRING", 0, TARGET_STRING}
};
-#define N_SELECTION_TARGETS (sizeof(selection_targets) / sizeof(selection_targets[0]))
+#define N_SELECTION_TARGETS ARRAY_LENGTH(selection_targets)
#ifdef FEAT_DND
/*
@@ -149,7 +149,7 @@ static const GtkTargetEntry dnd_targets[] =
{"STRING", 0, TARGET_STRING},
{"text/plain", 0, TARGET_TEXT_PLAIN}
};
-# define N_DND_TARGETS (sizeof(dnd_targets) / sizeof(dnd_targets[0]))
+# define N_DND_TARGETS ARRAY_LENGTH(dnd_targets)
#endif
@@ -6853,7 +6853,7 @@ mch_set_mouse_shape(int shape)
else
id &= ~1; // they are always even (why?)
}
- else if (shape < (int)(sizeof(mshape_ids) / sizeof(int)))
+ else if (shape < (int)ARRAY_LENGTH(mshape_ids))
id = mshape_ids[shape];
else
return;