had_problems = 1;
overflow_ptr = (char *) &end_magic;
- for (i=0; i<sizeof(long); i++) {
+ for (i=0; i<(int)sizeof(long); i++) {
if (overflow_ptr[i]!=magic_ptr[i]) {
overflows++;
}
zend_debug_alloc_output("%10s\t", "End:");
zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n", end_magic, MEM_BLOCK_END_MAGIC);
zend_debug_alloc_output("%10s\t","");
- if (overflows>=sizeof(long)) {
+ if (overflows>=(int)sizeof(long)) {
zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long));
} else {
zend_debug_alloc_output("%d byte(s) overflown\n", overflows);
/* If we did a shift... re-index like it did before */
if (!off_the_end) {
- int k = 0;
+ unsigned int k = 0;
int should_rehash = 0;
Bucket *p = Z_ARRVAL_PP(stack)->pListHead;
while (p != NULL) {
int pattern_len;
long flags = 0;
glob_t globbuf;
- int n, ret;
+ unsigned int n;
+ int ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &pattern, &pattern_len, &flags) == FAILURE)
return;
if (i < 0) {
RETURN_FALSE;
}
- if (i > sizeof(ans)) {
+ if (i > (int)sizeof(ans)) {
i = sizeof(ans);
}
hp = (HEADER *)&ans;
{
FILE *fp;
char *buf, *tmp=NULL;
- int buflen, l, pclose_return;
+ int l, pclose_return;
char *cmd_p, *b, *c, *d=NULL;
php_stream *stream;
- size_t bufl = 0;
+ size_t buflen, bufl = 0;
#if PHP_SIGCHILD
void (*sig_handler)();
#endif
return 0;
}
- memcpy(ent->d_name, basename, MIN(sizeof(ent->d_name), basename_len)-1);
+ memcpy(ent->d_name, basename, MIN((int)sizeof(ent->d_name), basename_len)-1);
ent->d_name[sizeof(ent->d_name)-1] = '\0';
efree(basename);
/* Where to get lo to hi bytes from */
byte_map[0] = 0;
- for (i = 0; i < sizeof(int); i++) {
+ for (i = 0; i < (int)sizeof(int); i++) {
int_map[i] = i;
}
/* Where to get hi to lo bytes from */
byte_map[0] = size - 1;
- for (i = 0; i < sizeof(int); i++) {
+ for (i = 0; i < (int)sizeof(int); i++) {
int_map[i] = size - (sizeof(int) - i);
}
const XML_Char *
XML_ErrorString(int code)
{
- if (code < 0 || code >= sizeof(error_mapping)) {
+ if (code < 0 || code >= (int)sizeof(error_mapping)) {
return "Unknown";
}
return error_mapping[code];
Unzip a gzip-compressed string */
PHP_FUNCTION(gzuncompress)
{
- int data_len, status, factor=1, maxfactor=16;
+ int data_len, status;
+ unsigned int factor=1, maxfactor=16;
long limit = 0;
unsigned long plength=0, length;
char *data, *s1=NULL, *s2=NULL;
that should be eneugh for all real life cases
*/
do {
- length = plength ? plength : data_len * (1 << factor++);
+ length = plength ? plength : (unsigned long)data_len * (1 << factor++);
s2 = (char *) erealloc(s1, length);
status = uncompress(s2, &length, data, data_len);
s1 = s2;
Unzip a gzip-compressed string */
PHP_FUNCTION(gzinflate)
{
- int data_len, status, factor=1, maxfactor=16;
+ int data_len, status;
+ unsigned int factor=1, maxfactor=16;
long limit = 0;
unsigned long plength=0, length;
char *data, *s1=NULL, *s2=NULL;
stream.zfree = (free_func) Z_NULL;
do {
- length = plength ? plength : data_len * (1 << factor++);
+ length = plength ? plength : (unsigned long)data_len * (1 << factor++);
s2 = (char *) erealloc(s1, length);
if (!s2 && s1) {
if (s) { /* if there is no path name after the file, do not bother */
/* to try open the directory */
length = s - (path_info + 2);
- if (length > sizeof(user) - 1)
+ if (length > (int)sizeof(user) - 1)
length = sizeof(user) - 1;
memcpy(user, path_info + 2, length);
user[length] = '\0';