Skip to content

Commit 464cae2

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

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ext/soap/php_sdl.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -1796,10 +1796,10 @@ static void sdl_serialize_key(const zend_string *key, smart_str *out)
17961796
}
17971797
}
17981798

1799-
static void sdl_serialize_encoder_ref(encodePtr enc, HashTable *tmp_encoders, smart_str *out) {
1799+
static void sdl_serialize_encoder_ref(const encodePtr enc, const HashTable *tmp_encoders, smart_str *out) {
18001800
if (enc) {
18011801
zval *encoder_num;
1802-
if ((encoder_num = zend_hash_str_find(tmp_encoders, (char*)&enc, sizeof(enc))) != 0) {
1802+
if ((encoder_num = zend_hash_str_find(tmp_encoders, (const char*)&enc, sizeof(enc))) != 0) {
18031803
WSDL_CACHE_PUT_INT(Z_LVAL_P(encoder_num), out);
18041804
} else {
18051805
WSDL_CACHE_PUT_INT(0, out);
@@ -1809,10 +1809,10 @@ static void sdl_serialize_encoder_ref(encodePtr enc, HashTable *tmp_encoders, sm
18091809
}
18101810
}
18111811

1812-
static void sdl_serialize_type_ref(sdlTypePtr type, HashTable *tmp_types, smart_str *out) {
1812+
static void sdl_serialize_type_ref(const sdlTypePtr type, const HashTable *tmp_types, smart_str *out) {
18131813
if (type) {
18141814
zval *type_num;
1815-
if ((type_num = zend_hash_str_find(tmp_types, (char*)&type, sizeof(type))) != NULL) {
1815+
if ((type_num = zend_hash_str_find(tmp_types, (const char*)&type, sizeof(type))) != NULL) {
18161816
WSDL_CACHE_PUT_INT(Z_LVAL_P(type_num), out);
18171817
} else {
18181818
WSDL_CACHE_PUT_INT(0, out);
@@ -1822,7 +1822,7 @@ static void sdl_serialize_type_ref(sdlTypePtr type, HashTable *tmp_types, smart_
18221822
}
18231823
}
18241824

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

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

1855-
static void sdl_serialize_model(sdlContentModelPtr model, HashTable *tmp_types, HashTable *tmp_elements, smart_str *out)
1855+
static void sdl_serialize_model(const sdlContentModelPtr model, const HashTable *tmp_types, const HashTable *tmp_elements, smart_str *out)
18561856
{
18571857
WSDL_CACHE_PUT_1(model->kind, out);
18581858
WSDL_CACHE_PUT_INT(model->min_occurs, out);
@@ -1884,7 +1884,7 @@ static void sdl_serialize_model(sdlContentModelPtr model, HashTable *tmp_types,
18841884
}
18851885
}
18861886

1887-
static void sdl_serialize_resriction_int(sdlRestrictionIntPtr x, smart_str *out)
1887+
static void sdl_serialize_resriction_int(const sdlRestrictionIntPtr x, smart_str *out)
18881888
{
18891889
if (x) {
18901890
WSDL_CACHE_PUT_1(1, out);
@@ -1895,7 +1895,7 @@ static void sdl_serialize_resriction_int(sdlRestrictionIntPtr x, smart_str *out)
18951895
}
18961896
}
18971897

1898-
static void sdl_serialize_resriction_char(sdlRestrictionCharPtr x, smart_str *out)
1898+
static void sdl_serialize_resriction_char(const sdlRestrictionCharPtr x, smart_str *out)
18991899
{
19001900
if (x) {
19011901
WSDL_CACHE_PUT_1(1, out);
@@ -1906,7 +1906,7 @@ static void sdl_serialize_resriction_char(sdlRestrictionCharPtr x, smart_str *ou
19061906
}
19071907
}
19081908

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

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

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

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

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

0 commit comments

Comments
 (0)