Skip to content

Commit dc96ff9

Browse files
[%pS migration] Use %pS in ext/com_dotnet (#23148)
1 parent 820ec86 commit dc96ff9

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎ext/com_dotnet/com_com.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ zend_result php_com_do_invoke(php_com_dotnet_object *obj, zend_string *name,
638638

639639
if (FAILED(hr)) {
640640
char *winerr = php_win32_error_to_msg(hr);
641-
spprintf(&msg, 0, "Unable to lookup `%s': %s", ZSTR_VAL(name), winerr);
641+
spprintf(&msg, 0, "Unable to lookup `%pS': %s", name, winerr);
642642
php_win32_error_msg_free(winerr);
643643
php_com_throw_exception(hr, msg);
644644
efree(msg);

‎ext/com_dotnet/com_typeinfo.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ PHP_COM_DOTNET_API zend_result php_com_import_typelib(ITypeLib *TL, int mode, in
211211
php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage);
212212
if ((exists = zend_get_constant(const_name)) != NULL) {
213213
if (COMG(autoreg_verbose) && !compare_function(&results, &value, exists)) {
214-
php_error_docref(NULL, E_WARNING, "Type library constant %s is already defined", ZSTR_VAL(const_name));
214+
php_error_docref(NULL, E_WARNING, "Type library constant %pS is already defined", const_name);
215215
}
216216
zend_string_release_ex(const_name, /* persistent */ false);
217217
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
@@ -539,7 +539,7 @@ bool php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, bool p
539539
SysFreeString(olename);
540540

541541
guid_str = php_com_string_from_clsid(&attr->guid, codepage);
542-
php_printf("class %s { /* GUID=%s */\n", ZSTR_VAL(ansi_name), ZSTR_VAL(guid_str));
542+
php_printf("class %pS { /* GUID=%pS */\n", ansi_name, guid_str);
543543
zend_string_release_ex(guid_str, /* persistent */ false);
544544
zend_string_release_ex(ansi_name, /* persistent */ false);
545545
}
@@ -593,16 +593,16 @@ bool php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, bool p
593593
if (olename) {
594594
func_desc = php_com_olestring_to_string(olename, codepage);
595595
SysFreeString(olename);
596-
php_printf("\t/* %s */\n", ZSTR_VAL(func_desc));
596+
php_printf("\t/* %pS */\n", func_desc);
597597
zend_string_release_ex(func_desc, /* persistent */ false);
598598
}
599599

600-
php_printf("\tvar $%s;\n\n", ZSTR_VAL(ansi_name));
600+
php_printf("\tvar $%pS;\n\n", ansi_name);
601601

602602
} else {
603603
/* a function */
604604

605-
php_printf("\tfunction %s(\n", ZSTR_VAL(ansi_name));
605+
php_printf("\tfunction %pS(\n", ansi_name);
606606

607607
for (j = 0; j < func->cParams; j++) {
608608
ELEMDESC *elem = &func->lprgelemdescParam[j];
@@ -626,9 +626,9 @@ bool php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, bool p
626626
if (j+1 < (int)cnames) {
627627
func_desc = php_com_olestring_to_string(names[j+1], codepage);
628628
SysFreeString(names[j+1]);
629-
php_printf(" */ %s%s%c\n",
629+
php_printf(" */ %s%pS%c\n",
630630
elem->tdesc.vt == VT_PTR ? "&$" : "$",
631-
ZSTR_VAL(func_desc),
631+
func_desc,
632632
j == func->cParams - 1 ? ' ' : ','
633633
);
634634
} else {
@@ -649,7 +649,7 @@ bool php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, bool p
649649
if (olename) {
650650
func_desc = php_com_olestring_to_string(olename, codepage);
651651
SysFreeString(olename);
652-
php_printf("\t\t/* %s */\n", ZSTR_VAL(func_desc));
652+
php_printf("\t\t/* %pS */\n", func_desc);
653653
zend_string_release_ex(func_desc, /* persistent */ false);
654654
}
655655

0 commit comments

Comments
 (0)