Browse Source

* */*: cl_istream -> std::istream, cl_ostream -> std::ostream.

master
Richard Kreckel 25 years ago
parent
commit
f3b29e52ea
  1. 8
      ChangeLog
  2. 5
      INSTALL
  3. 4
      NEWS
  4. 1
      configure.in
  5. 71
      doc/cln.tex
  6. 10
      include/cln/GV_complex.h
  7. 10
      include/cln/GV_integer.h
  8. 10
      include/cln/GV_rational.h
  9. 10
      include/cln/GV_real.h
  10. 10
      include/cln/SV_complex.h
  11. 10
      include/cln/SV_integer.h
  12. 10
      include/cln/SV_rational.h
  13. 10
      include/cln/SV_real.h
  14. 2
      include/cln/SV_ringelt.h
  15. 10
      include/cln/complex_io.h
  16. 2
      include/cln/condition.h
  17. 8
      include/cln/dfloat_io.h
  18. 8
      include/cln/ffloat_io.h
  19. 16
      include/cln/float_io.h
  20. 24
      include/cln/integer_io.h
  21. 31
      include/cln/io.h
  22. 8
      include/cln/lfloat_io.h
  23. 10
      include/cln/modinteger.h
  24. 16
      include/cln/rational_io.h
  25. 12
      include/cln/real_io.h
  26. 8
      include/cln/ring.h
  27. 8
      include/cln/sfloat_io.h
  28. 12
      include/cln/string.h
  29. 6
      include/cln/timing.h
  30. 10
      include/cln/univpoly.h
  31. 2
      include/cln/univpoly_complex.h
  32. 2
      include/cln/univpoly_integer.h
  33. 2
      include/cln/univpoly_modint.h
  34. 2
      include/cln/univpoly_rational.h
  35. 2
      include/cln/univpoly_real.h
  36. 22
      include/cln/version.h.in
  37. 18
      src/base/cl_version.cc
  38. 4
      src/base/output/cl_output_dec.cc
  39. 4
      src/base/output/cl_output_hex.cc
  40. 2
      src/base/ring/cl_no_ring.cc
  41. 2
      src/base/string/input/cl_st_get1.cc
  42. 2
      src/base/string/input/cl_st_get2.cc
  43. 2
      src/base/string/input/cl_st_getline1.cc
  44. 2
      src/base/string/input/cl_st_getline2.cc
  45. 2
      src/base/string/input/cl_st_gettoken.cc
  46. 2
      src/base/string/output/cl_st_print.cc
  47. 2
      src/complex/input/cl_N_read_stream.cc
  48. 2
      src/complex/output/cl_N_aprint.cc
  49. 2
      src/complex/output/cl_N_bprint.cc
  50. 2
      src/complex/ring/cl_C_ring.cc
  51. 2
      src/float/input/cl_F_read_stream.cc
  52. 2
      src/float/output/cl_F_aprint.cc
  53. 2
      src/float/output/cl_F_bprint.cc
  54. 2
      src/float/output/cl_F_cprint.cc
  55. 2
      src/float/output/cl_F_dprint.cc
  56. 2
      src/float/output/cl_F_printb.cc
  57. 2
      src/integer/input/cl_I_read_stream.cc
  58. 2
      src/integer/output/cl_I_aprint.cc
  59. 2
      src/integer/output/cl_I_bprint.cc
  60. 2
      src/integer/output/cl_I_cprint.cc
  61. 2
      src/integer/output/cl_I_dprint.cc
  62. 2
      src/integer/output/cl_I_print.cc
  63. 2
      src/integer/ring/cl_0_ring.cc
  64. 2
      src/integer/ring/cl_I_ring.cc
  65. 2
      src/modinteger/cl_MI_cond_composite.cc
  66. 2
      src/modinteger/cl_MI_int.h
  67. 2
      src/modinteger/cl_MI_std.h
  68. 2
      src/polynomial/elem/cl_UP_MI.h
  69. 2
      src/polynomial/elem/cl_UP_gen.h
  70. 2
      src/polynomial/elem/cl_UP_no_ring.cc
  71. 2
      src/polynomial/elem/cl_UP_number.h
  72. 2
      src/rational/input/cl_RA_read_stream.cc
  73. 2
      src/rational/output/cl_RA_aprint.cc
  74. 2
      src/rational/output/cl_RA_bprint.cc
  75. 2
      src/rational/output/cl_RA_cprint.cc
  76. 2
      src/rational/output/cl_RA_dprint.cc
  77. 2
      src/rational/output/cl_RA_print.cc
  78. 2
      src/rational/ring/cl_RA_ring.cc
  79. 4
      src/real/format-output/cl_fmt_cardinal.cc
  80. 2
      src/real/format-output/cl_fmt_integer.cc
  81. 2
      src/real/format-output/cl_fmt_newroman.cc
  82. 2
      src/real/format-output/cl_fmt_oldroman.cc
  83. 2
      src/real/format-output/cl_fmt_ordinal.cc
  84. 2
      src/real/format-output/cl_fmt_paddedstring.cc
  85. 14
      src/real/format-output/cl_format.h
  86. 2
      src/real/input/cl_R_read_stream.cc
  87. 2
      src/real/output/cl_R_aprint.cc
  88. 2
      src/real/output/cl_R_bprint.cc
  89. 2
      src/real/output/cl_R_cprint.cc
  90. 2
      src/real/ring/cl_R_ring.cc
  91. 8
      src/timing/cl_t_c2.cc
  92. 2
      src/timing/cl_t_report.cc
  93. 2
      src/vector/cl_GV_io.h
  94. 2
      src/vector/cl_GV_number_debug.cc
  95. 2
      src/vector/cl_SV_io.h
  96. 2
      src/vector/cl_SV_number_debug.cc
  97. 2
      src/vector/output/cl_GV_number_aprint.cc
  98. 2
      src/vector/output/cl_SV_aprint.cc
  99. 2
      src/vector/output/cl_SV_number_aprint.cc

8
ChangeLog

@ -1,3 +1,11 @@
2000-12-14 Richard Kreckel <kreckel@ginac.de>
* Version 1.1 released.
2000-12-13 Richard Kreckel <kreckel@ginac.de>
* */*: cl_istream -> std::istream, cl_ostream -> std::ostream.
2000-12-05 Richard Kreckel <kreckel@ginac.de> 2000-12-05 Richard Kreckel <kreckel@ginac.de>
* Makefile.in, src/Makefile.in, doc/Makefile.in: Use mkdir -p. * Makefile.in, src/Makefile.in, doc/Makefile.in: Use mkdir -p.

5
INSTALL

@ -14,7 +14,7 @@ Known to work with:
- Linux/x86, gcc-2.8.0, egcs-1.1, gcc-2.95.x - Linux/x86, gcc-2.8.0, egcs-1.1, gcc-2.95.x
- Solaris 2.4 (sparc), egcs-1.1, gcc-2.95 - Solaris 2.4 (sparc), egcs-1.1, gcc-2.95
- OSF/1 V4.0 (alpha), egcs-1.1, gcc-2.95 - OSF/1 V4.0 (alpha), egcs-1.1, gcc-2.95
- Irix 5.3, CC 4
- Irix 6.5, gcc-2.95
The "make" step takes about 1 hour, on a P-II / 400 MHz / 64 MB. The "make" step takes about 1 hour, on a P-II / 400 MHz / 64 MB.
@ -28,8 +28,5 @@ either "-O", "-O1" or "-O2 -fno-schedule-insns" to the CXXFLAGS. With full
egcs-1.1.1 or older on Sparc, you must specify --disable-shared because g++ egcs-1.1.1 or older on Sparc, you must specify --disable-shared because g++
would miscompile parts of the library. would miscompile parts of the library.
On MIPS (SGI Irix 6), pass option "--without-gmp" to configure. gmp does
not work when compiled in "n32" binary format on Irix.
More detailed installation instructions can be found in the documentation, More detailed installation instructions can be found in the documentation,
in the doc/ directory. in the doc/ directory.

4
NEWS

@ -1,4 +1,4 @@
2000-11-xx, version 1.1.0
2000-12-14, version 1.1.0
========================= =========================
Functional changes Functional changes
@ -24,7 +24,7 @@ Implementation changes
better match present-day CPUs. better match present-day CPUs.
* Fix several errors for architectures with 64-bit wide words. * Fix several errors for architectures with 64-bit wide words.
(Others than Alpha.)
(Others than Alpha, which worked already.)
* Fix compilation errors with current GCC-3.0 snapshots. * Fix compilation errors with current GCC-3.0 snapshots.

1
configure.in

@ -65,7 +65,6 @@ CL_CANONICAL_HOST_CPU
dnl dnl
dnl check for build configuration dnl check for build configuration
dnl dnl
LIBS=-lm
dnl libcln depends on libm dnl libcln depends on libm
PACKAGE=cln PACKAGE=cln
dnl libtool wants PACKAGE dnl libtool wants PACKAGE

71
doc/cln.tex

