Improve clang-format file

FossilOrigin-Name: 2bc02cf4700f34b37d510b7b9bedf34ff005dd333cb898dbf964a24f6eefa8cb
This commit is contained in:
Jonathan Schleifer 2024-08-03 17:11:40 +00:00
parent 7f42da935a
commit 28b0624e98
3 changed files with 40 additions and 26 deletions

View file

@ -4,3 +4,14 @@ UseTab: ForIndentation
BreakBeforeBraces: Linux
AlwaysBreakAfterReturnType: AllDefinitions
AlignAfterOpenBracket: DontAlign
ObjCBlockIndentWidth: 8
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
ObjCPropertyAttributeOrder: [
class, direct,
readonly, readwrite,
nullable, nonnull, null_resettable, null_unspecified,
assign, retain, strong, copy, weak, unsafe_unretained,
atomic, nonatomic,
getter, setter
]

View file

@ -6,14 +6,14 @@
enum { ID_VAR, ID_COMMAND, ID_ALIAS };
@interface Ident : OFObject
@property(nonatomic) int type; // one of ID_* above
@property(nonatomic) char *name;
@property(nonatomic) int min, max; // ID_VAR
@property(nonatomic) int *storage; // ID_VAR
@property(nonatomic) void (*fun)(); // ID_VAR, ID_COMMAND
@property(nonatomic) int narg; // ID_VAR, ID_COMMAND
@property(nonatomic) char *action; // ID_ALIAS
@property(nonatomic) bool persist;
@property (nonatomic) int type; // one of ID_* above
@property (nonatomic) char *name;
@property (nonatomic) int min, max; // ID_VAR
@property (nonatomic) int *storage; // ID_VAR
@property (nonatomic) void (*fun)(); // ID_VAR, ID_COMMAND
@property (nonatomic) int narg; // ID_VAR, ID_COMMAND
@property (nonatomic) char *action; // ID_ALIAS
@property (nonatomic) bool persist;
@end
@implementation Ident
@ -574,7 +574,8 @@ writecfg()
[idents enumerateKeysAndObjectsUsingBlock:^(
OFString *name, Ident *ident, bool *stop) {
if (ident.type == ID_ALIAS && !strstr(ident.name, "nextmap_")) {
fprintf(f, "alias \"%s\" [%s]\n", ident.name, ident.action);
fprintf(
f, "alias \"%s\" [%s]\n", ident.name, ident.action);
}
}];
fclose(f);

View file

@ -404,7 +404,8 @@ enum // function signatures for script functions, see command.cpp
OF_CONSTRUCTOR() \
{ \
enqueueInit(#name, ^{ \
name = variable(#name, min, cur, max, &name, NULL, true); \
name = \
variable(#name, min, cur, max, &name, NULL, true); \
}); \
}
#define VAR(name, min, cur, max) \
@ -412,7 +413,8 @@ enum // function signatures for script functions, see command.cpp
OF_CONSTRUCTOR() \
{ \
enqueueInit(#name, ^{ \
name = variable(#name, min, cur, max, &name, NULL, false); \
name = variable( \
#name, min, cur, max, &name, NULL, false); \
}); \
}
#define VARF(name, min, cur, max, body) \
@ -432,8 +434,8 @@ enum // function signatures for script functions, see command.cpp
OF_CONSTRUCTOR() \
{ \
enqueueInit(#name, ^{ \
name = \
variable(#name, min, cur, max, &name, var_##name, true); \
name = variable( \
#name, min, cur, max, &name, var_##name, true); \
}); \
} \
void var_##name() { body; }