Skip to content

Commit 9c82b1f

Browse files
author
Ilia Alshanetsky
committed
Fixed compiler warnings.
1 parent ceff58f commit 9c82b1f

File tree

9 files changed

+34
-34
lines changed

9 files changed

+34
-34
lines changed

ext/calendar/calendar.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ PHP_FUNCTION(cal_info)
177177
}
178178

179179
if (cal < 0 || cal >= CAL_NUM_CALS) {
180-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %d.", cal);
180+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
181181
RETURN_FALSE;
182182
}
183183

@@ -215,7 +215,7 @@ PHP_FUNCTION(cal_days_in_month)
215215
}
216216

217217
if (cal < 0 || cal >= CAL_NUM_CALS) {
218-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %d.", cal);
218+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
219219
RETURN_FALSE;
220220
}
221221

@@ -245,7 +245,7 @@ PHP_FUNCTION(cal_to_jd)
245245
}
246246

247247
if (cal < 0 || cal >= CAL_NUM_CALS) {
248-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %d.", cal);
248+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
249249
RETURN_FALSE;
250250
}
251251

@@ -268,7 +268,7 @@ PHP_FUNCTION(cal_from_jd)
268268
}
269269

270270
if (cal < 0 || cal >= CAL_NUM_CALS) {
271-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %d", cal);
271+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld", cal);
272272
RETURN_FALSE;
273273
}
274274
calendar = &cal_conversion_table[cal];

ext/dio/dio.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ PHP_FUNCTION(dio_open)
157157
}
158158

159159
if (fd == -1) {
160-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open file %s with flags %d and permissions %d: %s", file_name, flags, mode, strerror(errno));
160+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open file %s with flags %ld and permissions %ld: %s", file_name, flags, mode, strerror(errno));
161161
RETURN_FALSE;
162162
}
163163

@@ -237,7 +237,7 @@ PHP_FUNCTION(dio_truncate)
237237
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
238238

239239
if (ftruncate(f->fd, offset) == -1) {
240-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %d bytes: %s", f->fd, offset, strerror(errno));
240+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
241241
RETURN_FALSE;
242242
}
243243

ext/ldap/ldap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ PHP_FUNCTION(ldap_connect)
394394
#endif
395395

396396
if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) {
397-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", LDAPG(num_links));
397+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", LDAPG(num_links));
398398
RETURN_FALSE;
399399
}
400400

ext/mssql/php_mssql.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,13 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
485485
list_entry new_le;
486486

487487
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
488-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", MS_SQL_G(num_links));
488+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
489489
efree(hashed_details);
490490
dbfreelogin(mssql.login);
491491
RETURN_FALSE;
492492
}
493493
if (MS_SQL_G(max_persistent) != -1 && MS_SQL_G(num_persistent) >= MS_SQL_G(max_persistent)) {
494-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%d)", MS_SQL_G(num_persistent));
494+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent));
495495
efree(hashed_details);
496496
dbfreelogin(mssql.login);
497497
RETURN_FALSE;
@@ -606,7 +606,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
606606
}
607607
}
608608
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
609-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", MS_SQL_G(num_links));
609+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
610610
efree(hashed_details);
611611
RETURN_FALSE;
612612
}

ext/openssl/openssl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2298,7 +2298,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
22982298
cipher = EVP_des_ede3_cbc();
22992299
break;
23002300
default:
2301-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid cipher type `%d'", cipherid);
2301+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid cipher type `%ld'", cipherid);
23022302
goto clean_exit;
23032303
}
23042304
if (cipher == NULL) {

ext/sockets/sockets.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1033,12 +1033,12 @@ PHP_FUNCTION(socket_create)
10331033
&& arg1 != AF_INET6
10341034
#endif
10351035
&& arg1 != AF_INET) {
1036-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%d] specified for argument 1, assuming AF_INET", arg1);
1036+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%ld] specified for argument 1, assuming AF_INET", arg1);
10371037
arg1 = AF_INET;
10381038
}
10391039

10401040
if (arg2 > 10) {
1041-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%d] specified for argument 2, assuming SOCK_STREAM", arg2);
1041+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%ld] specified for argument 2, assuming SOCK_STREAM", arg2);
10421042
arg2 = SOCK_STREAM;
10431043
}
10441044

@@ -1651,12 +1651,12 @@ PHP_FUNCTION(socket_create_pair)
16511651
&& domain != AF_INET6
16521652
#endif
16531653
&& domain != AF_UNIX) {
1654-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%d] specified for argument 1, assuming AF_INET", domain);
1654+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%ld] specified for argument 1, assuming AF_INET", domain);
16551655
domain = AF_INET;
16561656
}
16571657

16581658
if (type > 10) {
1659-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%d] specified for argument 2, assuming SOCK_STREAM", type);
1659+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%ld] specified for argument 2, assuming SOCK_STREAM", type);
16601660
type = SOCK_STREAM;
16611661
}
16621662

ext/sysvsem/sysvsem.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ PHP_FUNCTION(sem_get)
193193

194194
semid = semget(key, 3, perm|IPC_CREAT);
195195
if (semid == -1) {
196-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
196+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
197197
RETURN_FALSE;
198198
}
199199

