From: Stephen D. <sd...@gm...> - 2009-02-05 19:51:20
|
On Thu, Feb 5, 2009 at 7:28 PM, Vasiljevic Zoran <zv...@ar...> wrote: > > On 05.02.2009, at 20:30, Vlad Seryakov wrote: > >> simple macro like #define NS_STR(s) (s != NULL ? s : "") >> can be used instead of using ?: every time > > I buy that. I dunno, seems a bit gratuitous. You can't tell what the code does just by looking at it, and maybe the default shouldn't be "" ? Maybe it's just a code formatting issue: >> Ns_Log(Dev, "config: %s:%s value=\"%s\" default=\"%s\" (string)", >> section, key, value, def); > > should be changed to something like > >> Ns_Log(Dev, "config: %s:%s value=\"%s\" default=\"%s\" (string)", >> section ? section : "", key, value ? value : "", def ? def : ""); If we limit ourselves to gcc: Ns_Log(Dev, "config: %s:%s value=\"%s\" default=\"%s\" (string)", section ?: "", key, value ?: "", def ?: ""); (Our Windows build works with gcc only now, I think). |