Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
5a5bd4a1
Commit
5a5bd4a1
authored
4 months ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
More fixups...
Some Coverity issues, some deadlocks, some crashes... Just misc stuff.
parent
a76da51b
No related branches found
No related tags found
No related merge requests found
Pipeline
#7775
failed
4 months ago
Stage: build
Stage: test
Stage: cleanup
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/conio/bitmap_con.c
+11
-3
11 additions, 3 deletions
src/conio/bitmap_con.c
src/conio/sdl_con.c
+6
-6
6 additions, 6 deletions
src/conio/sdl_con.c
src/xpdev/Common.gmake
+5
-0
5 additions, 0 deletions
src/xpdev/Common.gmake
src/xpdev/genwrap.c
+2
-0
2 additions, 0 deletions
src/xpdev/genwrap.c
with
24 additions
and
9 deletions
src/conio/bitmap_con.c
+
11
−
3
View file @
5a5bd4a1
...
...
@@ -814,15 +814,16 @@ bitmap_draw_vmem(int sx, int sy, int ex, int ey, struct vmem_cell *fill)
size_t
xoffset
=
(
sx
-
1
)
*
vstat
.
charwidth
;
size_t
yoffset
=
(
sy
-
1
)
*
vstat
.
charheight
;
bs
.
expand
=
vstat
.
flags
&
VIDMODES_FLAG_EXPAND
;
bs
.
font_data_width
=
vstat
.
charwidth
-
(
bs
.
expand
?
1
:
0
);
pthread_mutex_lock
(
&
screenlock
);
assert
(
xoffset
+
vstat
.
charwidth
<=
screena
.
screenwidth
);
assert
(
xoffset
+
vstat
.
charwidth
<=
screenb
.
screenwidth
);
assert
(
yoffset
+
vstat
.
charheight
<=
screena
.
screenheight
);
assert
(
yoffset
+
vstat
.
charheight
<=
screenb
.
screenheight
);
bs
.
maxpix
=
screena
.
screenwidth
*
screena
.
screenheight
;
bs
.
expand
=
vstat
.
flags
&
VIDMODES_FLAG_EXPAND
;
bs
.
font_data_width
=
vstat
.
charwidth
-
(
bs
.
expand
?
1
:
0
);
pthread_mutex_lock
(
&
screenlock
);
bs
.
pixeloffset
=
pixel_offset
(
&
screena
,
xoffset
,
yoffset
);
bs
.
cheat_colour
=
fill
[
0
].
bg
;
size_t
rsz
=
screena
.
screenwidth
-
vstat
.
charwidth
*
vwidth
;
...
...
@@ -971,6 +972,13 @@ static void blinker_thread(void *data)
lfc
=
force_cursor
;
force_cursor
=
0
;
blink
=
vstat
.
blink
;
pthread_mutex_lock
(
&
screenlock
);
if
(
screena
.
rect
==
NULL
)
{
pthread_mutex_unlock
(
&
screenlock
);
do_rwlock_unlock
(
&
vstatlock
);
continue
;
}
pthread_mutex_unlock
(
&
screenlock
);
do_rwlock_unlock
(
&
vstatlock
);
if
(
check_redraw
())
{
...
...
This diff is collapsed.
Click to expand it.
src/conio/sdl_con.c
+
6
−
6
View file @
5a5bd4a1
...
...
@@ -756,8 +756,8 @@ static void sdl_add_key(unsigned int keyval, struct video_stats *vs)
if
(
keyval
<=
0xffff
)
{
pthread_mutex_lock
(
&
sdl_keylock
);
if
(
sdl_keynext
+
1
==
sdl_key
)
{
beep
();
pthread_mutex_unlock
(
&
sdl_keylock
);
beep
();
return
;
}
if
((
sdl_keynext
+
2
==
sdl_key
)
&&
keyval
>
0xff
)
{
...
...
@@ -990,7 +990,7 @@ void sdl_video_event_thread(void *data)
}
else
{
if
(
bios_key
>=
26
||
(
bios_key
==
429496729
&&
((
ev
.
key
.
keysym
.
sym
>
SDLK_KP_5
)
||
(
ev
.
key
.
keysym
.
sym
==
SDLK_KP_0
))))
{
(
bios_key
==
25
&&
((
ev
.
key
.
keysym
.
sym
>
SDLK_KP_5
)
||
(
ev
.
key
.
keysym
.
sym
==
SDLK_KP_0
))))
{
terminate_bios
=
true
;
}
}
...
...
@@ -1146,8 +1146,10 @@ void sdl_video_event_thread(void *data)
case
SDL_WINDOWEVENT_SIZE_CHANGED
:
// SDL2: User resized window
case
SDL_WINDOWEVENT_RESIZED
:
pthread_mutex_lock
(
&
win_mutex
);
fullscreen
=
!!
(
sdl
.
GetWindowFlags
(
win
)
&
(
SDL_WINDOW_FULLSCREEN
|
SDL_WINDOW_FULLSCREEN_DESKTOP
));
sdl
.
SetWindowResizable
(
win
,
fullscreen
?
SDL_FALSE
:
SDL_TRUE
);
pthread_mutex_unlock
(
&
win_mutex
);
cio_api
.
mode
=
fullscreen
?
CIOLIB_MODE_SDL_FULLSCREEN
:
CIOLIB_MODE_SDL
;
pthread_mutex_lock
(
&
sdl_mode_mutex
);
if
(
sdl_mode
)
{
...
...
@@ -1326,17 +1328,17 @@ void sdl_video_event_thread(void *data)
case
SDL_USEREVENT_INIT
:
if
(
!
sdl_init_good
)
{
if
(
sdl
.
WasInit
(
SDL_INIT_VIDEO
)
==
SDL_INIT_VIDEO
)
{
pthread_mutex_lock
(
&
win_mutex
);
_beginthread
(
sdl_mouse_thread
,
0
,
NULL
);
sdl_init_good
=
1
;
pthread_mutex_unlock
(
&
win_mutex
);
}
}
sdl_ufunc_retval
=
0
;
sem_post
(
&
sdl_ufunc_ret
);
break
;
case
SDL_USEREVENT_GETWINPOS
:
pthread_mutex_lock
(
&
win_mutex
);
sdl
.
GetWindowPosition
(
win
,
ev
.
user
.
data1
,
ev
.
user
.
data2
);
pthread_mutex_unlock
(
&
win_mutex
);
sem_post
(
&
sdl_ufunc_ret
);
break
;
case
SDL_USEREVENT_MOUSEPOINTER
:
...
...
@@ -1380,8 +1382,6 @@ void sdl_video_event_thread(void *data)
break
;
}
}
sdl
.
QuitSubSystem
(
SDL_INIT_VIDEO
);
return
;
}
static
int
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/Common.gmake
+
5
−
0
View file @
5a5bd4a1
...
...
@@ -218,6 +218,11 @@ ifndef WITHOUT_ALSA_SOUND
ifeq ($(shell if [ -f /usr/include/alsa/asoundlib.h ] ; then echo YES ; fi),YES)
XPDEV-MT_CFLAGS += -DUSE_ALSA_SOUND
XPDEV-MT_LIBS += -ldl
else
ifeq ($(shell if [ -f /usr/local/include/alsa/asoundlib.h ] ; then echo YES ; fi),YES)
XPDEV-MT_CFLAGS += -DUSE_ALSA_SOUND
XPDEV-MT_LIBS += -ldl
endif
endif
endif
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/genwrap.c
+
2
−
0
View file @
5a5bd4a1
...
...
@@ -1147,8 +1147,10 @@ int64_t xp_fast_timer64(void)
}
cid
=
CLOCK_MONOTONIC_RAW
;
#endif
#ifdef CLOCK_MONOTONIC
if
(
cid
==
CLOCK_REALTIME
)
cid
=
CLOCK_MONOTONIC
;
#endif
if
(
clock_gettime
(
cid
,
&
ts
)
==
0
)
ret
=
ts
.
tv_sec
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment