bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-indent] Bug#212320: indent: --blank-lines-after-procedures does not


From: Erik de Castro Lopo
Subject: [Bug-indent] Bug#212320: indent: --blank-lines-after-procedures does not work in
Date: Sun, 28 Sep 2003 07:57:44 +1000

OK,

I have a fix for this. After the fix, the regression test has only one failure
(which this patch is supposed to fix). Therefore, this patch also patches 
the file regression/standard/wrapped-string.c.

If anyone can find any code which doesn't behave correctly with my patch applied
I'd be more than happy to lok at this issue again.

Cheers,
Erik

-------------------------------------------------------------------------------
diff -r -u indent-2.2.9/src/indent.c 
indent-2.2.9-blank-after-procedure/src/indent.c
--- indent-2.2.9/src/indent.c   2002-10-29 07:00:56.000000000 +1100
+++ indent-2.2.9-blank-after-procedure/src/indent.c     2003-09-28 
07:11:42.000000000 +1000
@@ -1501,6 +1501,25 @@
             }
         }
         
+#if 0
+        /* I don't know what this is supposed to do, but I do know that it 
+         * breaks the operation of the blanklines_after_procs setting in 
+         * situations like this where a blank line is supposed to be inserted
+         * between the two functions:
+         *
+         *     int func1 (void)
+         *     {
+         *         return 42 ;
+         *     }
+         *     static int func2 (void)
+         *     {
+         *         return 43 ;
+         *     }
+         *
+         * If this code is removed, the regression tests still pass (except
+         * for one which needs to be modified because a blank line is 
+         * inserted as it should be.
+         */
+         
         if (prefix_blankline_requested &&
             ((parser_state_tos->block_init != 0) ||
              (parser_state_tos->block_init_level != -1) ||
@@ -1511,7 +1530,8 @@
         {
             prefix_blankline_requested = 0;
         }
-        
+#endif
+
         *dec_ind = settings.decl_indent > 0 ? settings.decl_indent :
                                               token_end - token + 1; /* get 
length of token plus 1 */
     }
diff -r -u indent-2.2.9/regression/standard/wrapped-string.c 
indent-2.2.9-blank-after-procedure/regression/standard/wrapped-string.c
--- indent-2.2.9/regression/standard/wrapped-string.c   2002-01-18 
08:03:53.000000000 +1100
+++ indent-2.2.9-blank-after-procedure/regression/standard/wrapped-string.c     
2003-09-28 07:08:11.000000000 +1000
@@ -28,6 +28,7 @@
        1:      movl %0,%%ecx
                fs; rep; movsb");
 }
+
 static inline void
 __generic_memcpy_fromfs (void *to, const void *from, unsigned long n)
 {
-------------------------------------------------------------------------------



-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  address@hidden (Yes it's valid)
+-----------------------------------------------------------+
Windows 2000 : The Tyrannosaurus Rex of the software
world. Large, ferocious and soon to be extinct.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]