Mercurial > hg > octave-nkf
changeset 12918:f3a8d1efe2c1 stable
use gnulib:: qualifiers for more stdio functions
* oct-parse.yy (text_getc): Use gnulib::getc instead of getc.
(looking_at_classdef_keyword, looking_at_funciton_keyword):
Use gnulib::ftell, gnulib::fseek, and gnulib::fgets instead of
ftell, fseek, and fgets.
* file-io.cc (Fmkstemp): Use gnulib::mkstemp instead of mkstemp.
* lo-utils.cc (octave_fgets): Use gnulib::fgets instead of fgets.
* c-file-ptr-stream.h (c_file_ptr_buf::seek):
Use gnulib::fseek instead of fseek.
(c_file_ptr_buf::tell): Use gnulib::ftell instead of ftell.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 04 Aug 2011 10:39:37 -0400 |
parents | e116dd862879 |
children | 61906c0d1e9b b7e526ce7a3a |
files | liboctave/lo-utils.cc src/c-file-ptr-stream.h src/file-io.cc src/oct-parse.yy |
diffstat | 4 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/lo-utils.cc +++ b/liboctave/lo-utils.cc @@ -124,7 +124,7 @@ do { - if (fgets (bufptr, grow_size, f)) + if (gnulib::fgets (bufptr, grow_size, f)) { len = strlen (bufptr);
--- a/src/c-file-ptr-stream.h +++ b/src/c-file-ptr-stream.h @@ -75,9 +75,9 @@ int file_number () const { return f ? fileno (f) : -1; } int seek (long offset, int origin) - { return f ? fseek (f, offset, origin) : -1; } + { return f ? gnulib::fseek (f, offset, origin) : -1; } - long tell (void) { return f ? ftell (f) : -1; } + long tell (void) { return f ? gnulib::ftell (f) : -1; } void clear (void) { if (f) clearerr (f); }
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -1989,7 +1989,7 @@ OCTAVE_LOCAL_BUFFER (char, tmp, tmpl8.size () + 1); strcpy (tmp, tmpl8.c_str ()); - int fd = mkstemp (tmp); + int fd = gnulib::mkstemp (tmp); if (fd < 0) {
--- a/src/oct-parse.yy +++ b/src/oct-parse.yy @@ -3287,13 +3287,13 @@ static int text_getc (FILE *f) { - int c = getc (f); + int c = gnulib::getc (f); // Convert CRLF into just LF and single CR into LF. if (c == '\r') { - c = getc (f); + c = gnulib::getc (f); if (c != '\n') { @@ -3368,16 +3368,16 @@ { bool status = false; - long pos = ftell (ffile); + long pos = gnulib::ftell (ffile); char buf [10]; - fgets (buf, 10, ffile); + gnulib::fgets (buf, 10, ffile); size_t len = strlen (buf); if (len > 8 && strncmp (buf, "classdef", 8) == 0 && ! (isalnum (buf[8]) || buf[8] == '_')) status = true; - fseek (ffile, pos, SEEK_SET); + gnulib::fseek (ffile, pos, SEEK_SET); return status; } @@ -3428,16 +3428,16 @@ { bool status = false; - long pos = ftell (ffile); + long pos = gnulib::ftell (ffile); char buf [10]; - fgets (buf, 10, ffile); + gnulib::fgets (buf, 10, ffile); size_t len = strlen (buf); if (len > 8 && strncmp (buf, "function", 8) == 0 && ! (isalnum (buf[8]) || buf[8] == '_')) status = true; - fseek (ffile, pos, SEEK_SET); + gnulib::fseek (ffile, pos, SEEK_SET); return status; }