Skip to content

Commit a1dd39c

Browse files
committed
[[ Constify ]] Ensure extern refs to tables have const modifier
1 parent 1730335 commit a1dd39c

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

engine/src/exec-engine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ MCExecSetTypeInfo *kMCEngineSecurityCategoriesTypeInfo = &_kMCEngineSecurityCate
236236

237237
////////////////////////////////////////////////////////////////////////////////
238238

239-
extern LT command_table[];
239+
extern const LT command_table[];
240240
extern const uint4 command_table_size;
241-
extern Cvalue constant_table[];
241+
extern const Cvalue constant_table[];
242242
extern const uint4 constant_table_size;
243-
extern LT factor_table[];
243+
extern const LT factor_table[];
244244
extern const uint4 factor_table_size;
245245

246246
////////////////////////////////////////////////////////////////////////////////

engine/src/widget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ void MCWidget::recompute(void)
353353

354354
static void lookup_name_for_prop(Properties p_which, MCNameRef& r_name)
355355
{
356-
extern LT factor_table[];
356+
extern const LT factor_table[];
357357
extern const uint4 factor_table_size;
358358
for(uindex_t i = 0; i < factor_table_size; i++)
359359
if (factor_table[i] . type == TT_PROPERTY && factor_table[i] . which == p_which)

engine/test/test_lextable.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TEST(lextable, constant_table)
2525
// Checks that the entries of constant_table are in alphabetical order.
2626
//
2727
{
28-
extern Cvalue constant_table[];
28+
extern const Cvalue constant_table[];
2929
extern const uint4 constant_table_size;
3030

3131
ASSERT_GE(constant_table_size, (unsigned)1);
@@ -44,10 +44,10 @@ TEST(lextable, table_pointer)
4444
// Checks that the entries of factor_table are in alphabetical order.
4545
//
4646
{
47-
extern LT *table_pointers[];
47+
extern const LT *table_pointers[];
4848
extern const uint4 table_pointers_size;
4949

50-
extern uint2 table_sizes[];
50+
extern const uint2 table_sizes[];
5151
extern const uint4 table_sizes_size;
5252

5353
ASSERT_EQ(table_pointers_size, table_sizes_size);

0 commit comments

Comments
 (0)