Skip to content

Add const modifier for zend_extension #6462

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Zend/zend_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ typedef size_t (*op_array_persist_calc_func_t)(zend_op_array *op_array);
typedef size_t (*op_array_persist_func_t)(zend_op_array *op_array, void *mem);

struct _zend_extension {
char *name;
char *version;
char *author;
char *URL;
char *copyright;
const char *name;
const char *version;
const char *author;
const char *URL;
const char *copyright;

startup_func_t startup;
shutdown_func_t shutdown;
Expand Down
9 changes: 4 additions & 5 deletions sapi/phpdbg/phpdbg_prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ static void add_zendext_info(zend_extension *ext) /* {{{ */ {
/* }}} */

#ifdef HAVE_LIBDL
PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) /* {{{ */ {
PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, const char **name) /* {{{ */ {
DL_HANDLE handle;
char *extension_dir;

Expand Down Expand Up @@ -1325,7 +1325,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name)
}

module_entry = get_module();
*name = (char *) module_entry->name;
*name = module_entry->name;

if (strcmp(ZEND_EXTENSION_BUILD_ID, module_entry->build_id)) {
phpdbg_error("dl", "type=\"wrongbuild\" module=\"%s\" buildneeded=\"%s\" buildinstalled=\"%s\"", "%s was built with configuration %s, whereas running engine is %s", module_entry->name, module_entry->build_id, ZEND_EXTENSION_BUILD_ID);
Expand Down Expand Up @@ -1371,8 +1371,8 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name)

PHPDBG_COMMAND(dl) /* {{{ */
{
const char *type;
char *name, *path;
const char *type, *name;
char *path;

if (!param || param->type == EMPTY_PARAM) {
phpdbg_notice("dl", "extensiontype=\"Zend extension\"", "Zend extensions");
Expand All @@ -1388,7 +1388,6 @@ PHPDBG_COMMAND(dl) /* {{{ */
phpdbg_activate_err_buf(1);
if ((type = phpdbg_load_module_or_extension(&path, &name)) == NULL) {
phpdbg_error("dl", "path=\"%s\" %b", "Could not load %s, not found or invalid zend extension / module: %b", path);
efree(name);
} else {
phpdbg_notice("dl", "extensiontype=\"%s\" name=\"%s\" path=\"%s\"", "Successfully loaded the %s %s at path %s", type, name, path);
}
Expand Down