@ -12,6 +12,9 @@
@end iftex @end iftex
@c %**end of header @c %**end of header
@direntry
* CLN: (cln). Class Library for Numbers (C++).
@end direntry
@c My own index. @c My own index.
@defindex my @defindex my
@ -2415,18 +2418,15 @@ In Common Lisp notation: @code{#C(@var{realpart} @var{imagpart})}.
@section Input functions @section Input functions
Including @code{<cln/io.h>} defines a type @code{cl_istream}, which is
the type of the first argument to all input functions. @code{cl_istream}
is the same as @code{std::istream&}.
These are the simple input functions:
Including @code{<cln/io.h>} defines a number of simple input functions
that read from @code{std::istream&}:
@table @code @table @code
@item int freadchar (cl_istream stream)
@item int freadchar (std::istream& stream)
Reads a character from @code{stream}. Returns @code{cl_EOF} (not a @samp{char}!) Reads a character from @code{stream}. Returns @code{cl_EOF} (not a @samp{char}!)
if the end of stream was encountered or an error occurred. if the end of stream was encountered or an error occurred.
@item int funreadchar (cl_istream stream, int c)
@item int funreadchar (std::istream& stream, int c)
Puts back @code{c} onto @code{stream}. @code{c} must be the result of the Puts back @code{c} onto @code{stream}. @code{c} must be the result of the
last @code{freadchar} operation on @code{stream}. last @code{freadchar} operation on @code{stream}.
@end table @end table
@ -2436,7 +2436,7 @@ Each of the classes @code{cl_N}, @code{cl_R}, @code{cl_RA}, @code{cl_I},
defines, in @code{<cln/@var{type}_io.h>}, the following input function: defines, in @code{<cln/@var{type}_io.h>}, the following input function:
@table @code @table @code
@item cl_istream operator>> (cl_istream stream, @var{type}& result)
@item std::istream& operator>> (std::istream& stream, @var{type}& result)
Reads a number from @code{stream} and stores it in the @code{result}. Reads a number from @code{stream} and stores it in the @code{result}.
@end table @end table
@ -2444,11 +2444,11 @@ The most flexible input functions, defined in @code{<cln/@var{type}_io.h>},
are the following: are the following:
@table @code @table @code
@item cl_N read_complex (cl_istream stream, const cl_read_flags& flags)
@itemx cl_R read_real (cl_istream stream, const cl_read_flags& flags)
@itemx cl_F read_float (cl_istream stream, const cl_read_flags& flags)
@itemx cl_RA read_rational (cl_istream stream, const cl_read_flags& flags)
@itemx cl_I read_integer (cl_istream stream, const cl_read_flags& flags)
@item cl_N read_complex (std::istream& stream, const cl_read_flags& flags)
@itemx cl_R read_real (std::istream& stream, const cl_read_flags& flags)
@itemx cl_F read_float (std::istream& stream, const cl_read_flags& flags)
@itemx cl_RA read_rational (std::istream& stream, const cl_read_flags& flags)
@itemx cl_I read_integer (std::istream& stream, const cl_read_flags& flags)
Reads a number from @code{stream}. The @code{flags} are parameters which Reads a number from @code{stream}. The @code{flags} are parameters which
affect the input syntax. Whitespace before the number is silently skipped. affect the input syntax. Whitespace before the number is silently skipped.
@ -2514,32 +2514,29 @@ precision corresponding to their number of significant digits.
@section Output functions @section Output functions
Including @code{<cln/io.h>} defines a type @code{cl_ostream}, which is
the type of the first argument to all output functions. @code{cl_ostream}
is the same as @code{std::ostream&}.
These are the simple output functions:
Including @code{<cln/io.h>} defines a number of simple output functions
that write to @code{std::ostream&}:
@table @code @table @code
@item void fprintchar (cl_ostream stream, char c)
@item void fprintchar (std::ostream& stream, char c)
Prints the character @code{x} literally on the @code{stream}. Prints the character @code{x} literally on the @code{stream}.
@item void fprint (cl_ostream stream, const char * string)
@item void fprint (std::ostream& stream, const char * string)
Prints the @code{string} literally on the @code{stream}. Prints the @code{string} literally on the @code{stream}.
@item void fprintdecimal (cl_ostream stream, int x)
@itemx void fprintdecimal (cl_ostream stream, const cl_I& x)
@item void fprintdecimal (std::ostream& stream, int x)
@itemx void fprintdecimal (std::ostream& stream, const cl_I& x)
Prints the integer @code{x} in decimal on the @code{stream}. Prints the integer @code{x} in decimal on the @code{stream}.
@item void fprintbinary (cl_ostream stream, const cl_I& x)
@item void fprintbinary (std::ostream& stream, const cl_I& x)
Prints the integer @code{x} in binary (base 2, without prefix) Prints the integer @code{x} in binary (base 2, without prefix)
on the @code{stream}. on the @code{stream}.
@item void fprintoctal (cl_ostream stream, const cl_I& x)
@item void fprintoctal (std::ostream& stream, const cl_I& x)
Prints the integer @code{x} in octal (base 8, without prefix) Prints the integer @code{x} in octal (base 8, without prefix)
on the @code{stream}. on the @code{stream}.
@item void fprinthexadecimal (cl_ostream stream, const cl_I& x)
@item void fprinthexadecimal (std::ostream& stream, const cl_I& x)
Prints the integer @code{x} in hexadecimal (base 16, without prefix) Prints the integer @code{x} in hexadecimal (base 16, without prefix)
on the @code{stream}. on the @code{stream}.
@end table @end table
@ -2549,8 +2546,8 @@ Each of the classes @code{cl_N}, @code{cl_R}, @code{cl_RA}, @code{cl_I},
defines, in @code{<cln/@var{type}_io.h>}, the following output functions: defines, in @code{<cln/@var{type}_io.h>}, the following output functions:
@table @code @table @code
@item void fprint (cl_ostream stream, const @var{type}& x)
@itemx cl_ostream operator<< (cl_ostream stream, const @var{type}& x)
@item void fprint (std::ostream& stream, const @var{type}& x)
@itemx std::ostream& operator<< (std::ostream& stream, const @var{type}& x)
Prints the number @code{x} on the @code{stream}. The output may depend Prints the number @code{x} on the @code{stream}. The output may depend
on the global printer settings in the variable @code{default_print_flags}. on the global printer settings in the variable @code{default_print_flags}.
The @code{ostream} flags and settings (flags, width and locale) are The @code{ostream} flags and settings (flags, width and locale) are
@ -2560,15 +2557,15 @@ ignored.
The most flexible output function, defined in @code{<cln/@var{type}_io.h>}, The most flexible output function, defined in @code{<cln/@var{type}_io.h>},
are the following: are the following:
@example @example
void print_complex (cl_ostream stream, const cl_print_flags& flags,
void print_complex (std::ostream& stream, const cl_print_flags& flags,
const cl_N& z); const cl_N& z);
void print_real (cl_ostream stream, const cl_print_flags& flags,
void print_real (std::ostream& stream, const cl_print_flags& flags,
const cl_R& z); const cl_R& z);
void print_float (cl_ostream stream, const cl_print_flags& flags,
void print_float (std::ostream& stream, const cl_print_flags& flags,
const cl_F& z); const cl_F& z);
void print_rational (cl_ostream stream, const cl_print_flags& flags,
void print_rational (std::ostream& stream, const cl_print_flags& flags,
const cl_RA& z); const cl_RA& z);
void print_integer (cl_ostream stream, const cl_print_flags& flags,
void print_integer (std::ostream& stream, const cl_print_flags& flags,
const cl_I& z); const cl_I& z);
@end example @end example
Prints the number @code{x} on the @code{stream}. The @code{flags} are Prints the number @code{x} on the @code{stream}. The @code{flags} are
@ -2627,7 +2624,7 @@ These compare two rings for equality.
Given a ring @code{R}, the following members can be used. Given a ring @code{R}, the following members can be used.
@table @code @table @code
@item void R->fprint (cl_ostream stream, const cl_ring_element& x)
@item void R->fprint (std::ostream& stream, const cl_ring_element& x)
@cindex @code{fprint ()} @cindex @code{fprint ()}
@itemx cl_boolean R->equal (const cl_ring_element& x, const cl_ring_element& y) @itemx cl_boolean R->equal (const cl_ring_element& x, const cl_ring_element& y)
@cindex @code{equal ()} @cindex @code{equal ()}
@ -2849,9 +2846,9 @@ The following output functions are defined (see also the chapter on
input/output). input/output).
@table @code @table @code
@item void fprint (cl_ostream stream, const cl_MI& x)
@item void fprint (std::ostream& stream, const cl_MI& x)
@cindex @code{fprint ()} @cindex @code{fprint ()}
@itemx cl_ostream operator<< (cl_ostream stream, const cl_MI& x)
@itemx std::ostream& operator<< (std::ostream& stream, const cl_MI& x)
@cindex @code{operator << ()} @cindex @code{operator << ()}
Prints the modular integer @code{x} on the @code{stream}. The output may depend Prints the modular integer @code{x} on the @code{stream}. The output may depend
on the global printer settings in the variable @code{default_print_flags}. on the global printer settings in the variable @code{default_print_flags}.
@ -3171,9 +3168,9 @@ The following output functions are defined (see also the chapter on
input/output). input/output).
@table @code @table @code
@item void fprint (cl_ostream stream, const cl_UP& x)
@item void fprint (std::ostream& stream, const cl_UP& x)
@cindex @code{fprint ()} @cindex @code{fprint ()}
@itemx cl_ostream operator<< (cl_ostream stream, const cl_UP& x)
@itemx std::ostream& operator<< (std::ostream& stream, const cl_UP& x)
@cindex @code{operator << ()} @cindex @code{operator << ()}
Prints the univariate polynomial @code{x} on the @code{stream}. The output may Prints the univariate polynomial @code{x} on the @code{stream}. The output may
depend on the global printer settings in the variable depend on the global printer settings in the variable

10
include/cln/GV_complex.h

@ -40,14 +40,14 @@ inline const cl_GV_N copy (const cl_GV_N& vector)
} }
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_GV_N& x)
inline void fprint (std::ostream& stream, const cl_GV_N& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_complex (cl_ostream stream, const cl_print_flags& flags, const cl_N& z);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_complex (std::ostream& stream, const cl_print_flags& flags, const cl_N& z);
print_vector(stream, default_print_flags, print_vector(stream, default_print_flags,
(void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
(void (*) (cl_ostream, const cl_print_flags&, const cl_N&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_N&))
&print_complex, &print_complex,
x); x);
} }

10
include/cln/GV_integer.h

@ -62,14 +62,14 @@ CL_REQUIRE(cl_GV_I)
extern const cl_GV_I copy (const cl_GV_I&); extern const cl_GV_I copy (const cl_GV_I&);
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_GV_I& x)
inline void fprint (std::ostream& stream, const cl_GV_I& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_integer (cl_ostream stream, const cl_print_flags& flags, const cl_I& z);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_integer (std::ostream& stream, const cl_print_flags& flags, const cl_I& z);
print_vector(stream, default_print_flags, print_vector(stream, default_print_flags,
(void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
(void (*) (cl_ostream, const cl_print_flags&, const cl_I&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_I&))
&print_integer, &print_integer,
x); x);
} }

10
include/cln/GV_rational.h

@ -40,14 +40,14 @@ inline const cl_GV_RA copy (const cl_GV_RA& vector)
} }
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_GV_RA& x)
inline void fprint (std::ostream& stream, const cl_GV_RA& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_rational (cl_ostream stream, const cl_print_flags& flags, const cl_RA& z);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_rational (std::ostream& stream, const cl_print_flags& flags, const cl_RA& z);
print_vector(stream, default_print_flags, print_vector(stream, default_print_flags,
(void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
(void (*) (cl_ostream, const cl_print_flags&, const cl_RA&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_RA&))
&print_rational, &print_rational,
x); x);
} }

10
include/cln/GV_real.h

@ -40,14 +40,14 @@ inline const cl_GV_R copy (const cl_GV_R& vector)
} }
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_GV_R& x)
inline void fprint (std::ostream& stream, const cl_GV_R& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_real (cl_ostream stream, const cl_print_flags& flags, const cl_R& z);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_real (std::ostream& stream, const cl_print_flags& flags, const cl_R& z);
print_vector(stream, default_print_flags, print_vector(stream, default_print_flags,
(void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
(void (*) (cl_ostream, const cl_print_flags&, const cl_R&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_R&))
&print_real, &print_real,
x); x);
} }

10
include/cln/SV_complex.h

@ -36,14 +36,14 @@ inline const cl_SV_N copy (const cl_SV_N& vector)
} }
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_SV_N& x)
inline void fprint (std::ostream& stream, const cl_SV_N& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_complex (cl_ostream stream, const cl_print_flags& flags, const cl_N& z);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_complex (std::ostream& stream, const cl_print_flags& flags, const cl_N& z);
print_vector(stream, default_print_flags, print_vector(stream, default_print_flags,
(void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
(void (*) (cl_ostream, const cl_print_flags&, const cl_N&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_N&))
&print_complex, &print_complex,
x); x);
} }

10
include/cln/SV_integer.h

@ -33,14 +33,14 @@ inline const cl_SV_I copy (const cl_SV_I& vector)
} }
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_SV_I& x)
inline void fprint (std::ostream& stream, const cl_SV_I& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_integer (cl_ostream stream, const cl_print_flags& flags, const cl_I& z);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_integer (std::ostream& stream, const cl_print_flags& flags, const cl_I& z);
print_vector(stream, default_print_flags, print_vector(stream, default_print_flags,
(void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
(void (*) (cl_ostream, const cl_print_flags&, const cl_I&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_I&))
&print_integer, &print_integer,
x); x);
} }

10
include/cln/SV_rational.h

@ -36,14 +36,14 @@ inline const cl_SV_RA copy (const cl_SV_RA& vector)
} }
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_SV_RA& x)
inline void fprint (std::ostream& stream, const cl_SV_RA& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_rational (cl_ostream stream, const cl_print_flags& flags, const cl_RA& z);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_rational (std::ostream& stream, const cl_print_flags& flags, const cl_RA& z);
print_vector(stream, default_print_flags, print_vector(stream, default_print_flags,
(void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
(void (*) (cl_ostream, const cl_print_flags&, const cl_RA&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_RA&))
&print_rational, &print_rational,
x); x);
} }

10
include/cln/SV_real.h

