Skip to content

Macro SECS() error for value > 32 #2

@mega64

Description

@mega64

Dla wartości powyżej 32 następuje przekroczenie zakresu domyślnego typu int w mnożeniu razy tysiąc:
#define SECS(t) (unsigned long) (t * 1000)
Doraźnie pomaga wymuszene typu np.: SECS(33UL) ale to niewygodne.
Przydało by się wymuszenie typu samego argunentu:
#define SECS(t) (unsigned long) ( (unsigned long) t * 1000)

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