Merge lp:~karl-qdh/ido/ido.extra-passthrough-api into lp:ido/0.3

Proposed by Karl Lattimer
Status: Merged
Merged at revision: 73
Proposed branch: lp:~karl-qdh/ido/ido.extra-passthrough-api
Merge into: lp:ido/0.3
Diff against target: 68 lines (+21/-2)
2 files modified
src/idocalendarmenuitem.c (+20/-2)
src/idocalendarmenuitem.h (+1/-0)
To merge this branch: bzr merge lp:~karl-qdh/ido/ido.extra-passthrough-api
Reviewer Review Type Date Requested Status
David Barth (community) Approve
Ted Gould Pending
Review via email: mp+51310@code.launchpad.net

This proposal supersedes a proposal from 2011-02-25.

Description of the change

Added g_return if fails

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) wrote : Posted in a previous version of this proposal

It's a public function: can you verify that the pointer you're getting is safe before doing an indirection?

review: Needs Fixing
Revision history for this message
David Barth (dbarth) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/idocalendarmenuitem.c'
2--- src/idocalendarmenuitem.c 2011-02-23 15:49:47 +0000
3+++ src/idocalendarmenuitem.c 2011-02-25 15:31:22 +0000
4@@ -280,32 +280,50 @@
5 gboolean
6 ido_calendar_menu_item_mark_day (IdoCalendarMenuItem *menuitem, guint day)
7 {
8+ g_return_val_if_fail(IDO_IS_CALENDAR_MENU_ITEM(menuitem), FALSE);
9+
10 return gtk_calendar_mark_day(GTK_CALENDAR (menuitem->priv->calendar), day);
11 }
12
13 gboolean
14 ido_calendar_menu_item_unmark_day (IdoCalendarMenuItem *menuitem, guint day)
15 {
16+ g_return_val_if_fail(IDO_IS_CALENDAR_MENU_ITEM(menuitem), FALSE);
17+
18 return gtk_calendar_unmark_day(GTK_CALENDAR (menuitem->priv->calendar), day);
19 }
20
21 void
22 ido_calendar_menu_item_clear_marks (IdoCalendarMenuItem *menuitem)
23 {
24+ g_return_if_fail(IDO_IS_CALENDAR_MENU_ITEM(menuitem));
25+
26 gtk_calendar_clear_marks(GTK_CALENDAR (menuitem->priv->calendar));
27 }
28
29 void
30 ido_calendar_menu_item_set_display_options (IdoCalendarMenuItem *menuitem, GtkCalendarDisplayOptions flags)
31 {
32+ g_return_if_fail(IDO_IS_CALENDAR_MENU_ITEM(menuitem));
33+
34 gtk_calendar_set_display_options (GTK_CALENDAR (menuitem->priv->calendar), flags);
35 }
36
37+GtkCalendarDisplayOptions
38+ido_calendar_menu_item_get_display_options (IdoCalendarMenuItem *menuitem)
39+{
40+
41+ g_return_val_if_fail(IDO_IS_CALENDAR_MENU_ITEM(menuitem), NULL);
42+
43+ return gtk_calendar_get_display_options (GTK_CALENDAR (menuitem->priv->calendar));
44+}
45+
46 void
47 ido_calendar_menu_item_get_date (IdoCalendarMenuItem *menuitem,
48 guint *year,
49 guint *month,
50 guint *day) {
51-
52- gtk_calendar_get_date (GTK_CALENDAR (menuitem->priv->calendar), year, month, day);
53+
54+ g_return_if_fail(IDO_IS_CALENDAR_MENU_ITEM(menuitem));
55+ gtk_calendar_get_date (GTK_CALENDAR (menuitem->priv->calendar), year, month, day);
56 }
57
58=== modified file 'src/idocalendarmenuitem.h'
59--- src/idocalendarmenuitem.h 2011-02-24 19:25:04 +0000
60+++ src/idocalendarmenuitem.h 2011-02-25 15:31:22 +0000
61@@ -60,6 +60,7 @@
62 gboolean ido_calendar_menu_item_unmark_day (IdoCalendarMenuItem *menuitem, guint day);
63 void ido_calendar_menu_item_clear_marks (IdoCalendarMenuItem *menuitem);
64 void ido_calendar_menu_item_set_display_options (IdoCalendarMenuItem *menuitem, GtkCalendarDisplayOptions flags);
65+GtkCalendarDisplayOptions ido_calendar_menu_item_get_display_options (IdoCalendarMenuItem *menuitem);
66 void ido_calendar_menu_item_get_date (IdoCalendarMenuItem *menuitem,
67 guint *year,
68 guint *month,

Subscribers

People subscribed via source and target branches