Re: Cleanups for evolution/calendar

Kjartan Maraas <[email protected]>
Newsgroups gmane.comp.gnome.evolution.patches
Message-ID <1155745356.29241.9.camel@rivendell>
ons, 16,.08.2006 kl. 12.06 -0400, skrev Joe Shaw:
> Hi,
> 
> On Wed, 2006-08-16 at 17:47 +0200, Kjartan Maraas wrote:
> > ons, 16,.08.2006 kl. 11.36 -0400, skrev Joe Shaw:
> > > Hi,
> > > 
> > > On Wed, 2006-08-16 at 16:53 +0200, Kjartan Maraas wrote:
> > > > Index: gui/alarm-notify/alarm-notify.c
> > > > ===================================================================
> > > > RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-notify.c,v
> > > > retrieving revision 1.55
> > > > diff -u -p -r1.55 alarm-notify.c
> > > > --- gui/alarm-notify/alarm-notify.c     21 Apr 2006 19:38:16 -0000      1.55
> > > > +++ gui/alarm-notify/alarm-notify.c     16 Aug 2006 14:53:15 -0000
> > > > @@ -170,7 +170,7 @@ list_changed_cb (ESourceList *source_lis
> > > >         g_hash_table_foreach (priv->uri_client_hash[source_type], (GHFunc) process_removal_in_hash, &prd);
> > > >  
> > > >         for (l = prd.removals; l; l = l->next) {
> > > > -               d (printf("%s:%d (list_changed_cb) - Removing Calendar %s\n", __FILE__, __LINE__, l->data));            
> > > > +               d (printf("%p:%d (list_changed_cb) - Removing Calendar %s\n", __FILE__, __LINE__, l->data));            
> > > >                 alarm_notify_remove_calendar (an, source_type, l->data);
> > > >         }
> > > >         g_list_free (prd.removals); 
> > > 
> > > This doesn't seem right.  __FILE__, IIRC, is a string and you want it to
> > > be displayed as such.  This will turn the output:
> > > 
> > You're right, I changed the wrong format specifier :-) I should have
> > changed the last %s. Does that look correct to you?
> 
> More so, yes.  I don't really know what the real data type of l->data
> is, though.  If it's really a string, it should be casted to (char *) in
> the printf().  Otherwise %p is the right thing to do.
> 
I'm a bit baffled by the use of %d for all these structs and pointers.
If the debug output is supposed to show strings to the user they should
all be %s and casted to char * I guess?

Cheers
Kjartan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.