]> granicus.if.org Git - php/commitdiff
More wordsize fixes
authorArd Biesheuvel <abies@php.net>
Mon, 8 Mar 2004 23:11:45 +0000 (23:11 +0000)
committerArd Biesheuvel <abies@php.net>
Mon, 8 Mar 2004 23:11:45 +0000 (23:11 +0000)
ext/sqlite/libsqlite/src/main.c
ext/sqlite/libsqlite/src/table.c
ext/sqlite/libsqlite/src/vdbeaux.c
ext/standard/datetime.c
ext/standard/var.c
main/spprintf.c
main/streams/userspace.c
main/streams/xp_socket.c

index e2b269738b83d730c612b3073ffb626cbe2f21ff..f79f266293cdfd4a888f3b1e3f0facd13f8905b1 100644 (file)
@@ -856,7 +856,7 @@ void sqlite_progress_handler(
 ** This routine installs a default busy handler that waits for the
 ** specified number of milliseconds before returning 0.
 */
-void sqlite_busy_timeout(sqlite *db, int ms){
+void sqlite_busy_timeout(sqlite *db, long ms){
   if( ms>0 ){
     sqlite_busy_handler(db, sqliteDefaultBusyCallback, (void*)ms);
   }else{
index dc2d9fa7e584fa07152f6595e7dde6b6a1cd0c23..48c852d4878f839362a7608a1428535d50cab998 100644 (file)
@@ -31,7 +31,7 @@ typedef struct TabResult {
   int nAlloc;
   int nRow;
   int nColumn;
-  int nData;
+  long nData;
   int rc;
 } TabResult;
 
index 6249a29f0bc091de541071553a70d86aeb7725df..087128cbbc79673bb85c2979cb90e39120710f5d 100644 (file)
@@ -471,7 +471,7 @@ void sqliteVdbePrintOp(FILE *pOut, int pc, Op *pOp){
   char *zP3;
   char zPtr[40];
   if( pOp->p3type==P3_POINTER ){
-    sprintf(zPtr, "ptr(%#x)", (int)pOp->p3);
+    sprintf(zPtr, "ptr(%#lx)", (long)pOp->p3);
     zP3 = zPtr;
   }else{
     zP3 = pOp->p3;
@@ -522,7 +522,7 @@ int sqliteVdbeList(
     sprintf(p->zStack[2],"%d", p->aOp[i].p1);
     sprintf(p->zStack[3],"%d", p->aOp[i].p2);
     if( p->aOp[i].p3type==P3_POINTER ){
-      sprintf(p->aStack[4].z, "ptr(%#x)", (int)p->aOp[i].p3);
+      sprintf(p->aStack[4].z, "ptr(%#lx)", (long)p->aOp[i].p3);
       p->zStack[4] = p->aStack[4].z;
     }else{
       p->zStack[4] = p->aOp[i].p3;
index 32441fc83a2fe03172fa1e8804b2d731c929f3e5..82b06fb6d127304b0fe068f5719cc53f350448df 100644 (file)
@@ -83,7 +83,8 @@ void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
        struct tm *ta, tmbuf;
        time_t t, seconds;
        int i, gmadjust, arg_count = ZEND_NUM_ARGS();
-       int is_dst = -1, val, chgsecs = 0;
+       int is_dst = -1, chgsecs = 0;
+       long val;
 
        if (arg_count > 7 || zend_get_parameters_array_ex(arg_count, arguments) == FAILURE) {
                WRONG_PARAM_COUNT;
index 3fd9b4c364130a3719765394d1debce8dbe9e863..f0f5583dca8bef2f4a06966aea78e5fc17b6efcd 100644 (file)
@@ -740,7 +740,7 @@ PHP_FUNCTION(unserialize)
                if (!php_var_unserialize(&return_value, &p, p + Z_STRLEN_PP(buf),  &var_hash TSRMLS_CC)) {
                        PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
                        zval_dtor(return_value);
-                       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %d of %d bytes", p - Z_STRVAL_PP(buf), Z_STRLEN_PP(buf));
+                       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));
                        RETURN_FALSE;
                }
                PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
index 27336f7cf563ac6b531df573961cd94f46a40d88..31211f3bb0cf2f156616878027d2f2b3cb0179fc 100644 (file)
        while (isdigit((int)*str)) {            \
                num *= 10;                              \
                num += NUM(*str++);                     \
-               if (num >= LONG_MAX / 10) {                     \
+               if (num >= INT_MAX / 10) {                      \
                        while (isdigit((int)*str++));   \
                        break;                                                  \
                }                                                                       \
index 5f0ffe8b4812b8ebf8141661fc6602e40c29efd2..cf1c4d4c1e7e0dc4eafd67c634a2f62c127abf8d 100644 (file)
@@ -469,9 +469,9 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t
 
        /* don't allow strange buffer overruns due to bogus return */
        if (didwrite > count) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote %zd bytes more data than requested (%zd written, %zd max)",
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote %ld bytes more data than requested (%ld written, %ld max)",
                                us->wrapper->classname,
-                               didwrite - count, didwrite, count);
+                               (long)(didwrite - count), (long)didwrite, (long)count);
                didwrite = count;
        }
        
@@ -510,8 +510,8 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count
                convert_to_string(retval);
                didread = Z_STRLEN_P(retval);
                if (didread > count) {
-                       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",
-                                       us->wrapper->classname, didread - count, didread, count);
+                       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",
+                                       us->wrapper->classname, (long)(didread - count), (long)didread, (long)count);
                        didread = count;
                }
                if (didread > 0)
index d70a9c79bad6062c863bb02d2ddffc03621ce453..d6fb72257e1f57c3203ed2c2cf76d0eeea52766c 100644 (file)
@@ -57,8 +57,8 @@ static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count
        if (didwrite <= 0) {
                char *estr = php_socket_strerror(php_socket_errno(), NULL, 0);
 
-               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %d bytes failed with errno=%d %s",
-                               count, php_socket_errno(), estr);
+               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %ld bytes failed with errno=%d %s",
+                               (long)count, php_socket_errno(), estr);
                efree(estr);
        }