From: John Hodge Date: Mon, 22 Jul 2013 12:34:25 +0000 (+0800) Subject: Usermode/AxWin3 - Fixed scan-build complaints, added more complete debug X-Git-Tag: rel0.15~334 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=7680ee42e3fbfcc3cc92e68ad0928a9011f5057c;p=tpg%2Facess2.git Usermode/AxWin3 - Fixed scan-build complaints, added more complete debug --- diff --git a/Usermode/Applications/axwin3_src/Interface/main.c b/Usermode/Applications/axwin3_src/Interface/main.c index 82cedc23..e39d9050 100644 --- a/Usermode/Applications/axwin3_src/Interface/main.c +++ b/Usermode/Applications/axwin3_src/Interface/main.c @@ -30,6 +30,8 @@ tAxWin3_Widget *gSidebarRoot; tHWND gSystemMenu; tHWND gRunDialog; tAxWin3_Widget *gRunInput; + +tAxWin3_Widget *gWindowList; tAxWin3_Widget *gTimeDisplay; int giScreenWidth; int giScreenHeight; @@ -87,7 +89,7 @@ void create_sidebar(void) AxWin3_Widget_SetSize(ele, 4); // TODO: Program list - ele = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList"); + gWindowList = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList"); // - Plain
style spacer ele = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top"); diff --git a/Usermode/Applications/axwin3_src/WM/decorator.c b/Usermode/Applications/axwin3_src/WM/decorator.c index d0dd2640..add812cf 100644 --- a/Usermode/Applications/axwin3_src/WM/decorator.c +++ b/Usermode/Applications/axwin3_src/WM/decorator.c @@ -162,7 +162,7 @@ int Decorator_HandleMessage(tWindow *Window, int Message, int Length, const void case WNDMSG_MOUSEMOVE: { const struct sWndMsg_MouseMove *msg = Data; - if( btn1_down == Window ) + if( Window && btn1_down == Window ) { switch(btn1_mode) { diff --git a/Usermode/Applications/axwin3_src/WM/image.c b/Usermode/Applications/axwin3_src/WM/image.c index 49a074d9..5f863f98 100644 --- a/Usermode/Applications/axwin3_src/WM/image.c +++ b/Usermode/Applications/axwin3_src/WM/image.c @@ -99,7 +99,7 @@ tImage *Image_Load(const char *URI) */ int UnBase64(uint8_t *Dest, char *Src, int BufSize) { - uint32_t val; + uint32_t val = 0; int i, j; char *start_src = Src; diff --git a/Usermode/Applications/axwin3_src/WM/renderers/widget.c b/Usermode/Applications/axwin3_src/WM/renderers/widget.c index 247152d7..0261beab 100644 --- a/Usermode/Applications/axwin3_src/WM/renderers/widget.c +++ b/Usermode/Applications/axwin3_src/WM/renderers/widget.c @@ -536,6 +536,9 @@ int Widget_IPC_NewWidgetSubwin(tWindow *Win, size_t Len, const void *Data) return -1; if( strnlen(Msg->DebugName, max_debugname_len) == max_debugname_len ) return -1; + + _SysDebug("Widget_NewWidgetSubwin(%i %i Type %i Flags 0x%x Subwin %i)", + Msg->Parent, Msg->NewID, Msg->Type, Msg->Flags, Msg->WindowHandle); parent = Widget_GetElementById(Info, Msg->Parent); if(!parent) return 1; @@ -555,6 +558,8 @@ int Widget_IPC_SetFocus(tWindow *Win, size_t Len, const void *Data) tElement *ele; const tWidgetIPC_SetFocus *msg = Data; if(Len < sizeof(*msg)) return -1; + + _SysDebug("Widget_SetFocus(%i)", msg->WidgetID); ele = Widget_GetElementById(info, msg->WidgetID); Widget_SetFocus(info, ele); @@ -589,6 +594,8 @@ int Widget_IPC_SetSize(tWindow *Win, size_t Len, const void *Data) if( Len < sizeof(*Msg) ) return -1; + + _SysDebug("Widget_SetSize(%i, %i)", Msg->WidgetID, Msg->Value); ele = Widget_GetElementById(Info, Msg->WidgetID); if(!ele) return 1; @@ -608,6 +615,7 @@ int Widget_IPC_SetText(tWindow *Win, size_t Len, const void *Data) if( Msg->Text[Len - sizeof(*Msg) - 1] != '\0' ) return -1; + _SysDebug("Widget_SetText(%i, '%.30s')", Msg->WidgetID, Msg->Text); ele = Widget_GetElementById(Info, Msg->WidgetID); if(!ele) return 1; diff --git a/Usermode/Applications/axwin3_src/WM/renderers/widget/image.c b/Usermode/Applications/axwin3_src/WM/renderers/widget/image.c index c721454f..a6642c33 100644 --- a/Usermode/Applications/axwin3_src/WM/renderers/widget/image.c +++ b/Usermode/Applications/axwin3_src/WM/renderers/widget/image.c @@ -25,6 +25,7 @@ void Widget_Image_UpdateText(tElement *Element, const char *Text) if(Element->Data) free(Element->Data); Element->Data = Image_Load( Text ); if(!Element->Data) { + _SysDebug("Widget::Image - Load failed '%s'", Text); // Element->Flags &= ~ELEFLAG_FIXEDSIZE; return ; } diff --git a/Usermode/Applications/axwin3_src/WM/resources/cursor.h b/Usermode/Applications/axwin3_src/WM/resources/cursor.h index 8fc6776d..b445480d 100644 --- a/Usermode/Applications/axwin3_src/WM/resources/cursor.h +++ b/Usermode/Applications/axwin3_src/WM/resources/cursor.h @@ -8,7 +8,7 @@ static struct { uint16_t W, H; uint32_t Data[]; -} cCursorBitmap = { +} __attribute__((packed)) cCursorBitmap = { 8, 16, { 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,