• Guilherme Maciel Ferreira's avatar
    Increase LOG_LEVELS enum type safety · 3768362a
    Guilherme Maciel Ferreira authored
    Use enum LOG_LEVELS instead of int for log and trace levels.
    
    According to ISO/IEC 9899:2011, section 6.7.2.2
    (Enumeration specifiers), paragraph 4: "Each enumerated type
    shall be compatible with char, a signed integer type, or an
    unsigned integer type. The choice of type is implementation-
    defined, but shall be capable of representing the values of
    all the members". Section J.3.9 also exposes the implementation
    defined nature of enumeration signess.
    
    A negative value (-1) is assigned to objects of type enum
    LOG_LEVELS. However, the enumeration type might be implemented
    as unsigned integer, because there are only positive enumerators
    (enumeration members). Thus, this may cause signess mismatches on
    some architectures.
    Signed-off-by: 's avatarGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
    3768362a
Name
Last commit
Last update
.settings Loading commit data...
Windows Build Loading commit data...
build Loading commit data...
cmake Loading commit data...
doc Loading commit data...
src Loading commit data...
test Loading commit data...
.cproject Loading commit data...
.gitignore Loading commit data...
.gitreview Loading commit data...
.project Loading commit data...
.pydevproject Loading commit data...
.travis.yml Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTING.md Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
about.html Loading commit data...
build.xml Loading commit data...
edl-v10 Loading commit data...
epl-v10 Loading commit data...
notice.html Loading commit data...
travis-build.sh Loading commit data...
travis-install.sh Loading commit data...