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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544
|
Description: port to gcc 10
Solve multiple definitions
Author: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Bug-Debian: https://bugs.debian.org/957258
Last-Update: 2020-08-07
Index: gbatnav-1.0.4cvs20051004/gbnserver/gbnserver.c
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnserver/gbnserver.c
+++ gbatnav-1.0.4cvs20051004/gbnserver/gbnserver.c
@@ -45,7 +45,7 @@
#include "batnavggz.h"
#include "common.h"
-
+struct st_datos usuario;
/* algunos defines lindos del UNP second edition volume 1 */
#define LISTENQ 50
Index: gbatnav-1.0.4cvs20051004/gbnserver/server.h
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnserver/server.h
+++ gbatnav-1.0.4cvs20051004/gbnserver/server.h
@@ -34,7 +34,7 @@ enum {
C_LASTTOKEN
};
-struct st_datos usuario;
+extern struct st_datos usuario;
#define BATNAV_UDSOCKET "/tmp/batnav-socket"
Index: gbatnav-1.0.4cvs20051004/gbnserver/check_board.c
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnserver/check_board.c
+++ gbatnav-1.0.4cvs20051004/gbnserver/check_board.c
@@ -20,7 +20,7 @@
#include "protocol.h"
#include "server.h"
-struct st_datos usuario;
+extern struct st_datos usuario;
static gint
vacio( gint x, gint y, gint jugador )
Index: gbatnav-1.0.4cvs20051004/gbnrobot/robot_cliente.h
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnrobot/robot_cliente.h
+++ gbatnav-1.0.4cvs20051004/gbnrobot/robot_cliente.h
@@ -40,16 +40,16 @@ typedef struct cliente {
-CLIENTE cliente;
+extern CLIENTE cliente;
-GtkWidget *window;
-GtkWidget *box;
-GtkWidget *imagen;
-GtkWidget *label;
-GtkWidget *status_label;
+extern GtkWidget *window;
+extern GtkWidget *box;
+extern GtkWidget *imagen;
+extern GtkWidget *label;
+extern GtkWidget *status_label;
-gchar* pix;
+extern gchar* pix;
-GtkWidget *pbar;
+extern GtkWidget *pbar;
#endif
Index: gbatnav-1.0.4cvs20051004/gbnrobot/robot_proceso.c
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnrobot/robot_proceso.c
+++ gbatnav-1.0.4cvs20051004/gbnrobot/robot_proceso.c
@@ -30,6 +30,17 @@
#include "net.h"
#include "common.h"
+CLIENTE cliente;
+
+GtkWidget *window;
+GtkWidget *box;
+GtkWidget *imagen;
+GtkWidget *label;
+GtkWidget *status_label;
+
+gchar* pix;
+
+GtkWidget *pbar;
/* This describes all the arguments we understand. */
@@ -273,10 +284,10 @@ static void robot_numjug( char *str)
gtk_label_set_text(GTK_LABEL(label), buf);
}
}
-static void robot_ignore()
+static void robot_ignore(char *_unused)
{
}
-static void robot_killmyself()
+static void robot_killmyself(char *_unused)
{
bnwrite(cliente.sock,BN_EXIT);
@@ -287,12 +298,12 @@ static void robot_killmyself()
exit(1);
}
-static void robot_board_not_ok()
+static void robot_board_not_ok(char *_unused)
{
printf("gbnrobot: Robot: You sent an invalid board. Report this bug!\n");
- robot_killmyself();
+ robot_killmyself(NULL);
}
-static void robot_board_ok( void )
+static void robot_board_ok( char *_unused )
{
if(!cliente.with_nogui) {
gtk_label_set_text(GTK_LABEL(status_label), _("Ready"));
@@ -337,7 +348,7 @@ static void robot_discon( char *str )
x=atoi(str);
if( cliente.numjug==x ) {
/* printf("Robot %i: Me estan desconectando\n",x); */
- robot_killmyself();
+ robot_killmyself(NULL);
}
if(x>=0 || x < MAXPLAYER)
@@ -415,12 +426,12 @@ static void robot_lost( char *str)
que_usrfrom();
return;
}
-static void robot_ggz()
+static void robot_ggz(char *_unused)
{
bnwrite(cliente.sock,BN_NUMJUG);
}
-static void robot_win( int j, char *str)
+static void robot_win( char *str)
{
int a;
@@ -429,7 +440,7 @@ static void robot_win( int j, char *str)
return;
}
-static void robot_game_over( void )
+static void robot_game_over( char *_unused )
{
if(!cliente.with_nogui)
gtk_label_set_text(GTK_LABEL(status_label), _("Game Over"));
@@ -445,7 +456,7 @@ static int robot_lookup_funcion( PARSER
struct {
char *label;
- void (*func) ();
+ void (*func) (char *);
} tokens[] = {
{ BN_BOARD_NOT_OK, robot_board_not_ok },
{ BN_BOARD_OK, robot_board_ok },
@@ -509,7 +520,7 @@ static gboolean robot_proceso( GIOChanne
/* printf("ROBOT: Entrando a robot_proceso %i\n",sock); */
j=net_readline( sock, str,PROT_MAX_LEN );
if( j<1 ) {
- robot_killmyself();
+ robot_killmyself(NULL);
return FALSE;
}
@@ -571,7 +582,7 @@ char * load_pixmap_file( char *name )
static void on_exit_activate(GtkWidget *widget, gpointer data)
{
- robot_killmyself();
+ robot_killmyself(NULL);
}
Index: gbatnav-1.0.4cvs20051004/gbnclient/cliente.h
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnclient/cliente.h
+++ gbatnav-1.0.4cvs20051004/gbnclient/cliente.h
@@ -54,82 +54,84 @@ struct usuario {
int with_ggz; /* enable ggz mode */
int view_grid; /* show/hide the map grid */
-} usuario;
+};
-GSettings *settings;
+extern struct usuario usuario;
+
+extern GSettings *settings;
/* Variables - GTK */
/* contenedores */
-GtkWidget *window;
-GtkWidget *hbox;
-GtkWidget *vbox;
+extern GtkWidget *window;
+extern GtkWidget *hbox;
+extern GtkWidget *vbox;
/* left */
-GtkWidget *notebook_left;
-GtkWidget *label_left;
-GtkWidget *drawing_left;
-GtkWidget *hbox_text_help;
-GtkWidget *text_help;
-GtkWidget *vscrollbar_help;
+extern GtkWidget *notebook_left;
+extern GtkWidget *label_left;
+extern GtkWidget *drawing_left;
+extern GtkWidget *hbox_text_help;
+extern GtkWidget *text_help;
+extern GtkWidget *vscrollbar_help;
/* right */
-GtkWidget *notebook_right;
-GtkWidget *label_right_about;
-GtkWidget *drawing_right_about;
-GtkWidget *label_right[MAXPLAYER];
-GtkWidget *label_right2[MAXPLAYER];
-GtkWidget *drawing_right[MAXPLAYER];
+extern GtkWidget *notebook_right;
+extern GtkWidget *label_right_about;
+extern GtkWidget *drawing_right_about;
+extern GtkWidget *label_right[MAXPLAYER];
+extern GtkWidget *label_right2[MAXPLAYER];
+extern GtkWidget *drawing_right[MAXPLAYER];
/* otros */
-GtkWidget *hbox_text;
-GtkWidget *vscrollbar;
-GtkWidget *separator;
-GtkWidget *text;
+extern GtkWidget *hbox_text;
+extern GtkWidget *vscrollbar;
+extern GtkWidget *separator;
+extern GtkWidget *text;
/* Pixmaps */
-GdkPixbuf *barco1 ;
-GdkPixbuf *barco1_t ;
-GdkPixbuf *barco1_h ;
-GdkPixbuf *barco2h ;
-GdkPixbuf *barco2h_t ;
-GdkPixbuf *barco2h_h ;
-GdkPixbuf *barco2v ;
-GdkPixbuf *barco2v_t ;
-GdkPixbuf *barco2v_h ;
-GdkPixbuf *barco3h ;
-GdkPixbuf *barco3h_t ;
-GdkPixbuf *barco3h_h ;
-GdkPixbuf *barco3v ;
-GdkPixbuf *barco3v_t ;
-GdkPixbuf *barco3v_h ;
-GdkPixbuf *barco4h ;
-GdkPixbuf *barco4h_t ;
-GdkPixbuf *barco4h_h ;
-GdkPixbuf *barco4v ;
-GdkPixbuf *barco4v_t ;
-GdkPixbuf *barco4v_h ;
-
-GdkPixbuf *fondo ;
-GdkPixbuf *agua ;
-GdkPixbuf *about_pix ;
-GdkPixbuf *icono ;
-
-GtkWidget *hbox_status;
-GtkWidget *statusbar_left;
-GtkWidget *statusbar_right;
+extern GdkPixbuf *barco1 ;
+extern GdkPixbuf *barco1_t ;
+extern GdkPixbuf *barco1_h ;
+extern GdkPixbuf *barco2h ;
+extern GdkPixbuf *barco2h_t ;
+extern GdkPixbuf *barco2h_h ;
+extern GdkPixbuf *barco2v ;
+extern GdkPixbuf *barco2v_t ;
+extern GdkPixbuf *barco2v_h ;
+extern GdkPixbuf *barco3h ;
+extern GdkPixbuf *barco3h_t ;
+extern GdkPixbuf *barco3h_h ;
+extern GdkPixbuf *barco3v ;
+extern GdkPixbuf *barco3v_t ;
+extern GdkPixbuf *barco3v_h ;
+extern GdkPixbuf *barco4h ;
+extern GdkPixbuf *barco4h_t ;
+extern GdkPixbuf *barco4h_h ;
+extern GdkPixbuf *barco4v ;
+extern GdkPixbuf *barco4v_t ;
+extern GdkPixbuf *barco4v_h ;
+
+extern GdkPixbuf *fondo ;
+extern GdkPixbuf *agua ;
+extern GdkPixbuf *about_pix ;
+extern GdkPixbuf *icono ;
+
+extern GtkWidget *hbox_status;
+extern GtkWidget *statusbar_left;
+extern GtkWidget *statusbar_right;
/* Usadas por Configure */
-GtkWidget *conf_spinner_port;
-GtkWidget *conf_entry_server;
-GtkWidget *conf_entry_name;
-GtkWidget *conf_check_button;
-GtkWidget *conf_cb_ttyfill;
+extern GtkWidget *conf_spinner_port;
+extern GtkWidget *conf_entry_server;
+extern GtkWidget *conf_entry_name;
+extern GtkWidget *conf_check_button;
+extern GtkWidget *conf_cb_ttyfill;
/* Usadas por Sendmsg */
-GtkWidget *send_spinner_towho;
-GtkWidget *send_entry_message;
-GtkWidget *send_toggle_button;
+extern GtkWidget *send_spinner_towho;
+extern GtkWidget *send_entry_message;
+extern GtkWidget *send_toggle_button;
#endif /*__BN_CLIENTE__*/
Index: gbatnav-1.0.4cvs20051004/gbnclient/gbnclient.c
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnclient/gbnclient.c
+++ gbatnav-1.0.4cvs20051004/gbnclient/gbnclient.c
@@ -40,6 +40,64 @@
#include "version.h"
#include "g_connect.h"
+struct usuario usuario;
+GSettings *settings;
+GtkWidget *window;
+GtkWidget *hbox;
+GtkWidget *vbox;
+GtkWidget *notebook_left;
+GtkWidget *label_left;
+GtkWidget *drawing_left;
+GtkWidget *hbox_text_help;
+GtkWidget *text_help;
+GtkWidget *vscrollbar_help;
+GtkWidget *notebook_right;
+GtkWidget *label_right_about;
+GtkWidget *drawing_right_about;
+GtkWidget *label_right[MAXPLAYER];
+GtkWidget *label_right2[MAXPLAYER];
+GtkWidget *drawing_right[MAXPLAYER];
+GtkWidget *hbox_text;
+GtkWidget *vscrollbar;
+GtkWidget *separator;
+GtkWidget *text;
+GdkPixbuf *barco1 ;
+GdkPixbuf *barco1_t ;
+GdkPixbuf *barco1_h ;
+GdkPixbuf *barco2h ;
+GdkPixbuf *barco2h_t ;
+GdkPixbuf *barco2h_h ;
+GdkPixbuf *barco2v ;
+GdkPixbuf *barco2v_t ;
+GdkPixbuf *barco2v_h ;
+GdkPixbuf *barco3h ;
+GdkPixbuf *barco3h_t ;
+GdkPixbuf *barco3h_h ;
+GdkPixbuf *barco3v ;
+GdkPixbuf *barco3v_t ;
+GdkPixbuf *barco3v_h ;
+GdkPixbuf *barco4h ;
+GdkPixbuf *barco4h_t ;
+GdkPixbuf *barco4h_h ;
+GdkPixbuf *barco4v ;
+GdkPixbuf *barco4v_t ;
+GdkPixbuf *barco4v_h ;
+GdkPixbuf *fondo ;
+GdkPixbuf *agua ;
+GdkPixbuf *about_pix ;
+GdkPixbuf *icono ;
+GtkWidget *hbox_status;
+GtkWidget *statusbar_left;
+GtkWidget *statusbar_right;
+GtkWidget *conf_spinner_port;
+GtkWidget *conf_entry_server;
+GtkWidget *conf_entry_name;
+GtkWidget *conf_check_button;
+GtkWidget *conf_cb_ttyfill;
+GtkWidget *send_spinner_towho;
+GtkWidget *send_entry_message;
+GtkWidget *send_toggle_button;
+
/* This describes all the arguments we understand. */
static char *server_tmp;
Index: gbatnav-1.0.4cvs20051004/gbnserver/play.c
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnserver/play.c
+++ gbatnav-1.0.4cvs20051004/gbnserver/play.c
@@ -52,7 +52,7 @@ static int quejugador( int fd )
/************************************************************************
token_* funciones
*************************************************************************/
-static void token_numjug( int fd )
+static void token_numjug( int fd, char *_unused )
{
bnwrite(fd,
BN_REM":"BNVERSION" (c) 1995,2001 Ricardo Calixto Quesada\n"
@@ -228,7 +228,7 @@ static void token_read( int fd, char *st
bnwrite(fd,BN_READ"=-1,-1");
}
}
-static void token_status( int fd )
+static void token_status( int fd, char *_unused )
{
int i,j;
char outbuf[PROT_MAX_LEN]="";
@@ -251,7 +251,7 @@ static void token_status( int fd )
/* si fd==-1, es un mensaje directo del server */
/* it is a direct message of the server */
-void token_start( int fd )
+void token_start( int fd , char *_unused)
{
int i,j,r,cant;
char outbuf[PROT_MAX_LEN]="";
@@ -312,7 +312,7 @@ void token_start( int fd )
}
}
-void token_exit( int fd )
+void token_exit( int fd, char *_unused )
{
int i,j,k,temp;
int num_jug;
@@ -439,7 +439,7 @@ static void token_client_version( int fd
say_in_clist(j,C_CLIVER,str);
}
-static void token_server_version( int fd )
+static void token_server_version( int fd, char *_unused )
{
int j;
@@ -450,7 +450,7 @@ static void token_server_version( int fd
bnwrite(fd,BN_SER_VER"=%s",BATVER);
}
-static void token_help ( int fd )
+static void token_help ( int fd, char *_unused )
{
int j;
@@ -482,7 +482,7 @@ static int lookup_funcion( int fd,PARSER
struct {
char *label;
- void (*func) ();
+ void (*func) (int, char *);
} tokens[] =
{
{ BN_READ, token_read },
@@ -541,7 +541,7 @@ play_batnav( GIOChannel *src, GIOConditi
j=net_readline( fd, str, PROT_MAX_LEN );
if( j<1 ) {
- token_exit(fd);
+ token_exit(fd, NULL);
return FALSE;
}
Index: gbatnav-1.0.4cvs20051004/gbnclient/proceso.c
===================================================================
--- gbatnav-1.0.4cvs20051004.orig/gbnclient/proceso.c
+++ gbatnav-1.0.4cvs20051004/gbnclient/proceso.c
@@ -64,24 +64,24 @@ void poner_proximo_jugador( void )
token_*
*************************************************************/
-static void token_ggz()
+static void token_ggz(char *_unused)
{
bnwrite(usuario.sock,BN_NUMJUG);
}
-static void token_ignore()
+static void token_ignore(char *_unused)
{
}
-static void token_ser_full()
+static void token_ser_full(char *_unused)
{
textfill(0,_("Server is full. Try later"));
send_disconnect();
}
-static void token_sol()
+static void token_sol(char *_unused)
{
textfill(0,_("You can't play alone. Start a robot"));
}
-static void token_wait()
+static void token_wait(char *_unused)
{
textfill(0,_("People are playing. Try later"));
}
@@ -159,7 +159,7 @@ static void token_lost( char *str )
remove_page( j );
return;
}
-static void token_game_over()
+static void token_game_over(char *_unused)
{
int i,j;
@@ -429,11 +429,11 @@ static void token_start( char *str)
poner_proximo_jugador();
}
-static void token_board_not_ok( void )
+static void token_board_not_ok( char *_unused )
{
textfill(0,_("You sent an invalid board. Try with 'Random Board'"));
}
-static void token_board_ok( void )
+static void token_board_ok( char *_unused )
{
textfill(0,_("The board's OK. Press 'Start' and enjoy the game"));
usuario.play=BOARD;
@@ -462,7 +462,7 @@ static int lookup_funcion( int fd,PARSER
struct {
char *label;
- void (*func) ();
+ void (*func) (char *);
} tokens[] = {
{ BN_BOARD_NOT_OK, token_board_not_ok },
{ BN_BOARD_OK, token_board_ok },
|