English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 17 October 2023, 09:26   #1
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 195
Are there any clang-format experts here?

I would like to reformat some Amiga source files to give them the same style.

I have clang-format set to tab width and intent of 2 spaces and a ColumnLimit: 80 so that it breaks lines if they are longer than that.

What I want to achieve is to have function definitions and implementations wrapped and reformatted like this:

Code:
// Line exceeds 80
void startBalloon(GameResources *pResources, GameCharacterBalloon *pBalloon, ULONG x, ULONG y);

// Should be broken like this
void startBalloon(GameResources *pResources,
                  GameCharacterBalloon *pBalloon,
                  ULONG x,
                  ULONG y);
I also want function calls to wrap like this when the ColumnLimit of 80 is exceeded.

This behavior is easy to achieve with clang-format.

But when it comes to the Amiga library functions, I don't want this behavior. Because with the long tag-list driven function calls it creates something like:


Code:
pPlayfield->pScreen = OpenScreenTags(NULL,
                                     SA_DisplayID,
                                     PAL_MONITOR_ID | LORES_KEY,
                                     SA_Left,
                                     screenLeft,
                                     SA_Top,
                                     screenTop,
                                     SA_Width,
                                     picWidth,
                                     SA_Height,
                                     picHeight,
                                     SA_Depth,
                                     picDepth,
                                     SA_ShowTitle,
                                     FALSE,
                                     SA_VideoControl,
                                     (ULONG)vcTags,
                                     SA_Interleaved,
                                     TRUE,
                                     SA_Quiet,
                                     TRUE,
                                     SA_Type,
                                     CUSTOMSCREEN,
                                     SA_Exclusive,
                                     TRUE,
                                     SA_Colors32,
                                     (ULONG)pColors32,
                                     TAG_DONE);
But I want to achieve this:
Code:
pPlayfield->pScreen = OpenScreenTags(NULL,
                                     SA_DisplayID, PAL_MONITOR_ID|LORES_KEY,
                                     SA_Left, screenLeft,
                                     SA_Top, screenTop,
                                     SA_Width, picWidth,
                                     SA_Height, picHeight,
                                     SA_Depth, picDepth,
                                     SA_ShowTitle, FALSE,
                                     SA_VideoControl, (ULONG)vcTags,
                                     SA_Interleaved, TRUE,
                                     SA_Quiet, TRUE,
                                     SA_Type, CUSTOMSCREEN,
                                     SA_Exclusive, TRUE,
                                     SA_Colors32, (ULONG)pColors32,
                                     TAG_DONE);
Does anyone know if this is possible with clang-format at all?
thyslo is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
LLVM / Clang Progress SainT Amiga scene 37 31 October 2023 21:48
LCDaemon - any experts here? spotUP Amiga scene 0 25 June 2013 18:59
Any Disk experts? xArtx support.Hardware 13 17 June 2013 12:15
Need hardware experts help AmigaDave Hardware mods 0 16 October 2011 05:55
Protection experts out there? NOB support.Games 5 13 September 2005 17:38

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:24.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06646 seconds with 15 queries