From c703e1e5665335c9d598d9d6dc817313e3dd980c Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 20 Jan 2012 17:06:52 +0000 Subject: Don't return without value in non-void functions. Fix main to return int. --- games/xpipeman/distinfo | 5 ++- games/xpipeman/patches/patch-actions.c | 68 ++++++++++++++++++++++++++++++++++ games/xpipeman/patches/patch-ad | 34 +++++++++++++---- 3 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 games/xpipeman/patches/patch-actions.c (limited to 'games/xpipeman') diff --git a/games/xpipeman/distinfo b/games/xpipeman/distinfo index 6eb7ea5394f..d666ddbac36 100644 --- a/games/xpipeman/distinfo +++ b/games/xpipeman/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.5 2006/08/02 19:58:54 kristerw Exp $ +$NetBSD: distinfo,v 1.6 2012/01/20 17:06:52 joerg Exp $ SHA1 (xpipeman-1.5.tar.gz) = 065ec572f7be019737e2bb9ed131bc907c713cc5 RMD160 (xpipeman-1.5.tar.gz) = 9668409dadf70bf5bf4a546a3340846191937c74 @@ -6,6 +6,7 @@ Size (xpipeman-1.5.tar.gz) = 42990 bytes SHA1 (patch-aa) = a0b3eebec3488cc4201cebdd05297efd8ae79056 SHA1 (patch-ab) = 43bea8141e49a300402d435d4858ec61284efa52 SHA1 (patch-ac) = d0c388585988208e47b69dcaa1131870f74676a1 -SHA1 (patch-ad) = a97f685ab79b18d7717ccaf8771b34f645492434 +SHA1 (patch-actions.c) = a404f799157e49b0a756aa2adece2dac0c895acf +SHA1 (patch-ad) = a01454631c6664798e85fb7a1599ab61dff653e2 SHA1 (patch-ae) = 850a1d6d46df30303021d09b62879e0d7b3d960b SHA1 (patch-af) = fe20d1ef815c10a1130ac0bfeef5802dc9a8a1fe diff --git a/games/xpipeman/patches/patch-actions.c b/games/xpipeman/patches/patch-actions.c new file mode 100644 index 00000000000..cced2e3c5b8 --- /dev/null +++ b/games/xpipeman/patches/patch-actions.c @@ -0,0 +1,68 @@ +$NetBSD: patch-actions.c,v 1.1 2012/01/20 17:06:52 joerg Exp $ + +--- actions.c.orig 2012-01-20 13:52:23.000000000 +0000 ++++ actions.c +@@ -65,7 +65,7 @@ move_here_action(w,event,params,num_para + /* called to move a block to a specific place - does NOT place it */ + int tmp_block_x, tmp_block_y; + +- if((!game_active) || buttons_disabled) return; ++ if((!game_active) || buttons_disabled) return 0; + + tmp_block_x = coord_to_pos(event->x); + tmp_block_y = coord_to_pos(event->y); +@@ -84,6 +84,7 @@ move_here_action(w,event,params,num_para + show_movement(); + } + XFlush(display); ++ return 0; + } + + /*----------------------------------------------------------------------*/ +@@ -107,8 +108,9 @@ fast_flow_action(w,event,params,num_para + String *params; + Cardinal *num_params; + { +- if((!game_active) || buttons_disabled) return; ++ if((!game_active) || buttons_disabled) return 0; + speed_up_flow(); ++ return 0; + } + + /*----------------------------------------------------------------------*/ +@@ -131,7 +133,7 @@ move_action(w,event,params,num_params) + + tmp_num_params= *num_params; + +- if((!game_active) || buttons_disabled) return; ++ if((!game_active) || buttons_disabled) return 0; + + while((tmp_num_params)--) { + +@@ -156,6 +158,7 @@ move_action(w,event,params,num_params) + show_movement(); + } + XFlush(display); ++ return 0; + } + + +@@ -173,8 +176,9 @@ place_action(w,event,params,num_params) + */ + int diff_x, diff_y; + +- if((!game_active) || buttons_disabled) return; ++ if((!game_active) || buttons_disabled) return 0; + if (!place_block()) XBell(XtDisplay(w),100); ++ return 0; + } + + +@@ -186,6 +190,6 @@ pointer_moved(w, closure, event) + XPointerMovedEvent *event; + { + if(game_active) ; +- ++ return 0; + } + diff --git a/games/xpipeman/patches/patch-ad b/games/xpipeman/patches/patch-ad index f80850ca37d..da195417f42 100644 --- a/games/xpipeman/patches/patch-ad +++ b/games/xpipeman/patches/patch-ad @@ -1,8 +1,18 @@ -$NetBSD: patch-ad,v 1.2 1998/11/12 23:34:32 frueauf Exp $ +$NetBSD: patch-ad,v 1.3 2012/01/20 17:06:52 joerg Exp $ ---- main.c.orig Fri Sep 13 22:32:10 1991 -+++ main.c Mon Aug 17 00:20:12 1998 -@@ -138,9 +138,7 @@ +--- main.c.orig 1991-09-13 20:32:10.000000000 +0000 ++++ main.c +@@ -52,6 +52,9 @@ + #include + #endif + ++#include ++#include ++#include + + #include "xpipeman.h" + +@@ -138,9 +141,7 @@ static XtActionsRec actions[] = { {"do_nothing",(XtActionProc)do_nothing_action}, }; @@ -13,7 +23,7 @@ $NetBSD: patch-ad,v 1.2 1998/11/12 23:34:32 frueauf Exp $ static XrmOptionDescRec options[] = { {"-scorefile","scorefile",XrmoptionSepArg, NULL }, -@@ -148,13 +146,13 @@ +@@ -148,19 +149,20 @@ static XrmOptionDescRec options[] = { static XtResource application_resources[] = { {"foreground", "Foreground", XtRPixel, sizeof(Pixel), @@ -31,7 +41,15 @@ $NetBSD: patch-ad,v 1.2 1998/11/12 23:34:32 frueauf Exp $ }; /*----------------------------------------------------------------------*/ -@@ -177,7 +175,7 @@ + ++int + main(argc, argv) +- unsigned int argc; ++ int argc; + char **argv; + { + Arg args[1]; +@@ -177,7 +179,7 @@ main(argc, argv) XtAddActions(actions,XtNumber(actions)); @@ -40,7 +58,7 @@ $NetBSD: patch-ad,v 1.2 1998/11/12 23:34:32 frueauf Exp $ XtNumber(application_resources), NULL, 0 ); top_widget = XtCreateManagedWidget( -@@ -193,7 +191,7 @@ +@@ -193,7 +195,7 @@ main(argc, argv) arglistplayfield, XtNumber(arglistplayfield)); @@ -49,7 +67,7 @@ $NetBSD: patch-ad,v 1.2 1998/11/12 23:34:32 frueauf Exp $ quit_command = XtCreateManagedWidget( "quit_button", -@@ -263,12 +261,12 @@ +@@ -263,12 +265,12 @@ main(argc, argv) display = XtDisplay(playfield_widget); playfield = XtWindow(playfield_widget); -- cgit v1.2.3