Hi,

do you see anything wrong with this macro?

#define S2AS(_x) ( (_x) ? [[[NSAttributedString alloc] initWithString: (_x)] autorelease] : nil )

It is then called by passing a string like @"hi".

I added the ternary operator to return nil if nil is passed.

When used in TalkSoup, I get these two errors:

commands.m:368: warning: the address of '_OBJC_INSTANCE_30' will always evaluate as 'true' commands.m: In function '-[TalkSoup(Commands) commandClientinfo:connection:]':

main.m: In function '-[NetclassesConnection changeNick:onConnection:withNickname:sender:]':
main.m:418: warning: pointer type mismatch in conditional expression

(repeated in different places / methods).

Riccardo

_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to