Skip to content

Commit b303ba0

Browse files
author
Ard Biesheuvel
committed
More wordsize fixes
1 parent f1ff65c commit b303ba0

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

ext/sqlite/libsqlite/src/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ void sqlite_progress_handler(
856856
** This routine installs a default busy handler that waits for the
857857
** specified number of milliseconds before returning 0.
858858
*/
859-
void sqlite_busy_timeout(sqlite *db, int ms){
859+
void sqlite_busy_timeout(sqlite *db, long ms){
860860
if( ms>0 ){
861861
sqlite_busy_handler(db, sqliteDefaultBusyCallback, (void*)ms);
862862
}else{

ext/sqlite/libsqlite/src/table.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ typedef struct TabResult {
3131
int nAlloc;
3232
int nRow;
3333
int nColumn;
34-
int nData;
34+
long nData;
3535
int rc;
3636
} TabResult;
3737

ext/sqlite/libsqlite/src/vdbeaux.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ void sqliteVdbePrintOp(FILE *pOut, int pc, Op *pOp){
471471
char *zP3;
472472
char zPtr[40];
473473
if( pOp->p3type==P3_POINTER ){
474-
sprintf(zPtr, "ptr(%#x)", (int)pOp->p3);
474+
sprintf(zPtr, "ptr(%#lx)", (long)pOp->p3);
475475
zP3 = zPtr;
476476
}else{
477477
zP3 = pOp->p3;
@@ -522,7 +522,7 @@ int sqliteVdbeList(
522522
sprintf(p->zStack[2],"%d", p->aOp[i].p1);
523523
sprintf(p->zStack[3],"%d", p->aOp[i].p2);
524524
if( p->aOp[i].p3type==P3_POINTER ){
525-
sprintf(p->aStack[4].z, "ptr(%#x)", (int)p->aOp[i].p3);
525+
sprintf(p->aStack[4].z, "ptr(%#lx)", (long)p->aOp[i].p3);
526526
p->zStack[4] = p->aStack[4].z;
527527
}else{
528528
p->zStack[4] = p->aOp[i].p3;

ext/standard/datetime.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
8383
struct tm *ta, tmbuf;
8484
time_t t, seconds;
8585
int i, gmadjust, arg_count = ZEND_NUM_ARGS();
86-
int is_dst = -1, val, chgsecs = 0;
86+
int is_dst = -1, chgsecs = 0;
87+
long val;
8788

8889
if (arg_count > 7 || zend_get_parameters_array_ex(arg_count, arguments) == FAILURE) {
8990
WRONG_PARAM_COUNT;

ext/standard/var.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ PHP_FUNCTION(unserialize)
740740
if (!php_var_unserialize(&return_value, &p, p + Z_STRLEN_PP(buf), &var_hash TSRMLS_CC)) {
741741
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
742742
zval_dtor(return_value);
743-
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %d of %d bytes", p - Z_STRVAL_PP(buf), Z_STRLEN_PP(buf));
743+
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %d bytes", (long)(p - Z_STRVAL_PP(buf)), Z_STRLEN_PP(buf));
744744
RETURN_FALSE;
745745
}
746746
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);

main/spprintf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
while (isdigit((int)*str)) { \
150150
num *= 10; \
151151
num += NUM(*str++); \
152-
if (num >= LONG_MAX / 10) { \
152+
if (num >= INT_MAX / 10) { \
153153
while (isdigit((int)*str++)); \
154154
break; \
155155
} \

main/streams/userspace.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t
469469

470470
/* don't allow strange buffer overruns due to bogus return */
471471
if (didwrite > count) {
472-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote %zd bytes more data than requested (%zd written, %zd max)",
472+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote %ld bytes more data than requested (%ld written, %ld max)",
473473
us->wrapper->classname,
474-
didwrite - count, didwrite, count);
474+
(long)(didwrite - count), (long)didwrite, (long)count);
475475
didwrite = count;
476476
}
477477

@@ -510,8 +510,8 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count
510510
convert_to_string(retval);
511511
didread = Z_STRLEN_P(retval);
512512
if (didread > count) {
513-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read %zd bytes more data than requested (%zd read, %zd max) - excess data will be lost",
514-
us->wrapper->classname, didread - count, didread, count);
513+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read %ld bytes more data than requested (%ld read, %ld max) - excess data will be lost",
514+
us->wrapper->classname, (long)(didread - count), (long)didread, (long)count);
515515
didread = count;
516516
}
517517
if (didread > 0)

main/streams/xp_socket.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count
5757
if (didwrite <= 0) {
5858
char *estr = php_socket_strerror(php_socket_errno(), NULL, 0);
5959

60-
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %d bytes failed with errno=%d %s",
61-
count, php_socket_errno(), estr);
60+
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %ld bytes failed with errno=%d %s",
61+
(long)count, php_socket_errno(), estr);
6262
efree(estr);
6363
}
6464

0 commit comments

Comments
 (0)