Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

None correct type handling for slot 'rate of x11-video-mode structure #11

Closed
LinkFly opened this Issue · 4 comments

2 participants

@LinkFly

Slot 'rate in x11-video-mode structure type is double-float, but not correct handling this fact.
For correct working i changed this code:
(defmethod set-video-mode ((mode x11-video-mode))
(glop-xlib::with-current-display dpy
(glop-xlib::set-mode dpy 0 (x11-video-mode-index mode)
(x11-video-mode-rate mode))))

on it:

(defmethod set-video-mode ((mode x11-video-mode))
(glop-xlib::with-current-display dpy
(glop-xlib::set-mode dpy 0 (x11-video-mode-index mode)
(truncate (x11-video-mode-rate mode)))))

And also two call make-x11-video-mode:

(make-x11-video-mode
...
:rate rate
...)

Changed to:

(make-x11-video-mode
...
:rate (coerce rate 'double-float)
...)

Please analyzed bug report

@patzy
Owner

Looks like the type change was introduced during the osx implementation.
rate slot should be integer on x11 implementation but double-float on osx implementation.
I moved the rate slot to platform specific video-mode struct instead of the base one.

@LinkFly

Xm.. but slot "rate" in src/utils.lisp not specified:

(defstruct video-mode
(width 0 :type integer)
(height 0 :type integer)
(depth 0 :type integer)
(rate 0 :type double-float)) ; <

@patzy
Owner

I pushed the change to the devel branch not to the master one.
https://github.com/patzy/glop/tree/devel

@patzy
Owner

This has been merged for a while

@patzy patzy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.