newlib: ftello{64}: Fix type of returned value
Especially don't just use -1L since _off_t/_off64_t are not guaranteed to be of type long. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
1251555311
commit
dc2d175721
|
@ -99,7 +99,7 @@ _DEFUN(_ftello_r, (ptr, fp),
|
||||||
{
|
{
|
||||||
ptr->_errno = ESPIPE;
|
ptr->_errno = ESPIPE;
|
||||||
_newlib_flockfile_exit (fp);
|
_newlib_flockfile_exit (fp);
|
||||||
return -1L;
|
return (_off_t) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find offset of underlying I/O object, then adjust for buffered
|
/* Find offset of underlying I/O object, then adjust for buffered
|
||||||
|
@ -113,10 +113,10 @@ _DEFUN(_ftello_r, (ptr, fp),
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pos = fp->_seek (ptr, fp->_cookie, (_fpos_t) 0, SEEK_CUR);
|
pos = fp->_seek (ptr, fp->_cookie, (_fpos_t) 0, SEEK_CUR);
|
||||||
if (pos == -1L)
|
if (pos == (_fpos_t) -1)
|
||||||
{
|
{
|
||||||
_newlib_flockfile_exit (fp);
|
_newlib_flockfile_exit (fp);
|
||||||
return pos;
|
return (_off_t) -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fp->_flags & __SRD)
|
if (fp->_flags & __SRD)
|
||||||
|
@ -141,7 +141,7 @@ _DEFUN(_ftello_r, (ptr, fp),
|
||||||
}
|
}
|
||||||
|
|
||||||
_newlib_flockfile_end (fp);
|
_newlib_flockfile_end (fp);
|
||||||
return pos;
|
return (_off_t) pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _REENT_ONLY
|
#ifndef _REENT_ONLY
|
||||||
|
|
|
@ -96,7 +96,7 @@ _DEFUN (_ftello64_r, (ptr, fp),
|
||||||
{
|
{
|
||||||
ptr->_errno = ESPIPE;
|
ptr->_errno = ESPIPE;
|
||||||
_newlib_flockfile_exit(fp);
|
_newlib_flockfile_exit(fp);
|
||||||
return -1L;
|
return (_off64_t) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find offset of underlying I/O object, then adjust for buffered
|
/* Find offset of underlying I/O object, then adjust for buffered
|
||||||
|
@ -110,10 +110,10 @@ _DEFUN (_ftello64_r, (ptr, fp),
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pos = fp->_seek64 (ptr, fp->_cookie, (_fpos64_t) 0, SEEK_CUR);
|
pos = fp->_seek64 (ptr, fp->_cookie, (_fpos64_t) 0, SEEK_CUR);
|
||||||
if (pos == -1L)
|
if (pos == (_fpos64_t) -1)
|
||||||
{
|
{
|
||||||
_newlib_flockfile_exit(fp);
|
_newlib_flockfile_exit(fp);
|
||||||
return pos;
|
return (_off64_t) pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fp->_flags & __SRD)
|
if (fp->_flags & __SRD)
|
||||||
|
@ -138,7 +138,7 @@ _DEFUN (_ftello64_r, (ptr, fp),
|
||||||
}
|
}
|
||||||
|
|
||||||
_newlib_flockfile_end(fp);
|
_newlib_flockfile_end(fp);
|
||||||
return pos;
|
return (_off64_t) pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _REENT_ONLY
|
#ifndef _REENT_ONLY
|
||||||
|
|
Loading…
Reference in New Issue