zm: Typedef C++11 int types to make them easier to use

In order to clearly state the intended length of an integer variable
all usages of other integer types (short int, int, long int, ...)
should be converted.
pull/3122/head
Peter Keresztes Schmidt 2021-02-02 17:51:22 +01:00
parent b35e27d0b6
commit 0f5df0c739
2 changed files with 36 additions and 3 deletions

View File

@ -21,6 +21,8 @@
#ifndef ZM_H
#define ZM_H
#include "zm_define.h"
#include "zm_config.h"
#include "zm_signal.h"
#ifdef SOLARIS
@ -29,10 +31,8 @@
#endif
#include "zm_logger.h"
#include <stdint.h>
#include <iostream>
extern const char* self;
extern const char *self;
#endif // ZM_H

33
src/zm_define.h Normal file
View File

@ -0,0 +1,33 @@
/*
* This file is part of the ZoneMinder Project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef ZONEMINDER_SRC_ZM_DEFINE_H_
#define ZONEMINDER_SRC_ZM_DEFINE_H_
#include <cinttypes>
typedef std::int64_t int64;
typedef std::int32_t int32;
typedef std::int16_t int16;
typedef std::int8_t int8;
typedef std::uint64_t uint64;
typedef std::uint32_t uint32;
typedef std::uint16_t uint16;
typedef std::uint8_t uint8;
#endif // ZONEMINDER_SRC_ZM_DEFINE_H_