aboutsummaryrefslogtreecommitdiff
path: root/crn/packages/patches/blackbox_c_warnings.patch
diff options
context:
space:
mode:
authorChristopher R. Nelson <christopher.nelson@languidnights.com>2025-07-20 13:42:01 -0400
committerChristopher R. Nelson <christopher.nelson@languidnights.com>2025-07-20 13:42:01 -0400
commitfa8310b6048e527e23b3ccd1fecf2d05c03d6aaf (patch)
treebcbff128f95fadf5da2a4093c709d6f56e4060ef /crn/packages/patches/blackbox_c_warnings.patch
parent26c6a378a0f4733a4d5d77624eac5cdb192c9a5e (diff)
add patch (courtesy of Adrian Bunk for debian) to allow black-box
Diffstat (limited to 'crn/packages/patches/blackbox_c_warnings.patch')
-rw-r--r--crn/packages/patches/blackbox_c_warnings.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/crn/packages/patches/blackbox_c_warnings.patch b/crn/packages/patches/blackbox_c_warnings.patch
new file mode 100644
index 0000000..2c57daa
--- /dev/null
+++ b/crn/packages/patches/blackbox_c_warnings.patch
@@ -0,0 +1,46 @@
+Description: Fix compiler warnings in blackbox.c
+Author: Adrian Bunk <bunk@debian.org>
+
+--- black-box-1.4.8.orig/src/blackbox.c
++++ black-box-1.4.8/src/blackbox.c
+@@ -27,6 +27,7 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <time.h>
+ #include <SDL.h>
+ #include <SDL_image.h>
+ #include <SDL_timer.h>
+@@ -553,6 +554,11 @@ void show_real()
+ SDL_UpdateRect(screen,0,0,0,0);
+ }
+
++static int abrand(int a,int b) //random number between a and b (inclusive)
++{
++ return(a+(rand() % (b-a+1)));
++}
++
+ void generate_field()
+ {
+ int x,y;
+@@ -852,11 +858,6 @@ void click()
+ this_turn_demo=0;
+ }
+
+-int abrand(int a,int b) //random number between a and b (inclusive)
+-{
+- return(a+(rand() % (b-a+1)));
+-}
+-
+ void get_click()
+ {
+ while ( SDL_WaitEvent(&event) >= 0 ) {
+@@ -895,7 +896,7 @@ void init_sound()
+ }
+ }
+
+-main(int argc, char *argv[])
++int main(int argc, char *argv[])
+ {
+ printf("\nBlack-Box version %s, Copyright (C) 2000-2008 Karl Bartel\n",VERSION);
+ printf("Black-Box comes with ABSOLUTELY NO WARRANTY; for details see COPYING'.\n");