Mail Archives: djgpp-workers/2001/06/20/03:37:32
> From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
> Date: Tue, 19 Jun 2001 23:11:45 +0200 (MET DST)
>
> Some more corrections.
Thanks.
> while (s > 0) {
> - if (--f->_cnt > -f->_bufsiz && *(const char *)ptr != '\n')
> + if (--f->_cnt > -(long signed int)f->_bufsiz && *(const char *)ptr != 'n')
> *f->_ptr++ = *(const char *)ptr++;
Isn't it better to introduce a new `long signed int' variable, assign
to it the value of f->_bufsiz, and then use that new variable instead
of f->_bufsiz? Let the optimizer do the dirty work ;-)
> --- src/libc/compat/ioctl/ioctl.c 1998/06/28 17:25:20 1.2
> +++ src/libc/compat/ioctl/ioctl.c 2001/06/19 21:06:40
> @@ -157,7 +157,7 @@ static int _dos_ioctl(int fd, int cmd, i
> ** I _do_ like clear APIs.
> */
> if(cmd & DOS_XFER){
> - if(argcx <= __tb_size){ /* Can we use transfer buffer ? */
> + if(argcx <= (int)__tb_size){ /* Can we use transfer buffer ? */
> dosmemput((void *)argdx,argcx, __tb);
> r.x.ds = (__tb>>4) &0xffff;
> r.x.dx = __tb &0xf;
> @@ -183,7 +183,7 @@ static int _dos_ioctl(int fd, int cmd, i
> ** parameter after all the registers and the buffer pointer.
> */
> if( cmd & DOS_BRAINDEAD ){
> - if(xarg <= __tb_size){ /* Can we use transfer buffer ? */
> + if(xarg <= (int)__tb_size){ /* Can we use transfer buffer ? */
> dosmemput((void *)argdx,xarg, __tb);
> r.x.ds = (__tb>>4) &0xffff;
> r.x.dx = __tb &0xf;
This looks fine to me.
- Raw text -