Mercurial > hg > octave-shane
changeset 12254:23385f2c90b7 release-3-4-x
whitespace fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 26 Jan 2011 23:49:42 -0500 |
parents | 1f14586af94c |
children | ad70f6cf1268 |
files | ChangeLog doc/ChangeLog doc/interpreter/doccheck/mk_undocumented_list doc/interpreter/mk_doc_cache.m doc/interpreter/mkoctfile.1 doc/interpreter/munge-texi.cc examples/celldemo.cc examples/embedded.cc examples/fortdemo.cc examples/hello.cc examples/helloworld.cc examples/paramdemo.cc examples/stringdemo.cc examples/structdemo.cc examples/unwinddemo.cc libcruft/ChangeLog libcruft/mkf77def.in liboctave/ChangeLog liboctave/oct-refcount.h mk-opts.pl mkoctfile.cc.in mkoctfile.in scripts/ChangeLog scripts/gethelp.cc scripts/mkdoc src/ChangeLog src/gl-render.cc src/graphics.cc src/graphics.h.in src/lex.ll src/ov-mex-fcn.h |
diffstat | 31 files changed, 533 insertions(+), 502 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-01-26 John W. Eaton <jwe@octave.org> + + * mk-opts.pl, mkoctfile.cc.in, mkoctfile.in: Untabify. + + * mkf77def.in, mk-opts.pl, mkoctfile.cc.in, structdemo.cc, + unwinddemo.cc, fortdemo.cc, paramdemo.cc, + celldemo.cc,stringdemo.cc, hello.cc, embedded.cc, helloworld.cc: + Strip trailing whitespace. + 2011-01-26 Ben Abbott <bpabbott@mac.com> * README.MacOS: Modify organization, and update for MacPorts.
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2011-01-26 John W. Eaton <jwe@octave.org> + + * interpreter/mk_doc_cache.m, interpreter/mkoctfile.1, + interpreter/munge-texi.cc, interpreter/doccheck/mk_undocumented_list: + Strip trailing whitespace. + 2011-01-26 Rik <octave@nomad.inbox5.com> * interpreter/octave-bug.1: Delete obsolete man page
--- a/doc/interpreter/doccheck/mk_undocumented_list +++ b/doc/interpreter/doccheck/mk_undocumented_list @@ -6,7 +6,7 @@ ../../run-octave --norc --silent --no-history --eval '\ funclist = vertcat (__list_functions__ , __builtins__) \ disp("#!-separator-!#") \ - where = cellfun (\@which, funclist, \"UniformOutput\", 0)' + where = cellfun (\@which, funclist, \"UniformOutput\", 0)' _END_OCT_SCRIPT_ die "Unable to invoke 'run-octave'. Exiting\n" unless (@octave_output); @@ -32,10 +32,10 @@ next FUNC if ($where[$idx] =~ /interpreter/i); next FUNC if ($where[$idx] =~ m#test/#i); - push (@functions, $all_functions[$idx]); + push (@functions, $all_functions[$idx]); } -# Remove internal functions from the list of features requiring a DOCSTRING +# Remove internal functions from the list of features requiring a DOCSTRING @functions = grep (! /^__/, @functions); # Load list of function exceptions not requiring a DOCSTRING
--- a/doc/interpreter/mk_doc_cache.m +++ b/doc/interpreter/mk_doc_cache.m @@ -87,7 +87,7 @@ doc = regexprep (doc, "^[\r\n]+", ''); - ## Skip internal functions that start with __ as these aren't + ## Skip internal functions that start with __ as these aren't ## indexed by lookfor. if (length (symbol) > 2 && regexp (symbol, '^__.+__$')) continue;
--- a/doc/interpreter/mkoctfile.1 +++ b/doc/interpreter/mkoctfile.1 @@ -22,15 +22,15 @@ .SH NAME mkoctfile \- Compile dynamic-load modules for GNU Octave .SH SYNOPSIS -.BR mkoctfile\ [\-IDIR]\ [\-DDEF]\ [\-lLIB]\ [\-LDIR]\ [\-M|\-\-depend]\ -[\-c]\ [\-o FILE|\-\-output FILE]\ [\-p VAR|\-\-print VAR]\ [\-s|\-\-strip]\ -[\-v|\-\-verbose]\ [\-h|\-?|\-\-help]\ \fIfile\fP .\|.\|. +.BR mkoctfile\ [\-IDIR]\ [\-DDEF]\ [\-lLIB]\ [\-LDIR]\ [\-M|\-\-depend] +\ [\-c]\ [\-o FILE|\-\-output FILE]\ [\-p VAR|\-\-print VAR]\ [\-s|\-\-strip] +\ [\-v|\-\-verbose]\ [\-h|\-?|\-\-help]\ \fIfile\fP .\|.\|. .SH DESCRIPTION .PP \fImkoctfile\fP is used to compile source C, C++ or Fortran source code in -dynamically loadable +dynamically loadable .I .oct -file for +file for .BR octave (1). .SH OPTIONS \fImkoctfile\fP accepts the following options: @@ -60,25 +60,25 @@ .B \-p VAR|\-\-print VAR Print configuration variable VAR. Recognized variables are: .RS - ALL_CFLAGS FFTW_LIBS - ALL_CXXFLAGS FLIBS - ALL_FFLAGS FPICFLAG - ALL_LDFLAGS INCFLAGS - BLAS_LIBS LDFLAGS - CC LD_CXX + ALL_CFLAGS FFTW_LIBS + ALL_CXXFLAGS FLIBS + ALL_FFLAGS FPICFLAG + ALL_LDFLAGS INCFLAGS + BLAS_LIBS LDFLAGS + CC LD_CXX CFLAGS LD_STATIC_FLAG - CPICFLAG LFLAGS - CPPFLAGS LIBCRUFT - CXX LIBOCTAVE - CXXFLAGS LIBOCTINTERP - CXXPICFLAG LIBREADLINE - DEPEND_EXTRA_SED_PATTERN LIBS - DEPEND_FLAGS OCTAVE_LIBS - DL_LD RDYNAMIC_FLAG - DL_LDFLAGS RLD_FLAG - F2C SED - F2CFLAGS XTRA_CFLAGS - F77 XTRA_CXXFLAGS + CPICFLAG LFLAGS + CPPFLAGS LIBCRUFT + CXX LIBOCTAVE + CXXFLAGS LIBOCTINTERP + CXXPICFLAG LIBREADLINE + DEPEND_EXTRA_SED_PATTERN LIBS + DEPEND_FLAGS OCTAVE_LIBS + DL_LD RDYNAMIC_FLAG + DL_LDFLAGS RLD_FLAG + F2C SED + F2CFLAGS XTRA_CFLAGS + F77 XTRA_CXXFLAGS FFLAGS .RE .TP 8 @@ -96,7 +96,7 @@ Echo commands as they are executed. .TP 8 .B file -Compile or link file. Recognised file types are +Compile or link file. Recognised file types are .RS .c C source .cc C++ source @@ -113,5 +113,5 @@ John W. Eaton <jwe@octave.org> This manual page was contributed by Dirk Eddelbuettel -<edd@debian.org> for the Debian GNU/Linux distribution but +<edd@debian.org> for the Debian GNU/Linux distribution but may be used by others.
--- a/doc/interpreter/munge-texi.cc +++ b/doc/interpreter/munge-texi.cc @@ -75,8 +75,8 @@ char buf[16]; int i = 0; buf[i++] = static_cast<char> (c); - - if (( buf[i++] = static_cast<char> (is.get ())) == 's' + + if (( buf[i++] = static_cast<char> (is.get ())) == 's' && (buf[i++] = static_cast<char> (is.get ())) == 'e' && (buf[i++] = static_cast<char> (is.get ())) == 'e' && (buf[i++] = static_cast<char> (is.get ())) == 'a' @@ -86,16 +86,16 @@ && (buf[i++] = static_cast<char> (is.get ())) == '{') { doc += "@seealso{"; - + bool first = true; - + // process @seealso parameters while ((c = is.get ()) != EOF && c != doc_delim - && c != '}') + && c != '}') { // ignore whitespace and delimiters - while ( c == ' ' + while ( c == ' ' || c == '\t' || c == '\r' || c == '\n' @@ -103,14 +103,14 @@ { c = is.get (); } - + // test for end of @seealso - if (c == '}') + if (c == '}') break; - + // get function name std::string function_name; - do + do function_name += static_cast<char> (c); while ((c = is.get ()) != EOF && c != doc_delim @@ -132,7 +132,7 @@ + function_name + "}"; // test for end of @seealso - if (c == '}') + if (c == '}') break; } if (c == '}')
--- a/examples/celldemo.cc +++ b/examples/celldemo.cc @@ -1,7 +1,7 @@ #include <octave/oct.h> #include <octave/Cell.h> -DEFUN_DLD (celldemo, args, , "Cell Demo") +DEFUN_DLD (celldemo, args, , "Cell Demo") { octave_value_list retval; int nargin = args.length ();
--- a/examples/embedded.cc +++ b/examples/embedded.cc @@ -18,7 +18,7 @@ std::cout << "GCD of ["; for (octave_idx_type i = 0; i < n; i++) { - a_matrix (i) = 5 * (i + 1); + a_matrix (i) = 5 * (i + 1); if (i != 0) std::cout << ", " << 5 * (i + 2); else
--- a/examples/fortdemo.cc +++ b/examples/fortdemo.cc @@ -1,17 +1,17 @@ #include <octave/oct.h> #include <octave/f77-fcn.h> -extern "C" +extern "C" { - F77_RET_T - F77_FUNC (fortsub, FORTSUB) - (const int&, double*, F77_CHAR_ARG_DECL + F77_RET_T + F77_FUNC (fortsub, FORTSUB) + (const int&, double*, F77_CHAR_ARG_DECL F77_CHAR_ARG_LEN_DECL); } DEFUN_DLD (fortdemo , args , , "Fortran Demo.") { - octave_value_list retval; + octave_value_list retval; int nargin = args.length(); if (nargin != 1) print_usage (); @@ -24,7 +24,7 @@ octave_idx_type na = a.nelem (); OCTAVE_LOCAL_BUFFER (char, ctmp, 128); - F77_XFCN (fortsub, FORTSUB, (na, av, ctmp + F77_XFCN (fortsub, FORTSUB, (na, av, ctmp F77_CHAR_ARG_LEN (128))); retval(1) = std::string (ctmp);
--- a/examples/hello.cc +++ b/examples/hello.cc @@ -62,7 +62,7 @@ // Note that the third parameter (nargout) is not used, so it is // omitted from the list of arguments to DEFUN_DLD in order to avoid -// the warning from gcc about an unused function parameter. +// the warning from gcc about an unused function parameter. DEFUN_DLD (hello, args, , "[...] = hello (...)\n\
--- a/examples/helloworld.cc +++ b/examples/helloworld.cc @@ -4,7 +4,7 @@ "Hello World Help String") { int nargin = args.length (); - octave_stdout << "Hello World has " << nargin + octave_stdout << "Hello World has " << nargin << " input arguments and " << nargout << " output arguments.\n"; return octave_value_list ();
--- a/examples/paramdemo.cc +++ b/examples/paramdemo.cc @@ -1,6 +1,6 @@ #include <octave/oct.h> -DEFUN_DLD (paramdemo, args, nargout, +DEFUN_DLD (paramdemo, args, nargout, "Parameter Check Demo.") { int nargin = args.length (); @@ -21,13 +21,13 @@ if (m.any_element_is_inf_or_nan()) octave_stdout << " includes Inf or NaN values\n"; if (m.any_element_not_one_or_zero()) - octave_stdout << + octave_stdout << " includes other values than 1 and 0\n"; if (m.all_elements_are_int_or_inf_or_nan()) - octave_stdout << + octave_stdout << " includes only int, Inf or NaN values\n"; if (m.all_integers (min_val, max_val)) - octave_stdout << + octave_stdout << " includes only integers in [-10,10]\n"; } return retval;
--- a/examples/stringdemo.cc +++ b/examples/stringdemo.cc @@ -3,7 +3,7 @@ DEFUN_DLD (stringdemo, args, , "String Demo") { int nargin = args.length(); - octave_value_list retval; + octave_value_list retval; if (nargin != 1) print_usage (); @@ -22,7 +22,7 @@ for (octave_idx_type i = 0; i < nr / 2; i++) { std::string tmp = ch.row_as_string (i); - ch.insert (ch.row_as_string(nr-i-1).c_str(), + ch.insert (ch.row_as_string(nr-i-1).c_str(), i, 0); ch.insert (tmp.c_str(), nr-i-1, 0); }
--- a/examples/structdemo.cc +++ b/examples/structdemo.cc @@ -39,6 +39,6 @@ else print_usage (); - return retval; + return retval; }
--- a/examples/unwinddemo.cc +++ b/examples/unwinddemo.cc @@ -21,8 +21,7 @@ if (! error_state) { unwind_protect::begin_frame ("Funwinddemo"); - unwind_protect_ptr - (current_liboctave_warning_handler); + unwind_protect_ptr (current_liboctave_warning_handler); set_liboctave_warning_handler(err_hand); retval = octave_value (quotient (a, b)); unwind_protect::run_frame ("Funwinddemo");
--- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,3 +1,7 @@ +2011-01-26 John W. Eaton <jwe@octave.org> + + * mkf77def.in: Strip trailing whitespace. + 2011-01-20 John W. Eaton <jwe@octave.org> * misc/cquit.c, misc/f77-fcn.h, misc/quit.cc: Strip trailing
--- a/libcruft/mkf77def.in +++ b/libcruft/mkf77def.in @@ -3,17 +3,17 @@ # Copyright (C) 2006-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -53,6 +53,7 @@ do case "$arg" in *.f) + ## There are TABS in this sed command. $SED -n -e 'y/ABCDEFGHIJLKMNOPQRSTUVWXYZ/abcdefghijlkmnopqrstuvwxyz/; s/^\( \| \)[ ]*\(.*function\|subroutine\|entry\)[ ]*\([^ (]*\).*$/\3/p' "$srcdir/$arg" | eval $awkcmd ;; esac
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2011-01-26 John W. Eaton <jwe@octave.org> + + * oct-refcount.h: Strip trailing whitespace. + 2011-01-24 Pascal Dupuis <Pascal.Dupuis@worldonline.be> * SparseQR.h (class SparseQR::SparseQR_reps): Disallow copying.
--- a/liboctave/oct-refcount.h +++ b/liboctave/oct-refcount.h @@ -33,24 +33,24 @@ octave_refcount(count_type initial_count) : count(initial_count) {} // Increment/Decrement. int is postfix. - count_type operator++(void) - { - return ++count; + count_type operator++(void) + { + return ++count; } - count_type operator++(int) - { - return count++; + count_type operator++(int) + { + return count++; } count_type operator--(void) - { - return --count; + { + return --count; } count_type operator--(int) - { - return count--; + { + return count--; } operator count_type (void) const { return count; }
--- a/mk-opts.pl +++ b/mk-opts.pl @@ -3,17 +3,17 @@ # Copyright (C) 2002-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -24,7 +24,7 @@ # FIXME: # # * Improve default documentation and/or individual documentation -# in data files. +# in data files. # # * Fix print/show code to display/return something more informative # for special values (for example, -1 ==> infinite in some cases). @@ -111,7 +111,7 @@ elsif (/^\s*INCLUDE\s*=\s*"(\S+)"\s*$/) { $include = "${include}#include <$1>\n"; - } + } elsif (/^\s*DOC_STRING\s*$/) { die "duplicate DOC_STRING" if ($have_doc_string); @@ -120,8 +120,8 @@ } else { - die "mk-opts.pl: unknown command: $_\n" - } + die "mk-opts.pl: unknown command: $_\n" + } } } @@ -213,7 +213,7 @@ &get_min_match_len_info ($max_tokens); $fcn_name = lc ($CLASS) if ($fcn_name eq ""); - + $opt_fcn_name = "${fcn_name}_options" if ($opt_fcn_name eq ""); $static_object_name = "${fcn_name}_opts"; @@ -238,14 +238,14 @@ { for ($j = 0; $j < $max_tokens; $j++) { - $min_tok_len_to_match[$i][$j] = 0; + $min_tok_len_to_match[$i][$j] = 0; } $min_toks_to_match[$i] = 1; L1: for ($k = 0; $k < $opt_num; $k++) { - local ($duplicate) = 1; + local ($duplicate) = 1; if ($i != $k) { @@ -264,12 +264,12 @@ } else { - $duplicate = 0; + $duplicate = 0; - if ($min_tok_len_to_match[$i][$j] == 0) - { - $min_tok_len_to_match[$i][$j] = 1; - } + if ($min_tok_len_to_match[$i][$j] == 0) + { + $min_tok_len_to_match[$i][$j] = 1; + } local (@s) = split (//, $kw_tok[$i][$j]); local (@t) = split (//, $kw_tok[$k][$j]); @@ -282,10 +282,10 @@ { if ("$s[$ii]" eq "$t[$ii]") { - if ($ii + 2 > $min_tok_len_to_match[$i][$j]) - { - $min_tok_len_to_match[$i][$j]++; - } + if ($ii + 2 > $min_tok_len_to_match[$i][$j]) + { + $min_tok_len_to_match[$i][$j]++; + } } else { @@ -296,10 +296,10 @@ last L1; } } - else - { - die "ambiguous options \"$name[$i]\" and \"$name[$k]\"" if ($duplicate); - } + else + { + die "ambiguous options \"$name[$i]\" and \"$name[$k]\"" if ($duplicate); + } } } } @@ -618,9 +618,9 @@ &emit_option_table_entry ($i, 0); if ($i < $opt_num - 1) - { - print "\n"; - } + { + print "\n"; + } } print "};\n\n"; @@ -720,7 +720,7 @@ } elsif ($type[$i] eq "Array<int>" || $type[$i] eq "Array<octave_idx_type>") { - if ($type[$i] eq "Array<int>") + if ($type[$i] eq "Array<int>") { $elt_type = "int"; } @@ -736,10 +736,10 @@ else { os << \"\\n\\n\"; - octave_idx_type len = val.length (); - Matrix tmp (len, 1); - for (octave_idx_type i = 0; i < len; i++) - tmp(i,0) = val(i); + octave_idx_type len = val.length (); + Matrix tmp (len, 1); + for (octave_idx_type i = 0; i < len; i++) + tmp(i,0) = val(i); octave_print_internal (os, tmp, false, 2); os << \"\\n\\n\"; }\n"; @@ -901,7 +901,7 @@ } elsif ($type[$i] eq "Array<int>" || $type[$i] eq "Array<octave_idx_type>") { - if ($type[$i] eq "Array<int>") + if ($type[$i] eq "Array<int>") { $elt_type = "int"; } @@ -916,10 +916,10 @@ } else { - octave_idx_type len = val.length (); - ColumnVector tmp (len); - for (octave_idx_type i = 0; i < len; i++) - tmp(i) = val(i); + octave_idx_type len = val.length (); + ColumnVector tmp (len); + for (octave_idx_type i = 0; i < len; i++) + tmp(i) = val(i); retval = tmp; }\n"; } @@ -977,9 +977,9 @@ { print "\@item \\\"$name[$i]\\\"\\n\\\n"; if ($doc_item[$i] ne "") - { - print "$doc_item[$i]"; - } + { + print "$doc_item[$i]"; + } } print "\@end table\\n\\\n\@end deftypefn\") @@ -1010,7 +1010,7 @@ print_usage (); return retval; -}\n"; +}\n"; } sub emit_options_debug
--- a/mkoctfile.cc.in +++ b/mkoctfile.cc.in @@ -50,7 +50,7 @@ static std::string substitute_prefix (const std::string& s, const std::string& prefix, - const std::string& new_prefix) + const std::string& new_prefix) { std::string retval = s; @@ -58,7 +58,7 @@ { int len = prefix.length (); if (retval.find (prefix) == 0) - retval.replace (0, len, new_prefix); + retval.replace (0, len, new_prefix); } #if defined (__WIN32__) && ! defined (_POSIX_VERSION) @@ -79,9 +79,9 @@ { c = static_cast<char> (fgetc (fp)); if (c == '\n' || c == EOF) - break; + break; if (buf.size () <= idx) - buf.resize (buf.size () + 100); + buf.resize (buf.size () + 100); buf[idx++] = c; } if (idx == 0) @@ -130,15 +130,15 @@ int status = GetModuleFileName (0, &bin_dir[0], n); if (status < n) - { - bin_dir.resize (status); - break; - } + { + bin_dir.resize (status); + break; + } else - { - n *= 2; - bin_dir.resize (n); - } + { + n *= 2; + bin_dir.resize (n); + } } if (! bin_dir.empty ()) @@ -146,7 +146,7 @@ size_t pos = bin_dir.rfind ("\\bin\\"); if (pos != string::npos) - vars["OCTAVE_HOME"] = bin_dir.substr (0, pos); + vars["OCTAVE_HOME"] = bin_dir.substr (0, pos); } #endif @@ -162,20 +162,20 @@ if (! vars["OCTAVE_HOME"].empty ()) { DEFAULT_OCTINCLUDEDIR - = substitute_prefix (DEFAULT_OCTINCLUDEDIR, vars["OCTAVE_PREFIX"], - vars["OCTAVE_HOME"]); + = substitute_prefix (DEFAULT_OCTINCLUDEDIR, vars["OCTAVE_PREFIX"], + vars["OCTAVE_HOME"]); DEFAULT_INCLUDEDIR - = substitute_prefix (DEFAULT_INCLUDEDIR, vars["OCTAVE_PREFIX"], - vars["OCTAVE_HOME"]); + = substitute_prefix (DEFAULT_INCLUDEDIR, vars["OCTAVE_PREFIX"], + vars["OCTAVE_HOME"]); DEFAULT_LIBDIR - = substitute_prefix (DEFAULT_LIBDIR, vars["OCTAVE_PREFIX"], - vars["OCTAVE_HOME"]); + = substitute_prefix (DEFAULT_LIBDIR, vars["OCTAVE_PREFIX"], + vars["OCTAVE_HOME"]); DEFAULT_OCTLIBDIR - = substitute_prefix (DEFAULT_OCTLIBDIR, vars["OCTAVE_PREFIX"], - vars["OCTAVE_HOME"]); + = substitute_prefix (DEFAULT_OCTLIBDIR, vars["OCTAVE_PREFIX"], + vars["OCTAVE_HOME"]); } vars["OCTINCLUDEDIR"] = get_variable ("OCTINCLUDEDIR", DEFAULT_OCTINCLUDEDIR); @@ -296,25 +296,25 @@ " -p VAR, --print VAR Print configuration variable VAR. Recognized\n" " variables are:\n" "\n" -" ALL_CFLAGS FLIBS\n" -" ALL_CXXFLAGS FPICFLAG\n" -" ALL_FFLAGS INCFLAGS\n" -" ALL_LDFLAGS LAPACK_LIBS\n" -" BLAS_LIBS LDFLAGS\n" -" CC LD_CXX\n" -" CFLAGS LD_STATIC_FLAG\n" -" CPICFLAG LFLAGS\n" -" CPPFLAGS LIBCRUFT\n" -" CXX LIBOCTAVE\n" -" CXXFLAGS LIBOCTINTERP\n" -" CXXPICFLAG LIBS\n" -" DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS\n" -" DEPEND_FLAGS RDYNAMIC_FLAG\n" -" DL_LD READLINE_LIBS\n" -" DL_LDFLAGS RLD_FLAG\n" -" F77 SED\n" -" FFLAGS XTRA_CFLAGS\n" -" FFTW_LIBS XTRA_CXXFLAGS\n" +" ALL_CFLAGS FLIBS\n" +" ALL_CXXFLAGS FPICFLAG\n" +" ALL_FFLAGS INCFLAGS\n" +" ALL_LDFLAGS LAPACK_LIBS\n" +" BLAS_LIBS LDFLAGS\n" +" CC LD_CXX\n" +" CFLAGS LD_STATIC_FLAG\n" +" CPICFLAG LFLAGS\n" +" CPPFLAGS LIBCRUFT\n" +" CXX LIBOCTAVE\n" +" CXXFLAGS LIBOCTINTERP\n" +" CXXPICFLAG LIBS\n" +" DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS\n" +" DEPEND_FLAGS RDYNAMIC_FLAG\n" +" DL_LD READLINE_LIBS\n" +" DL_LDFLAGS RLD_FLAG\n" +" F77 SED\n" +" FFLAGS XTRA_CFLAGS\n" +" FFTW_LIBS XTRA_CXXFLAGS\n" "\n" " --link-stand-alone Link a stand-alone executable file.\n" "\n" @@ -356,9 +356,9 @@ { size_t p1 = retval.rfind ('/'), p2 = retval.rfind ('\\'); pos = (p1 != string::npos && p2 != string::npos - ? max (p1, p2) : (p2 != string::npos ? p2 : p1)); + ? max (p1, p2) : (p2 != string::npos ? p2 : p1)); if (pos != string::npos) - retval = retval.substr (0, pos); + retval = retval.substr (0, pos); } return retval; } @@ -373,7 +373,7 @@ ends_with (const string& s, const string& suffix) { return (s.length () >= suffix.length () - && s.rfind (suffix) == s.length () - suffix.length ()); + && s.rfind (suffix) == s.length () - suffix.length ()); } static int @@ -429,145 +429,145 @@ size_t len = arg.length (); if (ends_with (arg, ".c")) - { - file = arg; - cfiles.push_back (file); - } + { + file = arg; + cfiles.push_back (file); + } else if (ends_with (arg, ".cc") || ends_with (arg, ".C") - || ends_with (arg, ".cpp")) - { - file = arg; - ccfiles.push_back (file); - } + || ends_with (arg, ".cpp")) + { + file = arg; + ccfiles.push_back (file); + } else if (ends_with (arg, ".f") || ends_with (arg, ".F") - || ends_with (arg, "f90") || ends_with (arg, ".F90")) - { - file = arg; - f77files.push_back (file); - } + || ends_with (arg, "f90") || ends_with (arg, ".F90")) + { + file = arg; + f77files.push_back (file); + } else if (ends_with (arg, ".o") || ends_with (arg, ".obj")) - { - file = arg; - objfiles += (" " + quote_path (arg)); - } + { + file = arg; + objfiles += (" " + quote_path (arg)); + } else if (ends_with (arg, ".lib") || ends_with (arg, ".a")) - { - file = arg; - libfiles += (" " + quote_path (arg)); - } + { + file = arg; + libfiles += (" " + quote_path (arg)); + } else if (arg == "-d" || arg == "-debug" || arg == "--debug" || arg == "-v" || arg == "-verbose" || arg == "--verbose") - { - debug = true; - if (vars["CC"] == "cc-msvc") - vars["CC"] += " -d"; - if (vars["CXX"] == "cc-msvc") - vars["CXX"] += " -d"; - if (vars["DL_LD"] == "cc-msvc") - vars["DL_LD"] += " -d"; - } + { + debug = true; + if (vars["CC"] == "cc-msvc") + vars["CC"] += " -d"; + if (vars["CXX"] == "cc-msvc") + vars["CXX"] += " -d"; + if (vars["DL_LD"] == "cc-msvc") + vars["DL_LD"] += " -d"; + } else if (arg == "-h" || arg == "-?" || arg == "-help" || arg == "--help") - { - cout << usage_msg << endl; - cout << help_msg << endl; - return 0; - } + { + cout << usage_msg << endl; + cout << help_msg << endl; + return 0; + } else if (starts_with (arg, "-I")) - { - incflags += (" " + quote_path (arg)); - } + { + incflags += (" " + quote_path (arg)); + } else if (arg == "-idirafter") - { - if (i < argc-1) - { - arg = argv[++i]; - incflags += (" -idirafter " + arg); - } - else - cerr << "mkoctfile: include directory name missing" << endl; - } + { + if (i < argc-1) + { + arg = argv[++i]; + incflags += (" -idirafter " + arg); + } + else + cerr << "mkoctfile: include directory name missing" << endl; + } else if (starts_with (arg, "-D")) - { - defs += (" " + arg); - } + { + defs += (" " + arg); + } else if (starts_with (arg, "-Wl,") || starts_with (arg, "-l") - || starts_with (arg, "-L") || starts_with (arg, "-R")) - { - ldflags += (" " + arg); - } + || starts_with (arg, "-L") || starts_with (arg, "-R")) + { + ldflags += (" " + arg); + } else if (arg == "-M" || arg == "-depend" || arg == "--depend") - { - depend = true; - compile = false; - } + { + depend = true; + compile = false; + } else if (arg == "-o" || arg == "-output" || arg == "--output") - { - if (i < argc-1) - { - arg = argv[++i]; - outputfile = arg; - } - else - cerr << "mkoctfile: output file name missing" << endl; - } + { + if (i < argc-1) + { + arg = argv[++i]; + outputfile = arg; + } + else + cerr << "mkoctfile: output file name missing" << endl; + } else if (arg == "-p" || arg == "-print" || arg == "--print") - { - if (i < argc-1) - { - arg = argv[++i]; - cout << vars[arg] << endl; - return 0; - } - else - cerr << "mkoctfile: --print requires argument" << endl; - } + { + if (i < argc-1) + { + arg = argv[++i]; + cout << vars[arg] << endl; + return 0; + } + else + cerr << "mkoctfile: --print requires argument" << endl; + } else if (arg == "-s" || arg == "-strip" || arg == "--strip") - { - if (no_oct_file_strip_on_this_platform) - cerr << "mkoctfile: stripping disabled on this platform" << endl; - else - strip = true; - } + { + if (no_oct_file_strip_on_this_platform) + cerr << "mkoctfile: stripping disabled on this platform" << endl; + else + strip = true; + } else if (arg == "-c" || arg == "-compile" || arg == "--compile") - { - link = false; - } + { + link = false; + } else if (arg == "-g") - { - vars["ALL_CFLAGS"] += " -g"; - vars["ALL_CXXFLAGS"] += " -g"; - vars["ALL_FFLAGS"] += " -g"; - } + { + vars["ALL_CFLAGS"] += " -g"; + vars["ALL_CXXFLAGS"] += " -g"; + vars["ALL_FFLAGS"] += " -g"; + } else if (arg == "-link-stand-alone" || arg == "--link-stand-alone") - { - link_stand_alone = true; - } + { + link_stand_alone = true; + } else if (arg == "-mex" || arg == "--mex") - { - incflags += " -I."; + { + incflags += " -I."; #ifdef _MSC_VER - ldflags += " -Wl,-export:mexFunction"; + ldflags += " -Wl,-export:mexFunction"; #endif - output_ext = ".mex"; - } + output_ext = ".mex"; + } else if (starts_with (arg, "-W")) - { - pass_on_options += (" " + arg); - } + { + pass_on_options += (" " + arg); + } else - { - cerr << "mkoctfile: unrecognized argument " << arg; - return 1; - } + { + cerr << "mkoctfile: unrecognized argument " << arg; + return 1; + } if (!file.empty () && octfile.empty ()) - octfile = file; + octfile = file; } if (link_stand_alone) { if (!outputfile.empty ()) - output_option = "-o " + outputfile; + output_option = "-o " + outputfile; } else { @@ -580,7 +580,7 @@ octfile += output_ext; } else - octfile = basename (octfile, true) + output_ext; + octfile = basename (octfile, true) + output_ext; } list<string>::const_iterator it; @@ -588,60 +588,60 @@ if (depend) { for (it = cfiles.begin (); it != cfiles.end (); ++it) - { - string f = *it, dfile = basename (f, true) + ".d", line; + { + string f = *it, dfile = basename (f, true) + ".d", line; - unlink (dfile.c_str ()); - string cmd = vars["CC"] + " " + vars["DEPEND_FLAGS"] + " " - + vars["CPPFLAGS"] + " " + vars["ALL_CFLAGS"] + " " - + incflags + " " + defs + " " + quote_path (f); + unlink (dfile.c_str ()); + string cmd = vars["CC"] + " " + vars["DEPEND_FLAGS"] + " " + + vars["CPPFLAGS"] + " " + vars["ALL_CFLAGS"] + " " + + incflags + " " + defs + " " + quote_path (f); - FILE *fd = popen (cmd.c_str (), "r"); - ofstream fo (dfile.c_str ()); - int pos; - while (!feof (fd)) - { - line = get_line (fd); - if ((pos = line.rfind (".o:")) != string::npos) - { - int spos = line.rfind ('/', pos); - string ofile = (spos == string::npos ? line.substr (0, pos+2) : line.substr (spos+1, pos-spos+1)); - fo << "pic/" << ofile << " " << ofile << " " << dfile << line.substr (pos) << endl; - } - else - fo << line << endl; - } - pclose (fd); - fo.close (); - } + FILE *fd = popen (cmd.c_str (), "r"); + ofstream fo (dfile.c_str ()); + int pos; + while (!feof (fd)) + { + line = get_line (fd); + if ((pos = line.rfind (".o:")) != string::npos) + { + int spos = line.rfind ('/', pos); + string ofile = (spos == string::npos ? line.substr (0, pos+2) : line.substr (spos+1, pos-spos+1)); + fo << "pic/" << ofile << " " << ofile << " " << dfile << line.substr (pos) << endl; + } + else + fo << line << endl; + } + pclose (fd); + fo.close (); + } for (it = ccfiles.begin (); it != ccfiles.end (); ++it) - { - string f = *it, dfile = basename (f, true) + ".d", line; + { + string f = *it, dfile = basename (f, true) + ".d", line; - unlink (dfile.c_str ()); - string cmd = vars["CC"] + " " + vars["DEPEND_FLAGS"] + " " - + vars["CPPFLAGS"] + " " + vars["ALL_CXXFLAGS"] + " " - + incflags + " " + defs + " " + quote_path (f); + unlink (dfile.c_str ()); + string cmd = vars["CC"] + " " + vars["DEPEND_FLAGS"] + " " + + vars["CPPFLAGS"] + " " + vars["ALL_CXXFLAGS"] + " " + + incflags + " " + defs + " " + quote_path (f); - FILE *fd = popen (cmd.c_str (), "r"); - ofstream fo (dfile.c_str ()); - int pos; - while (!feof (fd)) - { - line = get_line (fd); - if ((pos = line.rfind (".o:")) != string::npos) - { - int spos = line.rfind ('/', pos); - string ofile = (spos == string::npos ? line.substr (0, pos+2) : line.substr (spos+1, pos-spos+1)); - fo << "pic/" << ofile << " " << ofile << " " << dfile << line.substr (pos+2) << endl; - } - else - fo << line << endl; - } - pclose (fd); - fo.close (); - } + FILE *fd = popen (cmd.c_str (), "r"); + ofstream fo (dfile.c_str ()); + int pos; + while (!feof (fd)) + { + line = get_line (fd); + if ((pos = line.rfind (".o:")) != string::npos) + { + int spos = line.rfind ('/', pos); + string ofile = (spos == string::npos ? line.substr (0, pos+2) : line.substr (spos+1, pos-spos+1)); + fo << "pic/" << ofile << " " << ofile << " " << dfile << line.substr (pos+2) << endl; + } + else + fo << line << endl; + } + pclose (fd); + fo.close (); + } return 0; } @@ -650,128 +650,128 @@ { string f = *it, b = basename (f, true); if (!vars["F77"].empty ()) - { - string o; - if (!outputfile.empty ()) - { - if (link) - o = b + ".o"; - else - o = outputfile; - } - else - o = b + ".o"; - objfiles += (" " + o); - string cmd = vars["F77"] + " -c " + vars["FPICFLAG"] + " " - + vars["ALL_FFLAGS"] + " " + incflags + " " + defs + " " - + pass_on_options + " " + f + " -o " + o; - result = run_command (cmd); - } + { + string o; + if (!outputfile.empty ()) + { + if (link) + o = b + ".o"; + else + o = outputfile; + } + else + o = b + ".o"; + objfiles += (" " + o); + string cmd = vars["F77"] + " -c " + vars["FPICFLAG"] + " " + + vars["ALL_FFLAGS"] + " " + incflags + " " + defs + " " + + pass_on_options + " " + f + " -o " + o; + result = run_command (cmd); + } else - { - cerr << "mkoctfile: no way to compile Fortran file " << f << endl; - return 1; - } + { + cerr << "mkoctfile: no way to compile Fortran file " << f << endl; + return 1; + } } for (it = cfiles.begin (); it != cfiles.end (); ++it) { string f = *it; if (!vars["CC"].empty ()) - { - string b = basename (f, true), o; - if (!outputfile.empty ()) - { - if (link) - o = b + ".o"; - else - o = outputfile; - } - else - o = b + ".o"; - objfiles += (" " + o); - string cmd = vars["CC"] + " -c " + vars["CPPFLAGS"] + " " - + vars["CPICFLAG"] + " " + vars["ALL_CFLAGS"] + " " - + pass_on_options + " " + incflags + " " + defs + " " - + quote_path (f) + " -o " + quote_path (o); - result = run_command (cmd); - } + { + string b = basename (f, true), o; + if (!outputfile.empty ()) + { + if (link) + o = b + ".o"; + else + o = outputfile; + } + else + o = b + ".o"; + objfiles += (" " + o); + string cmd = vars["CC"] + " -c " + vars["CPPFLAGS"] + " " + + vars["CPICFLAG"] + " " + vars["ALL_CFLAGS"] + " " + + pass_on_options + " " + incflags + " " + defs + " " + + quote_path (f) + " -o " + quote_path (o); + result = run_command (cmd); + } else - { - cerr << "mkoctfile: no way to compile C file " << f << endl; - return 1; - } + { + cerr << "mkoctfile: no way to compile C file " << f << endl; + return 1; + } } - + for (it = ccfiles.begin (); it != ccfiles.end (); ++it) { string f = *it; if (!vars["CXX"].empty ()) - { - string b = basename (f, true), o; - if (!outputfile.empty ()) - { - if (link) - o = b + ".o"; - else - o = outputfile; - } - else - o = b + ".o"; - objfiles += (" " + o); - string cmd = vars["CXX"] + " -c " + vars["CPPFLAGS"] + " " - + vars["CXXPICFLAG"] + " " + vars["ALL_CXXFLAGS"] + " " - + pass_on_options + " " + incflags + " " + defs + " " - + quote_path (f) + " -o " + quote_path (o); - result = run_command (cmd); - } + { + string b = basename (f, true), o; + if (!outputfile.empty ()) + { + if (link) + o = b + ".o"; + else + o = outputfile; + } + else + o = b + ".o"; + objfiles += (" " + o); + string cmd = vars["CXX"] + " -c " + vars["CPPFLAGS"] + " " + + vars["CXXPICFLAG"] + " " + vars["ALL_CXXFLAGS"] + " " + + pass_on_options + " " + incflags + " " + defs + " " + + quote_path (f) + " -o " + quote_path (o); + result = run_command (cmd); + } else - { - cerr << "mkoctfile: no way to compile C++ file " << f << endl; - return 1; - } + { + cerr << "mkoctfile: no way to compile C++ file " << f << endl; + return 1; + } } if (link && !objfiles.empty ()) { if (link_stand_alone) - { - if (!vars["LD_CXX"].empty ()) - { - string cmd = vars["LD_CXX"] + " " + vars["CPPFLAGS"] + " " - + vars["ALL_CXXFLAGS"] + " " + vars["RDYNAMIC_FLAG"] - + " " + vars["ALL_LDFLAGS"] + " " + pass_on_options - + " " + output_option + " " + objfiles + " " + libfiles - + " " + ldflags + " " + vars["LFLAGS"] + " " - + vars["RLD_FLAG"] + " " + vars["OCTAVE_LIBS"] + " " - + vars["LAPACK_LIBS"] + " " + vars["BLAS_LIBS"] + " " + { + if (!vars["LD_CXX"].empty ()) + { + string cmd = vars["LD_CXX"] + " " + vars["CPPFLAGS"] + " " + + vars["ALL_CXXFLAGS"] + " " + vars["RDYNAMIC_FLAG"] + + " " + vars["ALL_LDFLAGS"] + " " + pass_on_options + + " " + output_option + " " + objfiles + " " + libfiles + + " " + ldflags + " " + vars["LFLAGS"] + " " + + vars["RLD_FLAG"] + " " + vars["OCTAVE_LIBS"] + " " + + vars["LAPACK_LIBS"] + " " + vars["BLAS_LIBS"] + " " + vars["FFTW_LIBS"] + " " + vars["READLINE_LIBS"] + " " + vars["LIBS"] + " " + vars["FLIBS"]; - result = run_command (cmd); - } - else - { - cerr << "mkoctfile: no way to link stand-alone executable file" - << endl; - return 1; - } - } + result = run_command (cmd); + } + else + { + cerr << "mkoctfile: no way to link stand-alone executable file" + << endl; + return 1; + } + } else - { - string LINK_DEPS = vars["LFLAGS"] + " " + vars["OCTAVE_LIBS"] - + " " + vars["LDFLAGS"] + " " + vars["BLAS_LIBS"] + " " - + vars["FFTW_LIBS"] + " " + vars["LIBS"] + " " + vars["FLIBS"]; - string cmd = vars["DL_LD"] + " " + vars["DL_LDFLAGS"] + " " - + pass_on_options + " -o " + octfile + " " + objfiles + " " - + libfiles + " " + ldflags + " " + LINK_DEPS; - result = run_command (cmd); - } + { + string LINK_DEPS = vars["LFLAGS"] + " " + vars["OCTAVE_LIBS"] + + " " + vars["LDFLAGS"] + " " + vars["BLAS_LIBS"] + " " + + vars["FFTW_LIBS"] + " " + vars["LIBS"] + " " + vars["FLIBS"]; + string cmd = vars["DL_LD"] + " " + vars["DL_LDFLAGS"] + " " + + pass_on_options + " -o " + octfile + " " + objfiles + " " + + libfiles + " " + ldflags + " " + LINK_DEPS; + result = run_command (cmd); + } if (strip) - { - string cmd = "strip " + octfile; - result = run_command (cmd); - } + { + string cmd = "strip " + octfile; + result = run_command (cmd); + } } return result;
--- a/mkoctfile.in +++ b/mkoctfile.in @@ -222,25 +222,25 @@ -p VAR, --print VAR Print configuration variable VAR. Recognized variables are: - ALL_CFLAGS FLIBS - ALL_CXXFLAGS FPICFLAG - ALL_FFLAGS INCFLAGS - ALL_LDFLAGS LAPACK_LIBS - BLAS_LIBS LDFLAGS - CC LD_CXX - CFLAGS LD_STATIC_FLAG - CPICFLAG LFLAGS - CPPFLAGS LIBCRUFT - CXX LIBOCTAVE - CXXFLAGS LIBOCTINTERP - CXXPICFLAG LIBS - DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS - DEPEND_FLAGS RDYNAMIC_FLAG - DL_LD READLINE_LIBS - DL_LDFLAGS RLD_FLAG - F77 SED - FFLAGS XTRA_CFLAGS - FFTW_LIBS XTRA_CXXFLAGS + ALL_CFLAGS FLIBS + ALL_CXXFLAGS FPICFLAG + ALL_FFLAGS INCFLAGS + ALL_LDFLAGS LAPACK_LIBS + BLAS_LIBS LDFLAGS + CC LD_CXX + CFLAGS LD_STATIC_FLAG + CPICFLAG LFLAGS + CPPFLAGS LIBCRUFT + CXX LIBOCTAVE + CXXFLAGS LIBOCTINTERP + CXXPICFLAG LIBS + DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS + DEPEND_FLAGS RDYNAMIC_FLAG + DL_LD READLINE_LIBS + DL_LDFLAGS RLD_FLAG + F77 SED + FFLAGS XTRA_CFLAGS + FFTW_LIBS XTRA_CXXFLAGS --link-stand-alone Link a stand-alone executable file. @@ -430,11 +430,11 @@ esac if [ -n "$F77" ]; then if [ -n "$outputfile" ]; then - if $link; then - o=$b.o - else - o=$outputfile - fi + if $link; then + o=$b.o + else + o=$outputfile + fi else o=$b.o fi @@ -453,13 +453,13 @@ if [ -n "$CC" ]; then b=`echo $f | $SED 's,.*/,,; s,\.c$,,'` if [ -n "$outputfile" ]; then - if $link; then - o=$b.o - else - o=$outputfile - fi + if $link; then + o=$b.o + else + o=$outputfile + fi else - o=$b.o + o=$b.o fi objfiles="$objfiles $o" cmd="$CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $pass_on_options $incflags $defs $f -o $o" @@ -475,24 +475,24 @@ for f in $ccfiles; do if [ -n "$CXX" ]; then case $f in - *.cc) - b=`echo $f | $SED 's,.*/,,; s,\.cc$,,'` - ;; - *.C) - b=`echo $f | $SED 's,.*/,,; s,\.C$,,'` - ;; - *.cpp) - b=`echo $f | $SED 's,.*/,,; s,\.cpp$,,'` - ;; + *.cc) + b=`echo $f | $SED 's,.*/,,; s,\.cc$,,'` + ;; + *.C) + b=`echo $f | $SED 's,.*/,,; s,\.C$,,'` + ;; + *.cpp) + b=`echo $f | $SED 's,.*/,,; s,\.cpp$,,'` + ;; esac if [ -n "$outputfile" ]; then - if $link; then - o=$b.o - else - o=$outputfile - fi + if $link; then + o=$b.o + else + o=$outputfile + fi else - o=$b.o + o=$b.o fi objfiles="$objfiles $o" cmd="$CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $pass_on_options $incflags $defs $f -o $o"
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2011-01-26 John W. Eaton <jwe@octave.org> + + * mkdoc: Untabify. + + * mkdoc, gethelp.cc: Strip trailing whitespace. + 2011-01-26 John W. Eaton <jwe@octave.org> * general/curl.m: Simplify processing of outptut values.
--- a/scripts/gethelp.cc +++ b/scripts/gethelp.cc @@ -117,7 +117,7 @@ if (! help_txt.empty ()) { - if (looks_like_octave_copyright (help_txt)) + if (looks_like_octave_copyright (help_txt)) help_txt.resize (0); if (help_txt.empty ()) @@ -144,7 +144,7 @@ file_name = argv[2]; } - std::string help_text = extract_help_text (); + std::string help_text = extract_help_text (); if (! help_text.empty ()) {
--- a/scripts/mkdoc +++ b/scripts/mkdoc @@ -3,17 +3,17 @@ # Copyright (C) 1999-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -43,24 +43,24 @@ prefix="./" else $PERL -w -e ' - unless (@ARGV == 2) { die "Usage: $0 srcdir m_filename" ; } - ($srcdir, $m_fname) = ($ARGV[0], $ARGV[1]); - $full_fname = $srcdir . $m_fname; - exit unless ( $full_fname =~ m{(.*)/(@|)([^/]*)/(.*)\.m} ); - if ($2) { - $fcn = "$2$3/$4"; - } else { - $fcn = $4; - } - $re_srcdir = quotemeta($srcdir); - for (qx{ ./gethelp $fcn "$full_fname" < "$full_fname"} ) { - s/^\s+\@/\@/ unless $in_example; - s/^\s+\@group/\@group/; - s/^\s+\@end\s+group/\@end group/; - s|\@c $fcn $re_srcdir|\@c $fcn scripts/|o; - $in_example = (/\s*\@example\b/ .. /\s*\@end\s+example\b/); - print; - }' "$prefix" "$arg" + unless (@ARGV == 2) { die "Usage: $0 srcdir m_filename" ; } + ($srcdir, $m_fname) = ($ARGV[0], $ARGV[1]); + $full_fname = $srcdir . $m_fname; + exit unless ( $full_fname =~ m{(.*)/(@|)([^/]*)/(.*)\.m} ); + if ($2) { + $fcn = "$2$3/$4"; + } else { + $fcn = $4; + } + $re_srcdir = quotemeta($srcdir); + for (qx{ ./gethelp $fcn "$full_fname" < "$full_fname"} ) { + s/^\s+\@/\@/ unless $in_example; + s/^\s+\@group/\@group/; + s/^\s+\@end\s+group/\@end group/; + s|\@c $fcn $re_srcdir|\@c $fcn scripts/|o; + $in_example = (/\s*\@example\b/ .. /\s*\@end\s+example\b/); + print; + }' "$prefix" "$arg" fi done else
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-26 John W. Eaton <jwe@octave.org> + + * lex.ll, graphics.cc, gl-render.cc, ov-mex-fcn.h, graphics.h.in: + Delete trailing whitespace. + 2011-01-26 John W. Eaton <jwe@octave.org> Bug #32242.
--- a/src/gl-render.cc +++ b/src/gl-render.cc @@ -326,9 +326,9 @@ // No copying! - opengl_tesselator (const opengl_tesselator&); - - opengl_tesselator operator = (const opengl_tesselator&); + opengl_tesselator (const opengl_tesselator&); + + opengl_tesselator operator = (const opengl_tesselator&); GLUtesselator *glu_tess; bool fill; @@ -734,15 +734,15 @@ // drawn after axes object, for correct rendering? if (xyz == 0) // X { - b = render_text (ticklabels(i), val, p1, p2, ha, va); + b = render_text (ticklabels(i), val, p1, p2, ha, va); } else if (xyz == 1) // Y { - b = render_text (ticklabels(i), p1, val, p2, ha, va); + b = render_text (ticklabels(i), p1, val, p2, ha, va); } else if (xyz == 2) // Z { - b = render_text (ticklabels(i), p1, p2, val, ha, va); + b = render_text (ticklabels(i), p1, p2, val, ha, va); } wmax = std::max (wmax, static_cast<int> (b(2))); @@ -970,7 +970,7 @@ } Matrix view = props.get_view ().matrix_value (); - bool nearhoriz = std::abs(view(1)) <= 5; + bool nearhoriz = std::abs(view(1)) <= 5; Matrix axe_color = props.get_color_rgb (); bool visible = props.is_visible (); @@ -1143,7 +1143,7 @@ render_grid (minorgridstyle, xmticks, x_min, x_max, yPlane, yPlaneN, layer2Dtop ? zPlaneN : zPlane, zPlaneN, 0, (zstate != AXE_DEPTH_DIR)); - + // minor tick marks if (do_xminortick) {
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -5615,7 +5615,7 @@ private: callback_event (void) - : base_graphics_event (), handle (), + : base_graphics_event (), handle (), callback_name (), callback_data () { } @@ -5639,7 +5639,7 @@ } private: - + graphics_event::event_fcn function; void* function_data; @@ -5672,9 +5672,7 @@ private: set_event (void) - : base_graphics_event (), - // FIXME: it it private in order not to be used ? - handle (), property_name (), property_value () + : base_graphics_event (), handle (), property_name (), property_value () { } private:
--- a/src/graphics.h.in +++ b/src/graphics.h.in @@ -326,17 +326,17 @@ friend class property; public: - base_property (void) - : id (-1), count (1), name (), parent (), hidden (), listeners () + base_property (void) + : id (-1), count (1), name (), parent (), hidden (), listeners () { } base_property (const std::string& s, const graphics_handle& h) - : id (-1), count (1), name (s), parent (h), hidden (false), listeners () + : id (-1), count (1), name (s), parent (h), hidden (false), listeners () { } base_property (const base_property& p) - : id (-1), count (1), name (p.name), parent (p.parent), - hidden (p.hidden), listeners () + : id (-1), count (1), name (p.name), parent (p.parent), + hidden (p.hidden), listeners () { } virtual ~base_property (void) { } @@ -1103,8 +1103,7 @@ array_property (const std::string& nm, const graphics_handle& h, const octave_value& m) : base_property (nm, h), data (m), - xmin (), xmax (), xminp (), type_constraints (), size_constraints () - + xmin (), xmax (), xminp (), type_constraints (), size_constraints () { get_data_limits (); } @@ -2978,7 +2977,7 @@ { public: graphics_xform (void) - : xform (xform_eye ()), xform_inv (xform_eye ()), + : xform (xform_eye ()), xform_inv (xform_eye ()), sx ("linear"), sy ("linear"), sz ("linear"), zlim (1, 2, 0.0) { zlim(1) = 1.0;
--- a/src/lex.ll +++ b/src/lex.ll @@ -1886,7 +1886,7 @@ flex_stream_reader (const flex_stream_reader&); - flex_stream_reader& operator = (const flex_stream_reader&); + flex_stream_reader& operator = (const flex_stream_reader&); char *buf; };
--- a/src/ov-mex-fcn.h +++ b/src/ov-mex-fcn.h @@ -44,7 +44,7 @@ public: octave_mex_function (void) - : mex_fcn_ptr (), exit_fcn_ptr (), have_fmex (), sh_lib (), + : mex_fcn_ptr (), exit_fcn_ptr (), have_fmex (), sh_lib (), t_checked (), system_fcn_file () { } octave_mex_function (void *fptr, bool fmex, const octave_shlib& shl,