https://git.reactos.org/?p=reactos.git;a=commitdiff;h=97d937add160da97bca50…
commit 97d937add160da97bca5060f10df4b3f10ce5f2e
Author: Victor Perevertkin <victor(a)perevertkin.ru>
AuthorDate: Wed Nov 6 11:54:24 2019 +0300
Commit: Victor Perevertkin <victor(a)perevertkin.ru>
CommitDate: Thu Nov 7 22:32:15 2019 +0300
[ROSAPPS] Fix GCC8 warnings
---
.../applications/devutils/createspec/CMakeLists.txt | 4 ++++
.../applications/devutils/vgafontedit/fontboxeswnd.c | 7 -------
.../applications/devutils/vgafontedit/precomp.h | 7 ++++++-
.../applications/explorer-old/utility/dragdropimpl.h | 18 +++++++++---------
.../rosapps/applications/net/ncftp/ncftp/progress.c | 2 +-
modules/rosapps/applications/net/roshttpd/config.cpp | 2 +-
modules/rosapps/applications/net/roshttpd/httpd.cpp | 10 +++++-----
.../rosapps/applications/net/roshttpd/roshttpd.cpp | 2 +-
modules/rosapps/applications/sysutils/man/man.c | 19 +++++++++++--------
.../applications/sysutils/regexpl/Console.cpp | 4 +++-
.../applications/sysutils/screenshot/screenshot.c | 20 ++++++++++++--------
11 files changed, 53 insertions(+), 42 deletions(-)
diff --git a/modules/rosapps/applications/devutils/createspec/CMakeLists.txt
b/modules/rosapps/applications/devutils/createspec/CMakeLists.txt
index a517326f4fc..670c1d749b2 100644
--- a/modules/rosapps/applications/devutils/createspec/CMakeLists.txt
+++ b/modules/rosapps/applications/devutils/createspec/CMakeLists.txt
@@ -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)
diff --git a/modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
b/modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
index ec5f57fd62c..60bc7bdf187 100644
--- a/modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
+++ b/modules/rosapps/applications/devutils/vgafontedit/fontboxeswnd.c
@@ -30,13 +30,6 @@ GetCharacterRect(IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT
CharacterRect
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)
{
diff --git a/modules/rosapps/applications/devutils/vgafontedit/precomp.h
b/modules/rosapps/applications/devutils/vgafontedit/precomp.h
index 94ac9ddfbfa..2e4ac775418 100644
--- a/modules/rosapps/applications/devutils/vgafontedit/precomp.h
+++ b/modules/rosapps/applications/devutils/vgafontedit/precomp.h
@@ -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);
-__inline VOID GetCharacterPosition(IN UINT uCharacter, OUT PUINT uFontRow, OUT PUINT
uFontColumn);
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);
diff --git a/modules/rosapps/applications/explorer-old/utility/dragdropimpl.h
b/modules/rosapps/applications/explorer-old/utility/dragdropimpl.h
index 6a59c67a078..6ba857f225f 100644
--- a/modules/rosapps/applications/explorer-old/utility/dragdropimpl.h
+++ b/modules/rosapps/applications/explorer-old/utility/dragdropimpl.h
@@ -246,15 +246,15 @@ public:
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);
}
diff --git a/modules/rosapps/applications/net/ncftp/ncftp/progress.c
b/modules/rosapps/applications/net/ncftp/ncftp/progress.c
index 0559f2f8d32..ef9f9ce0b0f 100644
--- a/modules/rosapps/applications/net/ncftp/ncftp/progress.c
+++ b/modules/rosapps/applications/net/ncftp/ncftp/progress.c
@@ -209,7 +209,7 @@ PrStatBar(const FTPCIPtr cip, int mode)
static double uTotal, uMult;
const char *stall;
char localName[80];
- char line[128];
+ char line[134];
int i;
switch (mode) {
diff --git a/modules/rosapps/applications/net/roshttpd/config.cpp
b/modules/rosapps/applications/net/roshttpd/config.cpp
index b689e1674b2..c64b8b76bbd 100644
--- a/modules/rosapps/applications/net/roshttpd/config.cpp
+++ b/modules/rosapps/applications/net/roshttpd/config.cpp
@@ -49,7 +49,7 @@ void CConfig::Default()
try {
lpsStr = _strdup(dcfgDefaultResource);
DefaultResources.Insert(lpsStr);
- } catch (bad_alloc e) {
+ } catch (bad_alloc&) {
free((void *)lpsStr);
Clear();
throw;
diff --git a/modules/rosapps/applications/net/roshttpd/httpd.cpp
b/modules/rosapps/applications/net/roshttpd/httpd.cpp
index d4bb9e3a6c6..4604d8ef2e5 100644
--- a/modules/rosapps/applications/net/roshttpd/httpd.cpp
+++ b/modules/rosapps/applications/net/roshttpd/httpd.cpp
@@ -461,22 +461,22 @@ VOID CHttpDaemonThread::Execute()
case HTTPD_START: {
if (Daemon->GetState() == hsStopped)
Daemon->Start();
- break;
+ break;
}
case HTTPD_STOP: {
if (Daemon->GetState() == hsRunning)
Daemon->Stop();
- break;
+ break;
}
case HTTPD_SUSPEND: {
if (Daemon->GetState() == hsRunning){}
// FIXME: Suspend service
- break;
+ break;
}
case HTTPD_RESUME: {
if (Daemon->GetState() != hsSuspended){}
// FIXME: Resume service
- break;
+ break;
}
default:
DispatchMessage(&Msg);
@@ -486,7 +486,7 @@ VOID CHttpDaemonThread::Execute()
delete Daemon;
} catch (ESocket e) {
ReportErrorStr(e.what());
- } catch (bad_alloc e) {
+ } catch (bad_alloc&) {
ReportErrorStr(TS("Insufficient resources."));
}
}
diff --git a/modules/rosapps/applications/net/roshttpd/roshttpd.cpp
b/modules/rosapps/applications/net/roshttpd/roshttpd.cpp
index 89af9bf5290..c4a911448b3 100644
--- a/modules/rosapps/applications/net/roshttpd/roshttpd.cpp
+++ b/modules/rosapps/applications/net/roshttpd/roshttpd.cpp
@@ -45,7 +45,7 @@ VOID Run()
if (pConfiguration != NULL)
delete pConfiguration;
- } catch (bad_alloc e) {
+ } catch (bad_alloc&) {
if (pConfiguration != NULL)
delete pConfiguration;
ReportErrorStr(TS("Insufficient resources."));
diff --git a/modules/rosapps/applications/sysutils/man/man.c
b/modules/rosapps/applications/sysutils/man/man.c
index 3c54eb346a5..e382972b08d 100644
--- a/modules/rosapps/applications/sysutils/man/man.c
+++ b/modules/rosapps/applications/sysutils/man/man.c
@@ -155,10 +155,10 @@ void text_outp(char *cur_string)
while(cur_string[symbol]!=' ')
symbol++;
-
for(;cur_string[symbol]!='\n'; symbol++)
putchar(cur_string[symbol]);
- putchar(' ');
+
+ putchar(' ');
}
int
@@ -214,13 +214,16 @@ AnalyzeFile()
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;
}
diff --git a/modules/rosapps/applications/sysutils/regexpl/Console.cpp
b/modules/rosapps/applications/sysutils/regexpl/Console.cpp
index 0f61aa0d50d..98219a349e6 100644
--- a/modules/rosapps/applications/sysutils/regexpl/Console.cpp
+++ b/modules/rosapps/applications/sysutils/regexpl/Console.cpp
@@ -716,7 +716,9 @@ Paste:
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
diff --git a/modules/rosapps/applications/sysutils/screenshot/screenshot.c
b/modules/rosapps/applications/sysutils/screenshot/screenshot.c
index d71d7f4aebf..233010145f1 100644
--- a/modules/rosapps/applications/sysutils/screenshot/screenshot.c
+++ b/modules/rosapps/applications/sysutils/screenshot/screenshot.c
@@ -272,14 +272,18 @@ ConvertDDBtoDIB(PSCREENSHOT pScrSht)
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)
{