Status: | Merged |
---|---|
Merged at revision: | 249 |
Proposed branch: | lp:~ecx69/bellepoule/linux |
Merge into: | lp:bellepoule |
Diff against target: |
1526 lines (+235/-214) 40 files modified
Makefile (+4/-3) resources/glade/checkin.glade (+1/-1) resources/glade/pool_supervisor.glade (+3/-3) resources/glade/table.glade (+1/-1) sources/attribute.cpp (+26/-23) sources/attribute.hpp (+17/-17) sources/canvas.cpp (+5/-5) sources/canvas.hpp (+5/-5) sources/canvas_module.cpp (+2/-2) sources/canvas_module.hpp (+2/-2) sources/checkin.cpp (+17/-17) sources/checkin.hpp (+1/-1) sources/classification.cpp (+3/-3) sources/classification.hpp (+3/-3) sources/contest.cpp (+13/-13) sources/contest.hpp (+10/-10) sources/data.cpp (+7/-6) sources/data.hpp (+4/-4) sources/filter.cpp (+2/-2) sources/filter.hpp (+2/-2) sources/general_classification.cpp (+3/-2) sources/glade.cpp (+8/-4) sources/glade.hpp (+4/-4) sources/main.cpp (+1/-0) sources/module.cpp (+5/-3) sources/module.hpp (+5/-5) sources/object.cpp (+18/-13) sources/object.hpp (+6/-6) sources/player.cpp (+5/-5) sources/player.hpp (+7/-7) sources/players_list.cpp (+4/-4) sources/players_list.hpp (+4/-4) sources/pool.cpp (+15/-15) sources/pool.hpp (+5/-5) sources/pool_allocator.cpp (+3/-2) sources/score_collector.cpp (+2/-2) sources/score_collector.hpp (+2/-2) sources/stage.hpp (+1/-1) sources/table.cpp (+7/-5) sources/table.hpp (+2/-2) |
To merge this branch: | bzr merge lp:~ecx69/bellepoule/linux |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
betonniere | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message