@@ -225,7 +225,7 @@ PHP_FUNCTION(sem_get)
225225
sop[2].sem_flg = SEM_UNDO;
226226
while (semop(semid, sop, 3) == -1) {
227227
if (errno != EINTR) {
228-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));
228+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
229229
break;
230230
}
231231
}
@@ -237,7 +237,7 @@ PHP_FUNCTION(sem_get)
237237
count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL);
238238
#endif
239239
if (count == -1) {
240-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
240+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
241241
}
242242

243243
/* If we are the only user, then take this opportunity to set the max. */
@@ -248,17 +248,17 @@ PHP_FUNCTION(sem_get)
248248
union semun semarg;
249249
semarg.val = max_acquire;
250250
if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) {
251-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
251+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
252252
}
253253
#elif defined(SETVAL_WANTS_PTR)
254254
/* This is correct for Solaris 2.6 which does not have union semun. */
255255
if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) {
256-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
256+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
257257
}
258258
#else
259259
/* This works for i.e. AIX */
260260
if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) {
261-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
261+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
262262
}
263263
#endif
264264
}
@@ -270,7 +270,7 @@ PHP_FUNCTION(sem_get)
270270
sop[0].sem_flg = SEM_UNDO;
271271
while (semop(semid, sop, 1) == -1) {
272272
if (errno != EINTR) {
273-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));
273+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
274274
break;
275275
}
276276
}
@@ -307,7 +307,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
307307
ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semphore", php_sysvsem_module.le_sem);
308308

309309
if (!acquire && sem_ptr->count == 0) {
310-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %d (key 0x%x) is not currently acquired", Z_LVAL_PP(arg_id), sem_ptr->key);
310+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_PP(arg_id), sem_ptr->key);
311311
RETURN_FALSE;
312312
}
313313

@@ -317,7 +317,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
317317

318318
while (semop(sem_ptr->semid, &sop, 1) == -1) {
319319
if (errno != EINTR) {
320-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
320+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
321321
RETURN_FALSE;
322322
}
323323
}
@@ -372,7 +372,7 @@ PHP_FUNCTION(sem_remove)
372372
#else
373373
if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) {
374374
#endif
375-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semphore %d does not (any longer) exist", Z_LVAL_PP(arg_id));
375+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semphore %ld does not (any longer) exist", Z_LVAL_PP(arg_id));
376376
RETURN_FALSE;
377377
}
378378

@@ -381,7 +381,7 @@ PHP_FUNCTION(sem_remove)
381381
#else
382382
if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) {
383383
#endif
384-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for SysV sempphore %d: %s", Z_LVAL_PP(arg_id), strerror(errno));
384+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_PP(arg_id), strerror(errno));
385385
RETURN_FALSE;
386386
}
387387

ext/sysvshm/sysvshm.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ PHP_FUNCTION(shm_remove)
215215
}
216216

217217
if (shmctl(shm_list_ptr->id, IPC_RMID,NULL) < 0) {
218-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %i: %s", shm_list_ptr->key, id, strerror(errno));
218+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, id, strerror(errno));
219219
RETURN_FALSE;
220220
}
221221

@@ -246,7 +246,7 @@ PHP_FUNCTION(shm_put_var)
246246

247247
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
248248
if (type != php_sysvshm.le_shm) {
249-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
249+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
250250
RETURN_FALSE;
251251
}
252252

@@ -293,7 +293,7 @@ PHP_FUNCTION(shm_get_var)
293293

294294
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
295295
if (type != php_sysvshm.le_shm) {
296-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
296+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
297297
RETURN_FALSE;
298298
}
299299

@@ -302,7 +302,7 @@ PHP_FUNCTION(shm_get_var)
302302
shm_varpos = php_check_shm_data((shm_list_ptr->ptr), key);
303303

304304
if (shm_varpos < 0) {
305-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %d doesn't exist", key);
305+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %ld doesn't exist", key);
306306
RETURN_FALSE;
307307
}
308308
shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos);
@@ -339,14 +339,14 @@ PHP_FUNCTION(shm_remove_var)
339339

340340
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
341341
if (type != php_sysvshm.le_shm) {
342-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
342+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
343343
RETURN_FALSE;
344344
}
345345

346346
shm_varpos = php_check_shm_data((shm_list_ptr->ptr), key);
347347

348348
if (shm_varpos < 0) {
349-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %d doesn't exist", key);
349+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %ld doesn't exist", key);
350350
RETURN_FALSE;
351351
}
352352
php_remove_shm_data((shm_list_ptr->ptr), shm_varpos);

ext/xmlrpc/xmlrpc-epi-php.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
921921
else {
922922
/* could not create description */
923923
if(err.xml_elem_error.parser_code) {
924-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %i, column %i, message: %s] Unable to add introspection data returned from %s()",
924+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to add introspection data returned from %s()",
925925
err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error, Z_STRVAL_PP(php_function));
926926
}
927927
else {
@@ -1189,7 +1189,7 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
11891189
} else {
11901190
/* could not create description */
11911191
if(err.xml_elem_error.parser_code) {
1192-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %i, column %i, message: %s] Unable to create introspection data",
1192+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to create introspection data",
11931193
err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error);
11941194
} else {
11951195
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid xml structure. Unable to create introspection data");

0 commit comments

Comments
 (0)