Commit a3bb7972 authored by Hans de Goede's avatar Hans de Goede Committed by Bruno Coudoin

Fixed code to compile with the -Werror=unused-but-set-variable gcc new compilation flag.

parent 926699e0
......@@ -280,7 +280,6 @@ static GooCanvasItem *colors_create_item(GooCanvasItem *parent)
{
GdkPixbuf *pixmap;
char *str = NULL;
int i;
boardRootItem = goo_canvas_group_new (goo_canvas_get_root_item(gcomprisBoard->canvas),
NULL);
......@@ -303,7 +302,6 @@ static GooCanvasItem *colors_create_item(GooCanvasItem *parent)
g_object_set (highlight_image_item,
"visibility", GOO_CANVAS_ITEM_INVISIBLE,
NULL);
i = g_random_int_range(0,LAST_COLOR);
gdk_pixbuf_unref(pixmap);
......
......@@ -712,14 +712,11 @@ static void set_focus_item(ToBeFoundItem *toBeFoundItem, gboolean status)
static gboolean solution_found()
{
ToBeFoundItem *firstToBeFoundItem = currentToBeFoundItem;
ToBeFoundItem *toBeFoundItem;
/* Go to the leftmost digit */
while(firstToBeFoundItem->previous!=NULL)
firstToBeFoundItem = firstToBeFoundItem->previous;
toBeFoundItem = firstToBeFoundItem;
/* Check the numbers one by one */
while(firstToBeFoundItem != NULL)
{
......
......@@ -715,7 +715,7 @@ updateNbBeans (int alpha)
{
char buffer[3]; //Manipulation chaines de caracteres
int i, j, k, idxTabBeans = 0; //Compteur Boucle Manipulation Elements graphiques
int i, j, idxTabBeans = 0; //Compteur Boucle Manipulation Elements graphiques
static short int nbActiveBean = NBTOTALBEAN; //nbre graine restant sur plateau
static short int nbOldActiveBean; //nbre graine restant sur plateau au tour precedent
BEANHOLE_LINK *ptBeansHoleLink = NULL; //pointeur sur structures stockant les item graines et la case dans laquelle elles se trouvent.
......@@ -774,9 +774,6 @@ updateNbBeans (int alpha)
j < staticAwale->board[i] && idxTabBeans < nbActiveBean;
j++, idxTabBeans++)
{
k = 0 + g_random_int() % 4;
g_object_set (ptBeansHoleLink[idxTabBeans].beanPixbuf,
"x", (double) caseCoord[i] +
g_random_int() % 50,
......
......@@ -1928,7 +1928,7 @@ config_start(GcomprisBoard *agcomprisBoard,
else
drag_previous = 0;
gc_board_config_combo_drag(bconf, drag_mode);
gc_board_config_combo_drag(bconf, drag_previous);
}
......
......@@ -4452,7 +4452,6 @@ _wrap_goo_canvas_item_get_requested_area(PyGObject *self,
PyObject *kwargs)
{
static char *kwlist[] = { "cr", NULL };
int ret;
GooCanvasBounds bounds;
PycairoContext *cr;
......@@ -4461,7 +4460,7 @@ _wrap_goo_canvas_item_get_requested_area(PyGObject *self,
kwlist, &PycairoContext_Type, &cr))
return NULL;
ret = goo_canvas_item_get_requested_area(GOO_CANVAS_ITEM(self->obj),
goo_canvas_item_get_requested_area(GOO_CANVAS_ITEM(self->obj),
cr->ctx, &bounds);
return pygoo_canvas_bounds_new(&bounds);
......
......@@ -384,8 +384,7 @@ static PyMethodDef PythonGcomprisAdminModule[] = {
void python_gcompris_admin_module_init(void)
{
PyObject* module;
module = Py_InitModule("_gcompris_admin", PythonGcomprisAdminModule);
Py_InitModule("_gcompris_admin", PythonGcomprisAdminModule);
}
/* Some usefull code parts ... */
......
......@@ -194,8 +194,7 @@ static PyMethodDef PythonGcomprisSkinModule[] = {
void python_gc_skin_module_init(void)
{
PyObject* module;
module = Py_InitModule("_gcompris_skin", PythonGcomprisSkinModule);
Py_InitModule("_gcompris_skin", PythonGcomprisSkinModule);
}
/* Some usefull code parts ... */
......
......@@ -440,8 +440,7 @@ static PyMethodDef PythonGcomprisUtilsModule[] = {
void python_gcompris_utils_module_init(void)
{
PyObject* module;
module = Py_InitModule("_gcompris_utils", PythonGcomprisUtilsModule);
Py_InitModule("_gcompris_utils", PythonGcomprisUtilsModule);
}
/* Some usefull code parts ... */
......
......@@ -529,10 +529,6 @@ item_event(GooCanvasItem *item, GooCanvasItem *target,
GdkEvent *event, gpointer data)
{
int pos = GPOINTER_TO_INT(data);
double item_x, item_y;
item_x = event->button.x;
item_y = event->button.y;
//goo_canvas_convert_to_item_space(item->parent, &item_x, &item_y);
if(board_paused)
return FALSE;
......
......@@ -379,7 +379,6 @@ static void display_second(guint second)
static void
clockgame_create_item(GooCanvasItem *parent)
{
GooCanvasItem *item;
double needle_size = clock_size;
double min_point_size = clock_size*0.05;
double hour_point_size = clock_size*0.1;
......@@ -421,7 +420,7 @@ clockgame_create_item(GooCanvasItem *parent)
canvasPoints->coords[2]=cx + needle_size * sin(ang);
canvasPoints->coords[3]=cy - needle_size * cos(ang);
item = goo_canvas_polyline_new (boardRootItem, FALSE, 2,
goo_canvas_polyline_new (boardRootItem, FALSE, 2,
canvasPoints->coords[0],
canvasPoints->coords[1],
canvasPoints->coords[2],
......@@ -434,7 +433,7 @@ clockgame_create_item(GooCanvasItem *parent)
if(gcomprisBoard->level<5)
{
mtext = g_strdup_printf("%d", min);
item = goo_canvas_text_new (boardRootItem,
goo_canvas_text_new (boardRootItem,
mtext,
(double) cx + (needle_size+10) * sin(ang),
(double) cy - (needle_size+10) * cos(ang),
......@@ -451,7 +450,7 @@ clockgame_create_item(GooCanvasItem *parent)
if(min%5==0)
{
mtext = g_strdup_printf( "%d", min/5);
item = goo_canvas_text_new (boardRootItem,
goo_canvas_text_new (boardRootItem,
mtext,
(double) cx + (needle_size-30) * sin(ang),
(double) cy - (needle_size-30) * cos(ang),
......
......@@ -581,7 +581,6 @@ static void draw_redhands() {
// Draw the drak frame (horizontal and vertical lines) that helps positionning elements
static void draw_frame(int x, int y) {
GooCanvasItem *item_frame = NULL;
int i;
GooCanvasPoints *track;
......@@ -594,7 +593,7 @@ static void draw_frame(int x, int y) {
track->coords[2] = x + i * CRANE_FRAME_CELL;
track->coords[3] = y + (CRANE_FRAME_LINE * CRANE_FRAME_CELL) - CRANE_FRAME_BORDER;
item_frame = goo_canvas_polyline_new (boardRootItem, FALSE, 0,
goo_canvas_polyline_new (boardRootItem, FALSE, 0,
"points", track,
"fill-color", "black",
NULL);
......@@ -607,7 +606,7 @@ static void draw_frame(int x, int y) {
track->coords[2] = x + (CRANE_FRAME_COLUMN * CRANE_FRAME_CELL) - CRANE_FRAME_BORDER;
track->coords[3] = y + (i * CRANE_FRAME_CELL);
item_frame = goo_canvas_polyline_new (boardRootItem, FALSE, 0,
goo_canvas_polyline_new (boardRootItem, FALSE, 0,
"points", track,
"fill-color", "black",
NULL);
......
......@@ -342,13 +342,12 @@ piece_event (GooCanvasItem *item,
{
GooCanvasItem **board;
GooCanvasItem *text;
int num, pos, newpos;
int pos, newpos;
int x, y;
double dx = 0.0, dy = 0.0;
int move;
board = g_object_get_data (G_OBJECT (goo_canvas_item_get_parent(item)), "board");
num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "piece_num"));
pos = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "piece_pos"));
text = g_object_get_data (G_OBJECT (item), "text");
......
......@@ -41,7 +41,6 @@ void gc_about_start ()
{
GdkPixbuf *pixmap = NULL;
gdouble y_start = 0;
gdouble x_start = 0;
gint y = 0;
GooCanvasItem *item;
......@@ -75,7 +74,6 @@ void gc_about_start ()
GooCanvasBounds bounds;
goo_canvas_item_get_bounds(item, &bounds);
x_start = bounds.x1;
y_start = bounds.y1;
y = bounds.y2 - 26;
......
......@@ -151,14 +151,9 @@ static void
bar_start (GooCanvas *theCanvas)
{
GcomprisProperties *properties = gc_prop_get();
gint16 height;
gint16 buttony;
double zoom;
RsvgHandle *svg_handle;
GooCanvasBounds bounds;
height = BARHEIGHT-2;
_default_y = BOARDHEIGHT - BARHEIGHT;
_default_zoom = 1.0;
......@@ -174,10 +169,6 @@ bar_start (GooCanvas *theCanvas)
NULL);
SET_ITEM_LOCATION(bar_item, 0, 0);
goo_canvas_item_get_bounds(bar_item, &bounds);
zoom = (double)(height-BAR_GAP)/(bounds.y2 - bounds.y1);
buttony = (height-(bounds.y2 - bounds.y1)*zoom)/2 - 20;
/*
* The Order in which buttons are created represents
* also the order in which they will be displayed
......
......@@ -47,9 +47,6 @@ void gc_dialog_close() {
*/
void gc_dialog(gchar *str, DialogBoxCallBack dbcb)
{
gint y_start;
gint x_start;
g_warning("Dialog=%s\n", str);
/* If we are already running do nothing */
......@@ -82,8 +79,6 @@ void gc_dialog(gchar *str, DialogBoxCallBack dbcb)
GooCanvasBounds bounds;
goo_canvas_item_get_bounds(itemDialogText, &bounds);
x_start = bounds.x1;
y_start = bounds.y1;
goo_canvas_text_new (rootDialogItem,
str,
......
......@@ -161,8 +161,6 @@ display_file_selector(int the_mode,
FileSelectorCallBack iscb,
void *user_context)
{
GooCanvasItem *item;
gchar *name = NULL;
gchar *full_rootdir;
mode = the_mode;
......@@ -179,13 +177,12 @@ display_file_selector(int the_mode,
gc_board_pause(TRUE);
name = gcomprisBoard->name;
fileSelectorCallBack=iscb;
rootitem = goo_canvas_group_new (goo_canvas_get_root_item(gc_get_canvas()),
NULL);
item = goo_canvas_svg_new (rootitem,
goo_canvas_svg_new (rootitem,
gc_skin_rsvg_get(),
"svg-id", "#FILE_SELECTOR",
"pointer-events", GOO_CANVAS_EVENTS_NONE,
......@@ -197,7 +194,7 @@ display_file_selector(int the_mode,
if(mode==MODE_SAVE)
gtk_entry_set_max_length(GTK_ENTRY(widget_entry), 30);
item = goo_canvas_widget_new (rootitem,
goo_canvas_widget_new (rootitem,
GTK_WIDGET(widget_entry),
control_area_x1,
control_area_y1,
......@@ -281,7 +278,6 @@ static void
display_files(GooCanvasItem *root_item, gchar *rootdir)
{
GooCanvasItem *item;
double iw, ih;
const gchar *one_dirent;
GDir *dir;
......@@ -383,10 +379,6 @@ display_files(GooCanvasItem *root_item, gchar *rootdir)
gc_skin_get_color("gcompris/fileselectcol"),
NULL);
iw = IMAGE_WIDTH;
ih = IMAGE_HEIGHT;
/* Insert all files in a sorted list */
while((one_dirent = g_dir_read_name(dir)) != NULL)
......@@ -673,11 +665,5 @@ item_event_file_selector (GooCanvasItem *item,
static void entry_enter_callback( GtkWidget *widget,
GtkWidget *entry )
{
gchar *entry_text;
if(!rootitem)
return;
entry_text = (char *)gtk_entry_get_text(GTK_ENTRY(entry));
}
......@@ -289,7 +289,6 @@ void gc_item_focus_init(GooCanvasItem *source_item,
{
GooCanvasItem *highlight_item;
GooCanvasBounds bounds;
gboolean already_created = FALSE;
if(!target_item)
target_item = source_item;
......@@ -306,7 +305,6 @@ void gc_item_focus_init(GooCanvasItem *source_item,
if(highlight_item)
{
already_created = TRUE;
goo_canvas_item_remove(highlight_item);
}
......@@ -440,7 +438,6 @@ gc_item_rotate_relative(GooCanvasItem *item, double angle)
{
double x1, x2, y1, y2;
double tx1, tx2, ty1, ty2;
double cx, cy;
// goo_canvas_item_get_bounds( item, &x1, &y1, &x2, &y2 );
/* WARNING: Do not use goo_canvas_item_get_bounds which gives unpredictable results */
......@@ -478,10 +475,6 @@ gc_item_rotate_relative(GooCanvasItem *item, double angle)
x2 = MAX(tx1,tx2);
y2 = MAX(ty1,ty2);
cx = (x2+x1)/2;
cy = (y2+y1)/2;
goo_canvas_item_rotate(item, angle,
x1+(x2-x1)/2,
y1+(y2-y1)/2);
......
......@@ -153,8 +153,6 @@ display_confirm(gchar *title,
gchar *no_text,
ConfirmCallBack iscb) {
GooCanvasItem *item;
if(rootitem)
return;
......@@ -188,7 +186,7 @@ display_confirm(gchar *title,
rootitem = goo_canvas_group_new (goo_canvas_get_root_item(gc_get_canvas()),
NULL);
item = goo_canvas_svg_new (rootitem,
goo_canvas_svg_new (rootitem,
gc_skin_rsvg_get(),
"svg-id", "#DIALOG",
"pointer-events", GOO_CANVAS_EVENTS_NONE,
......
......@@ -108,7 +108,6 @@ gc_selector_images_start (GcomprisBoard *gcomprisBoard, gchar *dataset,
void *user_context)
{
GooCanvasItem *item;
gint y_start = 0;
gchar *dataseturl = NULL;
......@@ -129,7 +128,7 @@ gc_selector_images_start (GcomprisBoard *gcomprisBoard, gchar *dataset,
images_selector_displayed = TRUE;
item = goo_canvas_svg_new (rootitem,
goo_canvas_svg_new (rootitem,
gc_skin_rsvg_get(),
"svg-id", "#IMAGE_SELECTOR",
"pointer-events", GOO_CANVAS_EVENTS_NONE,
......
......@@ -477,9 +477,6 @@ void
gc_skin_get_gdkcolor_default(gchar* id, guint32 def, GdkColor *gdkcolor)
{
gchar *tmp;
guint32 color;
color = gc_skin_get_color_default(id, def);
tmp = g_strdup_printf("#%06X", gc_skin_get_color(id) >> 8);
gdk_color_parse(tmp, gdkcolor);
......
......@@ -69,8 +69,6 @@ GcomprisWordlist
GcomprisWordlist *wordlist;
xmlChar *text;
GSList *words = NULL;
if (!format)
return NULL;
......@@ -161,7 +159,6 @@ GcomprisWordlist
node = wlNode->children;
while((node!=NULL)) {
words = NULL;
if (node->type!=XML_ELEMENT_NODE){
node = node->next;
continue;
......
......@@ -172,12 +172,10 @@ goo_canvas_group_new (GooCanvasItem *parent,
...)
{
GooCanvasItem *item;
GooCanvasGroup *group;
va_list var_args;
const char *first_property;
item = g_object_new (GOO_TYPE_CANVAS_GROUP, NULL);
group = (GooCanvasGroup*) item;
va_start (var_args, parent);
first_property = va_arg (var_args, char*);
......@@ -894,12 +892,10 @@ goo_canvas_group_model_new (GooCanvasItemModel *parent,
...)
{
GooCanvasItemModel *model;
GooCanvasGroupModel *gmodel;
va_list var_args;
const char *first_property;
model = g_object_new (GOO_TYPE_CANVAS_GROUP_MODEL, NULL);
gmodel = (GooCanvasGroupModel*) model;
va_start (var_args, parent);
first_property = va_arg (var_args, char*);
......
......@@ -437,7 +437,6 @@ static void game_won() {
// Draw a frame with empty small squares
static void draw_frame(frame *my_frame) {
GooCanvasItem *item_frame = NULL;
int i, j;
double x = my_frame->coord_x;
double y = my_frame->coord_y;
......@@ -460,7 +459,7 @@ static void draw_frame(frame *my_frame) {
track->coords[8] = x + (j * (ITEM_SIZE + SPACE_BETWEEN_ITEMS));
track->coords[9] = y + (i * (ITEM_SIZE + SPACE_BETWEEN_ITEMS));
item_frame = goo_canvas_polyline_new (boardRootItem, FALSE, 0,
goo_canvas_polyline_new (boardRootItem, FALSE, 0,
"points", track,
"line-width", 1.0,
"fill-color", "#948d85",
......@@ -476,7 +475,6 @@ static void draw_frame(frame *my_frame) {
// Draw the table (line)
static void draw_table() {
GooCanvasItem *item_frame = NULL;
GooCanvasPoints *track;
track = goo_canvas_points_new(2);
......@@ -486,7 +484,7 @@ static void draw_table() {
track->coords[2] = MH_HAT_X + MH_HAT_WIDTH;
track->coords[3] = MH_HAT_Y + MH_HAT_HEIGHT + 5;
item_frame = goo_canvas_polyline_new (boardRootItem, FALSE, 0,
goo_canvas_polyline_new (boardRootItem, FALSE, 0,
"points", track,
"line-width", 1.0,
"fill-color", "black",
......
......@@ -139,11 +139,13 @@ finalize (GtkObject *object)
static void
class_init (Money_WidgetClass *class)
{
#if 0
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) class;
//2 object_class->destroy = finalize;
object_class->destroy = finalize;
#endif
}
static void
......
......@@ -921,7 +921,6 @@ static void
scale_next_level()
{
GdkPixbuf *pixmap, *pixmap2;
GooCanvasItem *item, *balance;
gdouble balance_x;
gc_bar_set_level(gcomprisBoard);
......@@ -949,7 +948,7 @@ scale_next_level()
NULL);
gdk_pixbuf_unref(pixmap2);
balance = goo_canvas_image_new(boardRootItem,
goo_canvas_image_new(boardRootItem,
pixmap,
balance_x,
balance_left_y,
......@@ -978,7 +977,7 @@ scale_next_level()
pixmap = gc_pixmap_load("scale/plateau.png");
item = goo_canvas_image_new(group_g,
goo_canvas_image_new(group_g,
pixmap,
0,
PLATE_Y,
......@@ -994,7 +993,7 @@ scale_next_level()
pixmap = gc_pixmap_load("scale/plateau.png");
pixmap2 = gdk_pixbuf_flip(pixmap, TRUE);
item = goo_canvas_image_new(group_d,
goo_canvas_image_new(group_d,
pixmap2,
0,
PLATE_Y,
......@@ -1179,7 +1178,7 @@ config_start(GcomprisBoard *agcomprisBoard,
else
drag_previous = 0;
gc_board_config_combo_drag(bconf, drag_mode);
gc_board_config_combo_drag(bconf, drag_previous);
}
......
......@@ -1770,7 +1770,6 @@ void spesavefig (void){
void taninitstart(void){
int i;
char* accurstr;
for (i = PXSTART; i<PXNBR+PXSTART; i++){
tabpxnam[i] = NULL;
......@@ -1797,22 +1796,6 @@ void taninitstart(void){
create_mainwindow(boardRootItem);
switch (accuracy){
case 0:
accurstr = "maccuracy1";
break;
case 2:
accurstr = "maccuracy3";
break;
default :
accurstr = "maccuracy2";
}
if (rotstepnbr==TOUR/256)
accurstr = "mrotcont";
else
accurstr = "mrotstp";
tanloadfigtab(figfilename);
}
......
......@@ -610,12 +610,9 @@ on_button_release (GooCanvasItem *item,
GdkEventButton *event,
car *thiscar)
{
GooCanvas *canvas;
double item_x, item_y;
GdkCursor *cursor;
canvas = goo_canvas_item_get_canvas (item);
item_x = event->x;
item_y = event->y;
goo_canvas_convert_to_item_space(goo_canvas_item_get_canvas(item),
......
......@@ -613,7 +613,6 @@ static void wordsgame_destroy_all_items()
static GooCanvasItem *wordsgame_create_item(GooCanvasItem *parent)
{
GooCanvasItem *item2;
LettersItem *item;
gchar *word = gc_wordlist_random_word_get(gc_wordlist, gcomprisBoard->level);
GtkAnchorType direction_anchor = GTK_ANCHOR_NW;
......@@ -646,8 +645,7 @@ static GooCanvasItem *wordsgame_create_item(GooCanvasItem *parent)
/* To 'erase' words, I create 2 times the text item. One is empty now */
/* It will be filled each time the user enters the right key */
item2 = \
goo_canvas_text_new (item->rootitem,
goo_canvas_text_new (item->rootitem,
item->word,
(double) 0,
(double) 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment