Re: [Evolution-hackers] Placing of goto labels

2013-05-30 Thread David Woodhouse
On Thu, 2013-03-28 at 09:30 +0100, Milan Crha wrote:
> What's the usual way for goto labels in other projects?
> Would it make sense to write labels 'one-space indented'?

FWIW one-space indented is what emacs does by default, and is thus what
you'll usually see in code that I've written.

-- 
David WoodhouseOpen Source Technology Centre
david.woodho...@intel.com  Intel Corporation





smime.p7s
Description: S/MIME cryptographic signature
___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-hackers


[Evolution-hackers] Placing of goto labels

2013-03-28 Thread Milan Crha
Hi,
I'm wondering how to write goto labels, and I'd like to ask how other
projects do it. The thing is not whether to use 'goto' or not, but how
to write goto labels and do not lose on it. I realized that the thing
one can lose is with diff generation, including 'git diff', if the label
is placed at the very beginning of the line, thus I begun to use one
space to avoid this some time ago. As an example, this is after two
changes below goto labels in two files:
---
$ git diff
diff --git a/calendar/gui/dialogs/event-editor.c 
b/calendar/gui/dialogs/event-editor.c
index 2ea6297..5b2d055 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -755,7 +755,7 @@ event_editor_send_comp (CompEditor *editor,
return COMP_EDITOR_CLASS (event_editor_parent_class)->
send_comp (editor, method, strip_alarms);
 
-   return FALSE;
+   return FALSE;xxx
 }
 
 /**
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 69bb388..53372dc 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -4123,7 +4123,7 @@ connect_signals:
message_list, "cursor-change",
G_CALLBACK (mail_reader_message_cursor_change_cb), 
reader);
 
-   /* but do not mark-as-seen if... */
+   /* xxxbut do not mark-as-seen if... */
g_signal_connect_swapped (
message_list, "tree-drag-begin",
G_CALLBACK (discard_timeout_mark_seen_cb), reader);

-

Both has a goto label above the change, but only the first shows
the function name in which the change was done, while with the second
one can only guess. (Note that in evolution code the most common label
is 'exit').

What's the usual way for goto labels in other projects?
Would it make sense to write labels 'one-space indented'?

Bye,
Milan

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-hackers