Lines 1-225
Link Here
|
1 |
--- item_tcl.C.orig 2004-03-11 11:26:56 UTC |
|
|
2 |
+++ item_tcl.C |
3 |
@@ -106,52 +106,52 @@ |
4 |
static int item_mlweekday (ClientData, Tcl_Interp*, int, const char*[]); |
5 |
|
6 |
static Dispatch_Entry item_dispatch[] = { |
7 |
- { "delete", 0, 0, item_delete }, |
8 |
- { "clone", 0, 0, item_clone }, |
9 |
+ { "delete", 0, 0, (Tcl_CmdProc *)item_delete }, |
10 |
+ { "clone", 0, 0, (Tcl_CmdProc *)item_clone }, |
11 |
|
12 |
- { "length", 0, 1, item_length }, |
13 |
- { "starttime", 0, 1, item_startt }, |
14 |
- { "alarms", 0, 1, item_alarms }, |
15 |
- { "option", 1, 2, item_option }, |
16 |
- { "delete_option", 1, 1, item_doption }, |
17 |
+ { "length", 0, 1, (Tcl_CmdProc *)item_length }, |
18 |
+ { "starttime", 0, 1, (Tcl_CmdProc *)item_startt }, |
19 |
+ { "alarms", 0, 1, (Tcl_CmdProc *)item_alarms }, |
20 |
+ { "option", 1, 2, (Tcl_CmdProc *)item_option }, |
21 |
+ { "delete_option", 1, 1, (Tcl_CmdProc *)item_doption }, |
22 |
|
23 |
- { "is", 1, 1, item_is }, |
24 |
- { "calendar", 0, 0, item_cal }, |
25 |
- { "text", 0, 1, item_text }, |
26 |
- { "uid", 0, 0, item_uid }, |
27 |
- { "earlywarning", 0, 1, item_early }, |
28 |
- { "owner", 0, 1, item_owner }, |
29 |
- { "owned", 0, 0, item_owned }, |
30 |
- { "own", 0, 0, item_own }, |
31 |
- { "hilite", 0, 1, item_hilite }, |
32 |
- { "todo", 0, 1, item_todo }, |
33 |
- { "is_done", 0, 0, item_is_done }, |
34 |
- { "done", 1, 1, item_done }, |
35 |
+ { "is", 1, 1, (Tcl_CmdProc *)item_is }, |
36 |
+ { "calendar", 0, 0, (Tcl_CmdProc *)item_cal }, |
37 |
+ { "text", 0, 1, (Tcl_CmdProc *)item_text }, |
38 |
+ { "uid", 0, 0, (Tcl_CmdProc *)item_uid }, |
39 |
+ { "earlywarning", 0, 1, (Tcl_CmdProc *)item_early }, |
40 |
+ { "owner", 0, 1, (Tcl_CmdProc *)item_owner }, |
41 |
+ { "owned", 0, 0, (Tcl_CmdProc *)item_owned }, |
42 |
+ { "own", 0, 0, (Tcl_CmdProc *)item_own }, |
43 |
+ { "hilite", 0, 1, (Tcl_CmdProc *)item_hilite }, |
44 |
+ { "todo", 0, 1, (Tcl_CmdProc *)item_todo }, |
45 |
+ { "is_done", 0, 0, (Tcl_CmdProc *)item_is_done }, |
46 |
+ { "done", 1, 1, (Tcl_CmdProc *)item_done }, |
47 |
|
48 |
- { "contains", 1, 1, item_cont }, |
49 |
- { "empty", 0, 0, item_empty }, |
50 |
- { "repeats", 0, 0, item_repeat }, |
51 |
- { "first", 0, 0, item_first }, |
52 |
- { "next", 1, 1, item_next }, |
53 |
- { "range", 2, 2, item_range }, |
54 |
- { "type", 0, 0, item_type }, |
55 |
- { "describe_repeat", 0, 0, item_desc }, |
56 |
+ { "contains", 1, 1, (Tcl_CmdProc *)item_cont }, |
57 |
+ { "empty", 0, 0, (Tcl_CmdProc *)item_empty }, |
58 |
+ { "repeats", 0, 0, (Tcl_CmdProc *)item_repeat }, |
59 |
+ { "first", 0, 0, (Tcl_CmdProc *)item_first }, |
60 |
+ { "next", 1, 1, (Tcl_CmdProc *)item_next }, |
61 |
+ { "range", 2, 2, (Tcl_CmdProc *)item_range }, |
62 |
+ { "type", 0, 0, (Tcl_CmdProc *)item_type }, |
63 |
+ { "describe_repeat", 0, 0, (Tcl_CmdProc *)item_desc }, |
64 |
|
65 |
- { "date", 1, 1, item_date }, |
66 |
- { "dayrepeat", 2, 2, item_dayr }, |
67 |
+ { "date", 1, 1, (Tcl_CmdProc *)item_date }, |
68 |
+ { "dayrepeat", 2, 2, (Tcl_CmdProc *)item_dayr }, |
69 |
|
70 |
- { "monthrepeat", 2, 2, item_monthr }, |
71 |
- { "month_day", 1, 3, item_mday }, |
72 |
- { "month_last_day", 1, 3, item_mlday }, |
73 |
- { "month_work_day", 1, 3, item_mworkday }, |
74 |
- { "month_last_work_day", 1, 3, item_mlworkday }, |
75 |
- { "month_week_day", 2, 4, item_mweekday }, |
76 |
- { "month_last_week_day", 2, 4, item_mlweekday }, |
77 |
+ { "monthrepeat", 2, 2, (Tcl_CmdProc *)item_monthr }, |
78 |
+ { "month_day", 1, 3, (Tcl_CmdProc *)item_mday }, |
79 |
+ { "month_last_day", 1, 3, (Tcl_CmdProc *)item_mlday }, |
80 |
+ { "month_work_day", 1, 3, (Tcl_CmdProc *)item_mworkday }, |
81 |
+ { "month_last_work_day", 1, 3, (Tcl_CmdProc *)item_mlworkday }, |
82 |
+ { "month_week_day", 2, 4, (Tcl_CmdProc *)item_mweekday }, |
83 |
+ { "month_last_week_day", 2, 4, (Tcl_CmdProc *)item_mlweekday }, |
84 |
|
85 |
- { "weekdays", 0, -1, item_wdays }, |
86 |
- { "start", 1, 1, item_start }, |
87 |
- { "finish", 1, 1, item_finish }, |
88 |
- { "deleteon", 1, 1, item_ondel }, |
89 |
+ { "weekdays", 0, -1, (Tcl_CmdProc *)item_wdays }, |
90 |
+ { "start", 1, 1, (Tcl_CmdProc *)item_start }, |
91 |
+ { "finish", 1, 1, (Tcl_CmdProc *)item_finish }, |
92 |
+ { "deleteon", 1, 1, (Tcl_CmdProc *)item_ondel }, |
93 |
|
94 |
{ 0, 0, 0, 0 } |
95 |
}; |
96 |
@@ -329,7 +329,7 @@ |
97 |
|
98 |
static int item_owned(ClientData c, Tcl_Interp* tcl, int argc, const char* argv[]) { |
99 |
Item_Tcl* item = (Item_Tcl*) c; |
100 |
- TCL_Return(tcl, (item->value()->IsMine() ? "1" : "0")); |
101 |
+ TCL_Return(tcl, (item->value()->IsMine() ? (char *)"1" : (char *)"0")); |
102 |
} |
103 |
|
104 |
static int item_own(ClientData c, Tcl_Interp* tcl, int argc, const char* argv[]) { |
105 |
@@ -492,12 +492,12 @@ |
106 |
|
107 |
static int item_empty(ClientData c, Tcl_Interp* tcl, int argc, const char* argv[]) { |
108 |
Item_Tcl* item = (Item_Tcl*) c; |
109 |
- TCL_Return(tcl, (item->value()->empty()?"1":"0")); |
110 |
+ TCL_Return(tcl, (item->value()->empty() ? (char *) "1" : (char *) "0")); |
111 |
} |
112 |
|
113 |
static int item_repeat(ClientData c, Tcl_Interp* tcl, int argc, const char* argv[]) { |
114 |
Item_Tcl* item = (Item_Tcl*) c; |
115 |
- TCL_Return(tcl,(item->value()->repeats()?"1":"0")); |
116 |
+ TCL_Return(tcl,(item->value()->repeats() ? (char *) "1" : (char *) "0")); |
117 |
} |
118 |
|
119 |
static int item_first(ClientData c, Tcl_Interp* tcl, int argc, const char* argv[]) { |
120 |
@@ -508,7 +508,7 @@ |
121 |
} |
122 |
|
123 |
char buffer[100]; |
124 |
- sprintf(buffer, "%d", d.EpochDays()); |
125 |
+ sprintf(buffer, "%ld", d.EpochDays()); |
126 |
Tcl_SetResult(tcl, buffer, TCL_VOLATILE); |
127 |
return TCL_OK; |
128 |
} |
129 |
@@ -518,43 +518,43 @@ |
130 |
char* result; |
131 |
switch (item->value()->repeat_type()) { |
132 |
case DateSet::None: |
133 |
- result = ""; |
134 |
+ result = (char *)""; |
135 |
break; |
136 |
case DateSet::Daily: |
137 |
- result = "Daily"; |
138 |
+ result = (char *)"Daily"; |
139 |
break; |
140 |
case DateSet::Weekly: |
141 |
- result = "Weekly"; |
142 |
+ result = (char *)"Weekly"; |
143 |
break; |
144 |
case DateSet::BiWeekly: |
145 |
- result = "Every Two Weeks"; |
146 |
+ result = (char *)"Every Two Weeks"; |
147 |
break; |
148 |
case DateSet::ThreeWeekly: |
149 |
- result = "Every Three Weeks"; |
150 |
+ result = (char *)"Every Three Weeks"; |
151 |
break; |
152 |
case DateSet::FourWeekly: |
153 |
- result = "Every Four Weeks"; |
154 |
+ result = (char *)"Every Four Weeks"; |
155 |
break; |
156 |
case DateSet::Monthly: |
157 |
- result = "Monthly"; |
158 |
+ result = (char *)"Monthly"; |
159 |
break; |
160 |
case DateSet::TwoMonthly: |
161 |
- result = "Every Two Months"; |
162 |
+ result = (char *)"Every Two Months"; |
163 |
break; |
164 |
case DateSet::ThreeMonthly: |
165 |
- result = "Every Three Months"; |
166 |
+ result = (char *)"Every Three Months"; |
167 |
break; |
168 |
case DateSet::FourMonthly: |
169 |
- result = "Every Four Months"; |
170 |
+ result = (char *)"Every Four Months"; |
171 |
break; |
172 |
case DateSet::SixMonthly: |
173 |
- result = "Every Six Months"; |
174 |
+ result = (char *)"Every Six Months"; |
175 |
break; |
176 |
case DateSet::Annual: |
177 |
- result = "Annual"; |
178 |
+ result = (char *)"Annual"; |
179 |
break; |
180 |
default: |
181 |
- result = "Complex"; |
182 |
+ result = (char *)"Complex"; |
183 |
break; |
184 |
} |
185 |
TCL_Return(tcl, result); |
186 |
@@ -576,7 +576,7 @@ |
187 |
TCL_Error(tcl, "invalid date"); |
188 |
} |
189 |
Date date(dateDays); |
190 |
- TCL_Return(tcl, (item->value()->contains(date)?"1":"0")); |
191 |
+ TCL_Return(tcl, (item->value()->contains(date) ? (char *)"1" : (char *)"0")); |
192 |
} |
193 |
|
194 |
static int item_next(ClientData c, Tcl_Interp* tcl, int argc, const char* argv[]) { |
195 |
@@ -592,7 +592,7 @@ |
196 |
} |
197 |
|
198 |
char buffer[100]; |
199 |
- sprintf(buffer, "%d", next.EpochDays()); |
200 |
+ sprintf(buffer, "%ld", next.EpochDays()); |
201 |
Tcl_SetResult(tcl, buffer, TCL_VOLATILE); |
202 |
return TCL_OK; |
203 |
} |
204 |
@@ -603,10 +603,10 @@ |
205 |
Date s, f; |
206 |
if (item->value()->range(s, f)) { |
207 |
char buffer[100]; |
208 |
- sprintf(buffer, "%d", s.EpochDays()); |
209 |
+ sprintf(buffer, "%ld", s.EpochDays()); |
210 |
if (Tcl_SetVar(tcl, argv[0], buffer, 0) == NULL) |
211 |
TCL_Error(tcl, "could not set range start variable"); |
212 |
- sprintf(buffer, "%d", f.EpochDays()); |
213 |
+ sprintf(buffer, "%ld", f.EpochDays()); |
214 |
if (Tcl_SetVar(tcl, argv[1], buffer, 0) == NULL) |
215 |
TCL_Error(tcl, "could not set range finish variable"); |
216 |
TCL_Return(tcl, "1"); |
217 |
@@ -886,7 +886,7 @@ |
218 |
if (file == 0) return 1; |
219 |
|
220 |
if (file->GetCalendar()->ReadOnly()) { |
221 |
- Tcl_SetResult(tcl, "item is in readonly calendar", TCL_STATIC); |
222 |
+ Tcl_SetResult(tcl, (char *)"item is in readonly calendar", TCL_STATIC); |
223 |
return 0; |
224 |
} |
225 |
|