Use defined type in cpp11_brackets_expression testcase

The Guile warnings are because SWIG hasn't seen a definition of
`size_t`, so just use `unsigned` for `Piece::size_type` instead and
remove these warning suppressions.

See #3034
This commit is contained in:
Olly Betts 2024-10-25 07:14:26 +13:00
parent c77498d5db
commit 1382a403f0
1 changed files with 1 additions and 13 deletions

View File

@ -1,19 +1,7 @@
%module cpp11_brackets_expression
#ifdef SWIGGUILE
// Suppress warnings SWIG/Guile emits because these constants have type size_t
// which we don't show SWIG a definition of.
%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::kOk2;
%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::SimpleAsYouExpect123;
%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::SimpleJust123;
%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::AsYouExpect123;
%warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE,SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::kMaxSize;
%warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE,SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::Just123;
#else
%warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE) Piece::kMaxSize;
%warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE) Piece::Just123;
#endif
%warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE) ::kMaxSizeGlobal;
%inline %{
@ -25,7 +13,7 @@ static constexpr int global_one_two_three() { return 123; }
class Piece {
public:
typedef size_t size_type;
typedef unsigned size_type;
typedef int difference_type;
static constexpr size_type kOk2 = std::numeric_limits<difference_type>::max();