Skip to content

Commit b40a98e

Browse files
committed
PHPC-183: Fix compiler warnings with -Wdeclaration-after-statement
This also increases the chances of successful Windows build :)
1 parent 8b1624b commit b40a98e

39 files changed

+51
-58
lines changed

php_phongo.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,8 @@ int phongo_stream_close(mongoc_stream_t *stream) /* {{{ */
674674

675675
void php_phongo_set_timeout(php_phongo_stream_socket *base_stream, int32_t timeout_msec) /* {{{ */
676676
{
677-
TSRMLS_FETCH_FROM_CTX(base_stream->tsrm_ls);
678677
struct timeval rtimeout = {0, 0};
678+
TSRMLS_FETCH_FROM_CTX(base_stream->tsrm_ls);
679679

680680
if (timeout_msec > 0) {
681681
rtimeout.tv_sec = timeout_msec / 1000;
@@ -1665,9 +1665,11 @@ PHP_GINIT_FUNCTION(phongo)
16651665
/* {{{ PHP_MINIT_FUNCTION */
16661666
PHP_MINIT_FUNCTION(phongo)
16671667
{
1668-
(void)type; /* We don't care if we are loaded via dl() or extension= */
16691668
void ***ctx = NULL;
16701669
TSRMLS_SET_CTX(ctx);
1670+
(void)type; /* We don't care if we are loaded via dl() or extension= */
1671+
1672+
16711673
REGISTER_INI_ENTRIES();
16721674

16731675
/* Initialize libbson */

src/BSON/Binary.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ zend_object_value php_phongo_binary_create_object(zend_class_entry *class_type T
141141
/* {{{ PHP_MINIT_FUNCTION */
142142
PHP_MINIT_FUNCTION(Binary)
143143
{
144-
(void)type; /* We don't care if we are loaded via dl() or extension= */
145144
zend_class_entry ce;
145+
(void)type;(void)module_number;
146146

147147
INIT_NS_CLASS_ENTRY(ce, "BSON", "Binary", php_phongo_binary_me);
148148
ce.create_object = php_phongo_binary_create_object;

src/BSON/Javascript.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ zend_object_value php_phongo_javascript_create_object(zend_class_entry *class_ty
129129
/* {{{ PHP_MINIT_FUNCTION */
130130
PHP_MINIT_FUNCTION(Javascript)
131131
{
132-
(void)type; /* We don't care if we are loaded via dl() or extension= */
133132
zend_class_entry ce;
133+
(void)type;(void)module_number;
134+
134135

135136
INIT_NS_CLASS_ENTRY(ce, "BSON", "Javascript", php_phongo_javascript_me);
136137
ce.create_object = php_phongo_javascript_create_object;

src/BSON/MaxKey.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ zend_object_value php_phongo_maxkey_create_object(zend_class_entry *class_type T
8787
/* {{{ PHP_MINIT_FUNCTION */
8888
PHP_MINIT_FUNCTION(MaxKey)
8989
{
90-
(void)type; /* We don't care if we are loaded via dl() or extension= */
9190
zend_class_entry ce;
91+
(void)type;(void)module_number;
92+
9293

9394
INIT_NS_CLASS_ENTRY(ce, "BSON", "MaxKey", php_phongo_maxkey_me);
9495
ce.create_object = php_phongo_maxkey_create_object;

src/BSON/MinKey.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ zend_object_value php_phongo_minkey_create_object(zend_class_entry *class_type T
8787
/* {{{ PHP_MINIT_FUNCTION */
8888
PHP_MINIT_FUNCTION(MinKey)
8989
{
90-
(void)type; /* We don't care if we are loaded via dl() or extension= */
9190
zend_class_entry ce;
91+
(void)type;(void)module_number;
92+
9293

9394
INIT_NS_CLASS_ENTRY(ce, "BSON", "MinKey", php_phongo_minkey_me);
9495
ce.create_object = php_phongo_minkey_create_object;

src/BSON/ObjectID.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ HashTable *php_phongo_objectid_get_debug_info(zval *object, int *is_temp TSRMLS_
180180
/* {{{ PHP_MINIT_FUNCTION */
181181
PHP_MINIT_FUNCTION(ObjectID)
182182
{
183-
(void)type;(void)module_number;
184183
zend_class_entry ce;
184+
(void)type;(void)module_number;
185185

186186
INIT_NS_CLASS_ENTRY(ce, "BSON", "ObjectID", php_phongo_objectid_me);
187187
php_phongo_objectid_ce = zend_register_internal_class(&ce TSRMLS_CC);

src/BSON/Persistable.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ static zend_function_entry php_phongo_persistable_me[] = {
6060
/* {{{ PHP_MINIT_FUNCTION */
6161
PHP_MINIT_FUNCTION(Persistable)
6262
{
63-
(void)type;
64-
(void)module_number;
6563
zend_class_entry ce;
64+
(void)type;(void)module_number;
6665

6766
INIT_NS_CLASS_ENTRY(ce, "BSON", "Persistable", php_phongo_persistable_me);
6867
php_phongo_persistable_ce = zend_register_internal_interface(&ce TSRMLS_CC);

src/BSON/Regex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ zend_object_value php_phongo_regex_create_object(zend_class_entry *class_type TS
194194
/* {{{ PHP_MINIT_FUNCTION */
195195
PHP_MINIT_FUNCTION(Regex)
196196
{
197-
(void)type; /* We don't care if we are loaded via dl() or extension= */
198197
zend_class_entry ce;
198+
(void)type;(void)module_number;
199199

200200
INIT_NS_CLASS_ENTRY(ce, "BSON", "Regex", php_phongo_regex_me);
201201
ce.create_object = php_phongo_regex_create_object;

src/BSON/Serializable.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ static zend_function_entry php_phongo_serializable_me[] = {
6464
/* {{{ PHP_MINIT_FUNCTION */
6565
PHP_MINIT_FUNCTION(Serializable)
6666
{
67-
(void)type;
68-
(void)module_number;
6967
zend_class_entry ce;
68+
(void)type;(void)module_number;
7069

7170
INIT_NS_CLASS_ENTRY(ce, "BSON", "Serializable", php_phongo_serializable_me);
7271
php_phongo_serializable_ce = zend_register_internal_interface(&ce TSRMLS_CC);

src/BSON/Timestamp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ zend_object_value php_phongo_timestamp_create_object(zend_class_entry *class_typ
138138
/* {{{ PHP_MINIT_FUNCTION */
139139
PHP_MINIT_FUNCTION(Timestamp)
140140
{
141-
(void)type; /* We don't care if we are loaded via dl() or extension= */
142141
zend_class_entry ce;
142+
(void)type;(void)module_number;
143143

144144
INIT_NS_CLASS_ENTRY(ce, "BSON", "Timestamp", php_phongo_timestamp_me);
145145
ce.create_object = php_phongo_timestamp_create_object;

0 commit comments

Comments
 (0)