Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
bc138163
Commit
bc138163
authored
Oct 13, 2011
by
Ryan C. Gordon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a whole slew of compiler warnings that -Wall exposed.
parent
cf1adee2
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
42 additions
and
68 deletions
+42
-68
SDL_cpuinfo.c
src/cpuinfo/SDL_cpuinfo.c
+3
-0
SDL_gesture.c
src/events/SDL_gesture.c
+2
-1
SDL_mouse.c
src/events/SDL_mouse.c
+0
-1
SDL_syspower.c
src/power/linux/SDL_syspower.c
+0
-8
SDL_render_gl.c
src/render/opengl/SDL_render_gl.c
+0
-2
SDL_blendline.c
src/render/software/SDL_blendline.c
+0
-4
SDL_draw.h
src/render/software/SDL_draw.h
+4
-4
SDL_syssem.c
src/thread/pthread/SDL_syssem.c
+1
-0
SDL_systhread.c
src/thread/pthread/SDL_systhread.c
+3
-0
SDL_x11events.c
src/video/x11/SDL_x11events.c
+6
-3
SDL_x11framebuffer.c
src/video/x11/SDL_x11framebuffer.c
+3
-0
SDL_x11mouse.c
src/video/x11/SDL_x11mouse.c
+1
-1
SDL_x11opengl.c
src/video/x11/SDL_x11opengl.c
+5
-3
SDL_x11shape.c
src/video/x11/SDL_x11shape.c
+1
-0
SDL_x11sym.h
src/video/x11/SDL_x11sym.h
+11
-11
SDL_x11touch.c
src/video/x11/SDL_x11touch.c
+1
-2
SDL_x11window.c
src/video/x11/SDL_x11window.c
+1
-28
No files found.
src/cpuinfo/SDL_cpuinfo.c
View file @
bc138163
...
...
@@ -384,6 +384,8 @@ SDL_GetCPUType(void)
return
SDL_CPUType
;
}
#ifdef TEST_MAIN
/* !!! FIXME: only used for test at the moment. */
static
const
char
*
SDL_GetCPUName
(
void
)
{
...
...
@@ -455,6 +457,7 @@ SDL_GetCPUName(void)
}
return
SDL_CPUName
;
}
#endif
int
SDL_GetCPUCacheLineSize
(
void
)
...
...
src/events/SDL_gesture.c
View file @
bc138163
...
...
@@ -390,10 +390,11 @@ int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) {
float
dollarRecognize
(
const
SDL_DollarPath
*
path
,
int
*
bestTempl
,
SDL_GestureTouch
*
touch
)
{
SDL_FloatPoint
points
[
DOLLARNPOINTS
];
int
numPoints
=
dollarNormalize
(
path
,
points
);
int
i
;
float
bestDiff
=
10000
;
dollarNormalize
(
path
,
points
);
//PrintPath(points);
*
bestTempl
=
-
1
;
for
(
i
=
0
;
i
<
touch
->
numDollarTemplates
;
i
++
)
{
...
...
src/events/SDL_mouse.c
View file @
bc138163
...
...
@@ -349,7 +349,6 @@ SDL_Cursor *
SDL_CreateCursor
(
const
Uint8
*
data
,
const
Uint8
*
mask
,
int
w
,
int
h
,
int
hot_x
,
int
hot_y
)
{
SDL_Mouse
*
mouse
=
SDL_GetMouse
();
SDL_Surface
*
surface
;
SDL_Cursor
*
cursor
;
int
x
,
y
;
...
...
src/power/linux/SDL_syspower.c
View file @
bc138163
...
...
@@ -128,7 +128,6 @@ check_proc_acpi_battery(const char * node, SDL_bool * have_battery,
char
*
val
=
NULL
;
SDL_bool
charge
=
SDL_FALSE
;
SDL_bool
choose
=
SDL_FALSE
;
SDL_bool
is_ac
=
SDL_FALSE
;
int
maximum
=
-
1
;
int
remaining
=
-
1
;
int
secs
=
-
1
;
...
...
@@ -214,13 +213,6 @@ check_proc_acpi_ac_adapter(const char * node, SDL_bool * have_ac)
char
*
ptr
=
NULL
;
char
*
key
=
NULL
;
char
*
val
=
NULL
;
SDL_bool
charge
=
SDL_FALSE
;
SDL_bool
choose
=
SDL_FALSE
;
SDL_bool
is_ac
=
SDL_FALSE
;
int
maximum
=
-
1
;
int
remaining
=
-
1
;
int
secs
=
-
1
;
int
pct
=
-
1
;
if
(
!
load_acpi_file
(
base
,
node
,
"state"
,
state
,
sizeof
(
state
)))
{
return
;
...
...
src/render/opengl/SDL_render_gl.c
View file @
bc138163
...
...
@@ -348,8 +348,6 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
static
void
GL_WindowEvent
(
SDL_Renderer
*
renderer
,
const
SDL_WindowEvent
*
event
)
{
GL_RenderData
*
data
=
(
GL_RenderData
*
)
renderer
->
driverdata
;
if
(
event
->
event
==
SDL_WINDOWEVENT_SIZE_CHANGED
)
{
/* Rebind the context to the window area and update matrices */
SDL_CurrentContext
=
NULL
;
...
...
src/render/software/SDL_blendline.c
View file @
bc138163
...
...
@@ -124,7 +124,6 @@ SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2,
SDL_BlendMode
blendMode
,
Uint8
_r
,
Uint8
_g
,
Uint8
_b
,
Uint8
_a
,
SDL_bool
draw_end
)
{
const
SDL_PixelFormat
*
fmt
=
dst
->
format
;
unsigned
r
,
g
,
b
,
a
,
inva
;
if
(
blendMode
==
SDL_BLENDMODE_BLEND
||
blendMode
==
SDL_BLENDMODE_ADD
)
{
...
...
@@ -216,7 +215,6 @@ SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2,
SDL_BlendMode
blendMode
,
Uint8
_r
,
Uint8
_g
,
Uint8
_b
,
Uint8
_a
,
SDL_bool
draw_end
)
{
const
SDL_PixelFormat
*
fmt
=
dst
->
format
;
unsigned
r
,
g
,
b
,
a
,
inva
;
if
(
blendMode
==
SDL_BLENDMODE_BLEND
||
blendMode
==
SDL_BLENDMODE_ADD
)
{
...
...
@@ -492,7 +490,6 @@ SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
SDL_BlendMode
blendMode
,
Uint8
_r
,
Uint8
_g
,
Uint8
_b
,
Uint8
_a
,
SDL_bool
draw_end
)
{
const
SDL_PixelFormat
*
fmt
=
dst
->
format
;
unsigned
r
,
g
,
b
,
a
,
inva
;
if
(
blendMode
==
SDL_BLENDMODE_BLEND
||
blendMode
==
SDL_BLENDMODE_ADD
)
{
...
...
@@ -584,7 +581,6 @@ SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
SDL_BlendMode
blendMode
,
Uint8
_r
,
Uint8
_g
,
Uint8
_b
,
Uint8
_a
,
SDL_bool
draw_end
)
{
const
SDL_PixelFormat
*
fmt
=
dst
->
format
;
unsigned
r
,
g
,
b
,
a
,
inva
;
if
(
blendMode
==
SDL_BLENDMODE_BLEND
||
blendMode
==
SDL_BLENDMODE_ADD
)
{
...
...
src/render/software/SDL_draw.h
View file @
bc138163
...
...
@@ -45,13 +45,13 @@
#define DRAW_SETPIXEL(setpixel) \
do { \
unsigned sr = r, sg = g, sb = b, sa = a; \
unsigned sr = r, sg = g, sb = b, sa = a;
(void) sa;
\
setpixel; \
} while (0)
#define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \
do { \
unsigned sr, sg, sb, sa; sa; \
unsigned sr, sg, sb, sa;
(void)
sa; \
getpixel; \
sr = DRAW_MUL(inva, sr) + r; \
sg = DRAW_MUL(inva, sg) + g; \
...
...
@@ -61,7 +61,7 @@ do { \
#define DRAW_SETPIXEL_ADD(getpixel, setpixel) \
do { \
unsigned sr, sg, sb, sa; sa; \
unsigned sr, sg, sb, sa;
(void)
sa; \
getpixel; \
sr += r; if (sr > 0xff) sr = 0xff; \
sg += g; if (sg > 0xff) sg = 0xff; \
...
...
@@ -71,7 +71,7 @@ do { \
#define DRAW_SETPIXEL_MOD(getpixel, setpixel) \
do { \
unsigned sr, sg, sb, sa; sa; \
unsigned sr, sg, sb, sa;
(void)
sa; \
getpixel; \
sr = DRAW_MUL(sr, r); \
sg = DRAW_MUL(sg, g); \
...
...
src/thread/pthread/SDL_syssem.c
View file @
bc138163
...
...
@@ -23,6 +23,7 @@
#include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <sys/time.h>
#include "SDL_thread.h"
#include "SDL_timer.h"
...
...
src/thread/pthread/SDL_systhread.c
View file @
bc138163
...
...
@@ -18,6 +18,7 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
#include <pthread.h>
...
...
@@ -31,6 +32,8 @@
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/syscall.h>
#include <unistd.h>
extern
int
pthread_setname_np
(
pthread_t
__target_thread
,
__const
char
*
__name
)
__THROW
__nonnull
((
2
));
#endif
#include "SDL_platform.h"
...
...
src/video/x11/SDL_x11events.c
View file @
bc138163
...
...
@@ -234,7 +234,6 @@ X11_DispatchEvent(_THIS)
case
KeyPress
:{
KeyCode
keycode
=
xevent
.
xkey
.
keycode
;
KeySym
keysym
=
NoSymbol
;
SDL_Scancode
scancode
;
char
text
[
SDL_TEXTINPUTEVENT_TEXT_SIZE
];
Status
status
=
0
;
...
...
@@ -243,7 +242,7 @@ X11_DispatchEvent(_THIS)
#endif
SDL_SendKeyboardKey
(
SDL_PRESSED
,
videodata
->
key_layout
[
keycode
]);
#if 1
if
(
videodata
->
key_layout
[
keycode
]
==
SDL
K
_UNKNOWN
)
{
if
(
videodata
->
key_layout
[
keycode
]
==
SDL
_SCANCODE
_UNKNOWN
)
{
int
min_keycode
,
max_keycode
;
XDisplayKeycodes
(
display
,
&
min_keycode
,
&
max_keycode
);
keysym
=
XKeycodeToKeysym
(
display
,
keycode
,
0
);
...
...
@@ -522,6 +521,11 @@ X11_Pending(Display * display)
return
(
0
);
}
/* !!! FIXME: this should be exposed in a header, or something. */
int
SDL_GetNumTouch
(
void
);
void
X11_PumpEvents
(
_THIS
)
{
...
...
@@ -545,7 +549,6 @@ X11_PumpEvents(_THIS)
#ifdef SDL_INPUT_LINUXEV
/* Process Touch events - TODO When X gets touch support, use that instead*/
int
i
=
0
,
rd
;
char
name
[
256
];
struct
input_event
ev
[
64
];
int
size
=
sizeof
(
struct
input_event
);
...
...
src/video/x11/SDL_x11framebuffer.c
View file @
bc138163
...
...
@@ -183,7 +183,10 @@ X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects,
rect
->
x
,
rect
->
y
,
rect
->
w
,
rect
->
h
);
}
}
XSync
(
display
,
False
);
return
0
;
}
void
...
...
src/video/x11/SDL_x11mouse.c
View file @
bc138163
...
...
@@ -136,7 +136,7 @@ X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y)
/* Code below assumes ARGB pixel format */
SDL_assert
(
surface
->
format
->
format
==
SDL_PIXELFORMAT_ARGB8888
);
rfg
=
gfg
=
bfg
=
rbg
=
gbg
=
bbg
=
fgBits
=
0
;
rfg
=
gfg
=
bfg
=
rbg
=
gbg
=
bbg
=
fgBits
=
bgBits
=
0
;
for
(
y
=
0
;
y
<
surface
->
h
;
++
y
)
{
ptr
=
(
Uint32
*
)((
Uint8
*
)
surface
->
pixels
+
y
*
surface
->
pitch
);
for
(
x
=
0
;
x
<
surface
->
w
;
++
x
)
{
...
...
src/video/x11/SDL_x11opengl.c
View file @
bc138163
...
...
@@ -19,8 +19,8 @@
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
#include "SDL_x11video.h"
#include "SDL_assert.h"
/* GLX implementation of SDL OpenGL support */
...
...
@@ -388,8 +388,10 @@ X11_GL_GetVisual(_THIS, Display * display, int screen)
XVisualInfo
*
vinfo
;
/* 64 seems nice. */
int
attribs
[
64
];
int
i
=
X11_GL_GetAttributes
(
_this
,
display
,
screen
,
attribs
,
64
);
const
int
max_attrs
=
64
;
int
attribs
[
max_attrs
];
const
int
i
=
X11_GL_GetAttributes
(
_this
,
display
,
screen
,
attribs
,
max_attrs
);
SDL_assert
(
i
<=
max_attrs
);
vinfo
=
_this
->
gl_data
->
glXChooseVisual
(
display
,
screen
,
attribs
);
if
(
!
vinfo
)
{
...
...
src/video/x11/SDL_x11shape.c
View file @
bc138163
...
...
@@ -26,6 +26,7 @@
#include "SDL_x11video.h"
#include "SDL_x11shape.h"
#include "SDL_x11window.h"
#include "../SDL_shape_internals.h"
SDL_Window
*
X11_CreateShapedWindow
(
const
char
*
title
,
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
w
,
unsigned
int
h
,
Uint32
flags
)
{
...
...
src/video/x11/SDL_x11sym.h
View file @
bc138163
...
...
@@ -178,17 +178,17 @@ SDL_X11_SYM(int,ipUnallocateAndSendData,(ChannelPtr a,IPCard b),(a,b),return)
/* XCursor support */
#if SDL_VIDEO_DRIVER_X11_XCURSOR
SDL_X11_MODULE
(
XCURSOR
)
SDL_X11_SYM
(
XcursorImage
*
,
XcursorImageCreate
,(
int
a
,
int
b
),(
a
,
b
),)
SDL_X11_SYM
(
XcursorImage
*
,
XcursorImageCreate
,(
int
a
,
int
b
),(
a
,
b
),
return
)
SDL_X11_SYM
(
void
,
XcursorImageDestroy
,(
XcursorImage
*
a
),(
a
),)
SDL_X11_SYM
(
Cursor
,
XcursorImageLoadCursor
,(
Display
*
a
,
const
XcursorImage
*
b
),(
a
,
b
),)
SDL_X11_SYM
(
Cursor
,
XcursorImageLoadCursor
,(
Display
*
a
,
const
XcursorImage
*
b
),(
a
,
b
),
return
)
#endif
/* Xinerama support */
#if SDL_VIDEO_DRIVER_X11_XINERAMA
SDL_X11_MODULE
(
XINERAMA
)
SDL_X11_SYM
(
Bool
,
XineramaIsActive
,(
Display
*
a
),(
a
),)
SDL_X11_SYM
(
Bool
,
XineramaQueryExtension
,(
Display
*
a
,
int
*
b
,
int
*
c
),(
a
,
b
,
c
),)
SDL_X11_SYM
(
XineramaScreenInfo
*
,
XineramaQueryScreens
,(
Display
*
a
,
int
*
b
),(
a
,
b
),)
SDL_X11_SYM
(
Bool
,
XineramaIsActive
,(
Display
*
a
),(
a
),
return
)
SDL_X11_SYM
(
Bool
,
XineramaQueryExtension
,(
Display
*
a
,
int
*
b
,
int
*
c
),(
a
,
b
,
c
),
return
)
SDL_X11_SYM
(
XineramaScreenInfo
*
,
XineramaQueryScreens
,(
Display
*
a
,
int
*
b
),(
a
,
b
),
return
)
#endif
/* XInput support for multiple mice, tablets, etc. */
...
...
@@ -229,12 +229,12 @@ SDL_X11_SYM(void,XShapeCombineMask,(Display *dpy,Window dest,int dest_kind,int x
#if SDL_VIDEO_DRIVER_X11_XVIDMODE
SDL_X11_MODULE
(
XVIDMODE
)
SDL_X11_SYM
(
Bool
,
XF86VidModeGetAllModeLines
,(
Display
*
a
,
int
b
,
int
*
c
,
XF86VidModeModeInfo
***
d
),(
a
,
b
,
c
,
d
),)
SDL_X11_SYM
(
Bool
,
XF86VidModeGetModeLine
,(
Display
*
a
,
int
b
,
int
*
c
,
XF86VidModeModeLine
*
d
),(
a
,
b
,
c
,
d
),)
SDL_X11_SYM
(
Bool
,
XF86VidModeGetViewPort
,(
Display
*
a
,
int
b
,
int
*
c
,
int
*
d
),(
a
,
b
,
c
,
d
),)
SDL_X11_SYM
(
Bool
,
XF86VidModeQueryExtension
,(
Display
*
a
,
int
*
b
,
int
*
c
),(
a
,
b
,
c
),)
SDL_X11_SYM
(
Bool
,
XF86VidModeQueryVersion
,(
Display
*
a
,
int
*
b
,
int
*
c
),(
a
,
b
,
c
),)
SDL_X11_SYM
(
Bool
,
XF86VidModeSwitchToMode
,(
Display
*
a
,
int
b
,
XF86VidModeModeInfo
*
c
),(
a
,
b
,
c
),)
SDL_X11_SYM
(
Bool
,
XF86VidModeGetAllModeLines
,(
Display
*
a
,
int
b
,
int
*
c
,
XF86VidModeModeInfo
***
d
),(
a
,
b
,
c
,
d
),
return
)
SDL_X11_SYM
(
Bool
,
XF86VidModeGetModeLine
,(
Display
*
a
,
int
b
,
int
*
c
,
XF86VidModeModeLine
*
d
),(
a
,
b
,
c
,
d
),
return
)
SDL_X11_SYM
(
Bool
,
XF86VidModeGetViewPort
,(
Display
*
a
,
int
b
,
int
*
c
,
int
*
d
),(
a
,
b
,
c
,
d
),
return
)
SDL_X11_SYM
(
Bool
,
XF86VidModeQueryExtension
,(
Display
*
a
,
int
*
b
,
int
*
c
),(
a
,
b
,
c
),
return
)
SDL_X11_SYM
(
Bool
,
XF86VidModeQueryVersion
,(
Display
*
a
,
int
*
b
,
int
*
c
),(
a
,
b
,
c
),
return
)
SDL_X11_SYM
(
Bool
,
XF86VidModeSwitchToMode
,(
Display
*
a
,
int
b
,
XF86VidModeModeInfo
*
c
),(
a
,
b
,
c
),
return
)
#endif
/* *INDENT-ON* */
...
...
src/video/x11/SDL_x11touch.c
View file @
bc138163
...
...
@@ -39,7 +39,6 @@ X11_InitTouch(_THIS)
FILE
*
fd
;
fd
=
fopen
(
"/proc/bus/input/devices"
,
"r"
);
char
c
;
int
i
=
0
;
int
tsfd
;
char
line
[
256
];
...
...
@@ -111,7 +110,7 @@ X11_InitTouch(_THIS)
}
}
close
(
fd
);
f
close
(
fd
);
#endif
}
...
...
src/video/x11/SDL_x11window.c
View file @
bc138163
...
...
@@ -86,31 +86,6 @@ X11_GetWMStateProperty(_THIS, SDL_Window * window, Atom atoms[3])
return
count
;
}
static
void
X11_GetDisplaySize
(
_THIS
,
SDL_Window
*
window
,
int
*
w
,
int
*
h
)
{
SDL_VideoData
*
data
=
(
SDL_VideoData
*
)
_this
->
driverdata
;
SDL_DisplayData
*
displaydata
=
(
SDL_DisplayData
*
)
SDL_GetDisplayForWindow
(
window
)
->
driverdata
;
XWindowAttributes
attr
;
XGetWindowAttributes
(
data
->
display
,
RootWindow
(
data
->
display
,
displaydata
->
screen
),
&
attr
);
if
(
window
->
flags
&
SDL_WINDOW_FULLSCREEN
)
{
/* The bounds when this window is visible is the fullscreen mode */
SDL_DisplayMode
fullscreen_mode
;
if
(
SDL_GetWindowDisplayMode
(
window
,
&
fullscreen_mode
)
==
0
)
{
attr
.
width
=
fullscreen_mode
.
w
;
attr
.
height
=
fullscreen_mode
.
h
;
}
}
if
(
w
)
{
*
w
=
attr
.
width
;
}
if
(
h
)
{
*
h
=
attr
.
height
;
}
}
static
int
SetupWindowData
(
_THIS
,
SDL_Window
*
window
,
Window
w
,
BOOL
created
)
{
...
...
@@ -320,7 +295,6 @@ X11_CreateWindow(_THIS, SDL_Window * window)
xattr
.
border_pixel
=
0
;
if
(
visual
->
class
==
DirectColor
)
{
Status
status
;
XColor
*
colorcells
;
int
i
;
int
ncolors
;
...
...
@@ -757,7 +731,6 @@ X11_SetWindowPosition(_THIS, SDL_Window * window)
{
SDL_WindowData
*
data
=
(
SDL_WindowData
*
)
window
->
driverdata
;
Display
*
display
=
data
->
videodata
->
display
;
int
x
,
y
;
XMoveWindow
(
display
,
data
->
xwindow
,
window
->
x
,
window
->
y
);
XFlush
(
display
);
...
...
@@ -952,7 +925,7 @@ X11_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
int
ncolors
;
int
rmask
,
gmask
,
bmask
;
int
rshift
,
gshift
,
bshift
;
int
i
,
j
;
int
i
;
if
(
visual
->
class
!=
DirectColor
)
{
SDL_SetError
(
"Window doesn't have DirectColor visual"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment