Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make typedefs platform independent #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ addons:
- "python3"
- "python3-pip"
before_install:
- sudo pip install --upgrade setuptools
- sudo pip install cpp-coveralls
- sudo pip3 install --upgrade setuptools
- sudo pip3 install cffi
- sudo pip3 install colorama
- sudo pip3 install coloredlogs
Expand Down
10 changes: 6 additions & 4 deletions include/raft_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@
#ifndef RAFT_DEFS_H_
#define RAFT_DEFS_H_

#include <stdint.h>

/**
* Unique entry ids are mostly used for debugging and nothing else,
* so there is little harm if they collide.
*/
typedef int raft_entry_id_t;
typedef int32_t raft_entry_id_t;

/**
* Monotonic term counter.
*/
typedef long int raft_term_t;
typedef int64_t raft_term_t;

/**
* Monotonic log entry index.
*
* This is also used to as an entry count size type.
*/
typedef long int raft_index_t;
typedef int64_t raft_index_t;

/**
* Unique node identifier.
*/
typedef int raft_node_id_t;
typedef int32_t raft_node_id_t;

#endif /* RAFT_DEFS_H_ */