diff --git a/src/modules/CommonLog/clf.c b/src/modules/CommonLog/clf.c index 1484cfbecd763c62e4521d39e602c6f659aea32f..db6a580bb9b78aa3a57e22b80676ecfd5ef33d56 100644 --- a/src/modules/CommonLog/clf.c +++ b/src/modules/CommonLog/clf.c @@ -1,6 +1,6 @@ /* MUST BE FIRST */ #include "global.h" -RCSID("$Id: clf.c,v 1.3 2000/07/28 07:11:47 hubbe Exp $"); +RCSID("$Id: clf.c,v 1.4 2000/08/19 11:12:21 grubba Exp $"); #include "fdlib.h" #include "stralloc.h" #include "pike_macros.h" @@ -10,6 +10,7 @@ RCSID("$Id: clf.c,v 1.3 2000/07/28 07:11:47 hubbe Exp $"); #include "builtin_functions.h" #include "module_support.h" #include "error.h" +#include "bignum.h" #include "threads.h" #include <stdio.h> @@ -95,7 +96,8 @@ static void f_read_clf( INT32 args ) FD f = -1; int cls, c, my_fd=1, state=0, tzs=0; char *char_pointer; - INT32 v=0, yy=0, mm=0, dd=0, h=0, m=0, s=0, tz=0, offs0=0, len=0; + INT32 v=0, yy=0, mm=0, dd=0, h=0, m=0, s=0, tz=0; + ptrdiff_t offs0=0, len=0; struct svalue *old_sp; /* #define DYNAMIC_BUF */ #ifdef DYNAMIC_BUF @@ -187,7 +189,7 @@ static void f_read_clf( INT32 args ) if(sp != old_sp) { if(sp == old_sp+15) { f_aggregate(15); - push_int(offs0); + push_int64(offs0); apply_svalue(logfun, 2); pop_stack(); } else @@ -703,7 +705,7 @@ static void f_read_clf( INT32 args ) } if(sp == old_sp + 15) { f_aggregate(15); - push_int(offs0); + push_int64(offs0); apply_svalue(logfun, 2); pop_stack(); } @@ -717,7 +719,7 @@ static void f_read_clf( INT32 args ) */ fd_close(f); pop_n_elems(sp-old_sp+args); - push_int(offs0); + push_int64(offs0); } diff --git a/src/modules/HTTPLoop/accept_and_parse.c b/src/modules/HTTPLoop/accept_and_parse.c index 050e36c3310956ae36be8f7dcb6cc12870a5a5dd..9ccc91cfac92a478079b88d90a3b48e6b218d506 100644 --- a/src/modules/HTTPLoop/accept_and_parse.c +++ b/src/modules/HTTPLoop/accept_and_parse.c @@ -197,7 +197,7 @@ static int parse(struct args *arg) aap_get_header(arg, "content-length", H_INT, &arg->res.content_len); if((arg->res.data_len - arg->res.body_start) < arg->res.content_len) { - int nr; + ptrdiff_t nr; /* read the rest of the request.. OBS: This is done without any * timeout right now. It is relatively easy to add one, though. * The only problem is that this might be an upload of a _large_ file, diff --git a/src/modules/Image/encodings/gif.c b/src/modules/Image/encodings/gif.c index 78c9a2368f38efbf8e42fd6e03d70dcf7a2310b8..9e69e77f8f331a555ad15a596235e0063b09b644 100644 --- a/src/modules/Image/encodings/gif.c +++ b/src/modules/Image/encodings/gif.c @@ -1,9 +1,9 @@ -/* $Id: gif.c,v 1.59 2000/08/16 19:50:13 grubba Exp $ */ +/* $Id: gif.c,v 1.60 2000/08/19 11:15:40 grubba Exp $ */ /* **! module Image **! note -**! $Id: gif.c,v 1.59 2000/08/16 19:50:13 grubba Exp $ +**! $Id: gif.c,v 1.60 2000/08/19 11:15:40 grubba Exp $ **! submodule GIF **! **! This submodule keep the GIF encode/decode capabilities @@ -31,7 +31,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: gif.c,v 1.59 2000/08/16 19:50:13 grubba Exp $"); +RCSID("$Id: gif.c,v 1.60 2000/08/19 11:15:40 grubba Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -832,7 +832,10 @@ CHRONO("gif render_block begin"); /* write gce control block */ { push_int(transparency); - if (alphaidx!=-1) push_int(alphaidx); else push_int(0); + if (alphaidx!=-1) + push_int64(alphaidx); + else + push_int(0); push_int(delay); push_int(user_input); push_int(disposal); @@ -854,7 +857,7 @@ CHRONO("render_block index end"); while (n2--) { if (!(a->r||a->g||a->b)) - *d=(unsigned char)alphaidx; + *d = DO_NOT_WARN((unsigned char)alphaidx); d++; a++; } diff --git a/src/modules/Image/font.c b/src/modules/Image/font.c index dc7b34b6a8a8681dc36d9db3d53d8db12ef77c8b..e9cb802d0472e536f65755d4bc30e99ccd1c1f10 100644 --- a/src/modules/Image/font.c +++ b/src/modules/Image/font.c @@ -1,4 +1,4 @@ -/* $Id: font.c,v 1.64 2000/08/14 14:27:05 grubba Exp $ */ +/* $Id: font.c,v 1.65 2000/08/19 11:16:53 grubba Exp $ */ #include "global.h" #define SPACE_CHAR 'i' @@ -9,7 +9,7 @@ extern unsigned char * image_default_font; /* **! module Image **! note -**! $Id: font.c,v 1.64 2000/08/14 14:27:05 grubba Exp $ +**! $Id: font.c,v 1.65 2000/08/19 11:16:53 grubba Exp $ **! class Font **! **! note @@ -268,7 +268,7 @@ static INLINE int char_width(struct font *this, INT32 c) } #ifndef HAVE_MMAP -static INLINE int my_read(int from, void *t, size_t towrite) +static INLINE ptrdiff_t my_read(int from, void *t, size_t towrite) { ptrdiff_t res; while((res = fd_read(from, t, towrite)) < 0) diff --git a/src/modules/Pipe/pipe.c b/src/modules/Pipe/pipe.c index e8618bf20b2d62fa85b99e7f92519def9158d285..bf8e5f7a4f46d83b0f366d82c23b17eca7550e1c 100644 --- a/src/modules/Pipe/pipe.c +++ b/src/modules/Pipe/pipe.c @@ -30,7 +30,7 @@ #include <fcntl.h> -RCSID("$Id: pipe.c,v 1.41 2000/08/17 18:25:04 grubba Exp $"); +RCSID("$Id: pipe.c,v 1.42 2000/08/19 11:18:12 grubba Exp $"); #include "threads.h" #include "stralloc.h" @@ -167,7 +167,7 @@ struct pipe int fd; /* buffer fd or -1 */ unsigned long bytes_in_buffer; - unsigned long pos; + size_t pos; /* fd: size of buffer file */ /* current position of first element (buffer or mmap) */ struct buffer *firstbuffer,*lastbuffer; diff --git a/src/modules/files/file.c b/src/modules/files/file.c index 060f6b174a7e42516655c7b95b3216b000b62eb0..cf19546af8084a301a66105ea197e98145a4ce1e 100644 --- a/src/modules/files/file.c +++ b/src/modules/files/file.c @@ -6,7 +6,7 @@ /**/ #define NO_PIKE_SHORTHAND #include "global.h" -RCSID("$Id: file.c,v 1.188 2000/08/16 20:12:50 grubba Exp $"); +RCSID("$Id: file.c,v 1.189 2000/08/19 11:22:23 grubba Exp $"); #include "fdlib.h" #include "interpret.h" #include "svalue.h" @@ -359,7 +359,7 @@ static struct pike_string *do_read(int fd, int *err) { ONERROR ebuf; - INT32 bytes_read,i; + ptrdiff_t bytes_read, i; bytes_read=0; *err=0; @@ -375,7 +375,7 @@ static struct pike_string *do_read(int fd, int fd=FD; int e; THREADS_ALLOW(); - i=fd_read(fd, str->str+bytes_read, r); + i = fd_read(fd, str->str+bytes_read, r); THREADS_DISALLOW(); e=errno; /* check signals may affect errno */ @@ -442,7 +442,7 @@ static struct pike_string *do_read(int fd, buf = low_make_buf_space(try_read, &b); THREADS_ALLOW(); - i=fd_read(fd, buf, try_read); + i = fd_read(fd, buf, try_read); THREADS_DISALLOW(); e=errno; /* check signals may effect errno */ @@ -1086,7 +1086,7 @@ static void file_write(INT32 args) #ifdef WITH_OOB static void file_write_oob(INT32 args) { - INT32 written,i; + ptrdiff_t written,i; struct pike_string *str; if(args<1 || Pike_sp[-args].type != PIKE_T_STRING) @@ -1109,7 +1109,7 @@ static void file_write_oob(INT32 args) { int fd=FD; THREADS_ALLOW(); - i=fd_send(fd, str->str + written, str->len - written, MSG_OOB); + i = fd_send(fd, str->str + written, str->len - written, MSG_OOB); THREADS_DISALLOW(); #ifdef _REENTRANT @@ -1400,7 +1400,7 @@ static void file_seek(INT32 args) #ifdef HAVE_LSEEK64 INT64 to = 0; #else - INT32 to = 0; + ptrdiff_t to = 0; #endif #ifdef HAVE_LSEEK64 @@ -1434,9 +1434,9 @@ static void file_seek(INT32 args) ERRNO=0; #ifdef HAVE_LSEEK64 - to=lseek64(FD,to,to<0 ? SEEK_END : SEEK_SET); + to = lseek64(FD,to,to<0 ? SEEK_END : SEEK_SET); #else - to=fd_lseek(FD,to,to<0 ? SEEK_END : SEEK_SET); + to = fd_lseek(FD,to,to<0 ? SEEK_END : SEEK_SET); #endif if(to<0) ERRNO=errno; @@ -1449,7 +1449,7 @@ static void file_tell(INT32 args) #ifdef HAVE_LSEEK64 INT64 to; #else - INT32 to; + ptrdiff_t to; #endif if(FD < 0) @@ -1457,9 +1457,9 @@ static void file_tell(INT32 args) ERRNO=0; #ifdef HAVE_LSEEK64 - to=lseek64(FD, 0L, SEEK_CUR); + to = lseek64(FD, 0L, SEEK_CUR); #else - to=fd_lseek(FD, 0L, SEEK_CUR); + to = fd_lseek(FD, 0L, SEEK_CUR); #endif if(to<0) ERRNO=errno; @@ -2330,8 +2330,8 @@ static TH_RETURN_TYPE proxy_thread(void * data) while(1) { - long len, w; - len=fd_read(p->from, buffer, READ_BUFFER); + ptrdiff_t len, w; + len = fd_read(p->from, buffer, READ_BUFFER); if(len==0) break; if(len<0) { @@ -2343,7 +2343,7 @@ static TH_RETURN_TYPE proxy_thread(void * data) w=0; while(w<len) { - long wl=fd_write(p->to, buffer+w, len-w); + ptrdiff_t wl = fd_write(p->to, buffer+w, len-w); if(wl<0) { if(errno==EINTR) continue; diff --git a/src/modules/files/file.h b/src/modules/files/file.h index 7b106f2f634a05812d40df5c7405ff4395ad15a2..04b5e936e6838f2ecdf4562eb1fcf40407aacfbc 100644 --- a/src/modules/files/file.h +++ b/src/modules/files/file.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: file.h,v 1.16 2000/08/04 18:33:02 grubba Exp $ + * $Id: file.h,v 1.17 2000/08/19 11:25:50 grubba Exp $ */ #ifndef FILE_H @@ -61,7 +61,7 @@ struct pike_sendfile { struct object *self; - int sent; + ptrdiff_t sent; struct array *headers; struct array *trailers; @@ -78,8 +78,8 @@ struct pike_sendfile struct my_file *from; struct my_file *to; - INT_TYPE offset; - INT_TYPE len; + ptrdiff_t offset; + ptrdiff_t len; struct iovec *hd_iov; struct iovec *tr_iov; @@ -89,7 +89,7 @@ struct pike_sendfile struct iovec *iovs; char *buffer; - int buf_size; + ptrdiff_t buf_size; }; #endif /* _REENTRANT */ diff --git a/src/modules/files/sendfile.c b/src/modules/files/sendfile.c index 91a38350962bdf66011f11460c6ccd3b2e479fcb..51a08580dcf7ae3ce112605815843549b934e3c5 100644 --- a/src/modules/files/sendfile.c +++ b/src/modules/files/sendfile.c @@ -1,5 +1,5 @@ /* - * $Id: sendfile.c,v 1.42 2000/08/11 23:49:54 per Exp $ + * $Id: sendfile.c,v 1.43 2000/08/19 11:25:58 grubba Exp $ * * Sends headers + from_fd[off..off+len-1] + trailers to to_fd asyncronously. * @@ -425,7 +425,7 @@ void low_do_sendfile(struct pike_sendfile *this) while (this->len) { void *mem; - int len = st.st_size - this->offset; /* To end of file */ + ptrdiff_t len = st.st_size - this->offset; /* To end of file */ char *buf; int buflen; if ((len > this->len) && (this->len >= 0)) { @@ -484,8 +484,8 @@ void low_do_sendfile(struct pike_sendfile *this) fd_lseek(this->from_fd, this->offset, SEEK_SET); { - int buflen; - int len = this->len; + ptrdiff_t buflen; + ptrdiff_t len = this->len; if ((len > this->buf_size) || (len < 0)) { len = this->buf_size; } @@ -494,7 +494,7 @@ void low_do_sendfile(struct pike_sendfile *this) this->len -= buflen; this->offset += buflen; while (buflen) { - int wrlen = fd_write(this->to_fd, buf, buflen); + ptrdiff_t wrlen = fd_write(this->to_fd, buf, buflen); if ((wrlen < 0) && (errno == EINTR)) { continue; } else if (wrlen < 0) { diff --git a/src/modules/system/nt.c b/src/modules/system/nt.c index 94a79fa1bc18e8446c9ba3f8c062e67d18fed91f..ccc74b916f026a8c46e8f4a796a390f5ca28e38f 100644 --- a/src/modules/system/nt.c +++ b/src/modules/system/nt.c @@ -1,5 +1,5 @@ /* - * $Id: nt.c,v 1.22 2000/08/18 22:03:50 grubba Exp $ + * $Id: nt.c,v 1.23 2000/08/19 11:29:15 grubba Exp $ * * NT system calls for Pike * @@ -63,9 +63,10 @@ static void push_regvalue(DWORD type, char* buffer, DWORD len) break; case REG_EXPAND_SZ: - type=ExpandEnvironmentStrings((LPCTSTR)buffer, - buffer+len, - sizeof(buffer)-len-1); + type = + ExpandEnvironmentStrings((LPCTSTR)buffer, + buffer+len, + DO_NOT_WARN((DWORD)(sizeof(buffer)-len-1))); if(type>sizeof(buffer)-len-1 || !type) error("RegGetValue: Failed to expand data.\n"); push_string(make_shared_string(buffer+len)); diff --git a/src/signal_handler.c b/src/signal_handler.c index 73ec0ef93c2c674d8a35b27c97dd8d2c45549fec..d229c7b6427f89e4951cd8f749c2e9cd86673e9e 100644 --- a/src/signal_handler.c +++ b/src/signal_handler.c @@ -25,7 +25,7 @@ #include "main.h" #include <signal.h> -RCSID("$Id: signal_handler.c,v 1.177 2000/08/17 18:58:28 grubba Exp $"); +RCSID("$Id: signal_handler.c,v 1.178 2000/08/19 11:35:51 grubba Exp $"); #ifdef HAVE_PASSWD_H # include <passwd.h> @@ -925,7 +925,7 @@ static void init_pid_status(struct object *o) { THIS->pid=-1; #ifdef __NT__ - THIS->handle=INVALID_HANDLE_VALUE; + THIS->handle = DO_NOT_WARN(INVALID_HANDLE_VALUE); #else THIS->state=PROCESS_UNKNOWN; THIS->result=-1; @@ -1302,7 +1302,7 @@ static HANDLE get_inheritable_handle(struct mapping *optional, char *name, int for_reading) { - HANDLE ret=INVALID_HANDLE_VALUE; + HANDLE ret = DO_NOT_WARN(INVALID_HANDLE_VALUE); struct svalue *save_stack=sp; struct svalue *tmp; if((tmp=simple_mapping_string_lookup(optional, name))) @@ -1782,9 +1782,9 @@ void f_create_process(INT32 args) #ifdef __NT__ { - HANDLE t1=INVALID_HANDLE_VALUE; - HANDLE t2=INVALID_HANDLE_VALUE; - HANDLE t3=INVALID_HANDLE_VALUE; + HANDLE t1 = DO_NOT_WARN(INVALID_HANDLE_VALUE); + HANDLE t2 = DO_NOT_WARN(INVALID_HANDLE_VALUE); + HANDLE t3 = DO_NOT_WARN(INVALID_HANDLE_VALUE); STARTUPINFO info; PROCESS_INFORMATION proc; int ret,err; @@ -1867,13 +1867,13 @@ void f_create_process(INT32 args) } t1=get_inheritable_handle(optional, "stdin",1); - if(t1!=INVALID_HANDLE_VALUE) info.hStdInput=t1; + if(t1 != DO_NOT_WARN(INVALID_HANDLE_VALUE)) info.hStdInput=t1; t2=get_inheritable_handle(optional, "stdout",0); - if(t2!=INVALID_HANDLE_VALUE) info.hStdOutput=t2; + if(t2 != DO_NOT_WARN(INVALID_HANDLE_VALUE)) info.hStdOutput=t2; t3=get_inheritable_handle(optional, "stderr",0); - if(t3!=INVALID_HANDLE_VALUE) info.hStdError=t3; + if(t3 != DO_NOT_WARN(INVALID_HANDLE_VALUE)) info.hStdError=t3; if((tmp=simple_mapping_string_lookup(optional, "env"))) { @@ -1929,9 +1929,9 @@ void f_create_process(INT32 args) if(env) pop_stack(); if(command_line) free(command_line); #if 1 - if(t1!=INVALID_HANDLE_VALUE) CloseHandle(t1); - if(t2!=INVALID_HANDLE_VALUE) CloseHandle(t2); - if(t3!=INVALID_HANDLE_VALUE) CloseHandle(t3); + if(t1 != DO_NOT_WARN(INVALID_HANDLE_VALUE)) CloseHandle(t1); + if(t2 != DO_NOT_WARN(INVALID_HANDLE_VALUE)) CloseHandle(t2); + if(t3 != DO_NOT_WARN(INVALID_HANDLE_VALUE)) CloseHandle(t3); #endif if(ret) @@ -3007,8 +3007,8 @@ static void f_pid_status_kill(INT32 args) #define HAVE_KILL static void f_kill(INT32 args) { - HANDLE proc=INVALID_HANDLE_VALUE; - HANDLE tofree=INVALID_HANDLE_VALUE; + HANDLE proc = DO_NOT_WARN(INVALID_HANDLE_VALUE); + HANDLE tofree = DO_NOT_WARN(INVALID_HANDLE_VALUE); #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) @@ -3025,7 +3025,7 @@ static void f_kill(INT32 args) 0, sp[-args].u.integer); /* fprintf(stderr,"PROC: %ld %ld\n",(long)proc,INVALID_HANDLE_VALUE); */ - if(!proc || proc==INVALID_HANDLE_VALUE) + if(!proc || proc == DO_NOT_WARN(INVALID_HANDLE_VALUE)) { errno=EPERM; pop_n_elems(args); @@ -3075,7 +3075,7 @@ static void f_kill(INT32 args) push_int(0); break; } - if(tofree != INVALID_HANDLE_VALUE) + if(tofree != DO_NOT_WARN(INVALID_HANDLE_VALUE)) CloseHandle(tofree); }