commit d28f0f268fdb61883843f6f429142305cd04da54
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Tue Sep 22 16:28:37 2026 +0200
Constify some arrays
Spotted by cppcheck.
---
src/Bullet.cpp | 16 ++++++++--------
src/CutAndPaste.cpp | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/Bullet.cpp b/src/Bullet.cpp
index e4a2c616b5..5b08f3f624 100644
--- a/src/Bullet.cpp
+++ b/src/Bullet.cpp
@@ -378,7 +378,7 @@ docstring const Bullet::bulletEntry(int f, int c)
FontSize Bullet::bulletFontSize(int s)
{
// see comment at bulletSize
- static FontSize BulletFontSize[SIZEMAX] = {
+ static FontSize const BulletFontSize[SIZEMAX] = {
TINY_SIZE, SCRIPT_SIZE, FOOTNOTE_SIZE, SMALL_SIZE, NORMAL_SIZE,
LARGE_SIZE, LARGER_SIZE, LARGEST_SIZE, HUGE_SIZE, HUGER_SIZE
};
@@ -390,7 +390,7 @@ FontSize Bullet::bulletFontSize(int s)
docstring const Bullet::bulletLabel(int f, int c)
{
// see comment at bulletEntry
- static int UnicodeBulletPanel0[CHARMAX] = {
+ static const int UnicodeBulletPanel0[CHARMAX] = {
/* standard */
0x02013, 0x22A2,
0x022A3, 0x0266D, 0x0266E,
@@ -407,7 +407,7 @@ docstring const Bullet::bulletLabel(int f, int c)
0x021C0, 0x021C1,
0x021D2, 0x0227B
};
- static int UnicodeBulletPanel1[CHARMAX] = {
+ static const int UnicodeBulletPanel1[CHARMAX] = {
/* amssymb */
0x021DB, 0x021A3,
0x021A0, 0x021DD,
@@ -426,7 +426,7 @@ docstring const Bullet::bulletLabel(int f, int c)
0x025BE, 0x029EB,
0x025FC
};
- static int UnicodeBulletPanel2[CHARMAX] = {
+ static const int UnicodeBulletPanel2[CHARMAX] = {
/* psnfss1 */
0x025CF, 0x0274D,
0x025D7, 0x02295,
@@ -447,7 +447,7 @@ docstring const Bullet::bulletLabel(int f, int c)
0x02766, 0x02767,
0x027A2, 0x027A3
};
- static int UnicodeBulletPanel3[CHARMAX] = {
+ static const int UnicodeBulletPanel3[CHARMAX] = {
/* psnfss2 */
0x0260E, 0x02706,
0x02702, 0x02704,
@@ -468,7 +468,7 @@ docstring const Bullet::bulletLabel(int f, int c)
0x02660, 0x02663,
0x02666, 0x02665
};
- static int UnicodeBulletPanel4[CHARMAX] = {
+ static const int UnicodeBulletPanel4[CHARMAX] = {
/* psnfss3 */
0x02721, 0x0272C,
0x0272B, 0x02B51,
@@ -489,7 +489,7 @@ docstring const Bullet::bulletLabel(int f, int c)
0x02746, 0x02740,
0x0273F, 0x02741
};
- static int UnicodeBulletPanel5[CHARMAX] = {
+ static const int UnicodeBulletPanel5[CHARMAX] = {
/* psnfss4 */
0x0279F, 0x027A0,
0x027A1, 0x027A8,
@@ -511,7 +511,7 @@ docstring const Bullet::bulletLabel(int f, int c)
0x027A7, 0x02212
}; /* string const BulletPanels[][] */
- static int * UnicodeBulletPanels[FONTMAX] = {
+ static const int * UnicodeBulletPanels[FONTMAX] = {
UnicodeBulletPanel0, UnicodeBulletPanel1,
UnicodeBulletPanel2, UnicodeBulletPanel3,
UnicodeBulletPanel4, UnicodeBulletPanel5
diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index 72ba42cb3b..01581d1cb2 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -1331,7 +1331,7 @@ bool pasteClipboardText(Cursor & cur, ErrorList &
errorList, bool asParagraphs,
// Then try TeX and HTML
Clipboard::TextType types[2] = {Clipboard::HtmlTextType,
Clipboard::LaTeXTextType};
- string names[2] = {"html", "latexclipboard"};
+ string const names[2] = {"html", "latexclipboard"};
for (int i = 0; i < 2; ++i) {
if (type != types[i] && type != Clipboard::AnyTextType)
continue;
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs