Skip to content

Remove use of "unsigned" type #6376

@Kebap

Description

@Kebap

Brief summary of issue / Description of requested feature:

Using unsigned type is an anti-pattern according to modern C++ guidelines:
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-nonnegative

We should avoid it in the future and remove its use in existing code.

Steps to reproduce the issue / Reasons for adding feature:

  1. Review src/dlgRoomSymbol.cpp
  2. Function has a signature like: void dlgRoomSymbol::init(QHash<QString, unsigned int>& pSymbols, QSet<TRoom*>& pRooms)

Error output / Expected result of feature

  1. Function nowadays is signed by using standard int alright
  2. But that particular case was not the only one. A search for "unsigned" finds 100+ places in almost 50 different files.

Extra information, such as the Mudlet version, operating system and ideas for how to solve / implement:

Originally noted / requested by Vadi here: #4573 (comment)

See also Expects: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#i6-prefer-expects-for-expressing-preconditions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions