mirror of
https://github.com/reactos/reactos.git
synced 2025-04-30 19:19:00 +00:00
[ROSAPPS] Fix GCC8 warnings
This commit is contained in:
parent
f7afca0973
commit
97d937add1
11 changed files with 53 additions and 42 deletions
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
if(GCC AND GCC_VERSION VERSION_GREATER 7)
|
||||||
|
add_compile_flags("-Wno-stringop-overflow")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(createspec createspec.c)
|
add_executable(createspec createspec.c)
|
||||||
set_module_type(createspec win32cui)
|
set_module_type(createspec win32cui)
|
||||||
target_link_libraries(createspec wine)
|
target_link_libraries(createspec wine)
|
||||||
|
|
|
@ -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
|
static INT
|
||||||
FontBoxesHitTest(IN UINT xPos, IN UINT yPos, OUT LPRECT CharacterRect)
|
FontBoxesHitTest(IN UINT xPos, IN UINT yPos, OUT LPRECT CharacterRect)
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,9 +136,14 @@ VOID CreateFontBoxesWindow(PFONT_WND_INFO FontWndInfo);
|
||||||
BOOL InitFontBoxesWndClass(VOID);
|
BOOL InitFontBoxesWndClass(VOID);
|
||||||
VOID UnInitFontBoxesWndClass(VOID);
|
VOID UnInitFontBoxesWndClass(VOID);
|
||||||
VOID GetCharacterRect(IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT CharacterRect);
|
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
|
// fontwnd.c
|
||||||
BOOL CreateFontWindow(PMAIN_WND_INFO MainWndInfo, PFONT_OPEN_INFO OpenInfo);
|
BOOL CreateFontWindow(PMAIN_WND_INFO MainWndInfo, PFONT_OPEN_INFO OpenInfo);
|
||||||
BOOL InitFontWndClass(VOID);
|
BOOL InitFontWndClass(VOID);
|
||||||
|
|
|
@ -246,15 +246,15 @@ public:
|
||||||
if (pDragSourceHelper == NULL)
|
if (pDragSourceHelper == NULL)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
SHDRAGIMAGE di;
|
SHDRAGIMAGE di;
|
||||||
BITMAP bm;
|
BITMAP bm;
|
||||||
GetObject(hBitmap, sizeof(bm), &bm);
|
GetObject(hBitmap, sizeof(bm), &bm);
|
||||||
di.sizeDragImage.cx = bm.bmWidth;
|
di.sizeDragImage.cx = bm.bmWidth;
|
||||||
di.sizeDragImage.cy = bm.bmHeight;
|
di.sizeDragImage.cy = bm.bmHeight;
|
||||||
di.hbmpDragImage = hBitmap;
|
di.hbmpDragImage = hBitmap;
|
||||||
di.crColorKey = crColorKey;
|
di.crColorKey = crColorKey;
|
||||||
di.ptOffset.x = pt.x - rc.left;
|
di.ptOffset.x = pt.x - rc.left;
|
||||||
di.ptOffset.y = pt.y - rc.top;
|
di.ptOffset.y = pt.y - rc.top;
|
||||||
return pDragSourceHelper->InitializeFromBitmap(&di, pDataObject);
|
return pDragSourceHelper->InitializeFromBitmap(&di, pDataObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ PrStatBar(const FTPCIPtr cip, int mode)
|
||||||
static double uTotal, uMult;
|
static double uTotal, uMult;
|
||||||
const char *stall;
|
const char *stall;
|
||||||
char localName[80];
|
char localName[80];
|
||||||
char line[128];
|
char line[134];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ void CConfig::Default()
|
||||||
try {
|
try {
|
||||||
lpsStr = _strdup(dcfgDefaultResource);
|
lpsStr = _strdup(dcfgDefaultResource);
|
||||||
DefaultResources.Insert(lpsStr);
|
DefaultResources.Insert(lpsStr);
|
||||||
} catch (bad_alloc e) {
|
} catch (bad_alloc&) {
|
||||||
free((void *)lpsStr);
|
free((void *)lpsStr);
|
||||||
Clear();
|
Clear();
|
||||||
throw;
|
throw;
|
||||||
|
|
|
@ -461,22 +461,22 @@ VOID CHttpDaemonThread::Execute()
|
||||||
case HTTPD_START: {
|
case HTTPD_START: {
|
||||||
if (Daemon->GetState() == hsStopped)
|
if (Daemon->GetState() == hsStopped)
|
||||||
Daemon->Start();
|
Daemon->Start();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HTTPD_STOP: {
|
case HTTPD_STOP: {
|
||||||
if (Daemon->GetState() == hsRunning)
|
if (Daemon->GetState() == hsRunning)
|
||||||
Daemon->Stop();
|
Daemon->Stop();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HTTPD_SUSPEND: {
|
case HTTPD_SUSPEND: {
|
||||||
if (Daemon->GetState() == hsRunning){}
|
if (Daemon->GetState() == hsRunning){}
|
||||||
// FIXME: Suspend service
|
// FIXME: Suspend service
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HTTPD_RESUME: {
|
case HTTPD_RESUME: {
|
||||||
if (Daemon->GetState() != hsSuspended){}
|
if (Daemon->GetState() != hsSuspended){}
|
||||||
// FIXME: Resume service
|
// FIXME: Resume service
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DispatchMessage(&Msg);
|
DispatchMessage(&Msg);
|
||||||
|
@ -486,7 +486,7 @@ VOID CHttpDaemonThread::Execute()
|
||||||
delete Daemon;
|
delete Daemon;
|
||||||
} catch (ESocket e) {
|
} catch (ESocket e) {
|
||||||
ReportErrorStr(e.what());
|
ReportErrorStr(e.what());
|
||||||
} catch (bad_alloc e) {
|
} catch (bad_alloc&) {
|
||||||
ReportErrorStr(TS("Insufficient resources."));
|
ReportErrorStr(TS("Insufficient resources."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ VOID Run()
|
||||||
|
|
||||||
if (pConfiguration != NULL)
|
if (pConfiguration != NULL)
|
||||||
delete pConfiguration;
|
delete pConfiguration;
|
||||||
} catch (bad_alloc e) {
|
} catch (bad_alloc&) {
|
||||||
if (pConfiguration != NULL)
|
if (pConfiguration != NULL)
|
||||||
delete pConfiguration;
|
delete pConfiguration;
|
||||||
ReportErrorStr(TS("Insufficient resources."));
|
ReportErrorStr(TS("Insufficient resources."));
|
||||||
|
|
|
@ -155,10 +155,10 @@ void text_outp(char *cur_string)
|
||||||
while(cur_string[symbol]!=' ')
|
while(cur_string[symbol]!=' ')
|
||||||
symbol++;
|
symbol++;
|
||||||
|
|
||||||
|
|
||||||
for(;cur_string[symbol]!='\n'; symbol++)
|
for(;cur_string[symbol]!='\n'; symbol++)
|
||||||
putchar(cur_string[symbol]);
|
putchar(cur_string[symbol]);
|
||||||
putchar(' ');
|
|
||||||
|
putchar(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -214,13 +214,16 @@ AnalyzeFile()
|
||||||
putchar(' ');
|
putchar(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
else text_outp(cur_string); // print plane text
|
else
|
||||||
th_outp(cur_string, THtag);
|
{
|
||||||
/* END of TAGs processing */
|
text_outp(cur_string); // print plane text
|
||||||
free(cur_string);
|
}
|
||||||
free(THtag);
|
th_outp(cur_string, THtag);
|
||||||
|
/* END of TAGs processing */
|
||||||
|
|
||||||
return 0;
|
free(cur_string);
|
||||||
|
free(THtag);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -716,7 +716,9 @@ Paste:
|
||||||
ASSERT(dwCompletionOffset <= dwCurrentCharOffset);
|
ASSERT(dwCompletionOffset <= dwCurrentCharOffset);
|
||||||
|
|
||||||
// Save not changing part (context) of completion in m_pchBuffer1
|
// 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;
|
m_pchBuffer1[dwCompletionOffset] = 0;
|
||||||
|
|
||||||
// Size of changing part
|
// Size of changing part
|
||||||
|
|
|
@ -272,14 +272,18 @@ ConvertDDBtoDIB(PSCREENSHOT pScrSht)
|
||||||
cClrBits = 24;
|
cClrBits = 24;
|
||||||
else cClrBits = 32;
|
else cClrBits = 32;
|
||||||
|
|
||||||
if (cClrBits != 24)
|
if (cClrBits != 24)
|
||||||
pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(),
|
{
|
||||||
0,
|
pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(),
|
||||||
sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1 << cClrBits));
|
0,
|
||||||
else
|
sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1 << cClrBits));
|
||||||
pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(),
|
}
|
||||||
0,
|
else
|
||||||
sizeof(BITMAPINFOHEADER));
|
{
|
||||||
|
pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(),
|
||||||
|
0,
|
||||||
|
sizeof(BITMAPINFOHEADER));
|
||||||
|
}
|
||||||
|
|
||||||
if (!pScrSht->lpbi)
|
if (!pScrSht->lpbi)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue