Skip to content

[tonic] Use precise-width integer types, following style guide. #93070

@ghost

Description

[Suggested by @dcharkes on flutter/engine/pull/29405]:

We should consider updating [the DartConverter templates] to int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t to make it conform to the style guide.

Specifically the Style Guide says:

Integer Types
Of the built-in C++ integer types, the only one used is int. If a program needs a variable of a different size, use a precise-width integer type [..] such as int16_t.

As such we might replace the templates at:
https://github.com/flutter/engine/blob/91033b9dab6b5819a4b8e9921bf849cfe1a9c5a2/third_party/tonic/converter/dart_converter.h#L92-L108

So that instead of, for instance:

template <>
struct DartConverter<unsigned long> : public DartConverterInteger<unsigned long> {};

We'd have:

template <>
struct DartConverter<uint32_t> : public DartConverterInteger<uint32_t> {};

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions