Skip to content

Commit 48f0469

Browse files
bjoriderickr
authored andcommitted
PHPC-398: zend_parse_parameter 's' expects a char* and size_t now
1 parent 7c99f91 commit 48f0469

File tree

8 files changed

+24
-23
lines changed

8 files changed

+24
-23
lines changed

phongo_compat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
# define ADD_ASSOC_STRING(_zv, _key, _value) add_assoc_string_ex(_zv, ZEND_STRS(_key), _value);
159159
# define ADD_ASSOC_STRINGL(_zv, _key, _value, _len) add_assoc_stringl_ex(_zv, ZEND_STRS(_key), _value, _len);
160160
# define phongo_free_object_arg zend_object
161+
# define phongo_zpp_char_len size_t
161162
# define ZEND_HASH_APPLY_COUNT(ht) (ht)->u.v.nApplyCount
162163
# define PHONGO_RETVAL_STRINGL(s, slen) RETVAL_STRINGL(s, slen)
163164
# define PHONGO_RETURN_STRINGL(s, slen) RETVAL_STRINGL(s, slen)
@@ -179,6 +180,7 @@
179180
# define Z_PHPDATE_P(object) zend_object_store_get_object(object TSRMLS_CC)
180181
# define Z_ISUNDEF(x) !x
181182
# define phongo_free_object_arg void
183+
# define phongo_zpp_char_len int
182184
# define ZEND_HASH_APPLY_COUNT(ht) (ht)->nApplyCount
183185
# define PHONGO_RETVAL_STRINGL(s, slen) RETVAL_STRINGL(s, slen, 1)
184186
# define PHONGO_RETURN_STRINGL(s, slen) RETVAL_STRINGL(s, slen, 1)

src/BSON/Binary.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ PHP_METHOD(Binary, __construct)
5353
php_phongo_binary_t *intern;
5454
zend_error_handling error_handling;
5555
char *data;
56-
int data_len;
56+
phongo_zpp_char_len data_len;
5757
long type;
5858

5959

src/BSON/Javascript.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ PHP_METHOD(Javascript, __construct)
5454
php_phongo_javascript_t *intern;
5555
zend_error_handling error_handling;
5656
char *javascript;
57-
int javascript_len;
57+
phongo_zpp_char_len javascript_len;
5858
zval *document = NULL;
5959
bson_t scope = BSON_INITIALIZER;
6060

src/BSON/ObjectID.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ PHP_METHOD(ObjectID, __construct)
5454
php_phongo_objectid_t *intern;
5555
zend_error_handling error_handling;
5656
char *id = NULL;
57-
int id_len;
57+
phongo_zpp_char_len id_len;
5858

5959

6060
zend_replace_error_handling(EH_THROW, phongo_exception_from_phongo_domain(PHONGO_ERROR_INVALID_ARGUMENT), &error_handling TSRMLS_CC);

src/BSON/Regex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ PHP_METHOD(Regex, __construct)
5353
php_phongo_regex_t *intern;
5454
zend_error_handling error_handling;
5555
char *pattern;
56-
int pattern_len;
56+
phongo_zpp_char_len pattern_len;
5757
char *flags;
58-
int flags_len;
58+
phongo_zpp_char_len flags_len;
5959

6060

6161
zend_replace_error_handling(EH_THROW, phongo_exception_from_phongo_domain(PHONGO_ERROR_INVALID_ARGUMENT), &error_handling TSRMLS_CC);

src/MongoDB/Manager.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ PHP_METHOD(Manager, __construct)
6060
{
6161
php_phongo_manager_t *intern;
6262
zend_error_handling error_handling;
63-
mongoc_uri_t *uri;
6463
char *uri_string = NULL;
65-
int uri_string_len = 0;
64+
phongo_zpp_char_len uri_string_len = 0;
6665
zval *options = NULL;
6766
bson_t bson_options = BSON_INITIALIZER;
6867
zval *driverOptions = NULL;
@@ -92,7 +91,7 @@ PHP_METHOD(Manager, executeCommand)
9291
{
9392
php_phongo_manager_t *intern;
9493
char *db;
95-
int db_len;
94+
phongo_zpp_char_len db_len;
9695
zval *command;
9796
zval *readPreference = NULL;
9897
php_phongo_command_t *cmd;
@@ -117,7 +116,7 @@ PHP_METHOD(Manager, executeQuery)
117116
{
118117
php_phongo_manager_t *intern;
119118
char *namespace;
120-
int namespace_len;
119+
phongo_zpp_char_len namespace_len;
121120
zval *zquery;
122121
zval *readPreference = NULL;
123122
DECLARE_RETURN_VALUE_USED
@@ -140,7 +139,7 @@ PHP_METHOD(Manager, executeBulkWrite)
140139
{
141140
php_phongo_manager_t *intern;
142141
char *namespace;
143-
int namespace_len;
142+
phongo_zpp_char_len namespace_len;
144143
zval *zbulk;
145144
zval *zwrite_concern = NULL;
146145
php_phongo_bulkwrite_t *bulk;

src/MongoDB/Server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ PHP_METHOD(Server, executeCommand)
6464
{
6565
php_phongo_server_t *intern;
6666
char *db;
67-
int db_len;
67+
phongo_zpp_char_len db_len;
6868
zval *command;
6969
zval *readPreference = NULL;
7070
php_phongo_command_t *cmd;
@@ -89,7 +89,7 @@ PHP_METHOD(Server, executeQuery)
8989
{
9090
php_phongo_server_t *intern;
9191
char *namespace;
92-
int namespace_len;
92+
phongo_zpp_char_len namespace_len;
9393
zval *zquery;
9494
zval *readPreference = NULL;
9595
DECLARE_RETURN_VALUE_USED
@@ -112,7 +112,7 @@ PHP_METHOD(Server, executeBulkWrite)
112112
{
113113
php_phongo_server_t *intern;
114114
char *namespace;
115-
int namespace_len;
115+
phongo_zpp_char_len namespace_len;
116116
zval *zbulk;
117117
zval *zwrite_concern = NULL;
118118
php_phongo_bulkwrite_t *bulk;

src/bson.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ void php_phongo_bson_typemap_to_state(zval *typemap, php_phongo_bson_typemap *ma
11651165
PHP_FUNCTION(toPHP)
11661166
{
11671167
char *data;
1168-
int data_len;
1168+
phongo_zpp_char_len data_len;
11691169
zval *typemap = NULL;
11701170
php_phongo_bson_state state = PHONGO_BSON_STATE_INITIALIZER;
11711171

@@ -1193,11 +1193,11 @@ PHP_FUNCTION(toPHP)
11931193
Returns the JSON representation of a BSON value */
11941194
PHP_FUNCTION(toJSON)
11951195
{
1196-
char *data;
1197-
int data_len;
1198-
const bson_t *b;
1199-
bool eof = false;
1200-
bson_reader_t *reader;
1196+
char *data;
1197+
phongo_zpp_char_len data_len;
1198+
const bson_t *b;
1199+
bool eof = false;
1200+
bson_reader_t *reader;
12011201

12021202
SUPPRESS_UNUSED_WARNING(return_value_ptr) SUPPRESS_UNUSED_WARNING(this_ptr) SUPPRESS_UNUSED_WARNING(return_value_used) /* We don't use these */
12031203

@@ -1230,10 +1230,10 @@ PHP_FUNCTION(toJSON)
12301230
Returns the BSON representation of a JSON value */
12311231
PHP_FUNCTION(fromJSON)
12321232
{
1233-
char *data;
1234-
int data_len;
1235-
bson_t b = BSON_INITIALIZER;
1236-
bson_error_t error;
1233+
char *data;
1234+
phongo_zpp_char_len data_len;
1235+
bson_t b = BSON_INITIALIZER;
1236+
bson_error_t error;
12371237

12381238
SUPPRESS_UNUSED_WARNING(return_value_ptr) SUPPRESS_UNUSED_WARNING(this_ptr) SUPPRESS_UNUSED_WARNING(return_value_used) /* We don't use these */
12391239

0 commit comments

Comments
 (0)