betonniere (betonniere) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile' |
2 | --- Makefile 2010-05-13 17:56:58 +0000 |
3 | +++ Makefile 2011-01-21 08:07:55 +0000 |
4 | @@ -11,11 +11,12 @@ |
5 | |
6 | # Options de compilation, l'option -Wno-write-strings est utilisé car beaucoup de warnings |
7 | # sur la conversion de chaines constantes en *gchar |
8 | -OPTS=-Wall -Wno-write-strings |
9 | +#OPTS=-Wall -Wno-write-strings -Werror -pedantic-errors |
10 | +OPTS=-Wall -std=c++98 -pedantic |
11 | OPTSDBG=$(OPTS) -g |
12 | |
13 | # Fichiers source à compiler et à linker, ATTENTION à mettre à jour la liste à chaque nouvelle version |
14 | -SRCS=attribute.cpp canvas.cpp canvas_module.cpp checkin.cpp classification.cpp contest.cpp data.cpp filter.cpp general_classification.cpp glade.cpp main.cpp match.cpp module.cpp object.cpp player.cpp players_list.cpp pool_allocator.cpp pool.cpp pool_match_order.cpp pool_supervisor.cpp schedule.cpp score_collector.cpp score.cpp sensitivity_trigger.cpp splitting.cpp stage.cpp table.cpp tournament.cpp |
15 | +SRCS=attendees.cpp attribute.cpp canvas.cpp canvas_module.cpp checkin.cpp classification.cpp contest.cpp data.cpp filter.cpp general_classification.cpp glade.cpp main.cpp match.cpp module.cpp object.cpp player.cpp players_list.cpp pool_allocator.cpp pool.cpp pool_match_order.cpp pool_supervisor.cpp schedule.cpp score_collector.cpp score.cpp sensitivity_trigger.cpp splitting.cpp stage.cpp swapper.cpp table.cpp tournament.cpp |
16 | OBJS=$(SRCS:.cpp=.o) |
17 | |
18 | # Nom du fichier exécutable à générer dans $(DBGDIR) et $(RLSDIR) |
19 | @@ -29,7 +30,7 @@ |
20 | |
21 | %.o: $(SRCDIR)/%.cpp |
22 | @mkdir -p $(OBJDIR) |
23 | - @$(CC) -c $< -o $(OBJDIR)/$@ $(CFLAGS) $(OPTS) |
24 | + @$(CC) -c $< -o $(OBJDIR)/$@ $(CFLAGS) $(OPTSDBG) |
25 | |
26 | .PHONY: clean |
27 | clean: |
28 | |
29 | === modified file 'resources/glade/checkin.glade' |
30 | --- resources/glade/checkin.glade 2010-10-04 20:12:34 +0000 |
31 | +++ resources/glade/checkin.glade 2011-01-21 08:07:55 +0000 |
32 | @@ -274,7 +274,7 @@ |
33 | <property name="visible">True</property> |
34 | <property name="spacing">2</property> |
35 | <child> |
36 | - <object class="GtkHBox" id="hbox2"> |
37 | + <object class="GtkHBox" id="hbox4"> |
38 | <property name="visible">True</property> |
39 | <child> |
40 | <object class="GtkVBox" id="check_vbox"> |
41 | |
42 | === modified file 'resources/glade/pool_supervisor.glade' |
43 | --- resources/glade/pool_supervisor.glade 2010-12-19 17:35:40 +0000 |
44 | +++ resources/glade/pool_supervisor.glade 2011-01-21 08:07:55 +0000 |
45 | @@ -318,7 +318,7 @@ |
46 | <property name="label_xalign">0</property> |
47 | <property name="shadow_type">none</property> |
48 | <child> |
49 | - <object class="GtkAspectFrame" id="aspectframe1"> |
50 | + <object class="GtkAspectFrame" id="aspectframe3"> |
51 | <property name="visible">True</property> |
52 | <property name="label_xalign">0</property> |
53 | <property name="shadow_type">none</property> |
54 | @@ -358,7 +358,7 @@ |
55 | </object> |
56 | </child> |
57 | <child type="label"> |
58 | - <object class="GtkLabel" id="label2"> |
59 | + <object class="GtkLabel" id="label3"> |
60 | <property name="visible">True</property> |
61 | <property name="label" translatable="yes"><b>What?</b></property> |
62 | <property name="use_markup">True</property> |
63 | @@ -417,7 +417,7 @@ |
64 | </object> |
65 | </child> |
66 | <child type="label"> |
67 | - <object class="GtkLabel" id="label1"> |
68 | + <object class="GtkLabel" id="label5"> |
69 | <property name="visible">True</property> |
70 | <property name="label" translatable="yes"><b>For what?</b></property> |
71 | <property name="use_markup">True</property> |
72 | |
73 | === modified file 'resources/glade/table.glade' |
74 | --- resources/glade/table.glade 2010-12-19 17:35:40 +0000 |
75 | +++ resources/glade/table.glade 2011-01-21 08:07:55 +0000 |
76 | @@ -530,7 +530,7 @@ |
77 | <property name="orientation">vertical</property> |
78 | <property name="spacing">2</property> |
79 | <child> |
80 | - <object class="GtkAspectFrame" id="aspectframe1"> |
81 | + <object class="GtkAspectFrame" id="aspectframe4"> |
82 | <property name="visible">True</property> |
83 | <property name="label_xalign">0</property> |
84 | <property name="shadow_type">none</property> |
85 | |
86 | === modified file 'sources/attribute.cpp' |
87 | --- sources/attribute.cpp 2010-12-13 21:03:47 +0000 |
88 | +++ sources/attribute.cpp 2011-01-21 08:07:55 +0000 |
89 | @@ -23,7 +23,7 @@ |
90 | GSList *AttributeDesc::_list = NULL; |
91 | |
92 | // -------------------------------------------------------------------------------- |
93 | -static gchar *GetUndivadableText (gchar *text) |
94 | +static gchar *GetUndivadableText (const gchar *text) |
95 | { |
96 | gchar *result = NULL; |
97 | |
98 | @@ -31,7 +31,7 @@ |
99 | { |
100 | guint nb_space = 0; |
101 | |
102 | - for (gchar *current = text; *current != 0; current++) |
103 | + for (gchar *current = (gchar *) text; *current != 0; current++) |
104 | { |
105 | if (*current == ' ') |
106 | { |
107 | @@ -67,16 +67,16 @@ |
108 | } |
109 | |
110 | // -------------------------------------------------------------------------------- |
111 | -AttributeDesc::AttributeDesc (GType type, |
112 | - gchar *code_name, |
113 | - gchar *xml_name, |
114 | - gchar *user_name) |
115 | +AttributeDesc::AttributeDesc (GType type, |
116 | + const gchar *code_name, |
117 | + const gchar *xml_name, |
118 | + const gchar *user_name) |
119 | : Object ("AttributeDesc") |
120 | { |
121 | _type = type; |
122 | - _code_name = code_name; |
123 | - _xml_name = xml_name; |
124 | - _user_name = user_name; |
125 | + _code_name = g_strdup (code_name); |
126 | + _xml_name = g_strdup (xml_name); |
127 | + _user_name = g_strdup (user_name); |
128 | _uniqueness = SINGULAR; |
129 | _persistency = PERSISTENT; |
130 | _scope = GLOBAL; |
131 | @@ -98,6 +98,9 @@ |
132 | { |
133 | g_object_unref (_discrete_store); |
134 | } |
135 | + g_free (_code_name); |
136 | + g_free (_xml_name); |
137 | + g_free (_user_name); |
138 | } |
139 | |
140 | // -------------------------------------------------------------------------------- |
141 | @@ -107,10 +110,10 @@ |
142 | } |
143 | |
144 | // -------------------------------------------------------------------------------- |
145 | -AttributeDesc *AttributeDesc::Declare (GType type, |
146 | - gchar *code_name, |
147 | - gchar *xml_name, |
148 | - gchar *user_name) |
149 | +AttributeDesc *AttributeDesc::Declare (GType type, |
150 | + const gchar *code_name, |
151 | + const gchar *xml_name, |
152 | + gchar *user_name) |
153 | { |
154 | AttributeDesc *attr_desc = new AttributeDesc (type, |
155 | code_name, |
156 | @@ -271,9 +274,9 @@ |
157 | } |
158 | |
159 | // -------------------------------------------------------------------------------- |
160 | -void AttributeDesc::AddDiscreteValues (gchar *first_xml_image, |
161 | - gchar *first_user_image, |
162 | - gchar *first_icon, |
163 | +void AttributeDesc::AddDiscreteValues (const gchar *first_xml_image, |
164 | + gchar *first_user_image, |
165 | + const gchar *first_icon, |
166 | ...) |
167 | { |
168 | if (_discrete_store == NULL) |
169 | @@ -286,9 +289,9 @@ |
170 | |
171 | { |
172 | va_list ap; |
173 | - gchar *xml_image = first_xml_image; |
174 | + gchar *xml_image = g_strdup (first_xml_image); |
175 | gchar *user_image = first_user_image; |
176 | - gchar *icon = first_icon; |
177 | + gchar *icon = g_strdup (first_icon); |
178 | |
179 | va_start (ap, first_icon); |
180 | while (xml_image) |
181 | @@ -324,7 +327,7 @@ |
182 | } |
183 | |
184 | // -------------------------------------------------------------------------------- |
185 | -void AttributeDesc::AddDiscreteValues (gchar *file) |
186 | +void AttributeDesc::AddDiscreteValues (const gchar *file) |
187 | { |
188 | if (_discrete_store == NULL) |
189 | { |
190 | @@ -434,7 +437,7 @@ |
191 | } |
192 | |
193 | // -------------------------------------------------------------------------------- |
194 | -AttributeDesc *AttributeDesc::GetDesc (gchar *name) |
195 | +AttributeDesc *AttributeDesc::GetDesc (const gchar *name) |
196 | { |
197 | for (guint i = 0; i < g_slist_length (_list); i++) |
198 | { |
199 | @@ -554,7 +557,7 @@ |
200 | } |
201 | |
202 | // -------------------------------------------------------------------------------- |
203 | -void TextAttribute::SetValue (gchar *value) |
204 | +void TextAttribute::SetValue (const gchar *value) |
205 | { |
206 | if (value) |
207 | { |
208 | @@ -648,7 +651,7 @@ |
209 | } |
210 | |
211 | // -------------------------------------------------------------------------------- |
212 | -void BooleanAttribute::SetValue (gchar *value) |
213 | +void BooleanAttribute::SetValue (const gchar *value) |
214 | { |
215 | if (value) |
216 | { |
217 | @@ -726,7 +729,7 @@ |
218 | } |
219 | |
220 | // -------------------------------------------------------------------------------- |
221 | -void IntAttribute::SetValue (gchar *value) |
222 | +void IntAttribute::SetValue (const gchar *value) |
223 | { |
224 | if (value) |
225 | { |
226 | |
227 | === modified file 'sources/attribute.hpp' |
228 | --- sources/attribute.hpp 2010-12-13 21:03:47 +0000 |
229 | +++ sources/attribute.hpp 2011-01-21 08:07:55 +0000 |
230 | @@ -72,28 +72,28 @@ |
231 | |
232 | static void SetPath (gchar *path); |
233 | |
234 | - static AttributeDesc *Declare (GType type, |
235 | - gchar *code_name, |
236 | - gchar *xml_name, |
237 | - gchar *user_name); |
238 | + static AttributeDesc *Declare (GType type, |
239 | + const gchar *code_name, |
240 | + const gchar *xml_name, |
241 | + gchar *user_name); |
242 | |
243 | static void CreateList (GSList **list, ...); |
244 | |
245 | static GSList *GetList (); |
246 | |
247 | - static AttributeDesc *GetDesc (gchar *name); |
248 | + static AttributeDesc *GetDesc (const gchar *name); |
249 | |
250 | void BindDiscreteValues (GObject *object, |
251 | GtkCellRenderer *renderer = NULL); |
252 | |
253 | gboolean HasDiscreteValue (); |
254 | |
255 | - void AddDiscreteValues (gchar *first_xml_image, |
256 | - gchar *first_user_image, |
257 | - gchar *first_icon, |
258 | + void AddDiscreteValues (const gchar *first_xml_image, |
259 | + gchar *first_user_image, |
260 | + const gchar *first_icon, |
261 | ...); |
262 | |
263 | - void AddDiscreteValues (gchar *file); |
264 | + void AddDiscreteValues (const gchar *file); |
265 | |
266 | void *GetDiscreteValue (guint from_code); |
267 | |
268 | @@ -107,10 +107,10 @@ |
269 | static gchar *_path; |
270 | static GSList *_list; |
271 | |
272 | - AttributeDesc (GType type, |
273 | - gchar *code_name, |
274 | - gchar *xml_name, |
275 | - gchar *user_name); |
276 | + AttributeDesc (GType type, |
277 | + const gchar *code_name, |
278 | + const gchar *xml_name, |
279 | + const gchar *user_name); |
280 | |
281 | ~AttributeDesc (); |
282 | }; |
283 | @@ -132,7 +132,7 @@ |
284 | |
285 | GType GetType (); |
286 | |
287 | - virtual void SetValue (gchar *value) = 0; |
288 | + virtual void SetValue (const gchar *value) = 0; |
289 | |
290 | virtual void SetValue (guint value) = 0; |
291 | |
292 | @@ -170,7 +170,7 @@ |
293 | |
294 | virtual ~TextAttribute (); |
295 | |
296 | - void SetValue (gchar *value); |
297 | + void SetValue (const gchar *value); |
298 | |
299 | void SetValue (guint value); |
300 | |
301 | @@ -201,7 +201,7 @@ |
302 | |
303 | virtual ~BooleanAttribute (); |
304 | |
305 | - void SetValue (gchar *value); |
306 | + void SetValue (const gchar *value); |
307 | |
308 | void SetValue (guint value); |
309 | |
310 | @@ -231,7 +231,7 @@ |
311 | |
312 | virtual ~IntAttribute (); |
313 | |
314 | - void SetValue (gchar *value); |
315 | + void SetValue (const gchar *value); |
316 | |
317 | void SetValue (guint value); |
318 | |
319 | |
320 | === modified file 'sources/canvas.cpp' |
321 | --- sources/canvas.cpp 2010-12-13 21:03:47 +0000 |
322 | +++ sources/canvas.cpp 2011-01-21 08:07:55 +0000 |
323 | @@ -37,7 +37,7 @@ |
324 | |
325 | // -------------------------------------------------------------------------------- |
326 | void Canvas::SetTableItemAttribute (GooCanvasItem *item, |
327 | - gchar *attribute, |
328 | + const gchar *attribute, |
329 | gdouble value) |
330 | { |
331 | GooCanvasItem *parent = goo_canvas_item_get_parent (item); |
332 | @@ -54,7 +54,7 @@ |
333 | |
334 | // -------------------------------------------------------------------------------- |
335 | void Canvas::SetTableItemAttribute (GooCanvasItem *item, |
336 | - gchar *attribute, |
337 | + const gchar *attribute, |
338 | guint value) |
339 | { |
340 | GooCanvasItem *parent = goo_canvas_item_get_parent (item); |
341 | @@ -71,7 +71,7 @@ |
342 | |
343 | // -------------------------------------------------------------------------------- |
344 | GooCanvasItem *Canvas::PutTextInTable (GooCanvasItem *table, |
345 | - gchar *text, |
346 | + const gchar *text, |
347 | guint row, |
348 | guint column) |
349 | { |
350 | @@ -108,7 +108,7 @@ |
351 | |
352 | // -------------------------------------------------------------------------------- |
353 | GooCanvasItem *Canvas::CreateIcon (GooCanvasItem *parent, |
354 | - gchar *icon_name, |
355 | + const gchar *icon_name, |
356 | gdouble x, |
357 | gdouble y) |
358 | { |
359 | @@ -138,7 +138,7 @@ |
360 | |
361 | // -------------------------------------------------------------------------------- |
362 | GooCanvasItem *Canvas::PutStockIconInTable (GooCanvasItem *table, |
363 | - gchar *icon_name, |
364 | + const gchar *icon_name, |
365 | guint row, |
366 | guint column) |
367 | { |
368 | |
369 | === modified file 'sources/canvas.hpp' |
370 | --- sources/canvas.hpp 2010-12-13 21:03:47 +0000 |
371 | +++ sources/canvas.hpp 2011-01-21 08:07:55 +0000 |
372 | @@ -31,12 +31,12 @@ |
373 | guint column); |
374 | |
375 | static GooCanvasItem *PutTextInTable (GooCanvasItem *table, |
376 | - gchar *text, |
377 | + const gchar *text, |
378 | guint row, |
379 | guint column); |
380 | |
381 | static GooCanvasItem *CreateIcon (GooCanvasItem *parent, |
382 | - gchar *icon_name, |
383 | + const gchar *icon_name, |
384 | gdouble x, |
385 | gdouble y); |
386 | |
387 | @@ -46,16 +46,16 @@ |
388 | guint column); |
389 | |
390 | static GooCanvasItem *PutStockIconInTable (GooCanvasItem *table, |
391 | - gchar *icon_name, |
392 | + const gchar *icon_name, |
393 | guint row, |
394 | guint column); |
395 | |
396 | static void SetTableItemAttribute (GooCanvasItem *item, |
397 | - gchar *attribute, |
398 | + const gchar *attribute, |
399 | guint value); |
400 | |
401 | static void SetTableItemAttribute (GooCanvasItem *item, |
402 | - gchar *attribute, |
403 | + const gchar *attribute, |
404 | gdouble value); |
405 | |
406 | static GooCanvas *CreatePrinterCanvas (GtkPrintContext *context); |
407 | |
408 | === modified file 'sources/canvas_module.cpp' |
409 | --- sources/canvas_module.cpp 2010-12-19 17:35:40 +0000 |
410 | +++ sources/canvas_module.cpp 2011-01-21 08:07:55 +0000 |
411 | @@ -25,8 +25,8 @@ |
412 | #include "canvas_module.hpp" |
413 | |
414 | // -------------------------------------------------------------------------------- |
415 | -CanvasModule::CanvasModule (gchar *glade_file, |
416 | - gchar *root) |
417 | +CanvasModule::CanvasModule (const gchar *glade_file, |
418 | + const gchar *root) |
419 | : Module (glade_file, |
420 | root) |
421 | { |
422 | |
423 | === modified file 'sources/canvas_module.hpp' |
424 | --- sources/canvas_module.hpp 2010-05-17 12:24:43 +0000 |
425 | +++ sources/canvas_module.hpp 2011-01-21 08:07:55 +0000 |
426 | @@ -26,8 +26,8 @@ |
427 | class CanvasModule : public Module |
428 | { |
429 | protected: |
430 | - CanvasModule (gchar *glade_file, |
431 | - gchar *root = NULL); |
432 | + CanvasModule (const gchar *glade_file, |
433 | + const gchar *root = NULL); |
434 | virtual ~CanvasModule (); |
435 | |
436 | static void WipeItem (GooCanvasItem *item); |
437 | |
438 | === modified file 'sources/checkin.cpp' |
439 | --- sources/checkin.cpp 2010-12-02 21:35:29 +0000 |
440 | +++ sources/checkin.cpp 2011-01-21 08:07:55 +0000 |
441 | @@ -264,7 +264,7 @@ |
442 | |
443 | // -------------------------------------------------------------------------------- |
444 | void Checkin::Load (xmlXPathContext *xml_context, |
445 | - gchar *from_node) |
446 | + const gchar *from_node) |
447 | { |
448 | gchar *path = g_strdup_printf ("%s/Tireurs", from_node); |
449 | xmlXPathObject *xml_object = xmlXPathEval (BAD_CAST path, xml_context); |
450 | @@ -778,24 +778,24 @@ |
451 | |
452 | player = new Player; |
453 | |
454 | - attr_id._name = "attending"; |
455 | + attr_id._name = (gchar *) "attending"; |
456 | player->SetAttributeValue (&attr_id, (guint) FALSE); |
457 | |
458 | if (tokens) |
459 | { |
460 | - attr_id._name = "name"; |
461 | + attr_id._name = (gchar *) "name"; |
462 | player->SetAttributeValue (&attr_id, tokens[0]); |
463 | |
464 | - attr_id._name = "first_name"; |
465 | + attr_id._name = (gchar *) "first_name"; |
466 | player->SetAttributeValue (&attr_id, tokens[1]); |
467 | |
468 | - attr_id._name = "birth_date"; |
469 | + attr_id._name = (gchar *) "birth_date"; |
470 | player->SetAttributeValue (&attr_id, tokens[2]); |
471 | |
472 | - attr_id._name = "gender"; |
473 | + attr_id._name = (gchar *) "gender"; |
474 | player->SetAttributeValue (&attr_id, tokens[3]); |
475 | |
476 | - attr_id._name = "country"; |
477 | + attr_id._name = (gchar *) "country"; |
478 | player->SetAttributeValue (&attr_id, tokens[4]); |
479 | |
480 | g_strfreev (tokens); |
481 | @@ -815,7 +815,7 @@ |
482 | 0); |
483 | if (tokens) |
484 | { |
485 | - attr_id._name = "licence"; |
486 | + attr_id._name = (gchar *) "licence"; |
487 | player->SetAttributeValue (&attr_id, tokens[0]); |
488 | |
489 | if (strlen (tokens[0]) > 2) |
490 | @@ -830,27 +830,27 @@ |
491 | |
492 | if (league) |
493 | { |
494 | - attr_id._name = "league"; |
495 | + attr_id._name = (gchar *) "league"; |
496 | player->SetAttributeValue (&attr_id, league); |
497 | g_free (league); |
498 | } |
499 | } |
500 | } |
501 | |
502 | - attr_id._name = "club"; |
503 | + attr_id._name = (gchar *) "club"; |
504 | player->SetAttributeValue (&attr_id, tokens[2]); |
505 | |
506 | - attr_id._name = "exported"; |
507 | + attr_id._name = (gchar *) "exported"; |
508 | player->SetAttributeValue (&attr_id, (guint) FALSE); |
509 | |
510 | if (tokens[3] == NULL) |
511 | { |
512 | - attr_id._name = "rating"; |
513 | + attr_id._name = (gchar *) "rating"; |
514 | player->SetAttributeValue (&attr_id, (guint) 0); |
515 | } |
516 | else |
517 | { |
518 | - attr_id._name = "rating"; |
519 | + attr_id._name = (gchar *) "rating"; |
520 | player->SetAttributeValue (&attr_id, tokens[3]); |
521 | } |
522 | |
523 | @@ -922,16 +922,16 @@ |
524 | Player *player = new Player; |
525 | Player::AttributeId attr_id (""); |
526 | |
527 | - attr_id._name = "attending"; |
528 | + attr_id._name = (gchar *) "attending"; |
529 | player->SetAttributeValue (&attr_id, (guint) FALSE); |
530 | |
531 | - attr_id._name = "name"; |
532 | + attr_id._name = (gchar *) "name"; |
533 | player->SetAttributeValue (&attr_id, tokens[i]); |
534 | |
535 | - attr_id._name = "first_name"; |
536 | + attr_id._name = (gchar *) "first_name"; |
537 | player->SetAttributeValue (&attr_id, tokens[i+1]); |
538 | |
539 | - attr_id._name = "exported"; |
540 | + attr_id._name = (gchar *) "exported"; |
541 | player->SetAttributeValue (&attr_id, (guint) FALSE); |
542 | |
543 | |
544 | |
545 | === modified file 'sources/checkin.hpp' |
546 | --- sources/checkin.hpp 2010-11-03 12:00:16 +0000 |
547 | +++ sources/checkin.hpp 2011-01-21 08:07:55 +0000 |
548 | @@ -72,7 +72,7 @@ |
549 | void Load (xmlNode *xml_node); |
550 | |
551 | void Load (xmlXPathContext *xml_context, |
552 | - gchar *from_node); |
553 | + const gchar *from_node); |
554 | |
555 | void Save (xmlTextWriter *xml_writer); |
556 | |
557 | |
558 | === modified file 'sources/classification.cpp' |
559 | --- sources/classification.cpp 2010-12-09 21:33:26 +0000 |
560 | +++ sources/classification.cpp 2011-01-21 08:07:55 +0000 |
561 | @@ -245,9 +245,9 @@ |
562 | } |
563 | |
564 | // -------------------------------------------------------------------------------- |
565 | -void Classification::WriteFFFString (FILE *file, |
566 | - Player *player, |
567 | - gchar *attr_name) |
568 | +void Classification::WriteFFFString (FILE *file, |
569 | + Player *player, |
570 | + const gchar *attr_name) |
571 | { |
572 | Player::AttributeId attr_id (attr_name); |
573 | Attribute *attr = player->GetAttribute (&attr_id); |
574 | |
575 | === modified file 'sources/classification.hpp' |
576 | --- sources/classification.hpp 2010-11-30 22:28:25 +0000 |
577 | +++ sources/classification.hpp 2011-01-21 08:07:55 +0000 |
578 | @@ -43,9 +43,9 @@ |
579 | private: |
580 | void OnPlugged (); |
581 | |
582 | - void WriteFFFString (FILE *file, |
583 | - Player *player, |
584 | - gchar *attr_name); |
585 | + void WriteFFFString (FILE *file, |
586 | + Player *player, |
587 | + const gchar *attr_name); |
588 | |
589 | ~Classification (); |
590 | }; |
591 | |
592 | === modified file 'sources/contest.cpp' |
593 | --- sources/contest.cpp 2010-12-29 20:11:22 +0000 |
594 | +++ sources/contest.cpp 2011-01-21 08:07:55 +0000 |
595 | @@ -35,35 +35,35 @@ |
596 | |
597 | #include "contest.hpp" |
598 | |
599 | -gchar *Contest::weapon_image[_nb_weapon] = |
600 | +const gchar *Contest::weapon_image[_nb_weapon] = |
601 | { |
602 | N_ ("Sabre"), |
603 | N_ ("Epée"), |
604 | N_ ("Foil") |
605 | }; |
606 | |
607 | -gchar *Contest::weapon_xml_image[_nb_weapon] = |
608 | +const gchar *Contest::weapon_xml_image[_nb_weapon] = |
609 | { |
610 | "S", |
611 | "E", |
612 | "F" |
613 | }; |
614 | |
615 | -gchar *Contest::gender_image[_nb_gender] = |
616 | +const gchar *Contest::gender_image[_nb_gender] = |
617 | { |
618 | N_ ("Male"), |
619 | N_ ("Female"), |
620 | N_ ("Mixed") |
621 | }; |
622 | |
623 | -gchar *Contest::gender_xml_image[_nb_gender] = |
624 | +const gchar *Contest::gender_xml_image[_nb_gender] = |
625 | { |
626 | "M", |
627 | "F", |
628 | "FM" |
629 | }; |
630 | |
631 | -gchar *Contest::category_image[_nb_category] = |
632 | +const gchar *Contest::category_image[_nb_category] = |
633 | { |
634 | N_ ("U8"), |
635 | N_ ("U10"), |
636 | @@ -75,7 +75,7 @@ |
637 | N_ ("Veteran") |
638 | }; |
639 | |
640 | -gchar *Contest::category_xml_image[_nb_category] = |
641 | +const gchar *Contest::category_xml_image[_nb_category] = |
642 | { |
643 | "O", |
644 | "P", |
645 | @@ -90,9 +90,9 @@ |
646 | GList *Contest::_color_list = NULL; |
647 | |
648 | // -------------------------------------------------------------------------------- |
649 | -Contest::Time::Time (gchar *name) |
650 | +Contest::Time::Time (const gchar *name) |
651 | { |
652 | - _name = name; |
653 | + _name = g_strdup (name); |
654 | _hour = 12; |
655 | _minute = 0; |
656 | } |
657 | @@ -104,12 +104,12 @@ |
658 | |
659 | // -------------------------------------------------------------------------------- |
660 | void Contest::Time::Save (xmlTextWriter *xml_writer, |
661 | - gchar *attr_name) |
662 | + const gchar *attr_name) |
663 | { |
664 | xmlTextWriterWriteFormatAttribute (xml_writer, |
665 | BAD_CAST attr_name, |
666 | "%02d:%02d", _hour, _minute); |
667 | -}; |
668 | +} |
669 | |
670 | // -------------------------------------------------------------------------------- |
671 | void Contest::Time::Load (gchar *attr) |
672 | @@ -971,8 +971,8 @@ |
673 | } |
674 | |
675 | // -------------------------------------------------------------------------------- |
676 | -gchar *Contest::GetSaveFileName (gchar *title, |
677 | - gchar *config_key) |
678 | +gchar *Contest::GetSaveFileName (gchar *title, |
679 | + const gchar *config_key) |
680 | { |
681 | GtkWidget *chooser; |
682 | char *filename = NULL; |
683 | @@ -1291,7 +1291,7 @@ |
684 | // -------------------------------------------------------------------------------- |
685 | gchar *Contest::GetGender () |
686 | { |
687 | - return gender_xml_image[_gender]; |
688 | + return (char *) gender_xml_image[_gender]; |
689 | } |
690 | |
691 | // -------------------------------------------------------------------------------- |
692 | |
693 | === modified file 'sources/contest.hpp' |
694 | --- sources/contest.hpp 2010-11-30 22:28:25 +0000 |
695 | +++ sources/contest.hpp 2011-01-21 08:07:55 +0000 |
696 | @@ -64,13 +64,13 @@ |
697 | private: |
698 | struct Time : public Object |
699 | { |
700 | - Time (gchar *name); |
701 | + Time (const gchar *name); |
702 | |
703 | ~Time (); |
704 | |
705 | void Load (gchar *attr); |
706 | void Save (xmlTextWriter *xml_writer, |
707 | - gchar *attr_name); |
708 | + const gchar *attr_name); |
709 | void ReadProperties (Glade *glade); |
710 | void FillInProperties (Glade *glade); |
711 | void Copy (Time *to); |
712 | @@ -81,16 +81,16 @@ |
713 | }; |
714 | |
715 | static const guint _nb_weapon = 3; |
716 | - static gchar *weapon_image[_nb_weapon]; |
717 | - static gchar *weapon_xml_image[_nb_weapon]; |
718 | + static const gchar *weapon_image[_nb_weapon]; |
719 | + static const gchar *weapon_xml_image[_nb_weapon]; |
720 | |
721 | static const guint _nb_gender = 3; |
722 | - static gchar *gender_image[_nb_gender]; |
723 | - static gchar *gender_xml_image[_nb_gender]; |
724 | + static const gchar *gender_image[_nb_gender]; |
725 | + static const gchar *gender_xml_image[_nb_gender]; |
726 | |
727 | static const guint _nb_category = 8; |
728 | - static gchar *category_image[_nb_category]; |
729 | - static gchar *category_xml_image[_nb_category]; |
730 | + static const gchar *category_image[_nb_category]; |
731 | + static const gchar *category_xml_image[_nb_category]; |
732 | |
733 | static GList *_color_list; |
734 | |
735 | @@ -126,8 +126,8 @@ |
736 | void InitInstance (); |
737 | void ReadProperties (); |
738 | void DisplayProperties (); |
739 | - gchar *GetSaveFileName (gchar *title, |
740 | - gchar *config_key); |
741 | + gchar *GetSaveFileName (gchar *title, |
742 | + const gchar *config_key); |
743 | void Save (gchar *filename); |
744 | void FillInProperties (); |
745 | void FillInDate (guint day, |
746 | |
747 | === modified file 'sources/data.cpp' |
748 | --- sources/data.cpp 2010-07-10 20:17:09 +0000 |
749 | +++ sources/data.cpp 2011-01-21 08:07:55 +0000 |
750 | @@ -22,20 +22,20 @@ |
751 | #include "data.hpp" |
752 | |
753 | // -------------------------------------------------------------------------------- |
754 | -Data::Data (gchar *xml_name, |
755 | - guint default_value) |
756 | +Data::Data (const gchar *xml_name, |
757 | + guint default_value) |
758 | { |
759 | - _xml_name = xml_name; |
760 | + _xml_name = g_strdup (xml_name); |
761 | _value = default_value; |
762 | |
763 | _is_integer = TRUE; |
764 | } |
765 | |
766 | // -------------------------------------------------------------------------------- |
767 | -Data::Data (gchar *xml_name, |
768 | - gchar *default_value) |
769 | +Data::Data (const gchar *xml_name, |
770 | + gchar *default_value) |
771 | { |
772 | - _xml_name = xml_name; |
773 | + _xml_name = g_strdup (xml_name); |
774 | _string = default_value; |
775 | |
776 | _is_integer = FALSE; |
777 | @@ -44,6 +44,7 @@ |
778 | // -------------------------------------------------------------------------------- |
779 | Data::~Data () |
780 | { |
781 | + g_free (_xml_name); |
782 | } |
783 | |
784 | // -------------------------------------------------------------------------------- |
785 | |
786 | === modified file 'sources/data.hpp' |
787 | --- sources/data.hpp 2010-07-10 20:17:09 +0000 |
788 | +++ sources/data.hpp 2011-01-21 08:07:55 +0000 |
789 | @@ -28,11 +28,11 @@ |
790 | guint _value; |
791 | gchar *_string; |
792 | |
793 | - Data (gchar *xml_name, |
794 | - guint default_value); |
795 | + Data (const gchar *xml_name, |
796 | + guint default_value); |
797 | |
798 | - Data (gchar *xml_name, |
799 | - gchar *default_value); |
800 | + Data (const gchar *xml_name, |
801 | + gchar *default_value); |
802 | |
803 | void Save (xmlTextWriter *xml_writer); |
804 | |
805 | |
806 | === modified file 'sources/filter.cpp' |
807 | --- sources/filter.cpp 2010-10-07 11:38:36 +0000 |
808 | +++ sources/filter.cpp 2011-01-21 08:07:55 +0000 |
809 | @@ -81,7 +81,7 @@ |
810 | } |
811 | |
812 | // -------------------------------------------------------------------------------- |
813 | -guint Filter::GetAttributeId (gchar *name) |
814 | +guint Filter::GetAttributeId (const gchar *name) |
815 | { |
816 | if (_attr_list) |
817 | { |
818 | @@ -118,7 +118,7 @@ |
819 | } |
820 | |
821 | // -------------------------------------------------------------------------------- |
822 | -void Filter::ShowAttribute (gchar *name) |
823 | +void Filter::ShowAttribute (const gchar *name) |
824 | { |
825 | GtkTreeIter iter; |
826 | GtkTreeIter *sibling = NULL; |
827 | |
828 | === modified file 'sources/filter.hpp' |
829 | --- sources/filter.hpp 2010-06-25 21:16:12 +0000 |
830 | +++ sources/filter.hpp 2011-01-21 08:07:55 +0000 |
831 | @@ -31,7 +31,7 @@ |
832 | |
833 | void SetAttributeList (GSList *list); |
834 | |
835 | - void ShowAttribute (gchar *name); |
836 | + void ShowAttribute (const gchar *name); |
837 | |
838 | void UpdateAttrList (); |
839 | |
840 | @@ -41,7 +41,7 @@ |
841 | |
842 | GSList *GetSelectedAttrList (); |
843 | |
844 | - guint GetAttributeId (gchar *name); |
845 | + guint GetAttributeId (const gchar *name); |
846 | |
847 | void SetOwner (Module *owner); |
848 | |
849 | |
850 | === modified file 'sources/general_classification.cpp' |
851 | --- sources/general_classification.cpp 2010-12-29 07:36:17 +0000 |
852 | +++ sources/general_classification.cpp 2011-01-21 08:07:55 +0000 |
853 | @@ -265,11 +265,11 @@ |
854 | |
855 | if (export_type == CSV) |
856 | { |
857 | - suffix = ".csv"; |
858 | + suffix = g_strdup (".csv"); |
859 | } |
860 | else |
861 | { |
862 | - suffix = ".fff"; |
863 | + suffix = g_strdup (".fff"); |
864 | } |
865 | |
866 | { |
867 | @@ -300,6 +300,7 @@ |
868 | g_free (dirname); |
869 | } |
870 | } |
871 | + g_free (suffix); |
872 | } |
873 | } |
874 | |
875 | |
876 | === modified file 'sources/glade.cpp' |
877 | --- sources/glade.cpp 2010-09-05 20:04:10 +0000 |
878 | +++ sources/glade.cpp 2011-01-21 08:07:55 +0000 |
879 | @@ -19,8 +19,8 @@ |
880 | gchar *Glade::_path = NULL; |
881 | |
882 | // -------------------------------------------------------------------------------- |
883 | -Glade::Glade (gchar *file_name, |
884 | - Object *owner) |
885 | +Glade::Glade (const gchar *file_name, |
886 | + Object *owner) |
887 | : Object ("Glade") |
888 | { |
889 | if (file_name) |
890 | @@ -33,6 +33,10 @@ |
891 | gtk_builder_add_from_file (_glade_xml, |
892 | path, |
893 | &error); |
894 | + if (error != NULL) |
895 | + { |
896 | + g_print ("<<%s>> %s\n", path, error->message); |
897 | + } |
898 | g_free (path); |
899 | |
900 | if (error != NULL) |
901 | @@ -94,14 +98,14 @@ |
902 | } |
903 | |
904 | // -------------------------------------------------------------------------------- |
905 | -GtkWidget *Glade::GetWidget (gchar *name) |
906 | +GtkWidget *Glade::GetWidget (const gchar *name) |
907 | { |
908 | return (GtkWidget *) (gtk_builder_get_object (_glade_xml, |
909 | name)); |
910 | } |
911 | |
912 | // -------------------------------------------------------------------------------- |
913 | -GObject *Glade::GetObject (gchar *name) |
914 | +GObject *Glade::GetObject (const gchar *name) |
915 | { |
916 | return gtk_builder_get_object (_glade_xml, |
917 | name); |
918 | |
919 | === modified file 'sources/glade.hpp' |
920 | --- sources/glade.hpp 2010-04-18 21:11:47 +0000 |
921 | +++ sources/glade.hpp 2011-01-21 08:07:55 +0000 |
922 | @@ -23,15 +23,15 @@ |
923 | class Glade : public Object |
924 | { |
925 | public: |
926 | - Glade (gchar *file_name, |
927 | - Object *owner); |
928 | + Glade (const gchar *file_name, |
929 | + Object *owner); |
930 | ~Glade (); |
931 | |
932 | static void SetPath (gchar *path); |
933 | |
934 | GtkWidget *GetRootWidget (); |
935 | - GtkWidget *GetWidget (gchar *name); |
936 | - GObject *GetObject (gchar *name); |
937 | + GtkWidget *GetWidget (const gchar *name); |
938 | + GObject *GetObject (const gchar *name); |
939 | void DetachFromParent (GtkWidget *widget); |
940 | |
941 | private: |
942 | |
943 | === modified file 'sources/main.cpp' |
944 | --- sources/main.cpp 2011-01-04 22:21:11 +0000 |
945 | +++ sources/main.cpp 2011-01-21 08:07:55 +0000 |
946 | @@ -40,6 +40,7 @@ |
947 | #include "attribute.hpp" |
948 | #include "general_classification.hpp" |
949 | #include "glade.hpp" |
950 | +#include "locale" |
951 | |
952 | // -------------------------------------------------------------------------------- |
953 | static void AboutDialogActivateLinkFunc (GtkAboutDialog *about, |
954 | |
955 | === modified file 'sources/module.cpp' |
956 | --- sources/module.cpp 2010-12-13 21:03:47 +0000 |
957 | +++ sources/module.cpp 2011-01-21 08:07:55 +0000 |
958 | @@ -22,12 +22,14 @@ |
959 | |
960 | #include "module.hpp" |
961 | |
962 | +const gdouble Module::PRINT_HEADER_HEIGHT = 10.0; // % of paper width |
963 | +const gdouble Module::PRINT_FONT_HEIGHT = 2.0; // % of paper width |
964 | GKeyFile *Module::_config_file = NULL; |
965 | GtkTreeModel *Module::_status_model = NULL; |
966 | |
967 | // -------------------------------------------------------------------------------- |
968 | -Module::Module (gchar *glade_file, |
969 | - gchar *root) |
970 | +Module::Module (const gchar *glade_file, |
971 | + const gchar *root) |
972 | //: Object ("Module") |
973 | { |
974 | _plugged_list = NULL; |
975 | @@ -115,7 +117,7 @@ |
976 | } |
977 | |
978 | // -------------------------------------------------------------------------------- |
979 | -GtkWidget *Module::GetWidget (gchar *name) |
980 | +GtkWidget *Module::GetWidget (const gchar *name) |
981 | { |
982 | return _glade->GetWidget (name); |
983 | } |
984 | |
985 | === modified file 'sources/module.hpp' |
986 | --- sources/module.hpp 2010-12-13 21:03:47 +0000 |
987 | +++ sources/module.hpp 2011-01-21 08:07:55 +0000 |
988 | @@ -47,7 +47,7 @@ |
989 | |
990 | GtkWidget *GetRootWidget (); |
991 | |
992 | - GtkWidget *GetWidget (gchar *name); |
993 | + GtkWidget *GetWidget (const gchar *name); |
994 | |
995 | virtual void SetFilter (Filter *filter); |
996 | |
997 | @@ -57,13 +57,13 @@ |
998 | Filter *_filter; |
999 | Glade *_glade; |
1000 | |
1001 | - static const gdouble PRINT_HEADER_HEIGHT = 10.0; // % of paper width |
1002 | - static const gdouble PRINT_FONT_HEIGHT = 2.0; // % of paper width |
1003 | + static const gdouble PRINT_HEADER_HEIGHT; |
1004 | + static const gdouble PRINT_FONT_HEIGHT; |
1005 | |
1006 | static GKeyFile *_config_file; |
1007 | |
1008 | - Module (gchar *glade_file, |
1009 | - gchar *root = NULL); |
1010 | + Module (const gchar *glade_file, |
1011 | + const gchar *root = NULL); |
1012 | |
1013 | virtual void OnPlugged () {}; |
1014 | virtual void OnUnPlugged () {}; |
1015 | |
1016 | === modified file 'sources/object.cpp' |
1017 | --- sources/object.cpp 2010-06-30 21:14:15 +0000 |
1018 | +++ sources/object.cpp 2011-01-21 08:07:55 +0000 |
1019 | @@ -28,7 +28,7 @@ |
1020 | }; |
1021 | |
1022 | // -------------------------------------------------------------------------------- |
1023 | -Object::Object (gchar *class_name) |
1024 | +Object::Object (const gchar *class_name) |
1025 | { |
1026 | g_datalist_init (&_datalist); |
1027 | _ref_count = 1; |
1028 | @@ -37,10 +37,12 @@ |
1029 | #ifdef DEBUG |
1030 | if (class_name == NULL) |
1031 | { |
1032 | - class_name = "anonymous"; |
1033 | - } |
1034 | - |
1035 | - _class_name = class_name; |
1036 | + _class_name = g_strdup ("anonymous"); |
1037 | + } |
1038 | + else |
1039 | + { |
1040 | + _class_name = g_strdup (class_name); |
1041 | + } |
1042 | |
1043 | for (guint i = 0; i < g_list_length (_list); i++) |
1044 | { |
1045 | @@ -90,6 +92,9 @@ |
1046 | return; |
1047 | } |
1048 | } |
1049 | + |
1050 | + g_free (_class_name); |
1051 | + |
1052 | #endif |
1053 | } |
1054 | |
1055 | @@ -130,11 +135,11 @@ |
1056 | |
1057 | // -------------------------------------------------------------------------------- |
1058 | void Object::SetData (Object *owner, |
1059 | - gchar *key, |
1060 | + const gchar *key, |
1061 | void *data, |
1062 | GDestroyNotify destroy_cbk) |
1063 | { |
1064 | - gchar *full_key = g_strdup_printf ("%p::%s", owner, key); |
1065 | + gchar *full_key = g_strdup_printf ("%p::%s", (void *) owner, key); |
1066 | |
1067 | g_datalist_set_data_full (&_datalist, |
1068 | full_key, |
1069 | @@ -144,10 +149,10 @@ |
1070 | } |
1071 | |
1072 | // -------------------------------------------------------------------------------- |
1073 | -void Object::RemoveData (Object *owner, |
1074 | - gchar *key) |
1075 | +void Object::RemoveData (Object *owner, |
1076 | + const gchar *key) |
1077 | { |
1078 | - gchar *full_key = g_strdup_printf ("%p::%s", owner, key); |
1079 | + gchar *full_key = g_strdup_printf ("%p::%s", (void *) owner, key); |
1080 | |
1081 | g_datalist_remove_data (&_datalist, |
1082 | full_key); |
1083 | @@ -165,11 +170,11 @@ |
1084 | } |
1085 | |
1086 | // -------------------------------------------------------------------------------- |
1087 | -void *Object::GetData (Object *owner, |
1088 | - gchar *key) |
1089 | +void *Object::GetData (Object *owner, |
1090 | + const gchar *key) |
1091 | { |
1092 | void *data; |
1093 | - gchar *full_key = g_strdup_printf ("%p::%s", owner, key); |
1094 | + gchar *full_key = g_strdup_printf ("%p::%s", (void *) owner, key); |
1095 | |
1096 | data = g_datalist_get_data (&_datalist, |
1097 | full_key); |
1098 | |
1099 | === modified file 'sources/object.hpp' |
1100 | --- sources/object.hpp 2010-09-21 12:47:35 +0000 |
1101 | +++ sources/object.hpp 2011-01-21 08:07:55 +0000 |
1102 | @@ -24,18 +24,18 @@ |
1103 | class Object |
1104 | { |
1105 | public: |
1106 | - Object (gchar *class_name = NULL); |
1107 | + Object (const gchar *class_name = NULL); |
1108 | |
1109 | void SetData (Object *owner, |
1110 | - gchar *key, |
1111 | + const gchar *key, |
1112 | void *data, |
1113 | GDestroyNotify destroy_cbk = NULL); |
1114 | |
1115 | - void *GetData (Object *owner, |
1116 | - gchar *key); |
1117 | + void *GetData (Object *owner, |
1118 | + const gchar *key); |
1119 | |
1120 | - void RemoveData (Object *owner, |
1121 | - gchar *key); |
1122 | + void RemoveData (Object *owner, |
1123 | + const gchar *key); |
1124 | |
1125 | void Retain (); |
1126 | |
1127 | |
1128 | === modified file 'sources/player.cpp' |
1129 | --- sources/player.cpp 2010-12-02 21:35:29 +0000 |
1130 | +++ sources/player.cpp 2011-01-21 08:07:55 +0000 |
1131 | @@ -167,13 +167,13 @@ |
1132 | } |
1133 | |
1134 | // -------------------------------------------------------------------------------- |
1135 | -void Player::SetChangeCbk (gchar *attr_name, |
1136 | - OnChange change_cbk, |
1137 | - void *data) |
1138 | +void Player::SetChangeCbk (const gchar *attr_name, |
1139 | + OnChange change_cbk, |
1140 | + void *data) |
1141 | { |
1142 | Client *client = new Client; |
1143 | |
1144 | - client->_attr_name = attr_name; |
1145 | + client->_attr_name = g_strdup (attr_name); |
1146 | client->_change_cbk = change_cbk; |
1147 | client->_data = data; |
1148 | |
1149 | @@ -203,7 +203,7 @@ |
1150 | |
1151 | // -------------------------------------------------------------------------------- |
1152 | void Player::SetAttributeValue (AttributeId *attr_id, |
1153 | - gchar *value) |
1154 | + const gchar *value) |
1155 | { |
1156 | Attribute *attr = GetAttribute (attr_id); |
1157 | |
1158 | |
1159 | === modified file 'sources/player.hpp' |
1160 | --- sources/player.hpp 2010-10-13 13:09:59 +0000 |
1161 | +++ sources/player.hpp 2011-01-21 08:07:55 +0000 |
1162 | @@ -29,10 +29,10 @@ |
1163 | class AttributeId : public Object |
1164 | { |
1165 | public: |
1166 | - AttributeId (gchar *name, |
1167 | - Object *owner = NULL) |
1168 | + AttributeId (const gchar *name, |
1169 | + Object *owner = NULL) |
1170 | { |
1171 | - _name = name; |
1172 | + _name = g_strdup (name); |
1173 | _owner = owner; |
1174 | _rand_seed = 0; |
1175 | } |
1176 | @@ -62,7 +62,7 @@ |
1177 | Attribute *GetAttribute (AttributeId *attr_id); |
1178 | |
1179 | void SetAttributeValue (AttributeId *attr_id, |
1180 | - gchar *value); |
1181 | + const gchar *value); |
1182 | |
1183 | void SetAttributeValue (AttributeId *attr_id, |
1184 | guint value); |
1185 | @@ -75,9 +75,9 @@ |
1186 | |
1187 | gchar *GetName (); |
1188 | |
1189 | - void SetChangeCbk (gchar *attr_name, |
1190 | - OnChange change_cbk, |
1191 | - void *data); |
1192 | + void SetChangeCbk (const gchar *attr_name, |
1193 | + OnChange change_cbk, |
1194 | + void *data); |
1195 | |
1196 | static gint CompareWithRef (Player *player, |
1197 | guint ref); |
1198 | |
1199 | === modified file 'sources/players_list.cpp' |
1200 | --- sources/players_list.cpp 2010-11-30 07:58:46 +0000 |
1201 | +++ sources/players_list.cpp 2011-01-21 08:07:55 +0000 |
1202 | @@ -25,8 +25,8 @@ |
1203 | #include "players_list.hpp" |
1204 | |
1205 | // -------------------------------------------------------------------------------- |
1206 | - PlayersList::PlayersList (gchar *glade_file, |
1207 | - guint rights) |
1208 | + PlayersList::PlayersList (const gchar *glade_file, |
1209 | + guint rights) |
1210 | : Module (glade_file) |
1211 | { |
1212 | _rights = rights; |
1213 | @@ -494,8 +494,8 @@ |
1214 | } |
1215 | |
1216 | // -------------------------------------------------------------------------------- |
1217 | -void PlayersList::SetAttributeRight (gchar *name, |
1218 | - gboolean modifiable) |
1219 | +void PlayersList::SetAttributeRight (const gchar *name, |
1220 | + gboolean modifiable) |
1221 | { |
1222 | AttributeDesc *desc = AttributeDesc::GetDesc (name); |
1223 | |
1224 | |
1225 | === modified file 'sources/players_list.hpp' |
1226 | --- sources/players_list.hpp 2010-09-21 12:47:35 +0000 |
1227 | +++ sources/players_list.hpp 2011-01-21 08:07:55 +0000 |
1228 | @@ -40,8 +40,8 @@ |
1229 | |
1230 | typedef gboolean (*CustomFilter) (Player *player); |
1231 | |
1232 | - PlayersList (gchar *glade_file, |
1233 | - guint rights = SORTABLE | MODIFIABLE); |
1234 | + PlayersList (const gchar *glade_file, |
1235 | + guint rights = SORTABLE | MODIFIABLE); |
1236 | |
1237 | ~PlayersList (); |
1238 | |
1239 | @@ -59,8 +59,8 @@ |
1240 | |
1241 | void SetFilter (Filter *filter); |
1242 | |
1243 | - void SetAttributeRight (gchar *name, |
1244 | - gboolean modifiable); |
1245 | + void SetAttributeRight (const gchar *name, |
1246 | + gboolean modifiable); |
1247 | |
1248 | virtual void OnListChanged () {}; |
1249 | |
1250 | |
1251 | === modified file 'sources/pool.cpp' |
1252 | --- sources/pool.cpp 2010-12-29 20:11:22 +0000 |
1253 | +++ sources/pool.cpp 2011-01-21 08:07:55 +0000 |
1254 | @@ -838,14 +838,14 @@ |
1255 | } |
1256 | |
1257 | // -------------------------------------------------------------------------------- |
1258 | -void Pool::SetDisplayData (Player *player, |
1259 | - GooCanvas *on_canvas, |
1260 | - gchar *name, |
1261 | - void *value) |
1262 | +void Pool::SetDisplayData (Player *player, |
1263 | + GooCanvas *on_canvas, |
1264 | + const gchar *name, |
1265 | + void *value) |
1266 | { |
1267 | player->SetData (GetDataOwner (), name, value); |
1268 | |
1269 | - _display_data = g_slist_prepend (_display_data, name); |
1270 | + _display_data = g_slist_prepend (_display_data, (void *) name); |
1271 | } |
1272 | |
1273 | // -------------------------------------------------------------------------------- |
1274 | @@ -921,19 +921,19 @@ |
1275 | guint HS_B; |
1276 | Player::AttributeId attr_id ("", data_owner); |
1277 | |
1278 | - attr_id._name = "victories_ratio"; |
1279 | + attr_id._name = (gchar *) "victories_ratio"; |
1280 | ratio_A = (guint) A->GetAttribute (&attr_id)->GetValue (); |
1281 | ratio_B = (guint) B->GetAttribute (&attr_id)->GetValue (); |
1282 | |
1283 | - attr_id._name = "indice"; |
1284 | + attr_id._name = (gchar *) "indice"; |
1285 | average_A = (gint) A->GetAttribute (&attr_id)->GetValue (); |
1286 | average_B = (gint) B->GetAttribute (&attr_id)->GetValue (); |
1287 | |
1288 | - attr_id._name = "HS"; |
1289 | + attr_id._name = (gchar *) "HS"; |
1290 | HS_A = (guint) A->GetAttribute (&attr_id)->GetValue (); |
1291 | HS_B = (guint) B->GetAttribute (&attr_id)->GetValue (); |
1292 | |
1293 | - attr_id._name = "status"; |
1294 | + attr_id._name = (gchar *) "status"; |
1295 | attr_id._owner = main_data_owner; |
1296 | if (A->GetAttribute (&attr_id) && B->GetAttribute (&attr_id)) |
1297 | { |
1298 | @@ -1195,7 +1195,7 @@ |
1299 | |
1300 | // -------------------------------------------------------------------------------- |
1301 | void Pool::RefreshAttribute (Player *player, |
1302 | - gchar *name, |
1303 | + const gchar *name, |
1304 | guint value, |
1305 | CombinedOperation operation) |
1306 | { |
1307 | @@ -1293,7 +1293,7 @@ |
1308 | } |
1309 | } |
1310 | |
1311 | - attr_id._name = "victories_ratio"; |
1312 | + attr_id._name = (gchar *) "victories_ratio"; |
1313 | attr = player->GetAttribute (&attr_id); |
1314 | data = player->GetData (GetDataOwner (), "VictoriesRatioItem"); |
1315 | if (data) |
1316 | @@ -1318,7 +1318,7 @@ |
1317 | g_free (text); |
1318 | } |
1319 | |
1320 | - attr_id._name = "HS"; |
1321 | + attr_id._name = (gchar *) "HS"; |
1322 | attr = player->GetAttribute (&attr_id); |
1323 | data = player->GetData (GetDataOwner (), "HSItem"); |
1324 | if (data) |
1325 | @@ -1343,7 +1343,7 @@ |
1326 | g_free (text); |
1327 | } |
1328 | |
1329 | - attr_id._name = "indice"; |
1330 | + attr_id._name = (gchar *) "indice"; |
1331 | attr = player->GetAttribute (&attr_id); |
1332 | data = player->GetData (GetDataOwner (), "IndiceItem"); |
1333 | if (data) |
1334 | @@ -1452,7 +1452,7 @@ |
1335 | xmlTextWriterWriteFormatAttribute (xml_writer, |
1336 | BAD_CAST "NbMatches", |
1337 | "%d", GetNbPlayers ()-1); |
1338 | - attr_id._name = "HS"; |
1339 | + attr_id._name = (gchar *) "HS"; |
1340 | attr = player->GetAttribute (&attr_id); |
1341 | if (attr) |
1342 | { |
1343 | @@ -1460,7 +1460,7 @@ |
1344 | xmlTextWriterWriteFormatAttribute (xml_writer, |
1345 | BAD_CAST "TD", |
1346 | "%d", HS); |
1347 | - attr_id._name = "indice"; |
1348 | + attr_id._name = (gchar *) "indice"; |
1349 | indice = (guint) player->GetAttribute (&attr_id)->GetValue (); |
1350 | xmlTextWriterWriteFormatAttribute (xml_writer, |
1351 | BAD_CAST "TR", |
1352 | |
1353 | === modified file 'sources/pool.hpp' |
1354 | --- sources/pool.hpp 2010-12-09 21:33:26 +0000 |
1355 | +++ sources/pool.hpp 2011-01-21 08:07:55 +0000 |
1356 | @@ -130,10 +130,10 @@ |
1357 | |
1358 | void OnUnPlugged (); |
1359 | |
1360 | - void SetDisplayData (Player *player, |
1361 | - GooCanvas *on_canvas, |
1362 | - gchar *name, |
1363 | - void *value); |
1364 | + void SetDisplayData (Player *player, |
1365 | + GooCanvas *on_canvas, |
1366 | + const gchar *name, |
1367 | + void *value); |
1368 | |
1369 | void Draw (GooCanvas *on_canvas, |
1370 | gboolean print_for_referees); |
1371 | @@ -151,7 +151,7 @@ |
1372 | void RefreshDashBoard (); |
1373 | |
1374 | void RefreshAttribute (Player *player, |
1375 | - gchar *name, |
1376 | + const gchar *name, |
1377 | guint value, |
1378 | CombinedOperation operation); |
1379 | |
1380 | |
1381 | === modified file 'sources/pool_allocator.cpp' |
1382 | --- sources/pool_allocator.cpp 2010-12-14 13:21:36 +0000 |
1383 | +++ sources/pool_allocator.cpp 2011-01-21 08:07:55 +0000 |
1384 | @@ -1107,18 +1107,19 @@ |
1385 | || ( _selected_config->has_two_size |
1386 | && ((pool_size == _selected_config->size)) || (pool_size == _selected_config->size + 1))) |
1387 | { |
1388 | - icon_name = GTK_STOCK_APPLY; |
1389 | + icon_name = g_strdup (GTK_STOCK_APPLY); |
1390 | pool->SetData (this, "is_balanced", (void *) 1); |
1391 | } |
1392 | else |
1393 | { |
1394 | - icon_name = GTK_STOCK_DIALOG_WARNING; |
1395 | + icon_name = g_strdup (GTK_STOCK_DIALOG_WARNING); |
1396 | pool->SetData (this, "is_balanced", 0); |
1397 | } |
1398 | |
1399 | Canvas::PutStockIconInTable (name_table, |
1400 | icon_name, |
1401 | 0, 0); |
1402 | + g_free (icon_name); |
1403 | } |
1404 | |
1405 | // Name |
1406 | |
1407 | === modified file 'sources/score_collector.cpp' |
1408 | --- sources/score_collector.cpp 2010-11-30 21:45:57 +0000 |
1409 | +++ sources/score_collector.cpp 2011-01-21 08:07:55 +0000 |
1410 | @@ -540,8 +540,8 @@ |
1411 | } |
1412 | |
1413 | // -------------------------------------------------------------------------------- |
1414 | -void ScoreCollector::SetConsistentColors (gchar *normal_color, |
1415 | - gchar *focus_color) |
1416 | +void ScoreCollector::SetConsistentColors (const gchar *normal_color, |
1417 | + const gchar *focus_color) |
1418 | { |
1419 | g_free (_consistent_normal_color); |
1420 | _consistent_normal_color = g_strdup (normal_color); |
1421 | |
1422 | === modified file 'sources/score_collector.hpp' |
1423 | --- sources/score_collector.hpp 2010-04-18 21:11:47 +0000 |
1424 | +++ sources/score_collector.hpp 2011-01-21 08:07:55 +0000 |
1425 | @@ -61,8 +61,8 @@ |
1426 | void SetNextCollectingPoint (GooCanvasItem *to, |
1427 | GooCanvasItem *next); |
1428 | |
1429 | - void SetConsistentColors (gchar *normal_color, |
1430 | - gchar *focus_color); |
1431 | + void SetConsistentColors (const gchar *normal_color, |
1432 | + const gchar *focus_color); |
1433 | |
1434 | void SetUnConsistentColors (gchar *normal_color, |
1435 | gchar *focus_colorg); |
1436 | |
1437 | === modified file 'sources/stage.hpp' |
1438 | --- sources/stage.hpp 2010-11-17 11:21:48 +0000 |
1439 | +++ sources/stage.hpp 2011-01-21 08:07:55 +0000 |
1440 | @@ -125,7 +125,7 @@ |
1441 | virtual void Load (xmlNode *xml_node); |
1442 | |
1443 | virtual void Load (xmlXPathContext *xml_context, |
1444 | - gchar *from_node) {}; |
1445 | + const gchar *from_node) {}; |
1446 | |
1447 | virtual void Save (xmlTextWriter *xml_writer) {}; |
1448 | |
1449 | |
1450 | === modified file 'sources/table.cpp' |
1451 | --- sources/table.cpp 2010-12-29 07:36:17 +0000 |
1452 | +++ sources/table.cpp 2011-01-21 08:07:55 +0000 |
1453 | @@ -29,6 +29,7 @@ |
1454 | |
1455 | const gchar *Table::_class_name = N_("Table"); |
1456 | const gchar *Table::_xml_class_name = "PhaseDeTableaux"; |
1457 | +const gdouble Table::_score_rect_size = 30.0; |
1458 | const gdouble Table::_level_spacing = 10.0; |
1459 | |
1460 | typedef enum |
1461 | @@ -246,7 +247,7 @@ |
1462 | } |
1463 | |
1464 | // -------------------------------------------------------------------------------- |
1465 | -GooCanvasItem *Table::GetQuickScore (gchar *container) |
1466 | +GooCanvasItem *Table::GetQuickScore (const gchar *container) |
1467 | { |
1468 | GtkWidget *view_port = _glade->GetWidget (container); |
1469 | GooCanvas *canvas = GOO_CANVAS (goo_canvas_new ()); |
1470 | @@ -317,15 +318,15 @@ |
1471 | |
1472 | if (_level_status[i]._has_error) |
1473 | { |
1474 | - icon = GTK_STOCK_DIALOG_WARNING; |
1475 | + icon = g_strdup (GTK_STOCK_DIALOG_WARNING); |
1476 | } |
1477 | else if (_level_status[i]._is_over == TRUE) |
1478 | { |
1479 | - icon = GTK_STOCK_APPLY; |
1480 | + icon = g_strdup (GTK_STOCK_APPLY); |
1481 | } |
1482 | else |
1483 | { |
1484 | - icon = GTK_STOCK_EXECUTE; |
1485 | + icon = g_strdup (GTK_STOCK_EXECUTE); |
1486 | } |
1487 | |
1488 | _level_status[i]._status_item = Canvas::PutStockIconInTable (_level_status[i-nb_missing_level]._level_header, |
1489 | @@ -339,6 +340,7 @@ |
1490 | gtk_list_store_set (_from_table_liststore, &iter, |
1491 | FROM_STATUS_COLUMN, icon, |
1492 | -1); |
1493 | + g_free (icon); |
1494 | } |
1495 | } |
1496 | SignalStatusUpdate (); |
1497 | @@ -954,7 +956,7 @@ |
1498 | |
1499 | if (parent_data->_match->IsDropped () == FALSE) |
1500 | { |
1501 | - text = "Q"; |
1502 | + text = (gchar *) "Q"; |
1503 | } |
1504 | else |
1505 | { |
1506 | |
1507 | === modified file 'sources/table.hpp' |
1508 | --- sources/table.hpp 2010-12-19 17:35:40 +0000 |
1509 | +++ sources/table.hpp 2011-01-21 08:07:55 +0000 |
1510 | @@ -60,7 +60,7 @@ |
1511 | gint page_nr); |
1512 | |
1513 | private: |
1514 | - static const gdouble _score_rect_size = 30.0; |
1515 | + static const gdouble _score_rect_size; |
1516 | |
1517 | struct LevelStatus |
1518 | { |
1519 | @@ -110,7 +110,7 @@ |
1520 | guint _print_nb_y_pages; |
1521 | GData *_match_list; |
1522 | |
1523 | - GooCanvasItem *GetQuickScore (gchar *container); |
1524 | + GooCanvasItem *GetQuickScore (const gchar *container); |
1525 | |
1526 | void Display (); |
1527 |