Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael <boost@cyberfiber.org>
Cc: gdb-patches@sourceware.org
Subject: coding conventions
Date: Sat, 02 Jan 2010 21:24:00 -0000	[thread overview]
Message-ID: <4B3FB999.6010005@cyberfiber.org> (raw)

[-- 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,


             reply	other threads:[~2010-01-02 21:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-02 21:24 Michael [this message]
2010-01-03  3:17 ` Joel Brobecker
2010-01-03 10:34   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B3FB999.6010005@cyberfiber.org \
    --to=boost@cyberfiber.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox