[go: up one dir, main page]

Skip to content

Formatting regression since 3.6.8

I get the following diff when formatting with astyle 3.6.8. When I switch back to 3.6.7 it works fine.

Git bisect result:

3aaca754c44b0acd1036fa7479bd3f5232fb9ecc is the first bad commit
commit 3aaca754c44b0acd1036fa7479bd3f5232fb9ecc
Author: Andre Simon <as@andre-simon.de>
Date:   Thu Mar 13 23:15:07 2025 +0100

    https://sourceforge.net/p/astyle/bugs/585/ fixed indentation of class modifiers within structs

 AStyle/src/ASBeautifier.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/driver/razerchromacommon.c b/driver/razerchromacommon.c
index ad8dabbf..5de1ac3b 100644
--- a/driver/razerchromacommon.c
+++ b/driver/razerchromacommon.c
@@ -953,16 +953,16 @@ struct razer_report razer_chroma_misc_set_keyswitch_optimization_command2(unsign
     // 0x00 -> Typing (Store)
     // 0x01 -> Gaming (Store)
     switch(optimization_mode) {
-    case 0x00:
-        report.arguments[0] = 0x01;
+case 0x00:
+            report.arguments[0] = 0x01;
         report.arguments[1] = 0x00;
         report.arguments[2] = 0x14;
         report.arguments[3] = 0x00;
         report.arguments[4] = 0x28;
         report.arguments[5] = 0x00;
         break;
-    case 0x01:
-        report.arguments[0] = 0x01;
+case 0x01:
+            report.arguments[0] = 0x01;
         break;
     }
 
@@ -1106,17 +1106,17 @@ struct razer_report razer_chroma_misc_set_polling_rate(unsigned short polling_ra
     struct razer_report report = get_razer_report(0x00, 0x05, 0x01);
 
     switch(polling_rate) {
-    case 1000:
-        report.arguments[0] = 0x01;
+case 1000:
+            report.arguments[0] = 0x01;
         break;
-    case  500:
-        report.arguments[0] = 0x02;
+case  500:
+            report.arguments[0] = 0x02;
         break;
-    case  125:
-        report.arguments[0] = 0x08;
+case  125:
+            report.arguments[0] = 0x08;
         break;
-    default: // 500Hz
-        report.arguments[0] = 0x02;
+default: // 500Hz
+            report.arguments[0] = 0x02;
         break;
     }
 
@@ -1156,29 +1156,29 @@ struct razer_report razer_chroma_misc_set_polling_rate2(unsigned short polling_r
 
     report.arguments[0] = argument; // For some devices Razer sends each request once with 0x00 and once with 0x01 - maybe varstore?
     switch(polling_rate) {
-    case 8000:
-        report.arguments[1] = 0x01;
+case 8000:
+            report.arguments[1] = 0x01;
         break;
-    case 4000:
-        report.arguments[1] = 0x02;
+case 4000:
+            report.arguments[1] = 0x02;
         break;
-    case 2000:
-        report.arguments[1] = 0x04;
+case 2000:
+            report.arguments[1] = 0x04;
         break;
-    case 1000:
-        report.arguments[1] = 0x08;
+case 1000:
+            report.arguments[1] = 0x08;
         break;
-    case  500:
-        report.arguments[1] = 0x10;
+case  500:
+            report.arguments[1] = 0x10;
         break;
-    case  250:
-        report.arguments[1] = 0x20;
+case  250:
+            report.arguments[1] = 0x20;
         break;
-    case  125:
-        report.arguments[1] = 0x40;
+case  125:
+            report.arguments[1] = 0x40;
         break;
-    default: // 500Hz
-        report.arguments[1] = 0x10;
+default: // 500Hz
+            report.arguments[1] = 0x10;
         break;
     }
 
@@ -1394,17 +1394,17 @@ struct razer_report razer_chroma_misc_set_orochi2011_poll_dpi(unsigned short pol
     memcpy(&report, &orochi2011_dpi, sizeof(orochi2011_dpi));
 
     switch(poll_rate) {
-    case 1000:
-        poll_rate = 0x01;
+case 1000:
+            poll_rate = 0x01;
         break;
-    case  500:
-        poll_rate = 0x02;
+case  500:
+            poll_rate = 0x02;
         break;
-    case  125:
-        poll_rate = 0x08;
+case  125:
+            poll_rate = 0x08;
         break;
-    default: // 500Hz
-        poll_rate = 0x02;
+default: // 500Hz
+            poll_rate = 0x02;
         break;
     }