Addressed comments by Terseus to match the spec

size_t -> long
uint8_t -> unsigned char

Signed-off-by: Vinzenz Feenstra <evilissimo@gmail.com>
This commit is contained in:
Vinzenz Feenstra 2014-02-14 12:42:47 +01:00
parent bfafcb4664
commit db3e3255a8

View file

@ -1217,8 +1217,8 @@ void OS_X11::set_icon(const Image& p_icon) {
int w = img.get_width(); int w = img.get_width();
int h = img.get_height(); int h = img.get_height();
// We're using size_t to have wordsize (32Bit build -> 32 Bits, 64 Bit build -> 64 Bits // We're using long to have wordsize (32Bit build -> 32 Bits, 64 Bit build -> 64 Bits
Vector<size_t> pd; Vector<long> pd;
pd.resize(2+w*h); pd.resize(2+w*h);
@ -1229,17 +1229,17 @@ void OS_X11::set_icon(const Image& p_icon) {
DVector<uint8_t>::Read r = img.get_data().read(); DVector<uint8_t>::Read r = img.get_data().read();
size_t * wr = &pd[2]; long * wr = &pd[2];
uint8_t const * pr = r.ptr(); uint8_t const * pr = r.ptr();
for(int i=0;i<w*h;i++) { for(int i=0;i<w*h;i++) {
size_t v=0; long v=0;
// A R G B // A R G B
v|=pr[3] << 24 | pr[0] << 16 | pr[1] << 8 | pr[2]; v|=pr[3] << 24 | pr[0] << 16 | pr[1] << 8 | pr[2];
*wr++=v; *wr++=v;
pr += 4; pr += 4;
} }
XChangeProperty(x11_display, x11_window, net_wm_icon, XA_CARDINAL, 32, PropModeReplace, (uint8_t*) pd.ptr(), pd.size()); XChangeProperty(x11_display, x11_window, net_wm_icon, XA_CARDINAL, 32, PropModeReplace, (unsigned char*) pd.ptr(), pd.size());
} else { } else {
XDeleteProperty(x11_display, x11_window, net_wm_icon); XDeleteProperty(x11_display, x11_window, net_wm_icon);
} }