* coding conventions
@ 2010-01-02 21:24 Michael
2010-01-03 3:17 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Michael @ 2010-01-02 21:24 UTC (permalink / raw)
Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 354 bytes --]
hi all,
here's a first patch:
it was generated using the command 'svn diff > ../boost.diff"
questions on the formatting of new code (conforming standards used at
gdb-patches@gnu.org):
1) can lines exceed the 80 character limit?
2) should standard indentation be taken as 2 or 4 white spaces?
the attachment can be applied as such.
Greetz,
Michael
[-- Attachment #2: boost.diff --]
[-- Type: text/x-patch, Size: 2019 bytes --]
Index: boost/numeric/ublas/io.hpp
===================================================================
--- boost/numeric/ublas/io.hpp (revision 58644)
+++ boost/numeric/ublas/io.hpp (working copy)
@@ -19,27 +19,40 @@
#include <boost/numeric/ublas/matrix_expression.hpp>
-namespace boost { namespace numeric { namespace ublas {
+namespace boost
+{
+ namespace numeric
+ {
+ namespace ublas
+ {
- template<class E, class T, class VE>
- // BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
- std::basic_ostream<E, T> &operator << (std::basic_ostream<E, T> &os,
- const vector_expression<VE> &v) {
- typedef typename VE::size_type size_type;
- size_type size = v ().size ();
- std::basic_ostringstream<E, T, std::allocator<E> > s;
- s.flags (os.flags ());
- s.imbue (os.getloc ());
- s.precision (os.precision ());
- s << '[' << size << "](";
- if (size > 0)
- s << v () (0);
- for (size_type i = 1; i < size; ++ i)
- s << ',' << v () (i);
- s << ')';
- return os << s.str ().c_str ();
- }
+ template<class E, class T, class VE>
+ std::basic_ostream<E, T> &operator <<
+ (std::basic_ostream<E, T> &os, const vector_expression<VE> &v)
+ {
+ typedef typename VE::size_type size_type;
+ size_type size = v ().size ();
+
+ std::basic_ostringstream<E, T, std::allocator<E> > s;
+
+ s.flags (os.flags ());
+ s.imbue (os.getloc ());
+ s.precision (os.precision ());
+
+ s << '[' << size << "](";
+
+ if (size > 0) s << v () (0);
+
+ for (size_type i = 1; i < size; ++ i)
+ {
+ s << ',' << v () (i);
+ s << ')';
+ }
+
+ return os << s.str ().c_str ();
+ }
+
template<class E, class T, class VT, class VA>
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
std::basic_istream<E, T> &operator >> (std::basic_istream<E, T> &is,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: coding conventions
2010-01-02 21:24 coding conventions Michael
@ 2010-01-03 3:17 ` Joel Brobecker
2010-01-03 10:34 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2010-01-03 3:17 UTC (permalink / raw)
To: Michael; +Cc: gdb-patches
> it was generated using the command 'svn diff > ../boost.diff"
There must be a confusion somewhere. FSF GDB is available only
via either CVS or git. Also, I don't know that GDB has a boost
subdirectory.
> questions on the formatting of new code (conforming standards used at
> gdb-patches@gnu.org):
>
> 1) can lines exceed the 80 character limit?
No.
> 2) should standard indentation be taken as 2 or 4 white spaces?
2 spaces. We also replace blocks of 8 spaces at the beginning of
a line by tabs.
--
Joel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: coding conventions
2010-01-03 3:17 ` Joel Brobecker
@ 2010-01-03 10:34 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2010-01-03 10:34 UTC (permalink / raw)
To: Joel Brobecker; +Cc: boost, gdb-patches
> Date: Sun, 3 Jan 2010 07:16:38 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> We also replace blocks of 8 spaces at the beginning of a line by
> tabs.
Not only at the beginning of a line, IMO: side comments can also be
indented with a mixture of TABs and spaces. At least that's what
Emacs does by default.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-03 10:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-02 21:24 coding conventions Michael
2010-01-03 3:17 ` Joel Brobecker
2010-01-03 10:34 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox