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
55
56
57
58
|
$NetBSD: patch-aj,v 1.2 2005/03/16 12:48:49 rillig Exp $
--- src/proj.c.orig Sat May 22 16:27:59 2004
+++ src/proj.c Wed Mar 16 11:12:06 2005
@@ -1948,8 +1948,6 @@ prj_obj_get_latest (GttProject *prj)
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},
@@ -1957,6 +1955,8 @@ static QofParam params[] = {
{ NULL },
};
+ global_book = qof_book_new();
+
qof_class_register (GTT_PROJECT_ID, (QofSortFunc)prj_obj_order, params);
return qof_object_register (&prj_object_def);
}
@@ -2290,9 +2290,10 @@ gtt_task_is_first_task (GttTask *tsk)
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;
}
@@ -2354,10 +2355,10 @@ time_t
gtt_task_get_secs_earliest (GttTask *tsk)
{
GList *node;
- if (NULL == tsk->interval_list) return 0;
-
time_t earliest = INT_MAX;
+ if (NULL == tsk->interval_list) return 0;
+
for (node=tsk->interval_list; node; node=node->next)
{
GttInterval * ivl = node->data;
@@ -2370,9 +2371,8 @@ time_t
gtt_task_get_secs_latest (GttTask *tsk)
{
GList *node;
- if (NULL == tsk->interval_list) return 0;
-
time_t latest = INT_MIN;
+ if (NULL == tsk->interval_list) return 0;
for (node=tsk->interval_list; node; node=node->next)
{
|