discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

attributed string Macro in TalkSoup


From: Riccardo Mottola
Subject: attributed string Macro in TalkSoup
Date: Tue, 10 Sep 2013 18:33:47 +0200
User-agent: Mozilla/5.0 (X11; NetBSD i386; rv:17.0) Gecko/20130221 Thunderbird/17.0.2

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]