@@ -84,19 +84,15 @@ PHP_INI_END()
84
84
#define PHP_NCURSES_CONST (x ) REGISTER_LONG_CONSTANT("NCURSES_"#x, x, CONST_CS | CONST_PERSISTENT)
85
85
#define PHP_NCURSES_FKEY_CONST (x ) REGISTER_LONG_CONSTANT("NCURSES_KEY_F"#x, KEY_F0 + x, CONST_CS | CONST_PERSISTENT)
86
86
87
- /* {{{ php_ncurses_globals_ctor */
88
- static void php_ncurses_globals_ctor (zend_ncurses_globals * pglobals )
87
+ static void php_ncurses_init_globals (zend_ncurses_globals * ncurses_globals )
89
88
{
90
- pglobals -> registered_constants = 0 ;
91
- pglobals -> is_initialised = 0 ;
89
+ memset (ncurses_globals , 0 , sizeof (* ncurses_globals ));
92
90
}
93
- /* }}} */
94
91
95
92
/* {{{ PHP_MINIT_FUNCTION
96
93
*/
97
94
PHP_MINIT_FUNCTION (ncurses )
98
95
{
99
- ZEND_INIT_MODULE_GLOBALS (ncurses , php_ncurses_globals_ctor , NULL );
100
96
/* color constants */
101
97
PHP_NCURSES_CONST (COLOR_BLACK );
102
98
PHP_NCURSES_CONST (COLOR_RED );
@@ -255,6 +251,8 @@ PHP_MINIT_FUNCTION(ncurses)
255
251
PHP_NCURSES_CONST (ALL_MOUSE_EVENTS );
256
252
PHP_NCURSES_CONST (REPORT_MOUSE_POSITION );
257
253
254
+ ZEND_INIT_MODULE_GLOBALS (ncurses , php_ncurses_init_globals , NULL );
255
+
258
256
le_ncurses_windows = zend_register_list_destructors_ex (ncurses_destruct_window , NULL , "ncurses_window" , module_number );
259
257
#if HAVE_NCURSES_PANEL
260
258
le_ncurses_panels = zend_register_list_destructors_ex (ncurses_destruct_panel , NULL , "ncurses_panel" , module_number );
0 commit comments