View Issue Details

IDProjectCategoryView StatusLast Update
0001416OpenMPTGeneralpublic2021-03-01 10:49
Reportermanx Assigned Tomanx  
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Product VersionOpenMPT 1.30.00.* (current testing) 
Target VersionOpenMPT 1.31 / libopenmpt 0.7 (goals) 
Summary0001416: run clang-format on soundbase/, and sounddev/
Description

Changes in these directories are rather minimal.

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Relationships

related to 0001105 assignedmanx clang-format support 

Activities

manx

manx

2021-02-14 13:08

administrator  

manx

manx

2021-02-16 14:40

administrator   ~0004637

clang-format 10 (and 11) still have serious trouble formatting

                info.flags = {
                        sysInfo.SystemClass == mpt::OS::Class::Windows ? sysInfo.IsWindowsOriginal() ? Info::Usability::Usable : Info::Usability::Experimental : Info::Usability::NotAvailable,
                        Info::Level::Primary,
                        Info::Compatible::No,
                        sysInfo.SystemClass == mpt::OS::Class::Windows && sysInfo.IsWindowsOriginal() ? Info::Api::Native : Info::Api::Emulated,
                        Info::Io::FullDuplex,
                        Info::Mixing::Hardware,
                        Info::Implementor::OpenMPT
                };

to something even remotely useful.

We should defer further clang-format on sounddev/ until Visual Studio comes with a newer clang-format.

manx

manx

2021-02-16 14:43

administrator   ~0004638

soundbase/ done in r14171

manx

manx

2021-03-01 10:43

administrator   ~0004672

AlignConsecutiveAssignments: true causese wrapped struct initialization to break. AlignConsecutiveAssignments: false solves this, but pratically breaks aligned enum declarations.

manx

manx

2021-03-01 10:48

administrator   ~0004673

Last edited: 2021-03-01 10:49

As we do not generally align consecutive assignments in code, this is the more logical setting anyway. As a work-around for breaking enums, we can use // clang-format offand // clang-format on around enums.

The problem with initialization with this setting is, that the expressions are considered individual assignments by clang-format and are thus aligned by spaces, instead of our approach of indenting them with 1 tab.

Issue History

Date Modified Username Field Change
2021-02-14 13:08 manx New Issue
2021-02-14 13:08 manx Status new => assigned
2021-02-14 13:08 manx Assigned To => manx
2021-02-14 13:08 manx File Added: clang-format-sound-v1.patch
2021-02-14 13:09 manx Relationship added related to 0001105
2021-02-16 14:40 manx Note Added: 0004637
2021-02-16 14:43 manx Note Added: 0004638
2021-02-16 14:43 manx Target Version OpenMPT 1.30 / libopenmpt 0.6 (goals) => OpenMPT 1.31 / libopenmpt 0.7 (goals)
2021-03-01 10:43 manx Note Added: 0004672
2021-03-01 10:48 manx Note Added: 0004673
2021-03-01 10:49 manx Note Edited: 0004673