[ROSAPPS] Fix GCC8 warnings
authorVictor Perevertkin <victor@perevertkin.ru>
Wed, 6 Nov 2019 08:54:24 +0000 (11:54 +0300)
committerVictor Perevertkin <victor@perevertkin.ru>
Thu, 7 Nov 2019 19:32:15 +0000 (22:32 +0300)
modules/rosapps/applications/devutils/createspec/CMakeLists.txt
modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
modules/rosapps/applications/devutils/vgafontedit/precomp.h
modules/rosapps/applications/explorer-old/utility/dragdropimpl.h
modules/rosapps/applications/net/ncftp/ncftp/progress.c
modules/rosapps/applications/net/roshttpd/config.cpp
modules/rosapps/applications/net/roshttpd/httpd.cpp
modules/rosapps/applications/net/roshttpd/roshttpd.cpp
modules/rosapps/applications/sysutils/man/man.c
modules/rosapps/applications/sysutils/regexpl/Console.cpp
modules/rosapps/applications/sysutils/screenshot/screenshot.c

index a517326..670c1d7 100644 (file)
@@ -1,4 +1,8 @@
 
 
+if(GCC AND GCC_VERSION VERSION_GREATER 7)
+    add_compile_flags("-Wno-stringop-overflow")
+endif()
+
 add_executable(createspec createspec.c)
 set_module_type(createspec win32cui)
 target_link_libraries(createspec wine)
 add_executable(createspec createspec.c)
 set_module_type(createspec win32cui)
 target_link_libraries(createspec wine)
index ec5f57f..60bc7bd 100644 (file)
@@ -30,13 +30,6 @@ GetCharacterRect(IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT CharacterRect
     CharacterRect->bottom = CharacterRect->top + CHARACTER_BOX_HEIGHT;
 }
 
     CharacterRect->bottom = CharacterRect->top + CHARACTER_BOX_HEIGHT;
 }
 
-__inline VOID
-GetCharacterPosition(IN UINT uCharacter, OUT PUINT uFontRow, OUT PUINT uFontColumn)
-{
-    *uFontRow = uCharacter / 16;
-    *uFontColumn = uCharacter % 16;
-}
-
 static INT
 FontBoxesHitTest(IN UINT xPos, IN UINT yPos, OUT LPRECT CharacterRect)
 {
 static INT
 FontBoxesHitTest(IN UINT xPos, IN UINT yPos, OUT LPRECT CharacterRect)
 {
index 94ac9dd..2e4ac77 100644 (file)
@@ -136,9 +136,14 @@ VOID CreateFontBoxesWindow(PFONT_WND_INFO FontWndInfo);
 BOOL InitFontBoxesWndClass(VOID);
 VOID UnInitFontBoxesWndClass(VOID);
 VOID GetCharacterRect(IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT CharacterRect);
 BOOL InitFontBoxesWndClass(VOID);
 VOID UnInitFontBoxesWndClass(VOID);
 VOID GetCharacterRect(IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT CharacterRect);
-__inline VOID GetCharacterPosition(IN UINT uCharacter, OUT PUINT uFontRow, OUT PUINT uFontColumn);
 VOID EditCurrentGlyph(PFONT_WND_INFO FontWndInfo);
 
 VOID EditCurrentGlyph(PFONT_WND_INFO FontWndInfo);
 
+inline VOID GetCharacterPosition(IN UINT uCharacter, OUT PUINT uFontRow, OUT PUINT uFontColumn)
+{
+    *uFontRow = uCharacter / 16;
+    *uFontColumn = uCharacter % 16;
+}
+
 // fontwnd.c
 BOOL CreateFontWindow(PMAIN_WND_INFO MainWndInfo, PFONT_OPEN_INFO OpenInfo);
 BOOL InitFontWndClass(VOID);
 // fontwnd.c
 BOOL CreateFontWindow(PMAIN_WND_INFO MainWndInfo, PFONT_OPEN_INFO OpenInfo);
 BOOL InitFontWndClass(VOID);
index 6a59c67..6ba857f 100644 (file)
@@ -246,15 +246,15 @@ public:
                if (pDragSourceHelper == NULL)
                        return E_FAIL;
 
                if (pDragSourceHelper == NULL)
                        return E_FAIL;
 
-                       SHDRAGIMAGE di;
-                       BITMAP          bm;
-                       GetObject(hBitmap, sizeof(bm), &bm);
-                       di.sizeDragImage.cx = bm.bmWidth;
-                       di.sizeDragImage.cy = bm.bmHeight;
-                       di.hbmpDragImage = hBitmap;
-                       di.crColorKey = crColorKey;
-                       di.ptOffset.x = pt.x - rc.left;
-                       di.ptOffset.y = pt.y - rc.top;
+               SHDRAGIMAGE     di;
+               BITMAP          bm;
+               GetObject(hBitmap, sizeof(bm), &bm);
+               di.sizeDragImage.cx = bm.bmWidth;
+               di.sizeDragImage.cy = bm.bmHeight;
+               di.hbmpDragImage = hBitmap;
+               di.crColorKey = crColorKey;
+               di.ptOffset.x = pt.x - rc.left;
+               di.ptOffset.y = pt.y - rc.top;
                return pDragSourceHelper->InitializeFromBitmap(&di, pDataObject);
        }
 
                return pDragSourceHelper->InitializeFromBitmap(&di, pDataObject);
        }
 