@ -36,14 +36,14 @@ inline const cl_SV_R copy (const cl_SV_R& vector)
} }
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_SV_R& x)
inline void fprint (std::ostream& stream, const cl_SV_R& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_real (cl_ostream stream, const cl_print_flags& flags, const cl_R& z);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_real (std::ostream& stream, const cl_print_flags& flags, const cl_R& z);
print_vector(stream, default_print_flags, print_vector(stream, default_print_flags,
(void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
(void (*) (cl_ostream, const cl_print_flags&, const cl_R&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
(void (*) (std::ostream&, const cl_print_flags&, const cl_R&))
&print_real, &print_real,
x); x);
} }

2
include/cln/SV_ringelt.h

@ -51,7 +51,7 @@ inline const cl_SV_ringelt copy (const cl_SV_ringelt& vector)
{ return The(cl_SV_ringelt) (copy((const cl_SV_any&) vector)); } { return The(cl_SV_ringelt) (copy((const cl_SV_any&) vector)); }
// Output. // Output.
extern void fprint (cl_ostream stream, const cl_ring& R, const cl_SV_ringelt& x);
extern void fprint (std::ostream& stream, const cl_ring& R, const cl_SV_ringelt& x);
// Debugging support. // Debugging support.
#ifdef CL_DEBUG #ifdef CL_DEBUG

10
include/cln/complex_io.h

@ -11,11 +11,11 @@ namespace cln {
// Undocumented input functions // Undocumented input functions
extern const cl_N read_complex (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse); extern const cl_N read_complex (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
extern const cl_N read_complex (cl_istream stream, const cl_read_flags& flags);
extern const cl_N read_complex (std::istream& stream, const cl_read_flags& flags);
// Documented input functions // Documented input functions
inline cl_istream operator>> (cl_istream stream, cl_N& result)
inline std::istream& operator>> (std::istream& stream, cl_N& result)
{ {
extern cl_read_flags cl_N_read_flags; extern cl_read_flags cl_N_read_flags;
result = read_complex(stream,cl_N_read_flags); result = read_complex(stream,cl_N_read_flags);
@ -32,10 +32,10 @@ inline cl_istream operator>> (cl_istream stream, cl_N& result)
// print_complex(stream,z); // print_complex(stream,z);
// > z: komplexe Zahl // > z: komplexe Zahl
// > stream: Stream // > stream: Stream
extern void print_complex (cl_ostream stream, const cl_print_flags& flags, const cl_N& z);
extern void print_complex (cl_ostream stream, const cl_print_number_flags& flags, const cl_N& z);
extern void print_complex (std::ostream& stream, const cl_print_flags& flags, const cl_N& z);
extern void print_complex (std::ostream& stream, const cl_print_number_flags& flags, const cl_N& z);
inline void fprint (cl_ostream stream, const cl_N& x)
inline void fprint (std::ostream& stream, const cl_N& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_complex(stream,default_print_flags,x); print_complex(stream,default_print_flags,x);

2
include/cln/condition.h

@ -16,7 +16,7 @@ struct cl_condition {
// Name. // Name.
virtual const char * name () const = 0; virtual const char * name () const = 0;
// Print. // Print.
virtual void print (cl_ostream) const = 0;
virtual void print (std::ostream&) const = 0;
// Virtual destructor. // Virtual destructor.
virtual ~cl_condition () = 0; virtual ~cl_condition () = 0;
private: private:

8
include/cln/dfloat_io.h

@ -8,19 +8,19 @@
namespace cln { namespace cln {
inline cl_istream operator>> (cl_istream stream, cl_DF& result)
inline std::istream& operator>> (std::istream& stream, cl_DF& result)
{ {
extern cl_read_flags cl_DF_read_flags; extern cl_read_flags cl_DF_read_flags;
extern const cl_F read_float (cl_istream, const cl_read_flags&);
extern const cl_F read_float (std::istream&, const cl_read_flags&);
result = As(cl_DF)(read_float(stream,cl_DF_read_flags)); result = As(cl_DF)(read_float(stream,cl_DF_read_flags));
return stream; return stream;
} }
// The following does strictly the same as the general `fprint' for floats. // The following does strictly the same as the general `fprint' for floats.
// It is here only so that people don't need to include <cln/float_io.h>. // It is here only so that people don't need to include <cln/float_io.h>.
inline void fprint (cl_ostream stream, const cl_DF& x)
inline void fprint (std::ostream& stream, const cl_DF& x)
{ {
extern void print_float (cl_ostream stream, const cl_print_flags& flags, const cl_F& z);
extern void print_float (std::ostream& stream, const cl_print_flags& flags, const cl_F& z);
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_float(stream,default_print_flags,x); print_float(stream,default_print_flags,x);
} }

8
include/cln/ffloat_io.h

@ -8,19 +8,19 @@
namespace cln { namespace cln {
inline cl_istream operator>> (cl_istream stream, cl_FF& result)
inline std::istream& operator>> (std::istream& stream, cl_FF& result)
{ {
extern cl_read_flags cl_FF_read_flags; extern cl_read_flags cl_FF_read_flags;
extern const cl_F read_float (cl_istream, const cl_read_flags&);
extern const cl_F read_float (std::istream&, const cl_read_flags&);
result = As(cl_FF)(read_float(stream,cl_FF_read_flags)); result = As(cl_FF)(read_float(stream,cl_FF_read_flags));
return stream; return stream;
} }
// The following does strictly the same as the general `fprint' for floats. // The following does strictly the same as the general `fprint' for floats.
// It is here only so that people don't need to include <cln/float_io.h>. // It is here only so that people don't need to include <cln/float_io.h>.
inline void fprint (cl_ostream stream, const cl_FF& x)
inline void fprint (std::ostream& stream, const cl_FF& x)
{ {
extern void print_float (cl_ostream stream, const cl_print_flags& flags, const cl_F& z);
extern void print_float (std::ostream& stream, const cl_print_flags& flags, const cl_F& z);
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_float(stream,default_print_flags,x); print_float(stream,default_print_flags,x);
} }

16
include/cln/float_io.h

@ -32,11 +32,11 @@ extern const cl_F read_float (unsigned int base, float_format_t prec,
// It is here only so that you don't need the complex and rational number // It is here only so that you don't need the complex and rational number
// readers in order to read a float number. ("Treeshaking") // readers in order to read a float number. ("Treeshaking")
extern const cl_F read_float (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse); extern const cl_F read_float (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
extern const cl_F read_float (cl_istream stream, const cl_read_flags& flags);
extern const cl_F read_float (std::istream& stream, const cl_read_flags& flags);
// Documented input functions // Documented input functions
inline cl_istream operator>> (cl_istream stream, cl_F& result)
inline std::istream& operator>> (std::istream& stream, cl_F& result)
{ {
extern cl_read_flags cl_F_read_flags; extern cl_read_flags cl_F_read_flags;
result = read_float(stream,cl_F_read_flags); result = read_float(stream,cl_F_read_flags);
@ -53,22 +53,22 @@ inline cl_istream operator>> (cl_istream stream, cl_F& result)
// print_float(stream,z); // print_float(stream,z);
// > z: Float // > z: Float
// > stream: Stream // > stream: Stream
extern void print_float (cl_ostream stream, const cl_print_flags& flags, const cl_F& z);
extern void print_float (cl_ostream stream, const cl_print_number_flags& flags, const cl_F& z);
extern void print_float (cl_ostream stream, const cl_print_real_flags& flags, const cl_F& z);
extern void print_float (cl_ostream stream, const cl_print_float_flags& flags, const cl_F& z);
extern void print_float (std::ostream& stream, const cl_print_flags& flags, const cl_F& z);
extern void print_float (std::ostream& stream, const cl_print_number_flags& flags, const cl_F& z);
extern void print_float (std::ostream& stream, const cl_print_real_flags& flags, const cl_F& z);
extern void print_float (std::ostream& stream, const cl_print_float_flags& flags, const cl_F& z);
// Gibt ein Float binär (sehr primitiv) aus. // Gibt ein Float binär (sehr primitiv) aus.
// print_float_binary(stream,z); // print_float_binary(stream,z);
// > z: Float // > z: Float
// > stream: Stream // > stream: Stream
extern void print_float_binary (cl_ostream stream, const cl_F& z);
extern void print_float_binary (std::ostream& stream, const cl_F& z);
// The following does strictly the same as the general `fprint' for numbers. // The following does strictly the same as the general `fprint' for numbers.
// It is here only so that you don't need the complex printer // It is here only so that you don't need the complex printer
// in order to print a float. ("Treeshaking") // in order to print a float. ("Treeshaking")
inline void fprint (cl_ostream stream, const cl_F& x)
inline void fprint (std::ostream& stream, const cl_F& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_float(stream,default_print_flags,x); print_float(stream,default_print_flags,x);

24
include/cln/integer_io.h

@ -27,11 +27,11 @@ extern const cl_I read_integer (unsigned int base,
// It is here only so that you don't need the rational, complex and float number // It is here only so that you don't need the rational, complex and float number
// readers in order to read an integer. ("Treeshaking") // readers in order to read an integer. ("Treeshaking")
extern const cl_I read_integer (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse); extern const cl_I read_integer (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
extern const cl_I read_integer (cl_istream stream, const cl_read_flags& flags);
extern const cl_I read_integer (std::istream& stream, const cl_read_flags& flags);
// Documented input functions // Documented input functions
inline cl_istream operator>> (cl_istream stream, cl_I& result)
inline std::istream& operator>> (std::istream& stream, cl_I& result)
{ {
extern cl_read_flags cl_I_read_flags; extern cl_read_flags cl_I_read_flags;
result = read_integer(stream,cl_I_read_flags); result = read_integer(stream,cl_I_read_flags);
@ -51,29 +51,29 @@ extern char * cl_decimal_string (const cl_I& x);
// > z: Integer // > z: Integer
// > base: Basis (>=2, <=36) // > base: Basis (>=2, <=36)
// > stream: Stream // > stream: Stream
extern void print_integer (cl_ostream stream, unsigned int base, const cl_I& z);
extern void print_integer (std::ostream& stream, unsigned int base, const cl_I& z);
// Dasselbe als String. Mit malloc_hook() alloziert, mit free_hook() freizugeben. // Dasselbe als String. Mit malloc_hook() alloziert, mit free_hook() freizugeben.
extern char * print_integer_to_string (unsigned int base, const cl_I& z); extern char * print_integer_to_string (unsigned int base, const cl_I& z);
// Documented output functions // Documented output functions
inline void fprintdecimal (cl_ostream stream, const cl_I& x)
inline void fprintdecimal (std::ostream& stream, const cl_I& x)
{ {
print_integer(stream,10,x); print_integer(stream,10,x);
} }
inline void fprintbinary (cl_ostream stream, const cl_I& x)
inline void fprintbinary (std::ostream& stream, const cl_I& x)
{ {
print_integer(stream,2,x); print_integer(stream,2,x);
} }
inline void fprintoctal (cl_ostream stream, const cl_I& x)
inline void fprintoctal (std::ostream& stream, const cl_I& x)
{ {
print_integer(stream,8,x); print_integer(stream,8,x);
} }
inline void fprinthexadecimal (cl_ostream stream, const cl_I& x)
inline void fprinthexadecimal (std::ostream& stream, const cl_I& x)
{ {
print_integer(stream,16,x); print_integer(stream,16,x);
} }
@ -83,16 +83,16 @@ inline void fprinthexadecimal (cl_ostream stream, const cl_I& x)
// > z: Zahl // > z: Zahl
// > stream: Stream // > stream: Stream
// > flags: Ausgabe-Parameter // > flags: Ausgabe-Parameter
extern void print_integer (cl_ostream stream, const cl_print_flags& flags, const cl_I& z);
extern void print_integer (cl_ostream stream, const cl_print_number_flags& flags, const cl_I& z);
extern void print_integer (cl_ostream stream, const cl_print_real_flags& flags, const cl_I& z);
extern void print_integer (cl_ostream stream, const cl_print_rational_flags& flags, const cl_I& z);
extern void print_integer (std::ostream& stream, const cl_print_flags& flags, const cl_I& z);
extern void print_integer (std::ostream& stream, const cl_print_number_flags& flags, const cl_I& z);
extern void print_integer (std::ostream& stream, const cl_print_real_flags& flags, const cl_I& z);
extern void print_integer (std::ostream& stream, const cl_print_rational_flags& flags, const cl_I& z);
// The following does strictly the same as the general `fprint' for numbers. // The following does strictly the same as the general `fprint' for numbers.
// It is here only so that you don't need the rational number printer // It is here only so that you don't need the rational number printer
// in order to print an integer. ("Treeshaking") // in order to print an integer. ("Treeshaking")
inline void fprint (cl_ostream stream, const cl_I& x)
inline void fprint (std::ostream& stream, const cl_I& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_integer(stream,default_print_flags,x); print_integer(stream,default_print_flags,x);

31
include/cln/io.h

@ -18,16 +18,17 @@
namespace cln { namespace cln {
// compatibility:
typedef std::istream& cl_istream; typedef std::istream& cl_istream;
typedef std::ostream& cl_ostream; typedef std::ostream& cl_ostream;
extern std::ostream* cl_debugout_stream; extern std::ostream* cl_debugout_stream;
#define cl_debugout (*cl_debugout_stream) #define cl_debugout (*cl_debugout_stream)
// Elementary operations on cl_istream
// Elementary operations on std::istream&
#define cl_EOF (-1) #define cl_EOF (-1)
inline int freadchar (cl_istream stream)
inline int freadchar (std::istream& stream)
{ {
char c; char c;
if (stream.get(c)) if (stream.get(c))
@ -37,46 +38,46 @@ inline int freadchar (cl_istream stream)
return cl_EOF; return cl_EOF;
} }
inline int funreadchar (cl_istream stream, int c)
inline int funreadchar (std::istream& stream, int c)
{ {
if (c != cl_EOF) if (c != cl_EOF)
stream.putback((char)c); stream.putback((char)c);
return c; return c;
} }
// Elementary operations on cl_ostream
// Elementary operations on std::ostream&
inline void fprintchar (cl_ostream stream, char c)
inline void fprintchar (std::ostream& stream, char c)
{ {
stream.put(c); stream.put(c);
} }
inline void fprint (cl_ostream stream, const char * string)
inline void fprint (std::ostream& stream, const char * string)
{ {
stream << string; stream << string;
} }
extern void fprintdecimal (cl_ostream stream, unsigned long x);
extern void fprintdecimal (cl_ostream stream, long x);
extern void fprintdecimal (std::ostream& stream, unsigned long x);
extern void fprintdecimal (std::ostream& stream, long x);
inline void fprintdecimal (cl_ostream stream, unsigned int x)
inline void fprintdecimal (std::ostream& stream, unsigned int x)
{ {
fprintdecimal(stream,(unsigned long)x); fprintdecimal(stream,(unsigned long)x);
} }
inline void fprintdecimal (cl_ostream stream, int x)
inline void fprintdecimal (std::ostream& stream, int x)
{ {
fprintdecimal(stream,(long)x); fprintdecimal(stream,(long)x);
} }
extern void fprinthexadecimal (cl_ostream stream, unsigned long x);
extern void fprinthexadecimal (cl_ostream stream, long x);
extern void fprinthexadecimal (std::ostream& stream, unsigned long x);
extern void fprinthexadecimal (std::ostream& stream, long x);
inline void fprinthexadecimal (cl_ostream stream, unsigned int x)
inline void fprinthexadecimal (std::ostream& stream, unsigned int x)
{ {
fprinthexadecimal(stream,(unsigned long)x); fprinthexadecimal(stream,(unsigned long)x);
} }
inline void fprinthexadecimal (cl_ostream stream, int x)
inline void fprinthexadecimal (std::ostream& stream, int x)
{ {
fprinthexadecimal(stream,(long)x); fprinthexadecimal(stream,(long)x);
} }
@ -93,7 +94,7 @@ CL_REQUIRE(cl_prin_globals)
// Define the customary << and >> operators. // Define the customary << and >> operators.
#define CL_DEFINE_PRINT_OPERATOR(_class_) \ #define CL_DEFINE_PRINT_OPERATOR(_class_) \
inline cl_ostream operator<< (cl_ostream stream, const _class_& x) \
inline std::ostream& operator<< (std::ostream& stream, const _class_& x) \
{ \ { \
fprint(stream,x); \ fprint(stream,x); \
return stream; \ return stream; \

8
include/cln/lfloat_io.h

@ -8,19 +8,19 @@
namespace cln { namespace cln {
inline cl_istream operator>> (cl_istream stream, cl_LF& result)
inline std::istream& operator>> (std::istream& stream, cl_LF& result)
{ {
extern cl_read_flags cl_LF_read_flags; extern cl_read_flags cl_LF_read_flags;
extern const cl_F read_float (cl_istream, const cl_read_flags&);
extern const cl_F read_float (std::istream&, const cl_read_flags&);
result = As(cl_LF)(read_float(stream,cl_LF_read_flags)); result = As(cl_LF)(read_float(stream,cl_LF_read_flags));
return stream; return stream;
} }
// The following does strictly the same as the general `fprint' for floats. // The following does strictly the same as the general `fprint' for floats.
// It is here only so that people don't need to include <cln/float_io.h>. // It is here only so that people don't need to include <cln/float_io.h>.
inline void fprint (cl_ostream stream, const cl_LF& x)
inline void fprint (std::ostream& stream, const cl_LF& x)
{ {
extern void print_float (cl_ostream stream, const cl_print_flags& flags, const cl_F& z);
extern void print_float (std::ostream& stream, const cl_print_flags& flags, const cl_F& z);
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_float(stream,default_print_flags,x); print_float(stream,default_print_flags,x);
} }

10
include/cln/modinteger.h

@ -81,7 +81,7 @@ struct cl_composite_condition : public cl_condition {
{ print(std::cerr); } { print(std::cerr); }
// Implement general condition methods. // Implement general condition methods.
const char * name () const; const char * name () const;
void print (cl_ostream) const;
void print (std::ostream&) const;
~cl_composite_condition () {} ~cl_composite_condition () {}
}; };
@ -151,7 +151,7 @@ public:
struct _cl_modint_setops /* cf. _cl_ring_setops */ { struct _cl_modint_setops /* cf. _cl_ring_setops */ {
// print // print
void (* fprint) (cl_heap_modint_ring* R, cl_ostream stream, const _cl_MI& x);
void (* fprint) (cl_heap_modint_ring* R, std::ostream& stream, const _cl_MI& x);
// equality // equality
cl_boolean (* equal) (cl_heap_modint_ring* R, const _cl_MI& x, const _cl_MI& y); cl_boolean (* equal) (cl_heap_modint_ring* R, const _cl_MI& x, const _cl_MI& y);
// random number // random number
@ -214,7 +214,7 @@ public:
cl_I modulus; // m, normalized to be >= 0 cl_I modulus; // m, normalized to be >= 0
public: public:
// Low-level operations. // Low-level operations.
void _fprint (cl_ostream stream, const _cl_MI& x)
void _fprint (std::ostream& stream, const _cl_MI& x)
{ setops->fprint(this,stream,x); } { setops->fprint(this,stream,x); }
cl_boolean _equal (const _cl_MI& x, const _cl_MI& y) cl_boolean _equal (const _cl_MI& x, const _cl_MI& y)
{ return setops->equal(this,x,y); } { return setops->equal(this,x,y); }
@ -251,7 +251,7 @@ public:
const cl_I _retract (const _cl_MI& x) const cl_I _retract (const _cl_MI& x)
{ return mulops->retract(this,x); } { return mulops->retract(this,x); }
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_MI& x)
void fprint (std::ostream& stream, const cl_MI& x)
{ {
if (!(x.ring() == this)) cl_abort(); if (!(x.ring() == this)) cl_abort();
_fprint(stream,x); _fprint(stream,x);
@ -370,7 +370,7 @@ extern cl_class cl_class_modint_ring;
// Operations on modular integers. // Operations on modular integers.
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_MI& x)
inline void fprint (std::ostream& stream, const cl_MI& x)
{ x.ring()->fprint(stream,x); } { x.ring()->fprint(stream,x); }
CL_DEFINE_PRINT_OPERATOR(cl_MI) CL_DEFINE_PRINT_OPERATOR(cl_MI)

16
include/cln/rational_io.h

@ -27,11 +27,11 @@ extern const cl_RA read_rational (unsigned int base,
// It is here only so that you don't need the complex and float number // It is here only so that you don't need the complex and float number
// readers in order to read an rational number. ("Treeshaking") // readers in order to read an rational number. ("Treeshaking")
extern const cl_RA read_rational (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse); extern const cl_RA read_rational (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
extern const cl_RA read_rational (cl_istream stream, const cl_read_flags& flags);
extern const cl_RA read_rational (std::istream& stream, const cl_read_flags& flags);
// Documented input functions // Documented input functions
inline cl_istream operator>> (cl_istream stream, cl_RA& result)
inline std::istream& operator>> (std::istream& stream, cl_RA& result)
{ {
extern cl_read_flags cl_RA_read_flags; extern cl_read_flags cl_RA_read_flags;
result = read_rational(stream,cl_RA_read_flags); result = read_rational(stream,cl_RA_read_flags);
@ -46,7 +46,7 @@ inline cl_istream operator>> (cl_istream stream, cl_RA& result)
// > z: rationale Zahl // > z: rationale Zahl
// > base: Basis (>=2, <=36) // > base: Basis (>=2, <=36)
// > stream: Stream // > stream: Stream
extern void print_rational (cl_ostream stream, unsigned int base, const cl_RA& z);
extern void print_rational (std::ostream& stream, unsigned int base, const cl_RA& z);
// Documented output functions // Documented output functions
@ -56,16 +56,16 @@ extern void print_rational (cl_ostream stream, unsigned int base, const cl_RA& z
// > z: Zahl // > z: Zahl
// > stream: Stream // > stream: Stream
// > flags: Ausgabe-Parameter // > flags: Ausgabe-Parameter
extern void print_rational (cl_ostream stream, const cl_print_flags& flags, const cl_RA& z);
extern void print_rational (cl_ostream stream, const cl_print_number_flags& flags, const cl_RA& z);
extern void print_rational (cl_ostream stream, const cl_print_real_flags& flags, const cl_RA& z);
extern void print_rational (cl_ostream stream, const cl_print_rational_flags& flags, const cl_RA& z);
extern void print_rational (std::ostream& stream, const cl_print_flags& flags, const cl_RA& z);
extern void print_rational (std::ostream& stream, const cl_print_number_flags& flags, const cl_RA& z);
extern void print_rational (std::ostream& stream, const cl_print_real_flags& flags, const cl_RA& z);
extern void print_rational (std::ostream& stream, const cl_print_rational_flags& flags, const cl_RA& z);
// The following does strictly the same as the general `fprint' for numbers. // The following does strictly the same as the general `fprint' for numbers.
// It is here only so that you don't need the complex and long-float number // It is here only so that you don't need the complex and long-float number
// printers in order to print an integer. ("Treeshaking") // printers in order to print an integer. ("Treeshaking")
inline void fprint (cl_ostream stream, const cl_RA& x)
inline void fprint (std::ostream& stream, const cl_RA& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_rational(stream,default_print_flags,x); print_rational(stream,default_print_flags,x);

12
include/cln/real_io.h

@ -14,11 +14,11 @@ namespace cln {
// It is here only so that you don't need the complex number reader // It is here only so that you don't need the complex number reader
// in order to read an rational number. ("Treeshaking") // in order to read an rational number. ("Treeshaking")
extern const cl_R read_real (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse); extern const cl_R read_real (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
extern const cl_R read_real (cl_istream stream, const cl_read_flags& flags);
extern const cl_R read_real (std::istream& stream, const cl_read_flags& flags);
// Documented input functions // Documented input functions
inline cl_istream operator>> (cl_istream stream, cl_R& result)
inline std::istream& operator>> (std::istream& stream, cl_R& result)
{ {
extern cl_read_flags cl_R_read_flags; extern cl_read_flags cl_R_read_flags;
result = read_real(stream,cl_R_read_flags); result = read_real(stream,cl_R_read_flags);
@ -36,15 +36,15 @@ inline cl_istream operator>> (cl_istream stream, cl_R& result)
// > z: Zahl // > z: Zahl
// > stream: Stream // > stream: Stream
// > flags: Ausgabe-Parameter // > flags: Ausgabe-Parameter
extern void print_real (cl_ostream stream, const cl_print_flags& flags, const cl_R& z);
extern void print_real (cl_ostream stream, const cl_print_number_flags& flags, const cl_R& z);
extern void print_real (cl_ostream stream, const cl_print_real_flags& flags, const cl_R& z);
extern void print_real (std::ostream& stream, const cl_print_flags& flags, const cl_R& z);
extern void print_real (std::ostream& stream, const cl_print_number_flags& flags, const cl_R& z);
extern void print_real (std::ostream& stream, const cl_print_real_flags& flags, const cl_R& z);
// The following does strictly the same as the general `fprint' for numbers. // The following does strictly the same as the general `fprint' for numbers.
// It is here only so that you don't need the complex number printer // It is here only so that you don't need the complex number printer
// in order to print an integer. ("Treeshaking") // in order to print an integer. ("Treeshaking")
inline void fprint (cl_ostream stream, const cl_R& x)
inline void fprint (std::ostream& stream, const cl_R& x)
{ {
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_real(stream,default_print_flags,x); print_real(stream,default_print_flags,x);

8
include/cln/ring.h

@ -155,7 +155,7 @@ public: // Debugging output.
struct _cl_ring_setops { struct _cl_ring_setops {
// print // print
void (* fprint) (cl_heap_ring* R, cl_ostream stream, const _cl_ring_element& x);
void (* fprint) (cl_heap_ring* R, std::ostream& stream, const _cl_ring_element& x);
// equality // equality
cl_boolean (* equal) (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y); cl_boolean (* equal) (cl_heap_ring* R, const _cl_ring_element& x, const _cl_ring_element& y);
// ... // ...
@ -208,7 +208,7 @@ public:
// ... // ...
public: public:
// Low-level operations. // Low-level operations.
void _fprint (cl_ostream stream, const _cl_ring_element& x)
void _fprint (std::ostream& stream, const _cl_ring_element& x)
{ setops->fprint(this,stream,x); } { setops->fprint(this,stream,x); }
cl_boolean _equal (const _cl_ring_element& x, const _cl_ring_element& y) cl_boolean _equal (const _cl_ring_element& x, const _cl_ring_element& y)
{ return setops->equal(this,x,y); } { return setops->equal(this,x,y); }
@ -233,7 +233,7 @@ public:
const _cl_ring_element _expt_pos (const _cl_ring_element& x, const cl_I& y) const _cl_ring_element _expt_pos (const _cl_ring_element& x, const cl_I& y)
{ return mulops->expt_pos(this,x,y); } { return mulops->expt_pos(this,x,y); }
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_ring_element& x)
void fprint (std::ostream& stream, const cl_ring_element& x)
{ {
if (!(x.ring() == this)) cl_abort(); if (!(x.ring() == this)) cl_abort();
_fprint(stream,x); _fprint(stream,x);
@ -314,7 +314,7 @@ public: \
// Operations on ring elements. // Operations on ring elements.
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_ring_element& x)
inline void fprint (std::ostream& stream, const cl_ring_element& x)
{ x.ring()->fprint(stream,x); } { x.ring()->fprint(stream,x); }
CL_DEFINE_PRINT_OPERATOR(cl_ring_element) CL_DEFINE_PRINT_OPERATOR(cl_ring_element)

8
include/cln/sfloat_io.h

@ -8,19 +8,19 @@
namespace cln { namespace cln {
inline cl_istream operator>> (cl_istream stream, cl_SF& result)
inline std::istream& operator>> (std::istream& stream, cl_SF& result)
{ {
extern cl_read_flags cl_SF_read_flags; extern cl_read_flags cl_SF_read_flags;
extern const cl_F read_float (cl_istream, const cl_read_flags&);
extern const cl_F read_float (std::istream&, const cl_read_flags&);
result = As(cl_SF)(read_float(stream,cl_SF_read_flags)); result = As(cl_SF)(read_float(stream,cl_SF_read_flags));
return stream; return stream;
} }
// The following does strictly the same as the general `fprint' for floats. // The following does strictly the same as the general `fprint' for floats.
// It is here only so that people don't need to include <cln/float_io.h>. // It is here only so that people don't need to include <cln/float_io.h>.
inline void fprint (cl_ostream stream, const cl_SF& x)
inline void fprint (std::ostream& stream, const cl_SF& x)
{ {
extern void print_float (cl_ostream stream, const cl_print_flags& flags, const cl_F& z);
extern void print_float (std::ostream& stream, const cl_print_flags& flags, const cl_F& z);
extern cl_print_flags default_print_flags; extern cl_print_flags default_print_flags;
print_float(stream,default_print_flags,x); print_float(stream,default_print_flags,x);
} }

12
include/cln/string.h

@ -131,7 +131,7 @@ CL_REQUIRE(cl_st_null)
extern unsigned long hashcode (const cl_string& str); extern unsigned long hashcode (const cl_string& str);
// Output. // Output.
extern void fprint (cl_ostream stream, const cl_string& str);
extern void fprint (std::ostream& stream, const cl_string& str);
CL_DEFINE_PRINT_OPERATOR(cl_string) CL_DEFINE_PRINT_OPERATOR(cl_string)
// Input. // Input.
@ -139,23 +139,23 @@ CL_DEFINE_PRINT_OPERATOR(cl_string)
// Reads a line. Up to delim. The delimiter character is not placed in the // Reads a line. Up to delim. The delimiter character is not placed in the
// resulting string. The delimiter character is kept in the input stream. // resulting string. The delimiter character is kept in the input stream.
// If EOF is encountered, the stream's eofbit is set. // If EOF is encountered, the stream's eofbit is set.
extern const cl_string cl_fget (cl_istream stream, char delim = '\n');
extern const cl_string cl_fget (std::istream& stream, char delim = '\n');
// Reads a line. Up to delim. The delimiter character is not placed in the // Reads a line. Up to delim. The delimiter character is not placed in the
// resulting string. The delimiter character is extracted from the input stream. // resulting string. The delimiter character is extracted from the input stream.
// If EOF is encountered, the stream's eofbit is set. // If EOF is encountered, the stream's eofbit is set.
extern const cl_string cl_fgetline (cl_istream stream, char delim = '\n');
extern const cl_string cl_fgetline (std::istream& stream, char delim = '\n');
// Like above, but only up to n-1 characters. If n-1 characters were read // Like above, but only up to n-1 characters. If n-1 characters were read
// before the delimiter character was seen, the stream's failbit is set. // before the delimiter character was seen, the stream's failbit is set.
extern const cl_string cl_fget (cl_istream stream, int n, char delim = '\n');
extern const cl_string cl_fgetline (cl_istream stream, int n, char delim = '\n');
extern const cl_string cl_fget (std::istream& stream, int n, char delim = '\n');
extern const cl_string cl_fgetline (std::istream& stream, int n, char delim = '\n');
// Skips whitespace and then reads a non-whitespace string. // Skips whitespace and then reads a non-whitespace string.
// If stream.width() is greater than 0, at most stream.width()-1 non-whitespace // If stream.width() is greater than 0, at most stream.width()-1 non-whitespace
// characters are read. When done, stream.width(0) is called. // characters are read. When done, stream.width(0) is called.
// If EOF is encountered, the stream's eofbit is set. // If EOF is encountered, the stream's eofbit is set.
extern cl_istream operator>> (cl_istream stream, cl_string& str);
extern std::istream& operator>> (std::istream& stream, cl_string& str);
// Runtime typing support. // Runtime typing support.
extern cl_class cl_class_string; extern cl_class cl_class_string;

6
include/cln/timing.h

@ -47,13 +47,13 @@ extern const cl_time_consumption cl_current_time_consumption ();
// Report a time consumption. // Report a time consumption.
// (Should better be a virtual member function of `cl_time_consumption'). // (Should better be a virtual member function of `cl_time_consumption').
extern void cl_timing_report (cl_ostream, const cl_time_consumption&);
extern void cl_timing_report (std::ostream&, const cl_time_consumption&);
struct cl_timing { struct cl_timing {
// Constructor, starts the time interval. // Constructor, starts the time interval.
cl_timing (cl_time_consumption& accumulator); cl_timing (cl_time_consumption& accumulator);
cl_timing (cl_ostream destination = std::cerr);
cl_timing (const char *, cl_ostream destination = std::cerr);
cl_timing (std::ostream& destination = std::cerr);
cl_timing (const char *, std::ostream& destination = std::cerr);
// Destructor, closes the time interval and does a report. // Destructor, closes the time interval and does a report.
~cl_timing (); ~cl_timing ();
//private: //private:

10
include/cln/univpoly.h

@ -111,7 +111,7 @@ public: // Ability to place an object at a given address.
struct _cl_univpoly_setops /* cf. _cl_ring_setops */ { struct _cl_univpoly_setops /* cf. _cl_ring_setops */ {
// print // print
void (* fprint) (cl_heap_univpoly_ring* R, cl_ostream stream, const _cl_UP& x);
void (* fprint) (cl_heap_univpoly_ring* R, std::ostream& stream, const _cl_UP& x);
// equality // equality
// (Be careful: This is not well-defined for polynomials with // (Be careful: This is not well-defined for polynomials with
// floating-point coefficients.) // floating-point coefficients.)
@ -184,7 +184,7 @@ public:
const cl_ring& basering () const { return _basering; } const cl_ring& basering () const { return _basering; }
public: public:
// Low-level operations. // Low-level operations.
void _fprint (cl_ostream stream, const _cl_UP& x)
void _fprint (std::ostream& stream, const _cl_UP& x)
{ setops->fprint(this,stream,x); } { setops->fprint(this,stream,x); }
cl_boolean _equal (const _cl_UP& x, const _cl_UP& y) cl_boolean _equal (const _cl_UP& x, const _cl_UP& y)
{ return setops->equal(this,x,y); } { return setops->equal(this,x,y); }
@ -225,7 +225,7 @@ public:
const cl_ring_element _eval (const _cl_UP& x, const cl_ring_element& y) const cl_ring_element _eval (const _cl_UP& x, const cl_ring_element& y)
{ return polyops->eval(this,x,y); } { return polyops->eval(this,x,y); }
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_UP& x)
void fprint (std::ostream& stream, const cl_UP& x)
{ {
if (!(x.ring() == this)) cl_abort(); if (!(x.ring() == this)) cl_abort();
_fprint(stream,x); _fprint(stream,x);
@ -357,7 +357,7 @@ extern cl_class cl_class_univpoly_ring;
// Operations on polynomials. // Operations on polynomials.
// Output. // Output.
inline void fprint (cl_ostream stream, const cl_UP& x)
inline void fprint (std::ostream& stream, const cl_UP& x)
{ x.ring()->fprint(stream,x); } { x.ring()->fprint(stream,x); }
CL_DEFINE_PRINT_OPERATOR(cl_UP) CL_DEFINE_PRINT_OPERATOR(cl_UP)
@ -531,7 +531,7 @@ template <class T>
class cl_heap_univpoly_specialized_ring : public cl_heap_univpoly_ring { class cl_heap_univpoly_specialized_ring : public cl_heap_univpoly_ring {
SUBCLASS_cl_heap_univpoly_ring() SUBCLASS_cl_heap_univpoly_ring()
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_UP_specialized<T>& x)
void fprint (std::ostream& stream, const cl_UP_specialized<T>& x)
{ {
cl_heap_univpoly_ring::fprint(stream,x); cl_heap_univpoly_ring::fprint(stream,x);
} }

2
include/cln/univpoly_complex.h

@ -60,7 +60,7 @@ public: // Ability to place an object at a given address.
class cl_heap_univpoly_complex_ring : public cl_heap_univpoly_ring { class cl_heap_univpoly_complex_ring : public cl_heap_univpoly_ring {
SUBCLASS_cl_heap_univpoly_ring() SUBCLASS_cl_heap_univpoly_ring()
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_UP_N& x)
void fprint (std::ostream& stream, const cl_UP_N& x)
{ {
cl_heap_univpoly_ring::fprint(stream,x); cl_heap_univpoly_ring::fprint(stream,x);
} }

2
include/cln/univpoly_integer.h

@ -59,7 +59,7 @@ public: // Ability to place an object at a given address.
class cl_heap_univpoly_integer_ring : public cl_heap_univpoly_ring { class cl_heap_univpoly_integer_ring : public cl_heap_univpoly_ring {
SUBCLASS_cl_heap_univpoly_ring() SUBCLASS_cl_heap_univpoly_ring()
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_UP_I& x)
void fprint (std::ostream& stream, const cl_UP_I& x)
{ {
cl_heap_univpoly_ring::fprint(stream,x); cl_heap_univpoly_ring::fprint(stream,x);
} }

2
include/cln/univpoly_modint.h

@ -51,7 +51,7 @@ class cl_heap_univpoly_modint_ring : public cl_heap_univpoly_ring {
SUBCLASS_cl_heap_univpoly_ring() SUBCLASS_cl_heap_univpoly_ring()
const cl_modint_ring& basering () const { return The(cl_modint_ring)(_basering); } const cl_modint_ring& basering () const { return The(cl_modint_ring)(_basering); }
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_UP_MI& x)
void fprint (std::ostream& stream, const cl_UP_MI& x)
{ {
cl_heap_univpoly_ring::fprint(stream,x); cl_heap_univpoly_ring::fprint(stream,x);
} }

2
include/cln/univpoly_rational.h

@ -60,7 +60,7 @@ public: // Ability to place an object at a given address.
class cl_heap_univpoly_rational_ring : public cl_heap_univpoly_ring { class cl_heap_univpoly_rational_ring : public cl_heap_univpoly_ring {
SUBCLASS_cl_heap_univpoly_ring() SUBCLASS_cl_heap_univpoly_ring()
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_UP_RA& x)
void fprint (std::ostream& stream, const cl_UP_RA& x)
{ {
cl_heap_univpoly_ring::fprint(stream,x); cl_heap_univpoly_ring::fprint(stream,x);
} }

2
include/cln/univpoly_real.h

@ -60,7 +60,7 @@ public: // Ability to place an object at a given address.
class cl_heap_univpoly_real_ring : public cl_heap_univpoly_ring { class cl_heap_univpoly_real_ring : public cl_heap_univpoly_ring {
SUBCLASS_cl_heap_univpoly_ring() SUBCLASS_cl_heap_univpoly_ring()
// High-level operations. // High-level operations.
void fprint (cl_ostream stream, const cl_UP_R& x)
void fprint (std::ostream& stream, const cl_UP_R& x)
{ {
cl_heap_univpoly_ring::fprint(stream,x); cl_heap_univpoly_ring::fprint(stream,x);
} }

22
include/cln/version.h.in

@ -0,0 +1,22 @@
// Version information (cf. cln.m4)
#ifndef _CL_VERSION_H
#define _CL_VERSION_H
/* These definitions are adjusted by `configure' automatically. */
#define CL_VERSION_MAJOR 1
#define CL_VERSION_MINOR 1
#define CL_VERSION_PATCHLEVEL 0
#define CL_VERSION 1.1.0
namespace cln {
extern const int version_major;
extern const int version_minor;
extern const int version_patchlevel;
} // namespace cln
#endif /* _CL_VERSION_H */

18
src/base/cl_version.cc

@ -0,0 +1,18 @@
// Version string buried into the library
// General includes.
#include "cl_sysdep.h"
// Specification.
#include "cln/version.h"
// Implementation.
namespace cln {
const int version_major = CL_VERSION_MAJOR;
const int version_minor = CL_VERSION_MINOR;
const int version_patchlevel = CL_VERSION_PATCHLEVEL;
} // namespace cln

4
src/base/output/cl_output_dec.cc

@ -14,7 +14,7 @@ namespace cln {
// We don't use `stream << x' or `stream << dec << x', because an ostream // We don't use `stream << x' or `stream << dec << x', because an ostream
// carries so many attributes, and we don't want to modifies these attributes. // carries so many attributes, and we don't want to modifies these attributes.
void fprintdecimal (cl_ostream stream, unsigned long x)
void fprintdecimal (std::ostream& stream, unsigned long x)
{ {
#define bufsize 20 #define bufsize 20
var char buf[bufsize+1]; var char buf[bufsize+1];
@ -30,7 +30,7 @@ void fprintdecimal (cl_ostream stream, unsigned long x)
#undef bufsize #undef bufsize
} }
void fprintdecimal (cl_ostream stream, long x)
void fprintdecimal (std::ostream& stream, long x)
{ {
if (x >= 0) if (x >= 0)
fprintdecimal(stream,(unsigned long)x); fprintdecimal(stream,(unsigned long)x);

4
src/base/output/cl_output_hex.cc

@ -11,7 +11,7 @@
namespace cln { namespace cln {
void fprinthexadecimal (cl_ostream stream, unsigned long x)
void fprinthexadecimal (std::ostream& stream, unsigned long x)
{ {
#define bufsize 16 #define bufsize 16
var char buf[bufsize+1]; var char buf[bufsize+1];
@ -27,7 +27,7 @@ void fprinthexadecimal (cl_ostream stream, unsigned long x)
#undef bufsize #undef bufsize
} }
void fprinthexadecimal (cl_ostream stream, long x)
void fprinthexadecimal (std::ostream& stream, long x)
{ {
if (x >= 0) if (x >= 0)
fprintdecimal(stream,(unsigned long)x); fprintdecimal(stream,(unsigned long)x);

2
src/base/ring/cl_no_ring.cc

@ -59,7 +59,7 @@ static const _cl_ring_element dummy_op2 (cl_heap_ring* R, const _cl_ring_element
uninitialized_error(x); uninitialized_error(y); RETDUMMY; uninitialized_error(x); uninitialized_error(y); RETDUMMY;
} }
static void dummy_fprint (cl_heap_ring* R, cl_ostream stream, const _cl_ring_element& x)
static void dummy_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_element& x)
{ {
unused R; unused R;
unused stream; unused stream;

2
src/base/string/input/cl_st_get1.cc

@ -14,7 +14,7 @@
namespace cln { namespace cln {
const cl_string cl_fget (cl_istream stream, char delim)
const cl_string cl_fget (std::istream& stream, char delim)
{ {
var cl_spushstring buffer; var cl_spushstring buffer;
// Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF). // Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF).

2
src/base/string/input/cl_st_get2.cc

@ -14,7 +14,7 @@
namespace cln { namespace cln {
const cl_string cl_fget (cl_istream stream, int n, char delim)
const cl_string cl_fget (std::istream& stream, int n, char delim)
{ {
var cl_spushstring buffer; var cl_spushstring buffer;
// Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF). // Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF).

2
src/base/string/input/cl_st_getline1.cc

@ -14,7 +14,7 @@
namespace cln { namespace cln {
const cl_string cl_fgetline (cl_istream stream, char delim)
const cl_string cl_fgetline (std::istream& stream, char delim)
{ {
var cl_spushstring buffer; var cl_spushstring buffer;
// Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF). // Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF).

2
src/base/string/input/cl_st_getline2.cc

@ -14,7 +14,7 @@
namespace cln { namespace cln {
const cl_string cl_fgetline (cl_istream stream, int n, char delim)
const cl_string cl_fgetline (std::istream& stream, int n, char delim)
{ {
var cl_spushstring buffer; var cl_spushstring buffer;
// Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF). // Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF).

2
src/base/string/input/cl_st_gettoken.cc

@ -15,7 +15,7 @@
namespace cln { namespace cln {
cl_istream operator>> (cl_istream stream, cl_string& str)
std::istream& operator>> (std::istream& stream, cl_string& str)
{ {
var cl_spushstring buffer; var cl_spushstring buffer;
var int n = stream.width(); var int n = stream.width();

2
src/base/string/output/cl_st_print.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void fprint (cl_ostream stream, const cl_string& str)
void fprint (std::ostream& stream, const cl_string& str)
{ {
stream.write(str.asciz(),str.length()); stream.write(str.asciz(),str.length());
} }

2
src/complex/input/cl_N_read_stream.cc

@ -38,7 +38,7 @@ static cl_boolean number_char_p (char c)
} }
} }
const cl_N read_complex (cl_istream stream, const cl_read_flags& flags)
const cl_N read_complex (std::istream& stream, const cl_read_flags& flags)
{ {
// One pre-allocated buffer. This reduces the allocation/free cost. // One pre-allocated buffer. This reduces the allocation/free cost.
static pushstring_hack buffer; static pushstring_hack buffer;

2
src/complex/output/cl_N_aprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_complex (cl_ostream stream, const cl_print_flags& flags, const cl_N& z)
void print_complex (std::ostream& stream, const cl_print_flags& flags, const cl_N& z)
{ {
print_complex(stream,(const cl_print_number_flags&)flags,z); print_complex(stream,(const cl_print_number_flags&)flags,z);
} }

2
src/complex/output/cl_N_bprint.cc

@ -16,7 +16,7 @@
namespace cln { namespace cln {
void print_complex (cl_ostream stream, const cl_print_number_flags& flags, const cl_N& z)
void print_complex (std::ostream& stream, const cl_print_number_flags& flags, const cl_N& z)
{ {
if (realp(z)) { if (realp(z)) {
DeclareType(cl_R,z); DeclareType(cl_R,z);

2
src/complex/ring/cl_C_ring.cc

@ -17,7 +17,7 @@ CL_PROVIDE(cl_C_ring)
namespace cln { namespace cln {
static void N_fprint (cl_heap_ring* R, cl_ostream stream, const _cl_ring_element& x)
static void N_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_element& x)
{ {
unused R; unused R;
fprint(stream,The(cl_N)(x)); fprint(stream,The(cl_N)(x));

2
src/float/input/cl_F_read_stream.cc

@ -40,7 +40,7 @@ static cl_boolean number_char_p (char c)
} }
} }
const cl_F read_float (cl_istream stream, const cl_read_flags& flags)
const cl_F read_float (std::istream& stream, const cl_read_flags& flags)
{ {
// One pre-allocated buffer. This reduces the allocation/free cost. // One pre-allocated buffer. This reduces the allocation/free cost.
static pushstring_hack buffer; static pushstring_hack buffer;

2
src/float/output/cl_F_aprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_float (cl_ostream stream, const cl_print_flags& flags, const cl_F& z)
void print_float (std::ostream& stream, const cl_print_flags& flags, const cl_F& z)
{ {
print_float(stream,(const cl_print_number_flags&)flags,z); print_float(stream,(const cl_print_number_flags&)flags,z);
} }

2
src/float/output/cl_F_bprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_float (cl_ostream stream, const cl_print_number_flags& flags, const cl_F& z)
void print_float (std::ostream& stream, const cl_print_number_flags& flags, const cl_F& z)
{ {
print_float(stream,(const cl_print_real_flags&)flags,z); print_float(stream,(const cl_print_real_flags&)flags,z);
} }

2
src/float/output/cl_F_cprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_float (cl_ostream stream, const cl_print_real_flags& flags, const cl_F& z)
void print_float (std::ostream& stream, const cl_print_real_flags& flags, const cl_F& z)
{ {
print_float(stream,(const cl_print_float_flags&)flags,z); print_float(stream,(const cl_print_float_flags&)flags,z);
} }

2
src/float/output/cl_F_dprint.cc

@ -361,7 +361,7 @@ static const cl_decimal_decoded_float decode_float_decimal (const cl_F& x)
} }
// Ausgabefunktion: // Ausgabefunktion:
void print_float (cl_ostream stream, const cl_print_float_flags& flags, const cl_F& z)
void print_float (std::ostream& stream, const cl_print_float_flags& flags, const cl_F& z)
{ {
var cl_decimal_decoded_float z_decoded = decode_float_decimal(z); var cl_decimal_decoded_float z_decoded = decode_float_decimal(z);
var char * & mantstring = z_decoded.a; var char * & mantstring = z_decoded.a;

2
src/float/output/cl_F_printb.cc

@ -16,7 +16,7 @@
namespace cln { namespace cln {
void print_float_binary (cl_ostream stream, const cl_F& z)
void print_float_binary (std::ostream& stream, const cl_F& z)
{ {
// Vorzeichen, Punkt, Mantisse (binär), (Zweiersystem-)Exponent (dezimal) // Vorzeichen, Punkt, Mantisse (binär), (Zweiersystem-)Exponent (dezimal)
cl_idecoded_float m_e_s = integer_decode_float(z); cl_idecoded_float m_e_s = integer_decode_float(z);

2
src/integer/input/cl_I_read_stream.cc

@ -40,7 +40,7 @@ static cl_boolean number_char_p (char c)
} }
} }
const cl_I read_integer (cl_istream stream, const cl_read_flags& flags)
const cl_I read_integer (std::istream& stream, const cl_read_flags& flags)
{ {
// One pre-allocated buffer. This reduces the allocation/free cost. // One pre-allocated buffer. This reduces the allocation/free cost.
static pushstring_hack buffer; static pushstring_hack buffer;

2
src/integer/output/cl_I_aprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_integer (cl_ostream stream, const cl_print_flags& flags, const cl_I& z)
void print_integer (std::ostream& stream, const cl_print_flags& flags, const cl_I& z)
{ {
print_integer(stream,(const cl_print_number_flags&)flags,z); print_integer(stream,(const cl_print_number_flags&)flags,z);
} }

2
src/integer/output/cl_I_bprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_integer (cl_ostream stream, const cl_print_number_flags& flags, const cl_I& z)
void print_integer (std::ostream& stream, const cl_print_number_flags& flags, const cl_I& z)
{ {
print_integer(stream,(const cl_print_real_flags&)flags,z); print_integer(stream,(const cl_print_real_flags&)flags,z);
} }

2
src/integer/output/cl_I_cprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_integer (cl_ostream stream, const cl_print_real_flags& flags, const cl_I& z)
void print_integer (std::ostream& stream, const cl_print_real_flags& flags, const cl_I& z)
{ {
print_integer(stream,(const cl_print_rational_flags&)flags,z); print_integer(stream,(const cl_print_rational_flags&)flags,z);
} }

2
src/integer/output/cl_I_dprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_integer (cl_ostream stream, const cl_print_rational_flags& flags, const cl_I& z)
void print_integer (std::ostream& stream, const cl_print_rational_flags& flags, const cl_I& z)
{ {
var unsigned int base = flags.rational_base; var unsigned int base = flags.rational_base;
if (flags.rational_readably) if (flags.rational_readably)

2
src/integer/output/cl_I_print.cc

@ -15,7 +15,7 @@
namespace cln { namespace cln {
void print_integer (cl_ostream stream, unsigned int base, const cl_I& z)
void print_integer (std::ostream& stream, unsigned int base, const cl_I& z)
{ {
var cl_I abs_z; var cl_I abs_z;
if (minusp(z)) { if (minusp(z)) {

2
src/integer/ring/cl_0_ring.cc

@ -33,7 +33,7 @@ static const _cl_ring_element null_op2 (cl_heap_ring* R, const _cl_ring_element&
return _cl_ring_element(R, (cl_I)0); return _cl_ring_element(R, (cl_I)0);
} }
static void null_fprint (cl_heap_ring* R, cl_ostream stream, const _cl_ring_element& x)
static void null_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_element& x)
{ {
unused R; unused R;
unused x; unused x;

2
src/integer/ring/cl_I_ring.cc

@ -17,7 +17,7 @@ CL_PROVIDE(cl_I_ring)
namespace cln { namespace cln {
static void I_fprint (cl_heap_ring* R, cl_ostream stream, const _cl_ring_element& x)
static void I_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_element& x)
{ {
unused R; unused R;
fprint(stream,The(cl_I)(x)); fprint(stream,The(cl_I)(x));

2
src/modinteger/cl_MI_cond_composite.cc

@ -17,7 +17,7 @@ namespace cln {
const char * cl_composite_condition::name () const const char * cl_composite_condition::name () const
{ return "cl_composite_condition"; } { return "cl_composite_condition"; }
void cl_composite_condition::print (cl_ostream strm) const
void cl_composite_condition::print (std::ostream& strm) const
{ {
fprint(strm, "Exception <cl_composite_condition> occurred: p = "); fprint(strm, "Exception <cl_composite_condition> occurred: p = ");
fprint(strm, p); fprint(strm, p);

2
src/modinteger/cl_MI_int.h

@ -2,7 +2,7 @@
namespace cln { namespace cln {
static void int_fprint (cl_heap_modint_ring* R, cl_ostream stream, const _cl_MI &x)
static void int_fprint (cl_heap_modint_ring* R, std::ostream& stream, const _cl_MI &x)
{ {
fprint(stream,R->_retract(x)); fprint(stream,R->_retract(x));
} }

2
src/modinteger/cl_MI_std.h

@ -2,7 +2,7 @@
namespace cln { namespace cln {
static void std_fprint (cl_heap_modint_ring* R, cl_ostream stream, const _cl_MI &x)
static void std_fprint (cl_heap_modint_ring* R, std::ostream& stream, const _cl_MI &x)
{ {
fprint(stream,R->_retract(x)); fprint(stream,R->_retract(x));
fprint(stream," mod "); fprint(stream," mod ");

2
src/polynomial/elem/cl_UP_MI.h

@ -32,7 +32,7 @@ static inline void modint_normalize (cl_heap_modint_ring* R, cl_GV_MI& result, u
} }
} }
static void modint_fprint (cl_heap_univpoly_ring* UPR, cl_ostream stream, const _cl_UP& x)
static void modint_fprint (cl_heap_univpoly_ring* UPR, std::ostream& stream, const _cl_UP& x)
{{ {{
DeclarePoly(cl_GV_MI,x); DeclarePoly(cl_GV_MI,x);
var cl_heap_modint_ring* R = TheModintRing(UPR->basering()); var cl_heap_modint_ring* R = TheModintRing(UPR->basering());

2
src/polynomial/elem/cl_UP_gen.h

@ -28,7 +28,7 @@ static inline void gen_normalize (cl_heap_ring* R, cl_SV_ringelt& result, uintL
} }
} }
static void gen_fprint (cl_heap_univpoly_ring* UPR, cl_ostream stream, const _cl_UP& x)
static void gen_fprint (cl_heap_univpoly_ring* UPR, std::ostream& stream, const _cl_UP& x)
{{ {{
DeclarePoly(cl_SV_ringelt,x); DeclarePoly(cl_SV_ringelt,x);
var cl_heap_ring* R = TheRing(UPR->basering()); var cl_heap_ring* R = TheRing(UPR->basering());

2
src/polynomial/elem/cl_UP_no_ring.cc

@ -59,7 +59,7 @@ static const _cl_UP dummy_op2 (cl_heap_univpoly_ring* R, const _cl_UP& x, const
uninitialized_error(x); uninitialized_error(y); RETDUMMY; uninitialized_error(x); uninitialized_error(y); RETDUMMY;
} }
static void dummy_fprint (cl_heap_univpoly_ring* R, cl_ostream stream, const _cl_UP& x)
static void dummy_fprint (cl_heap_univpoly_ring* R, std::ostream& stream, const _cl_UP& x)
{ {
unused R; unused R;
unused stream; unused stream;

2
src/polynomial/elem/cl_UP_number.h

@ -29,7 +29,7 @@ static inline void num_normalize (cl_number_ring_ops<cl_number>& ops, cl_SV_numb
} }
} }
static void num_fprint (cl_heap_univpoly_ring* UPR, cl_ostream stream, const _cl_UP& x)
static void num_fprint (cl_heap_univpoly_ring* UPR, std::ostream& stream, const _cl_UP& x)
{{ {{
DeclarePoly(cl_SV_number,x); DeclarePoly(cl_SV_number,x);
var cl_number_ring_ops<cl_number>& ops = *TheNumberRing(UPR->basering())->ops; var cl_number_ring_ops<cl_number>& ops = *TheNumberRing(UPR->basering())->ops;

2
src/rational/input/cl_RA_read_stream.cc

@ -41,7 +41,7 @@ static cl_boolean number_char_p (char c)
} }
} }
const cl_RA read_rational (cl_istream stream, const cl_read_flags& flags)
const cl_RA read_rational (std::istream& stream, const cl_read_flags& flags)
{ {
// One pre-allocated buffer. This reduces the allocation/free cost. // One pre-allocated buffer. This reduces the allocation/free cost.
static pushstring_hack buffer; static pushstring_hack buffer;

2
src/rational/output/cl_RA_aprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_rational (cl_ostream stream, const cl_print_flags& flags, const cl_RA& z)
void print_rational (std::ostream& stream, const cl_print_flags& flags, const cl_RA& z)
{ {
print_rational(stream,(const cl_print_number_flags&)flags,z); print_rational(stream,(const cl_print_number_flags&)flags,z);
} }

2
src/rational/output/cl_RA_bprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_rational (cl_ostream stream, const cl_print_number_flags& flags, const cl_RA& z)
void print_rational (std::ostream& stream, const cl_print_number_flags& flags, const cl_RA& z)
{ {
print_rational(stream,(const cl_print_real_flags&)flags,z); print_rational(stream,(const cl_print_real_flags&)flags,z);
} }

2
src/rational/output/cl_RA_cprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_rational (cl_ostream stream, const cl_print_real_flags& flags, const cl_RA& z)
void print_rational (std::ostream& stream, const cl_print_real_flags& flags, const cl_RA& z)
{ {
print_rational(stream,(const cl_print_rational_flags&)flags,z); print_rational(stream,(const cl_print_rational_flags&)flags,z);
} }

2
src/rational/output/cl_RA_dprint.cc

@ -16,7 +16,7 @@
namespace cln { namespace cln {
void print_rational (cl_ostream stream, const cl_print_rational_flags& flags, const cl_RA& z)
void print_rational (std::ostream& stream, const cl_print_rational_flags& flags, const cl_RA& z)
{ {
var unsigned int base = flags.rational_base; var unsigned int base = flags.rational_base;
if (flags.rational_readably) if (flags.rational_readably)

2
src/rational/output/cl_RA_print.cc

@ -15,7 +15,7 @@
namespace cln { namespace cln {
void print_rational (cl_ostream stream, unsigned int base, const cl_RA& z)
void print_rational (std::ostream& stream, unsigned int base, const cl_RA& z)
{ {
if (integerp(z)) { if (integerp(z)) {
DeclareType(cl_I,z); DeclareType(cl_I,z);

2
src/rational/ring/cl_RA_ring.cc

@ -17,7 +17,7 @@ CL_PROVIDE(cl_RA_ring)
namespace cln { namespace cln {
static void RA_fprint (cl_heap_ring* R, cl_ostream stream, const _cl_ring_element& x)
static void RA_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_element& x)
{ {
unused R; unused R;
fprint(stream,The(cl_RA)(x)); fprint(stream,The(cl_RA)(x));

4
src/real/format-output/cl_fmt_cardinal.cc

@ -40,7 +40,7 @@ static const char * const cl_format_ones [20] = {
// gibt eine ganze Zahl >0, <1000 im Klartext auf englisch auf den stream aus. // gibt eine ganze Zahl >0, <1000 im Klartext auf englisch auf den stream aus.
// (arg=0 -> gibt nichts aus.) // (arg=0 -> gibt nichts aus.)
static void format_small_cardinal (cl_ostream stream, uintL arg)
static void format_small_cardinal (std::ostream& stream, uintL arg)
{ {
var uintL hundreds = floor(arg,100); var uintL hundreds = floor(arg,100);
var uintL tens_and_ones = arg % 100; var uintL tens_and_ones = arg % 100;
@ -65,7 +65,7 @@ static void format_small_cardinal (cl_ostream stream, uintL arg)
} }
} }
void format_cardinal (cl_ostream stream, const cl_I& argument)
void format_cardinal (std::ostream& stream, const cl_I& argument)
{ {
if (zerop(argument)) if (zerop(argument))
fprint(stream,"zero"); fprint(stream,"zero");

2
src/real/format-output/cl_fmt_integer.cc

@ -15,7 +15,7 @@
namespace cln { namespace cln {
void format_integer (cl_ostream stream, const cl_I& arg,
void format_integer (std::ostream& stream, const cl_I& arg,
unsigned int base, sintL mincol, char padchar, unsigned int base, sintL mincol, char padchar,
char commachar, uintL commainterval, cl_boolean commaflag, char commachar, uintL commainterval, cl_boolean commaflag,
cl_boolean positive_sign_flag) cl_boolean positive_sign_flag)

2
src/real/format-output/cl_fmt_newroman.cc

@ -15,7 +15,7 @@
namespace cln { namespace cln {
void format_new_roman (cl_ostream stream, const cl_I& arg)
void format_new_roman (std::ostream& stream, const cl_I& arg)
{ {
if (!(0 < arg && arg < 4000)) { if (!(0 < arg && arg < 4000)) {
fprint(std::cerr, "format_new_roman: argument should be in the range 1 - 3999, not "); fprint(std::cerr, "format_new_roman: argument should be in the range 1 - 3999, not ");

2
src/real/format-output/cl_fmt_oldroman.cc

@ -15,7 +15,7 @@
namespace cln { namespace cln {
void format_old_roman (cl_ostream stream, const cl_I& arg)
void format_old_roman (std::ostream& stream, const cl_I& arg)
{ {
if (!(0 < arg && arg < 5000)) { if (!(0 < arg && arg < 5000)) {
fprint(std::cerr, "format_old_roman: argument should be in the range 1 - 4999, not "); fprint(std::cerr, "format_old_roman: argument should be in the range 1 - 4999, not ");

2
src/real/format-output/cl_fmt_ordinal.cc

@ -49,7 +49,7 @@ static const char * const cl_format_ordinal_tens [10] = {
"ninetieth", "ninetieth",
}; };
void format_ordinal (cl_ostream stream, const cl_I& argument)
void format_ordinal (std::ostream& stream, const cl_I& argument)
{ {
if (zerop(argument)) if (zerop(argument))
fprint(stream,"zeroth"); fprint(stream,"zeroth");

2
src/real/format-output/cl_fmt_paddedstring.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void format_padded_string (cl_ostream stream, sintL mincol, sintL colinc, sintL minpad, char padchar, cl_boolean padleftflag, const char * str)
void format_padded_string (std::ostream& stream, sintL mincol, sintL colinc, sintL minpad, char padchar, cl_boolean padleftflag, const char * str)
{ {
var sintL need = ::strlen(str) + minpad; // so viele Zeichen mindestens var sintL need = ::strlen(str) + minpad; // so viele Zeichen mindestens
var uintL auxpad = (need < mincol var uintL auxpad = (need < mincol

14
src/real/format-output/cl_format.h

@ -10,22 +10,22 @@
namespace cln { namespace cln {
// gibt arg als römische Zahl auf stream aus, z.B. 4 als IIII. // gibt arg als römische Zahl auf stream aus, z.B. 4 als IIII.
extern void format_old_roman (cl_ostream stream, const cl_I& arg);
extern void format_old_roman (std::ostream& stream, const cl_I& arg);
// gibt arg als römische Zahl auf stream aus, z.B. 4 als IV. // gibt arg als römische Zahl auf stream aus, z.B. 4 als IV.
extern void format_new_roman (cl_ostream stream, const cl_I& arg);
extern void format_new_roman (std::ostream& stream, const cl_I& arg);
extern const char * const cl_format_tens [10]; extern const char * const cl_format_tens [10];
// gibt die ganze Zahl arg im Klartext auf englisch auf den Stream aus. // gibt die ganze Zahl arg im Klartext auf englisch auf den Stream aus.
extern void format_cardinal (cl_ostream stream, const cl_I& arg);
extern void format_cardinal (std::ostream& stream, const cl_I& arg);
// gibt eine ganze Zahl arg als Abzählnummer im Klartext auf englisch // gibt eine ganze Zahl arg als Abzählnummer im Klartext auf englisch
// auf den stream aus. // auf den stream aus.
extern void format_ordinal (cl_ostream stream, const cl_I& arg);
extern void format_ordinal (std::ostream& stream, const cl_I& arg);
// gibt count (>=0) Zeichen ch auf stream aus. // gibt count (>=0) Zeichen ch auf stream aus.
inline void format_padding (cl_ostream stream, sintL count, char ch)
inline void format_padding (std::ostream& stream, sintL count, char ch)
{ {
for (; count >= 0; count--) for (; count >= 0; count--)
fprintchar(stream,ch); fprintchar(stream,ch);
@ -37,14 +37,14 @@ inline void format_padding (cl_ostream stream, sintL count, char ch)
// werden mindestens minpad Zeichen eingefügt, eventuelle weitere dann in // werden mindestens minpad Zeichen eingefügt, eventuelle weitere dann in
// Blöcken à colinc Zeichen. Falls padleftflag, werden sie links eingefügt, // Blöcken à colinc Zeichen. Falls padleftflag, werden sie links eingefügt,
// sonst rechts vom String. // sonst rechts vom String.
extern void format_padded_string (cl_ostream stream, sintL mincol, sintL colinc, sintL minpad, char padchar, cl_boolean padleftflag, const char * str);
extern void format_padded_string (std::ostream& stream, sintL mincol, sintL colinc, sintL minpad, char padchar, cl_boolean padleftflag, const char * str);
// gibt den Integer arg auf den Stream aus: // gibt den Integer arg auf den Stream aus:
// in Zahlenbasis base, mit Vorzeichen (+ nur falls >0 und positive-sign-flag), // in Zahlenbasis base, mit Vorzeichen (+ nur falls >0 und positive-sign-flag),
// bei commaflag alle drei Stellen unterbrochen durch ein Zeichen commachar. // bei commaflag alle drei Stellen unterbrochen durch ein Zeichen commachar.
// Das Ganze links aufgefüllt mit padchar's, so daß die Gesamtbreite mindestens // Das Ganze links aufgefüllt mit padchar's, so daß die Gesamtbreite mindestens
// mincol ist. // mincol ist.
extern void format_integer (cl_ostream stream, const cl_I& arg, unsigned int base, sintL mincol, char padchar, char commachar, uintL commainterval, cl_boolean commaflag, cl_boolean positive_sign_flag);
extern void format_integer (std::ostream& stream, const cl_I& arg, unsigned int base, sintL mincol, char padchar, char commachar, uintL commainterval, cl_boolean commaflag, cl_boolean positive_sign_flag);
// format_scale_exponent(arg) liefert zur Floating-Point-Zahl arg // format_scale_exponent(arg) liefert zur Floating-Point-Zahl arg
// drei Werte: mantissa und n, mit // drei Werte: mantissa und n, mit

2
src/real/input/cl_R_read_stream.cc

@ -40,7 +40,7 @@ static cl_boolean number_char_p (char c)
} }
} }
const cl_R read_real (cl_istream stream, const cl_read_flags& flags)
const cl_R read_real (std::istream& stream, const cl_read_flags& flags)
{ {
// One pre-allocated buffer. This reduces the allocation/free cost. // One pre-allocated buffer. This reduces the allocation/free cost.
static pushstring_hack buffer; static pushstring_hack buffer;

2
src/real/output/cl_R_aprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_real (cl_ostream stream, const cl_print_flags& flags, const cl_R& z)
void print_real (std::ostream& stream, const cl_print_flags& flags, const cl_R& z)
{ {
print_real(stream,(const cl_print_number_flags&)flags,z); print_real(stream,(const cl_print_number_flags&)flags,z);
} }

2
src/real/output/cl_R_bprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void print_real (cl_ostream stream, const cl_print_number_flags& flags, const cl_R& z)
void print_real (std::ostream& stream, const cl_print_number_flags& flags, const cl_R& z)
{ {
print_real(stream,(const cl_print_real_flags&)flags,z); print_real(stream,(const cl_print_real_flags&)flags,z);
} }

2
src/real/output/cl_R_cprint.cc

@ -16,7 +16,7 @@
namespace cln { namespace cln {
void print_real (cl_ostream stream, const cl_print_real_flags& flags, const cl_R& z)
void print_real (std::ostream& stream, const cl_print_real_flags& flags, const cl_R& z)
{ {
if (rationalp(z)) { if (rationalp(z)) {
DeclareType(cl_RA,z); DeclareType(cl_RA,z);

2
src/real/ring/cl_R_ring.cc

@ -18,7 +18,7 @@ CL_PROVIDE(cl_R_ring)
namespace cln { namespace cln {
static void R_fprint (cl_heap_ring* R, cl_ostream stream, const _cl_ring_element& x)
static void R_fprint (cl_heap_ring* R, std::ostream& stream, const _cl_ring_element& x)
{ {
unused R; unused R;
fprint(stream,The(cl_R)(x)); fprint(stream,The(cl_R)(x));

8
src/timing/cl_t_c2.cc

@ -1,4 +1,4 @@
// constructor cl_timing(cl_ostream).
// constructor cl_timing(std::ostream&).
// General includes. // General includes.
#include "cl_sysdep.h" #include "cl_sysdep.h"
@ -19,14 +19,14 @@ static void report_stream (const cl_timing& t)
usage.realtime = usage_end.realtime - usage_start.realtime; usage.realtime = usage_end.realtime - usage_start.realtime;
usage.usertime = usage_end.usertime - usage_start.usertime; usage.usertime = usage_end.usertime - usage_start.usertime;
var cl_ostream destination = *(std::ostream*) t.report_destination;
var std::ostream& destination = *(std::ostream*) t.report_destination;
if (t.comment) if (t.comment)
fprint(destination,t.comment); fprint(destination,t.comment);
cl_timing_report(destination,usage); cl_timing_report(destination,usage);
fprint(destination,"\n"); fprint(destination,"\n");
} }
cl_timing::cl_timing (cl_ostream destination)
cl_timing::cl_timing (std::ostream& destination)
{ {
report_fn = report_stream; report_fn = report_stream;
report_destination = &destination; report_destination = &destination;
@ -34,7 +34,7 @@ cl_timing::cl_timing (cl_ostream destination)
tmp = cl_current_time_consumption(); tmp = cl_current_time_consumption();
} }
cl_timing::cl_timing (const char * msg, cl_ostream destination)
cl_timing::cl_timing (const char * msg, std::ostream& destination)
{ {
report_fn = report_stream; report_fn = report_stream;
report_destination = &destination; report_destination = &destination;

2
src/timing/cl_t_report.cc

@ -15,7 +15,7 @@ namespace cln {
#define CL_HZ 1000 #define CL_HZ 1000
#define CL_HZ_NSECS (1000000000/CL_HZ) #define CL_HZ_NSECS (1000000000/CL_HZ)
void cl_timing_report (cl_ostream stream, const cl_time_consumption& t)
void cl_timing_report (std::ostream& stream, const cl_time_consumption& t)
{ {
var uintL real_sec = t.realtime.tv_sec; var uintL real_sec = t.realtime.tv_sec;
var uintL real_msec = (t.realtime.tv_nsec + (CL_HZ_NSECS-1)/2) / CL_HZ_NSECS; var uintL real_msec = (t.realtime.tv_nsec + (CL_HZ_NSECS-1)/2) / CL_HZ_NSECS;

2
src/vector/cl_GV_io.h

@ -15,7 +15,7 @@ namespace cln {
// > flags: Flags // > flags: Flags
// > fun: Ausgabefunktion für die einzelnen Elemente // > fun: Ausgabefunktion für die einzelnen Elemente
// > vector: Vektor // > vector: Vektor
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_GV_number& vector);
} // namespace cln } // namespace cln

2
src/vector/cl_GV_number_debug.cc

@ -15,7 +15,7 @@
namespace cln { namespace cln {
static void print_for_debug (cl_ostream stream, const cl_print_flags& flags, const cl_number& z)
static void print_for_debug (std::ostream& stream, const cl_print_flags& flags, const cl_number& z)
{ {
unused stream; // must be cl_debugout unused stream; // must be cl_debugout
unused flags; // must be default_print_flags unused flags; // must be default_print_flags

2
src/vector/cl_SV_io.h

@ -15,7 +15,7 @@ namespace cln {
// > flags: Flags // > flags: Flags
// > fun: Ausgabefunktion für die einzelnen Elemente // > fun: Ausgabefunktion für die einzelnen Elemente
// > vector: Vektor // > vector: Vektor
extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
} // namespace cln } // namespace cln

2
src/vector/cl_SV_number_debug.cc

@ -15,7 +15,7 @@
namespace cln { namespace cln {
static void print_for_debug (cl_ostream stream, const cl_print_flags& flags, const cl_number& z)
static void print_for_debug (std::ostream& stream, const cl_print_flags& flags, const cl_number& z)
{ {
unused stream; // must be cl_debugout unused stream; // must be cl_debugout
unused flags; // must be default_print_flags unused flags; // must be default_print_flags

2
src/vector/output/cl_GV_number_aprint.cc

@ -17,7 +17,7 @@
namespace cln { namespace cln {
void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* printfun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_GV_number& vector)
void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* printfun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_GV_number& vector)
{ {
var uintL len = vector.length(); var uintL len = vector.length();
if (flags.vector_syntax == vsyntax_commonlisp) { if (flags.vector_syntax == vsyntax_commonlisp) {

2
src/vector/output/cl_SV_aprint.cc

@ -13,7 +13,7 @@
namespace cln { namespace cln {
void fprint (cl_ostream stream, const cl_ring& R, const cl_SV_ringelt& vector)
void fprint (std::ostream& stream, const cl_ring& R, const cl_SV_ringelt& vector)
{ {
var const cl_print_flags& flags = default_print_flags; var const cl_print_flags& flags = default_print_flags;
var uintL len = vector.length(); var uintL len = vector.length();

2
src/vector/output/cl_SV_number_aprint.cc

@ -17,7 +17,7 @@
namespace cln { namespace cln {
void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* printfun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_SV_number& vector)
void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* printfun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector)
{ {
var uintL len = vector.length(); var uintL len = vector.length();
if (flags.vector_syntax == vsyntax_commonlisp) { if (flags.vector_syntax == vsyntax_commonlisp) {

Loading…
Cancel
Save