diff options
| author | Paul Eggert | 2015-11-19 15:24:30 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-11-19 15:25:16 -0800 |
| commit | d81b0e1326a1ce3b588fa1b812b868fa877d41da (patch) | |
| tree | 5523cfce4ce07b044e08fe1d8141f0ec6822424a /src | |
| parent | 92949781eb0963fd1b25f1eec4e2d72d2c8ae32e (diff) | |
| download | emacs-d81b0e1326a1ce3b588fa1b812b868fa877d41da.tar.gz emacs-d81b0e1326a1ce3b588fa1b812b868fa877d41da.zip | |
Omit unnecessary clear in Fmodule_load
* src/emacs-module.c (Fmodule_load):
Simplify and avoid unnecessary initialization of priv member to 0.
* src/emacs-module.c: (module_vec_set, module_vec_get, module_vec_size)
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs-module.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c index 8992840307f..f611c8ba600 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -692,19 +692,16 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0, | |||
| 692 | if (!module_init) | 692 | if (!module_init) |
| 693 | error ("Module %s does not have an init function.", SDATA (file)); | 693 | error ("Module %s does not have an init function.", SDATA (file)); |
| 694 | 694 | ||
| 695 | struct { | 695 | struct emacs_runtime_private priv; |
| 696 | struct emacs_runtime pub; | 696 | struct emacs_runtime pub = |
| 697 | struct emacs_runtime_private priv; | 697 | { |
| 698 | } runtime = { | 698 | .size = sizeof pub, |
| 699 | .pub = { | 699 | .private_members = &priv, |
| 700 | .size = sizeof runtime.pub, | 700 | .get_environment = module_get_environment |
| 701 | .get_environment = module_get_environment, | 701 | }; |
| 702 | .private_members = &runtime.priv | 702 | initialize_environment (&priv.environment); |
| 703 | } | 703 | int r = module_init (&pub); |
| 704 | }; | 704 | finalize_environment (&priv.environment); |
| 705 | initialize_environment (&runtime.priv.environment); | ||
| 706 | int r = module_init (&runtime.pub); | ||
| 707 | finalize_environment (&runtime.priv.environment); | ||
| 708 | 705 | ||
| 709 | if (r != 0) | 706 | if (r != 0) |
| 710 | { | 707 | { |