]> granicus.if.org Git - php/commitdiff
fix datatype mismatches
authorAnatol Belski <ab@php.net>
Tue, 24 Mar 2015 17:49:54 +0000 (18:49 +0100)
committerAnatol Belski <ab@php.net>
Tue, 24 Mar 2015 21:02:29 +0000 (22:02 +0100)
ext/session/php_session.h
ext/session/session.c
main/SAPI.c
main/SAPI.h

index c6734acfa92284c8e0745687605ed785d3d097a4..58f6ea85cd7f2e2bc681987e6a1efc8b937844ab 100644 (file)
 #define PS_NUM_APIS      9
 #define PS_OPEN_ARGS     void **mod_data, const char *save_path, const char *session_name
 #define PS_CLOSE_ARGS    void **mod_data
-#define PS_READ_ARGS     void **mod_data, zend_string *key, zend_string **val, int maxlifetime
-#define PS_WRITE_ARGS    void **mod_data, zend_string *key, zend_string *val, int maxlifetime
+#define PS_READ_ARGS     void **mod_data, zend_string *key, zend_string **val, zend_long maxlifetime
+#define PS_WRITE_ARGS    void **mod_data, zend_string *key, zend_string *val, zend_long maxlifetime
 #define PS_DESTROY_ARGS  void **mod_data, zend_string *key
-#define PS_GC_ARGS       void **mod_data, int maxlifetime, int *nrdels
+#define PS_GC_ARGS       void **mod_data, zend_long maxlifetime, int *nrdels
 #define PS_CREATE_SID_ARGS void **mod_data
 #define PS_VALIDATE_SID_ARGS void **mod_data, zend_string *key
-#define PS_UPDATE_TIMESTAMP_ARGS void **mod_data, zend_string *key, zend_string *val, int maxlifetime
+#define PS_UPDATE_TIMESTAMP_ARGS void **mod_data, zend_string *key, zend_string *val, zend_long maxlifetime
 
 typedef struct ps_module_struct {
        const char *s_name;
@@ -227,7 +227,7 @@ ZEND_TSRMLS_CACHE_EXTERN();
 #endif
 
 #define PS_SERIALIZER_ENCODE_ARGS void
-#define PS_SERIALIZER_DECODE_ARGS const char *val, int vallen
+#define PS_SERIALIZER_DECODE_ARGS const char *val, size_t vallen
 
 typedef struct ps_serializer_struct {
        const char *name;
index b1582c0e8aee922eecf1a70296be8e0b96965739..eed91fc90a8662fd9974537f491225333ff93b10 100644 (file)
@@ -767,7 +767,7 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
 
 static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */
 {
-       int tmp;
+       zend_long tmp;
        tmp = zend_atoi(new_value->val, new_value->len);
        if(tmp < 0) {
                php_error_docref(NULL, E_WARNING, "session.upload_progress.freq must be greater than or equal to zero");
@@ -1004,7 +1004,7 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */
        const char *endptr = val + vallen;
        zval current;
        int has_value;
-       int namelen;
+       ptrdiff_t namelen;
        zend_string *name;
        php_unserialize_data_t var_hash;
 
@@ -1988,7 +1988,7 @@ static PHP_FUNCTION(session_id)
        if (PS(id)) {
                /* keep compatibility for "\0" characters ???
                 * see: ext/session/tests/session_id_error3.phpt */
-               int len = strlen(PS(id)->val);
+               size_t len = strlen(PS(id)->val);
                if (UNEXPECTED(len != PS(id)->len)) {
                        RETVAL_NEW_STR(zend_string_init(PS(id)->val, len, 0));
                } else {
@@ -2197,7 +2197,7 @@ static PHP_FUNCTION(session_start)
        zval *value;
        zend_ulong num_idx;
        zend_string *str_idx;
-       int read_and_close = 0;
+       zend_long read_and_close = 0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a", &options) == FAILURE) {
                RETURN_FALSE;
index d23907ce81fa34d78041bc4f74545ba4f156a69a..2757c2e5218fcdcb9d8b5cb1fc3df1125e1f993c 100644 (file)
@@ -595,7 +595,7 @@ static void sapi_update_response_code(int ncode)
  * since zend_llist_del_element only remove one matched item once,
  * we should remove them by ourself
  */
-static void sapi_remove_header(zend_llist *l, char *name, uint len) {
+static void sapi_remove_header(zend_llist *l, char *name, size_t len) {
        sapi_header_struct *header;
        zend_llist_element *next;
        zend_llist_element *current=l->head;
@@ -623,7 +623,7 @@ static void sapi_remove_header(zend_llist *l, char *name, uint len) {
        }
 }
 
-SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace)
+SAPI_API int sapi_add_header_ex(char *header_line, size_t header_line_len, zend_bool duplicate, zend_bool replace)
 {
        sapi_header_line ctr = {0};
        int r;
@@ -666,7 +666,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg)
        sapi_header_struct sapi_header;
        char *colon_offset;
        char *header_line;
-       uint header_line_len;
+       size_t header_line_len;
        int http_response_code;
 
        if (SG(headers_sent) && !SG(request_info).no_headers) {
index a8485df773bd284038aeed177b04f6b63855d350..e7a2721641b6f24c939278c86ad14078b8faf7c8 100644 (file)
@@ -52,7 +52,7 @@
 
 typedef struct {
        char *header;
-       uint header_len;
+       size_t header_len;
 } sapi_header_struct;
 
 
@@ -169,7 +169,7 @@ END_EXTERN_C()
 
 typedef struct {
        char *line; /* If you allocated this, you need to free it yourself */
-       uint line_len;
+       size_t line_len;
        zend_long response_code; /* long due to zend_parse_parameters compatibility */
 } sapi_header_line;
 
@@ -185,7 +185,7 @@ BEGIN_EXTERN_C()
 SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg);
 
 /* Deprecated functions. Use sapi_header_op instead. */
-SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace);
+SAPI_API int sapi_add_header_ex(char *header_line, size_t header_line_len, zend_bool duplicate, zend_bool replace);
 #define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1)