Suppresses 15 compilers warnings.
if (reinit) {
SETLOCAL(f);
- f->bits &= ~SF_NULL; /* turn off /dev/null handling */
+ f->bits &= (unsigned short)~SF_NULL; /* turn off /dev/null handling */
if ((f->bits & SF_MMAP) || (f->mode & SF_INIT))
sfsetbuf(f, NIL(void *), (size_t) SF_UNBOUND);
else if (f->data == f->tiny)
rc = f->getr;
justseek = f->bits & SF_JUSTSEEK;
- f->bits &= ~SF_JUSTSEEK;
+ f->bits &= (unsigned short)~SF_JUSTSEEK;
for (first = 1;; first = 0, (f->mode &= ~SF_LOCK)) { /* check mode */
if (SFMODE(f, local) != SF_READ && _sfmode(f, SF_READ, local) < 0)
#define SF_MVSIZE 00002000
#define SFMVSET(f) (((f)->size *= SF_NMAP), ((f)->bits |= SF_MVSIZE) )
#define SFMVUNSET(f) (!((f)->bits&SF_MVSIZE) ? 0 : \
- (((f)->bits &= ~SF_MVSIZE), ((f)->size /= SF_NMAP)) )
-#define SFCLRBITS(f) (SFMVUNSET(f), ((f)->bits &= ~(SF_DCDOWN|SF_MVSIZE)) )
+ (((f)->bits &= (unsigned short)~SF_MVSIZE), ((f)->size /= SF_NMAP)) )
+#define SFCLRBITS(f) (SFMVUNSET(f), ((f)->bits &= (unsigned short)~(SF_DCDOWN|SF_MVSIZE)) )
/* bits for the mode field, SF_INIT defined in sfio_t.h */
#define SF_RC 00000010u /* peeking for a record */
#define SFDCRD(f,buf,n,dc,rv) \
{ int dcdown = f->bits&SF_DCDOWN; f->bits |= SF_DCDOWN; \
rv = (*dc->readf)(f,buf,n,dc); \
- if(!dcdown) f->bits &= ~SF_DCDOWN; \
+ if(!dcdown) f->bits &= (unsigned short)~SF_DCDOWN; \
}
#define SFDCWR(f,buf,n,dc,rv) \
{ int dcdown = f->bits&SF_DCDOWN; f->bits |= SF_DCDOWN; \
rv = (*dc->writef)(f,buf,n,dc); \
- if(!dcdown) f->bits &= ~SF_DCDOWN; \
+ if(!dcdown) f->bits &= (unsigned short)~SF_DCDOWN; \
}
#define SFDCSK(f,addr,type,dc,rv) \
{ int dcdown = f->bits&SF_DCDOWN; f->bits |= SF_DCDOWN; \
rv = (*dc->seekf)(f,addr,type,dc); \
- if(!dcdown) f->bits &= ~SF_DCDOWN; \
+ if(!dcdown) f->bits &= (unsigned short)~SF_DCDOWN; \
}
/* fast peek of a stream */
if ((f->flags & SF_RDWR) == SF_RDWR)
f->bits |= SF_BOTH;
else
- f->bits &= ~SF_BOTH;
+ f->bits &= (unsigned short)~SF_BOTH;
if (f->flags & SF_READ)
f->mode = (f->mode & ~SF_WRITE) | SF_READ;
GETLOCAL(f, local);
if ((rcrv = f->mode & (SF_RC | SF_RV)))
f->mode &= ~(SF_RC | SF_RV);
- f->bits &= ~SF_JUSTSEEK;
+ f->bits &= (unsigned short)~SF_JUSTSEEK;
if (f->mode & SF_PKRD)
SFMTXRETURN(f, -1);
GETLOCAL(f, local);
justseek = f->bits & SF_JUSTSEEK;
- f->bits &= ~SF_JUSTSEEK;
+ f->bits &= (unsigned short)~SF_JUSTSEEK;
if (!buf)
SFMTXRETURN(f, (ssize_t) (-1));
osize = f->size;
f->flags &= (unsigned short)~SF_MALLOC;
- f->bits &= ~SF_MMAP;
+ f->bits &= (unsigned short)~SF_MMAP;
/* pure read/string streams must have a valid string */
if ((f->flags & (SF_RDWR | SF_STRING)) == SF_RDSTR &&
f->endb = f->endr = f->endw = f->data;
f->extent = f->here = 0;
f->mode = (f->mode & SF_RDWR) | SF_INIT;
- f->bits &= ~SF_NULL; /* off /dev/null handling */
+ f->bits &= (unsigned short)~SF_NULL; /* off /dev/null handling */
}
}
if (!SFISNULL(f) && (f->bits & SF_HOLE)) { /* realize a previously created hole of 0's */
if (SFSK(f, (Sfoff_t) (-1), SEEK_CUR, f->disc) >= 0)
(void) SFWR(f, "", 1, f->disc);
- f->bits &= ~SF_HOLE;
+ f->bits &= (unsigned short)~SF_HOLE;
}
f->mode |= pool;
}
}
if ((wr = write(f->file, wbuf, buf - wbuf)) > 0) {
w += wr;
- f->bits &= ~SF_HOLE;
+ f->bits &= (unsigned short)~SF_HOLE;
}
if (wr != (buf - wbuf))
break;
} else {
do_write:
if ((w = write(f->file, (char *) buf, n)) > 0)
- f->bits &= ~SF_HOLE;
+ f->bits &= (unsigned short)~SF_HOLE;
}
if (errno == 0)