fix: build error on window&ubuntu

This commit is contained in:
rankun 2020-04-18 13:06:13 +08:00
parent ea91f36917
commit 791457b822
3 changed files with 5 additions and 5 deletions

View file

@ -28,8 +28,9 @@ msvc{
}
# warning as error
#4566 https://github.com/Chuyu-Team/VC-LTL/issues/27
*g++*: QMAKE_CXXFLAGS += -Werror
*msvc*: QMAKE_CXXFLAGS += /WX
*msvc*: QMAKE_CXXFLAGS += /WX /wd4566
# 源码
SOURCES += \

View file

@ -107,7 +107,7 @@ QByteArray ControlMsg::serializeData()
BufferUtil::write32(buffer, m_data.injectKeycode.metastate);
break;
case CMT_INJECT_TEXT:
BufferUtil::write16(buffer, strlen(m_data.injectText.text));
BufferUtil::write16(buffer, static_cast<quint32>(strlen(m_data.injectText.text)));
buffer.write(m_data.injectText.text, strlen(m_data.injectText.text));
break;
case CMT_INJECT_TOUCH: {
@ -124,7 +124,7 @@ QByteArray ControlMsg::serializeData()
BufferUtil::write32(buffer, m_data.injectScroll.vScroll);
break;
case CMT_SET_CLIPBOARD:
BufferUtil::write16(buffer, strlen(m_data.setClipboard.text));
BufferUtil::write16(buffer, static_cast<quint32>(strlen(m_data.setClipboard.text)));
buffer.write(m_data.setClipboard.text, strlen(m_data.setClipboard.text));
break;
case CMT_SET_SCREEN_POWER_MODE:

View file

@ -29,7 +29,6 @@ static const GLfloat coordinate[] = {
// 纹理坐标存储4个xy坐标
// 坐标范围为[0,1],左下角为 0,0
// TODO 为什么这个顺序指定四个顶点?顶点坐标和纹理坐标如何映射的?
0.0f,
1.0f,
1.0f,
@ -249,7 +248,7 @@ void QYUVOpenGLWidget::deInitTextures()
glDeleteTextures(3, m_texture);
}
memset(m_texture, 0, 3);
memset(m_texture, 0, sizeof(m_texture));
m_textureInited = false;
}