index 0559f2f..ef9f9ce 100644 (file)
@@ -209,7 +209,7 @@ PrStatBar(const FTPCIPtr cip, int mode)
        static double uTotal, uMult;
        const char *stall;
        char localName[80];
        static double uTotal, uMult;
        const char *stall;
        char localName[80];
-       char line[128];
+       char line[134];
        int i;
 
        switch (mode) {
        int i;
 
        switch (mode) {
index b689e16..c64b8b7 100644 (file)
@@ -49,7 +49,7 @@ void CConfig::Default()
        try {
                lpsStr = _strdup(dcfgDefaultResource);
                DefaultResources.Insert(lpsStr);
        try {
                lpsStr = _strdup(dcfgDefaultResource);
                DefaultResources.Insert(lpsStr);
-       } catch (bad_alloc e) {
+       } catch (bad_alloc&) {
                free((void *)lpsStr);
                Clear();
                throw;
                free((void *)lpsStr);
                Clear();
                throw;
index d4bb9e3..4604d8e 100644 (file)
@@ -461,22 +461,22 @@ VOID CHttpDaemonThread::Execute()
                            case HTTPD_START: {
                                    if (Daemon->GetState() == hsStopped)
                                            Daemon->Start();
                            case HTTPD_START: {
                                    if (Daemon->GetState() == hsStopped)
                                            Daemon->Start();
-                                           break;
+                    break;
                                        }
                                        case HTTPD_STOP: {
                            if (Daemon->GetState() == hsRunning)
                                                        Daemon->Stop();
                                        }
                                        case HTTPD_STOP: {
                            if (Daemon->GetState() == hsRunning)
                                                        Daemon->Stop();
-                                               break;
+                    break;
                                        }
                                        case HTTPD_SUSPEND: {
                                                if (Daemon->GetState() == hsRunning){}
                                                        // FIXME: Suspend service
                                        }
                                        case HTTPD_SUSPEND: {
                                                if (Daemon->GetState() == hsRunning){}
                                                        // FIXME: Suspend service
-                                               break;
+                    break;
                                        }
                                        case HTTPD_RESUME: {
                                                if (Daemon->GetState() != hsSuspended){}
                                                        // FIXME: Resume service
                                        }
                                        case HTTPD_RESUME: {
                                                if (Daemon->GetState() != hsSuspended){}
                                                        // FIXME: Resume service
-                                               break;
+                    break;
                                        }
                                        default:
                         DispatchMessage(&Msg);
                                        }
                                        default:
                         DispatchMessage(&Msg);
@@ -486,7 +486,7 @@ VOID CHttpDaemonThread::Execute()
                delete Daemon;
        } catch (ESocket e) {
                ReportErrorStr(e.what());
                delete Daemon;
        } catch (ESocket e) {
                ReportErrorStr(e.what());
-       } catch (bad_alloc e) {
+       } catch (bad_alloc&) {
                ReportErrorStr(TS("Insufficient resources."));
        }
 }
                ReportErrorStr(TS("Insufficient resources."));
        }
 }
