From 18f086f4cb80e38a6be108ab16a91719301efbff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Sun, 29 Sep 1996 02:19:16 +0200 Subject: [PATCH] warning removed Rev: src/modules/image/togif.c:1.2 Rev: src/modules/pipe/pipe.c:1.4 Rev: src/modules/regexp/regexp.c:1.2 Rev: src/modules/spider/encode_decode.c:1.2 Rev: src/modules/spider/sharedmem.c:1.3 Rev: src/modules/spider/sharedmem.h:1.2 Rev: src/modules/spider/spider.c:1.8 Rev: src/modules/spider/streamed_parser.c:1.2 --- src/modules/image/togif.c | 2 +- src/modules/pipe/pipe.c | 21 +++++++++++---------- src/modules/regexp/regexp.c | 8 ++++---- src/modules/spider/encode_decode.c | 4 ++-- src/modules/spider/sharedmem.c | 6 +++--- src/modules/spider/sharedmem.h | 2 +- src/modules/spider/spider.c | 8 ++++---- src/modules/spider/streamed_parser.c | 2 +- 8 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/modules/image/togif.c b/src/modules/image/togif.c index e140e0b199..4e7fa8702b 100644 --- a/src/modules/image/togif.c +++ b/src/modules/image/togif.c @@ -85,7 +85,7 @@ struct pike_string * if (i+254>(int)lzw.outpos) wr=lzw.outpos-i; else wr=254; low_my_putchar( (unsigned char)wr, &buf ); /* bytes in chunk */ - low_my_binary_strcat( lzw.out+i, wr, &buf ); + low_my_binary_strcat( (char *) lzw.out+i, wr, &buf ); } low_my_putchar( 0, &buf ); /* terminate stream */ diff --git a/src/modules/pipe/pipe.c b/src/modules/pipe/pipe.c index 2293acf91b..bf7022dcb0 100644 --- a/src/modules/pipe/pipe.c +++ b/src/modules/pipe/pipe.c @@ -76,7 +76,7 @@ struct input { struct object *obj; struct pike_string *str; - unsigned char *mmap; + char *mmap; } u; unsigned long len; /* current input: string or mmap len */ int set_blocking_offset, set_nonblocking_offset; @@ -139,7 +139,7 @@ static int offset_output_write_callback; static int offset_output_close_callback; static int mmapped, nobjects, nstrings, noutputs, ninputs, nbuffers, sbuffers; -static unsigned char static_buffer[READ_BUFFER_SIZE]; +static char static_buffer[READ_BUFFER_SIZE]; void close_and_free_everything(struct object *o,struct pipe *); static INLINE void output_finish(struct object *obj); @@ -292,7 +292,7 @@ static void low_start() for(obj=THIS->firstoutput;obj;obj=next) { obj->refs++; /* Hang on PLEASE!! /hubbe */ - o=(struct output *)&(obj->storage); + o=(struct output *)(obj->storage); if (o->obj && o->mode==O_SLEEP) { if (!o->obj->prog) @@ -461,7 +461,7 @@ static INLINE void output_finish(struct object *obj) { struct output *o; - o=(struct output *)&(obj->storage); + o=(struct output *)(obj->storage); if (o->obj) { @@ -503,7 +503,7 @@ static INLINE void output_try_write_some(struct object *obj) unsigned long len; INT32 ret; - out=(struct output*)&(obj->storage); + out=(struct output*)(obj->storage); #ifdef INSISTANT_WRITE do @@ -556,7 +556,7 @@ static void pipe_input(INT32 args) { struct input *i; int fd=-1; /* Per, one less warning to worry about... */ - unsigned char *m; + char *m; struct stat s; struct object *obj; @@ -585,7 +585,8 @@ static void pipe_input(INT32 args) if (fd != -1 && fstat(fd,&s)==0) { if(S_ISREG(s.st_mode) /* regular file */ - && ((int)(m=mmap(0,s.st_size,PROT_READ,MAP_FILE|MAP_SHARED,fd,0))!=-1)) + && ((long)(m=(char *)mmap(0,s.st_size,PROT_READ, + MAP_FILE|MAP_SHARED,fd,0))!=-1)) { mmapped += s.st_size; @@ -727,7 +728,7 @@ static void pipe_output(INT32 args) /* Allocate a new struct output */ obj=clone(output_program,0); - o=(struct output *)&(obj->storage); + o=(struct output *)(obj->storage); o->next=THIS->firstoutput; THIS->firstoutput=obj; noutputs++; @@ -850,7 +851,7 @@ static void pipe_close_output_callback(INT32 args) if(sp[-args].u.object->prog != output_program) error("Illegal argument to pipe->close_output_callback\n"); - o=(struct output *)&(sp[-args].u.object->storage); + o=(struct output *)(sp[-args].u.object->storage); if (THIS->output_closed_callback.type!=T_INT) { @@ -967,7 +968,7 @@ void close_and_free_everything(struct object *thisobj,struct pipe *p) while (p->firstoutput) { obj=p->firstoutput; - o=(struct output *)&(obj->storage); + o=(struct output *)(obj->storage); p->firstoutput=o->next; output_finish(obj); free_object(obj); diff --git a/src/modules/regexp/regexp.c b/src/modules/regexp/regexp.c index 6c496acdff..729c6995a7 100644 --- a/src/modules/regexp/regexp.c +++ b/src/modules/regexp/regexp.c @@ -243,21 +243,21 @@ STATIC void regoptail(); * of the structure of the compiled regexp. */ regexp *regcomp(exp,excompat) -unsigned char *exp; +char *exp; int excompat; /* \( \) operators like in unix ex */ { register regexp *r; - register unsigned char *scan; + register char *scan; register char *longest; register int len; int flags; short *exp2,*dest,c; - if (exp == (unsigned char *)NULL) + if (exp == (char *)NULL) FAIL("NULL argument"); exp2=(short*)xalloc( (strlen(exp)+1) * (sizeof(short[8])/sizeof(char[8])) ); - for ( scan=exp,dest=exp2;( c= *scan++); ) { + for ( scan=exp,dest=exp2;( c= UCHARAT(scan++)); ) { switch (c) { case '(': case ')': diff --git a/src/modules/spider/encode_decode.c b/src/modules/spider/encode_decode.c index 3bba915345..92ebb0eefa 100644 --- a/src/modules/spider/encode_decode.c +++ b/src/modules/spider/encode_decode.c @@ -200,7 +200,7 @@ void f_encode_value(INT32 args) push_string(low_free_buf(&buff)); } -static unsigned char extract_char(char **v, unsigned INT32 *l) +static unsigned char extract_char(char **v, INT32 *l) { if(!*l) error("Format error, not enough place for char.\n"); else (*l)--; @@ -209,7 +209,7 @@ static unsigned char extract_char(char **v, unsigned INT32 *l) } -static INT32 extract_int(char **v, unsigned INT32 *l) +static INT32 extract_int(char **v, INT32 *l) { unsigned INT32 j; INT32 t=0; diff --git a/src/modules/spider/sharedmem.c b/src/modules/spider/sharedmem.c index 3acdcf63a4..6646e281a5 100644 --- a/src/modules/spider/sharedmem.c +++ b/src/modules/spider/sharedmem.c @@ -74,7 +74,7 @@ static void new_shared_chunk(int len) pointer = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - if(pointer==MAP_FAILED) + if((long)pointer==(long)MAP_FAILED) { perror("shared_malloc::mmap"); error("shared_malloc(): Can't mmap() /tmp/.spinnerlock.\n"); @@ -141,7 +141,7 @@ void *shared_malloc(size_t size) return shmem_head->p + shmem_head->len - shmem_head->left - size; } -void shared_free(void *pointer) +void shared_free(char *pointer) { struct shared_memory_chunk *which = shmem_head; @@ -175,7 +175,7 @@ void *shared_malloc(size_t size) * shared _at_all_ */ } -void shared_free(void *pointer) +void shared_free(char *pointer) { #ifdef SHARED_MALLOC_DEBUG fprintf(stderr, "fake_shared_free(%p)\n", pointer); diff --git a/src/modules/spider/sharedmem.h b/src/modules/spider/sharedmem.h index d97c5ef658..122d238639 100644 --- a/src/modules/spider/sharedmem.h +++ b/src/modules/spider/sharedmem.h @@ -1,3 +1,3 @@ void *shared_malloc(size_t size); -void shared_free(void *pointer); +void shared_free(char *pointer); diff --git a/src/modules/spider/spider.c b/src/modules/spider/spider.c index 874a93d49e..1460fb5a30 100644 --- a/src/modules/spider/spider.c +++ b/src/modules/spider/spider.c @@ -580,7 +580,7 @@ void do_html_parse(struct pike_string *ss, struct array *extra_args) { int i,j,k,l,m,len,last; - unsigned char *s; + char *s; struct svalue sval1,sval2; struct pike_string *ss2; if (!ss->len) @@ -596,7 +596,7 @@ void do_html_parse(struct pike_string *ss, return; } - s=(unsigned char *)ss->str; + s=ss->str; len=ss->len; last=0; @@ -782,7 +782,7 @@ void do_html_parse_lines(struct pike_string *ss, int line) { int i,j,k,l,m,len,last; - unsigned char *s; + char *s; struct svalue sval1,sval2; struct pike_string *ss2; if (!ss->len) @@ -798,7 +798,7 @@ void do_html_parse_lines(struct pike_string *ss, return; } - s=(unsigned char *)ss->str; + s=ss->str; len=ss->len; last=0; diff --git a/src/modules/spider/streamed_parser.c b/src/modules/spider/streamed_parser.c index ad15ff9c2d..bda72fbb48 100644 --- a/src/modules/spider/streamed_parser.c +++ b/src/modules/spider/streamed_parser.c @@ -831,7 +831,7 @@ void streamed_parser_parse( INT32 args ) void streamed_parser_finish( INT32 args ) { if(args) error("FOO!\n"); /* Per ... */ - push_string( make_shared_binary_string( DATA->last_buffer, DATA->last_buffer_size ) ); + push_string( make_shared_binary_string( (char *)(DATA->last_buffer), DATA->last_buffer_size ) ); if (DATA->last_buffer) free( DATA->last_buffer ); DATA->last_buffer = 0; -- GitLab