summaryrefslogtreecommitdiffstats
path: root/deskutils/gnotime/files/patch-src::proj.c
blob: be5af97667fd3f1df4b0a112b138483f3df7b197 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- src/proj.c.orig Fri Sep  2 03:49:22 2005
+++ src/proj.c  Fri Oct 21 11:56:29 2005
@@ -1952,8 +1952,6 @@
 gboolean
 gtt_project_obj_register (void)
 {
-   global_book = qof_book_new();
-
 /* Associate an ASCII name to each getter, as well as the return type */
 static QofParam params[] = {
        { GTT_PROJECT_EARLIEST, QOF_TYPE_DATE, (QofAccessFunc)prj_obj_get_earliest, NULL},
@@ -1961,6 +1959,8 @@
        { NULL },
    };
 
+   global_book = qof_book_new();
+
    qof_class_register (GTT_PROJECT_ID, (QofSortFunc)prj_obj_order, params);
    return qof_object_register (&prj_object_def);
 }
@@ -2294,9 +2294,10 @@
 gboolean
 gtt_task_is_last_task (GttTask *tsk)
 {
+   GList *last;
    if (!tsk || !tsk->parent || !tsk->parent->task_list) return TRUE;
 
-   GList *last = g_list_last (tsk->parent->task_list);
+   last = g_list_last (tsk->parent->task_list);
    if ((GttTask *) last->data == tsk) return TRUE;
    return FALSE;
 }
@@ -2358,9 +2359,9 @@
 gtt_task_get_secs_earliest (GttTask *tsk)
 {
    GList *node;
+   time_t earliest = INT_MAX;
    if (NULL == tsk->interval_list) return 0;
 
-   time_t earliest = INT_MAX;
 
    for (node=tsk->interval_list; node; node=node->next)
    {
@@ -2374,9 +2375,9 @@
 gtt_task_get_secs_latest (GttTask *tsk)
 {
    GList *node;
+   time_t latest = INT_MIN;
    if (NULL == tsk->interval_list) return 0;
 
-   time_t latest = INT_MIN;
 
    for (node=tsk->interval_list; node; node=node->next)
    {