index 89af9bf..c4a9114 100644 (file)
@@ -45,7 +45,7 @@ VOID Run()
 
                if (pConfiguration != NULL)
                    delete pConfiguration;
 
                if (pConfiguration != NULL)
                    delete pConfiguration;
-       } catch (bad_alloc e) {
+       } catch (bad_alloc&) {
                if (pConfiguration != NULL)
                        delete pConfiguration;
                ReportErrorStr(TS("Insufficient resources."));
                if (pConfiguration != NULL)
                        delete pConfiguration;
                ReportErrorStr(TS("Insufficient resources."));
index 3c54eb3..e382972 100644 (file)
@@ -155,10 +155,10 @@ void text_outp(char *cur_string)
         while(cur_string[symbol]!=' ')
             symbol++;
 
         while(cur_string[symbol]!=' ')
             symbol++;
 
-
     for(;cur_string[symbol]!='\n'; symbol++)
         putchar(cur_string[symbol]);
     for(;cur_string[symbol]!='\n'; symbol++)
         putchar(cur_string[symbol]);
-        putchar(' ');
+
+    putchar(' ');
 }
 
 int
 }
 
 int
@@ -214,13 +214,16 @@ AnalyzeFile()
         putchar(' ');
        }
 
         putchar(' ');
        }
 
-     else text_outp(cur_string); // print plane text
-     th_outp(cur_string, THtag);
-/* END of TAGs processing */
-     free(cur_string);
-     free(THtag);
+     else
+     {
+       text_outp(cur_string); // print plane text
+     }
+    th_outp(cur_string, THtag);
+    /* END of TAGs processing */
 
 
-     return 0;
+    free(cur_string);
+    free(THtag);
+    return 0;
 }
 
 
 }
 
 
index 0f61aa0..98219a3 100644 (file)
@@ -716,7 +716,9 @@ Paste:
                                ASSERT(dwCompletionOffset <= dwCurrentCharOffset);
 
         // Save not changing part (context) of completion in m_pchBuffer1
                                ASSERT(dwCompletionOffset <= dwCurrentCharOffset);
 
         // Save not changing part (context) of completion in m_pchBuffer1
-                               _tcsncpy(m_pchBuffer1,m_pchBuffer,dwCompletionOffset);
+
+                               // FIXME: dwCompletionOffset is always 0 here
+                               // _tcsncpy(m_pchBuffer1,m_pchBuffer,dwCompletionOffset);
                                m_pchBuffer1[dwCompletionOffset] = 0;
 
         // Size of changing part
                                m_pchBuffer1[dwCompletionOffset] = 0;
 
         // Size of changing part
index d71d7f4..2330101 100644 (file)
@@ -272,14 +272,18 @@ ConvertDDBtoDIB(PSCREENSHOT pScrSht)
                cClrBits = 24;
        else cClrBits = 32;
 
                cClrBits = 24;
        else cClrBits = 32;
 
-       if (cClrBits != 24)
-        pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(),
-                                                0,
-                                                sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1 << cClrBits));
-    else
-        pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(),
-                                                0,
-                                                sizeof(BITMAPINFOHEADER));
+  if (cClrBits != 24)
+  {
+    pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(),
+                                            0,
+                                            sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1 << cClrBits));
+  }
+  else
+  {
+    pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(),
+                                            0,
+                                            sizeof(BITMAPINFOHEADER));
+  }
 
        if (!pScrSht->lpbi)
        {
 
        if (!pScrSht->lpbi)
        {