diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-11-19 14:03:29 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-11-19 14:04:00 -0800 |
commit | 68d58e69738db41061812b10f2f3f50b6a1b9aa0 (patch) | |
tree | 8045f9ded98f40daf1901862d729d1336adf2f06 /modules | |
parent | f2c002592196297a3517b3ed1f05c8ac7b096044 (diff) | |
download | emacs-68d58e69738db41061812b10f2f3f50b6a1b9aa0.tar.gz |
Prefer intmax_t to int64_t in module code
* modules/mod-test/mod-test.c (sum, Fmod_test_sum):
* src/emacs-module.c (module_extract_integer)
(module_make_integer):
* src/emacs-module.h (struct emacs_env_25):
Prefer intmax_t to int64_t. This doesn’t change the generated
code on any of the machines Emacs currently ports to, but it’s
at least in theory more future-proof as C99 doesn’t guarantee
that int64_t exists.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mod-test/mod-test.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/mod-test/mod-test.c b/modules/mod-test/mod-test.c index e27fb582355..79f347f04ab 100644 --- a/modules/mod-test/mod-test.c +++ b/modules/mod-test/mod-test.c @@ -31,7 +31,8 @@ Fmod_test_return_t (emacs_env *env, int nargs, emacs_value args[], void *data) } /* Expose simple sum function. */ -static int64_t sum (int64_t a, int64_t b) +static intmax_t +sum (intmax_t a, intmax_t b) { return a + b; } @@ -39,10 +40,10 @@ static int64_t sum (int64_t a, int64_t b) static emacs_value Fmod_test_sum (emacs_env *env, int nargs, emacs_value args[], void *data) { - int64_t a = env->extract_integer (env, args[0]); - int64_t b = env->extract_integer (env, args[1]); + intmax_t a = env->extract_integer (env, args[0]); + intmax_t b = env->extract_integer (env, args[1]); - int64_t r = sum(a, b); + intmax_t r = sum (a, b); return env->make_integer (env, r); } |