Skip to content

Commit ee75f34

Browse files
committed
ext/soap: Add const qualifiers for serialize functions
As serializing something should not affect the value of it
1 parent ca2b131 commit ee75f34

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ext/soap/php_sdl.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,10 +1795,10 @@ static void sdl_serialize_key(const zend_string *key, smart_str *out)
17951795
}
17961796
}
17971797

1798-
static void sdl_serialize_encoder_ref(encodePtr enc, HashTable *tmp_encoders, smart_str *out) {
1798+
static void sdl_serialize_encoder_ref(const encodePtr enc, const HashTable *tmp_encoders, smart_str *out) {
17991799
if (enc) {
18001800
zval *encoder_num;
1801-
if ((encoder_num = zend_hash_str_find(tmp_encoders, (char*)&enc, sizeof(enc))) != 0) {
1801+
if ((encoder_num = zend_hash_str_find(tmp_encoders, (const char*)&enc, sizeof(enc))) != 0) {
18021802
WSDL_CACHE_PUT_INT(Z_LVAL_P(encoder_num), out);
18031803
} else {
18041804
WSDL_CACHE_PUT_INT(0, out);
@@ -1808,10 +1808,10 @@ static void sdl_serialize_encoder_ref(encodePtr enc, HashTable *tmp_encoders, sm
18081808
}
18091809
}
18101810

1811-
static void sdl_serialize_type_ref(sdlTypePtr type, HashTable *tmp_types, smart_str *out) {
1811+
static void sdl_serialize_type_ref(const sdlTypePtr type, const HashTable *tmp_types, smart_str *out) {
18121812
if (type) {
18131813
zval *type_num;
1814-
if ((type_num = zend_hash_str_find(tmp_types, (char*)&type, sizeof(type))) != NULL) {
1814+
if ((type_num = zend_hash_str_find(tmp_types, (const char*)&type, sizeof(type))) != NULL) {
18151815
WSDL_CACHE_PUT_INT(Z_LVAL_P(type_num), out);
18161816
} else {
18171817
WSDL_CACHE_PUT_INT(0, out);
@@ -1821,7 +1821,7 @@ static void sdl_serialize_type_ref(sdlTypePtr type, HashTable *tmp_types, smart_
18211821
}
18221822
}
18231823

1824-
static void sdl_serialize_attribute(sdlAttributePtr attr, HashTable *tmp_encoders, smart_str *out)
1824+
static void sdl_serialize_attribute(const sdlAttributePtr attr, const HashTable *tmp_encoders, smart_str *out)
18251825
{
18261826
size_t i;
18271827

@@ -1851,7 +1851,7 @@ static void sdl_serialize_attribute(sdlAttributePtr attr, HashTable *tmp_encoder
18511851
}
18521852
}
18531853

1854-
static void sdl_serialize_model(sdlContentModelPtr model, HashTable *tmp_types, HashTable *tmp_elements, smart_str *out)
1854+
static void sdl_serialize_model(const sdlContentModelPtr model, const HashTable *tmp_types, const HashTable *tmp_elements, smart_str *out)
18551855
{
18561856
WSDL_CACHE_PUT_1(model->kind, out);
18571857
WSDL_CACHE_PUT_INT(model->min_occurs, out);
@@ -1883,7 +1883,7 @@ static void sdl_serialize_model(sdlContentModelPtr model, HashTable *tmp_types,
18831883
}
18841884
}
18851885

1886-
static void sdl_serialize_resriction_int(sdlRestrictionIntPtr x, smart_str *out)
1886+
static void sdl_serialize_resriction_int(const sdlRestrictionIntPtr x, smart_str *out)
18871887
{
18881888
if (x) {
18891889
WSDL_CACHE_PUT_1(1, out);
@@ -1894,7 +1894,7 @@ static void sdl_serialize_resriction_int(sdlRestrictionIntPtr x, smart_str *out)
18941894
}
18951895
}
18961896

1897-
static void sdl_serialize_resriction_char(sdlRestrictionCharPtr x, smart_str *out)
1897+
static void sdl_serialize_resriction_char(const sdlRestrictionCharPtr x, smart_str *out)
18981898
{
18991899
if (x) {
19001900
WSDL_CACHE_PUT_1(1, out);
@@ -1905,7 +1905,7 @@ static void sdl_serialize_resriction_char(sdlRestrictionCharPtr x, smart_str *ou
19051905
}
19061906
}
19071907

1908-
static void sdl_serialize_type(sdlTypePtr type, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out)
1908+
static void sdl_serialize_type(const sdlTypePtr type, const HashTable *tmp_encoders, const HashTable *tmp_types, smart_str *out)
19091909
{
19101910
size_t i;
19111911
HashTable *tmp_elements = NULL;
@@ -2001,15 +2001,15 @@ static void sdl_serialize_type(sdlTypePtr type, HashTable *tmp_encoders, HashTab
20012001
}
20022002
}
20032003

2004-
static void sdl_serialize_encoder(encodePtr enc, HashTable *tmp_types, smart_str *out)
2004+
static void sdl_serialize_encoder(const encodePtr enc, const HashTable *tmp_types, smart_str *out)
20052005
{
20062006
WSDL_CACHE_PUT_INT(enc->details.type, out);
20072007
sdl_serialize_string(enc->details.type_str, out);
20082008
sdl_serialize_string(enc->details.ns, out);
20092009
sdl_serialize_type_ref(enc->details.sdl_type, tmp_types, out);
20102010
}
20112011

2012-
static void sdl_serialize_parameters(HashTable *ht, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out)
2012+
static void sdl_serialize_parameters(const HashTable *ht, const HashTable *tmp_encoders, const HashTable *tmp_types, smart_str *out)
20132013
{
20142014
size_t i;
20152015

@@ -2033,7 +2033,7 @@ static void sdl_serialize_parameters(HashTable *ht, HashTable *tmp_encoders, Has
20332033
}
20342034
}
20352035

2036-
static void sdl_serialize_soap_body(sdlSoapBindingFunctionBodyPtr body, HashTable *tmp_encoders, HashTable *tmp_types, smart_str *out)
2036+
static void sdl_serialize_soap_body(const sdlSoapBindingFunctionBodyPtr body, const HashTable *tmp_encoders, const HashTable *tmp_types, smart_str *out)
20372037
{
20382038
size_t i, j;
20392039

0 commit comments

Comments
 (0)