[PATCH 1.12] A coding style for the server

Aaron Plattner aplattner at nvidia.com
Sat Feb 11 15:35:21 PST 2012


On 02/11/2012 02:53 PM, Jeremy Huddleston wrote:
> Catching up on this thread is not as entertaining as I had hoped.  You all are way too civilized.
> 
> vim sucks!  emacs sucks!  Let's throw some tomatoes already!
> 
> 
> On Jan 18, 2012, at 8:58 PM, Daniel Stone<daniel at fooishbar.org>  wrote:
> 
>>> I had the impression from skimming over xorg code base that most of it
>>> was using -psl?
>>
>> Yeah, that's my rough impression too; I'll add that for v2.  (Even
>> though it is a pretty lame alternative to just using cscope.)
> 
> I prever -npsl though.  IMI, it just looks nicer, but it doesn't matter to me as much as -ce does.

You have to be careful with -npsl, or you get stuff like this:


+extern _X_EXPORT ExtensionEntry *AddExtension(const char * /*name */ ,
+                                              int /*NumEvents */ ,
+                                              int /*NumErrors */ ,
+                                              int (* /*MainProc */ )(ClientPtr
+                                                                     /*client */
+                                              ), int (* /*SwappedMainProc */
+                                              )(ClientPtr /*client */ ),
+                                              void (*   /*CloseDownProc */
+                                              )(ExtensionEntry *
+                                                /*extension */ ),
+                                              unsigned short (*
+                                                              /*MinorOpcodeProc */
+                                              )(ClientPtr
+                                                /*client */ )
     );

... though the right fix there is typedefs.


Also, wtf, indent?


-/* static */ int
-miPolyBuildEdge(double x0, double y0, double k, /* x0 * dy - y0 * dx */
-                int dx, int dy, int xi, int yi, int left, PolyEdgePtr edge)
+                                                                        /* static */ int miPolyBuildEdge(double x0, double y0, double k,
+                                                                        /* x0 * dy - y0 * dx */
+                                                                                                         int
+                                                                                                         dx,
+                                                                                                         int
+                                                                                                         dy,
+                                                                                                         int
+                                                                                                         xi,
+                                                                                                         int
+                                                                                                         yi,
+                                                                                                         int
+                                                                                                         left,
+                                                                                                         PolyEdgePtr
+                                                                                                         edge)

I guess it gets confused by comments?  It also gets confused by _X_EXPORT since -npsl seems to refuse to join those lines if there's an _X_EXPORT in them.

I guess what I'm saying is that I don't think we want to run an automatic reformatter on the code without fixing stuff like this first.

-- Aaron


More information about the xorg-devel mailing list