File: implicit-declaration.patch

package info (click to toggle)
libsdl-perl 2.548-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,972 kB
  • sloc: perl: 13,985; ansic: 583; makefile: 35
file content (45 lines) | stat: -rw-r--r-- 1,198 bytes parent folder | download | duplicates (2)
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
From 90d7056288282df9febf04acce6712f4071e4103 Mon Sep 17 00:00:00 2001
From: Ryan Schmidt <git@ryandesign.com>
Date: Wed, 26 Jan 2022 02:55:04 -0600
Subject: [PATCH] Fix implicit declaration of _calc_offset

Origin: https://github.com/PerlGameDev/SDL/pull/299

---
 src/SDLx/Surface.xs | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Index: b/src/SDLx/Surface.xs
===================================================================
--- a/src/SDLx/Surface.xs
+++ b/src/SDLx/Surface.xs
@@ -16,6 +16,14 @@
 #include <SDL_gfxPrimitives.h>
 #endif
 
+int _calc_offset ( SDL_Surface* surface, int x, int y )
+{
+    int offset;
+    offset  = (surface->pitch * y) / surface->format->BytesPerPixel;
+    offset += x;
+    return offset;
+}
+
 SV * get_pixel32 (SDL_Surface *surface, int x, int y)
 {
     /* Convert the pixels to 32 bit  */
@@ -52,14 +60,6 @@
     return newRV_noinc((SV *)matrix);
 }
 
-int _calc_offset ( SDL_Surface* surface, int x, int y )
-{
-    int offset;
-    offset  = (surface->pitch * y) / surface->format->BytesPerPixel;
-    offset += x;
-    return offset;
-}
-
 unsigned int _get_pixel(SDL_Surface * surface, int offset)
 {
     unsigned int value;