From 80ead27c5a721f4adf267756dd868d0ed8a22c06 Mon Sep 17 00:00:00 2001 From: Dejan Budimir Date: Sun, 22 Jul 2018 13:57:18 +0200 Subject: [PATCH 1/2] Prepare for MinGW makefile. The code needs a few (minor) fixes for things which give the more pedantic GCC some trouble. - possible uses of uninitialized variables - signed-unsigned comparisons - missing fields in initializers - missing casts - missing braces - 'escapes' at EOLs (in comments) - a nested comment --- .gitignore | 8 ++ build/mingw/EditPrint_dummy.c | 5 ++ build/mingw/makefile | 0 build/mingw/mingw_build_macros.h | 69 ++++++++++++++ src/Dlapi.c | 27 +++--- src/Dlapi.h | 2 +- src/Edit.c | 38 ++++---- src/Edit.h | 2 +- src/Helpers.c | 22 ++--- src/Helpers.h | 6 +- src/Notepad2.c | 81 +++++++++-------- src/Notepad2.h | 2 +- src/Styles.c | 150 +++++++++++++++---------------- src/Version.h | 2 + 14 files changed, 254 insertions(+), 160 deletions(-) create mode 100644 build/mingw/EditPrint_dummy.c create mode 100644 build/mingw/makefile create mode 100644 build/mingw/mingw_build_macros.h diff --git a/.gitignore b/.gitignore index 0d2c59ba..bf3e2cb4 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,11 @@ /res/Notepad2.exe.manifest /signinfo.txt /src/VersionRev.h +/build/mingw/*.o +/build/mingw/*/*.o +/build/mingw/*.exe +.tags +.tags_sorted_by_file +*.sublime-project +*.sublime-workspace +*.ansi.rc \ No newline at end of file diff --git a/build/mingw/EditPrint_dummy.c b/build/mingw/EditPrint_dummy.c new file mode 100644 index 00000000..8e399771 --- /dev/null +++ b/build/mingw/EditPrint_dummy.c @@ -0,0 +1,5 @@ +#include + +BOOL EditPrint(HWND h,LPCWSTR s1,LPCWSTR s2) { return FALSE; } +void EditPrintSetup(HWND h) {} +void EditPrintInit() {} diff --git a/build/mingw/makefile b/build/mingw/makefile new file mode 100644 index 00000000..e69de29b diff --git a/build/mingw/mingw_build_macros.h b/build/mingw/mingw_build_macros.h new file mode 100644 index 00000000..c22a0444 --- /dev/null +++ b/build/mingw/mingw_build_macros.h @@ -0,0 +1,69 @@ +#ifndef MINGW_BUILD_MACROS_H +#define MINGW_BUILD_MACROS_H + + +#define VERSION_COMPILER__EXPAND_INNER(x) #x +#define VERSION_COMPILER__EXPAND(x) VERSION_COMPILER__EXPAND_INNER(x) +#define VERSION_COMPILER \ +(L"MinGW " \ +VERSION_COMPILER__EXPAND(__GNUC__) "." \ +VERSION_COMPILER__EXPAND(__GNUC_MINOR__) "." \ +VERSION_COMPILER__EXPAND(__GNUC_PATCHLEVEL__)) + + +// https://msdn.microsoft.com/en-us/library/ms942642.aspx +#define TBBUTTON_INIT_6(\ +iBitmap,idCommand,fsState,fsStyle,dwData,iString){\ +iBitmap,idCommand,fsState,fsStyle,dwData,iString} + +// https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/commctrl.h +#define TBBUTTON_INIT_7(\ +iBitmap,idCommand,fsState,fsStyle,dwData,iString){\ +iBitmap,idCommand,fsState,fsStyle,{0},dwData,iString} + +// https://docs.microsoft.com/en-us/windows/desktop/api/commctrl/ns-commctrl-_tbbutton +#define TBBUTTON_INIT_8(\ +iBitmap,idCommand,fsState,fsStyle,dwData,iString){\ +iBitmap,idCommand,fsState,fsStyle,{0},{0},dwData,iString} + + +#define EDITFINDREPLACE_INIT_11(\ +szFind,szReplace,szFindUTF8,szReplaceUTF8,fuFlags,bTransformBS,\ +bObsolete,bFindClose,bReplaceClose,bNoFindWrap,hwnd){\ +szFind,szReplace,szFindUTF8,szReplaceUTF8,fuFlags,bTransformBS,\ +bObsolete,bFindClose,bReplaceClose,bNoFindWrap,hwnd} + +#define EDITFINDREPLACE_INIT_12(\ +szFind,szReplace,szFindUTF8,szReplaceUTF8,fuFlags,bTransformBS,\ +bObsolete,bFindClose,bReplaceClose,bNoFindWrap,hwnd){\ +szFind,szReplace,szFindUTF8,szReplaceUTF8,fuFlags,bTransformBS,\ +bObsolete,bFindClose,bReplaceClose,bNoFindWrap,hwnd,FALSE} + + +#define EDITLEXER_INIT_A(\ +iLexer,rid,pszName,pszDefExt,szExtensions,pKeyWords,Styles){\ +iLexer,rid,pszName,pszDefExt,szExtensions,pKeyWords,Styles} + + +#ifdef BOOKMARK_EDITION +#define EDITFINDREPLACE_INIT EDITFINDREPLACE_INIT_12 +#else +#define EDITFINDREPLACE_INIT EDITFINDREPLACE_INIT_11 +#endif // !BOOKMARK_EDITION + + +#ifdef MINGW_BUILD +#define TBBUTTON_INIT TBBUTTON_INIT_7 +#define FORCE_INLINE __attribute__((always_inline)) +// #define UNUSED __attribute__((unused)) +// #define UNUSED_VAR(x) +// #define ALLOW_EXTRA_SEMICOLON(counter) char const dummy ## counter +#else +#define TBBUTTON_INIT TBBUTTON_INIT_6 +// #define UNUSED +// #define UNUSED_VAR(x) x +// #define ALLOW_EXTRA_SEMICOLON(counter) +#endif // !MINGW_BUILD + + +#endif // !MINGW_BUILD_MACROS_H diff --git a/src/Dlapi.c b/src/Dlapi.c index ed4951d8..c81a42cf 100644 --- a/src/Dlapi.c +++ b/src/Dlapi.c @@ -69,7 +69,7 @@ BOOL DirList_Init(HWND hwnd,LPCWSTR pszHeader) LV_COLUMN lvc; // Allocate DirListData Property - LPDLDATA lpdl = (LPVOID)GlobalAlloc(GPTR,sizeof(DLDATA)); + LPDLDATA lpdl = (LPDLDATA)GlobalAlloc(GPTR,sizeof(DLDATA)); SetProp(hwnd,pDirListProp,(HANDLE)lpdl); // Setup dl @@ -123,7 +123,7 @@ BOOL DirList_Init(HWND hwnd,LPCWSTR pszHeader) BOOL DirList_Destroy(HWND hwnd) { - LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp); + LPDLDATA lpdl = (LPDLDATA)GetProp(hwnd,pDirListProp); // Release multithreading objects DirList_TerminateIconThread(hwnd); @@ -297,7 +297,7 @@ int DirList_Fill(HWND hwnd,LPCWSTR lpszDir,DWORD grfFlags,LPCWSTR lpszFileSpec, pidl, NULL, &IID_IShellFolder, - &lpsf)) + (void**)&lpsf)) { @@ -326,7 +326,7 @@ int DirList_Fill(HWND hwnd,LPCWSTR lpszDir,DWORD grfFlags,LPCWSTR lpszFileSpec, lpsf->lpVtbl->GetAttributesOf( lpsf, 1, - &pidlEntry, + (ITEMIDLIST const **)&pidlEntry, &dwAttributes); if (dwAttributes & SFGAO_FILESYSTEM) @@ -434,7 +434,7 @@ DWORD WINAPI DirList_IconThread(LPVOID lpParam) CoInitialize(NULL); // Get IShellIcon - lpdl->lpsf->lpVtbl->QueryInterface(lpdl->lpsf,&IID_IShellIcon,&lpshi); + lpdl->lpsf->lpVtbl->QueryInterface(lpdl->lpsf,&IID_IShellIcon,(void **)&lpshi); while (iItem < iMaxItem && WaitForSingleObject(lpdl->hExitThread,0) != WAIT_OBJECT_0) { @@ -465,7 +465,8 @@ DWORD WINAPI DirList_IconThread(LPVOID lpParam) // Link and Share Overlay lplvid->lpsf->lpVtbl->GetAttributesOf( lplvid->lpsf, - 1,&lplvid->pidl, + 1, + (ITEMIDLIST const **)&lplvid->pidl, &dwAttributes); if (dwAttributes & SFGAO_LINK) @@ -848,10 +849,10 @@ BOOL DirList_PropertyDlg(HWND hwnd,int iItem) lplvid->lpsf, GetParent(hwnd), // Owner 1, // Number of objects - &lplvid->pidl, // pidl + (ITEMIDLIST const **)&lplvid->pidl, // pidl &IID_IContextMenu, NULL, - &lpcm)) + (void **)&lpcm)) { cmi.cbSize = sizeof(CMINVOKECOMMANDINFO); @@ -1128,7 +1129,7 @@ int DriveBox_Fill(HWND hwnd) pidl, NULL, &IID_IShellFolder, - &lpsf)) + (void **)&lpsf)) { @@ -1157,7 +1158,7 @@ int DriveBox_Fill(HWND hwnd) lpsf->lpVtbl->GetAttributesOf( lpsf, 1, - &pidlEntry, + (ITEMIDLIST const **)&pidlEntry, &dwAttributes); if (dwAttributes & SFGAO_FILESYSTEM) @@ -1350,10 +1351,10 @@ BOOL DriveBox_PropertyDlg(HWND hwnd) lpdcid->lpsf, GetParent(hwnd), // Owner 1, // Number of objects - &lpdcid->pidl, // pidl + (ITEMIDLIST const **)&lpdcid->pidl, // pidl &IID_IContextMenu, NULL, - &lpcm)) + (void **)&lpcm)) { cmi.cbSize = sizeof(CMINVOKECOMMANDINFO); @@ -1583,4 +1584,4 @@ BOOL IL_GetDisplayName(LPSHELLFOLDER lpsf, -/// End of Dlapi.c \\\ +/// End of Dlapi.c /// diff --git a/src/Dlapi.h b/src/Dlapi.h index 66348669..e5c8284f 100644 --- a/src/Dlapi.h +++ b/src/Dlapi.h @@ -193,4 +193,4 @@ BOOL IL_GetDisplayName(LPSHELLFOLDER, #endif // _DLAPI_H_ -/// End of Dlapi.h \\\ +/// End of Dlapi.h /// diff --git a/src/Edit.c b/src/Edit.c index 39a70d04..6709ae76 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -637,7 +637,7 @@ void Encoding_InitDefaults() { // Try to set the DOS encoding to DOS-437 if the default OEMCP is not DOS-437 if (mEncoding[g_DOSEncoding].uCodePage != 437) { - int i; + size_t i; for (i = CPI_UTF7 + 1; i < COUNTOF(mEncoding); ++i) { if (mEncoding[i].uCodePage == 437 && Encoding_IsValid(i)) { g_DOSEncoding = i; @@ -661,7 +661,7 @@ int Encoding_MapIniSetting(BOOL bLoad,int iSetting) { case 7: return CPI_UNICODEBE; case 8: return CPI_UTF7; default: { - int i; + size_t i; for (i = CPI_UTF7 + 1; i < COUNTOF(mEncoding); i++) { if (mEncoding[i].uCodePage == (UINT)iSetting && Encoding_IsValid(i)) return(i); @@ -712,7 +712,7 @@ int Encoding_MatchW(LPCWSTR pwszTest) { int Encoding_MatchA(char *pchTest) { - int i; + size_t i; char chTest[256]; char *pchSrc = pchTest; char *pchDst = chTest; @@ -742,7 +742,7 @@ int Encoding_MatchA(char *pchTest) { BOOL Encoding_IsValid(int iTestEncoding) { CPINFO cpi; if (iTestEncoding >= 0 && - iTestEncoding < COUNTOF(mEncoding)) { + (size_t)iTestEncoding < COUNTOF(mEncoding)) { if ((mEncoding[iTestEncoding].uFlags & NCP_INTERNAL) || IsValidCodePage(mEncoding[iTestEncoding].uCodePage) && GetCPInfo(mEncoding[iTestEncoding].uCodePage,&cpi)) { @@ -764,7 +764,7 @@ int CmpEncoding(const void *s1, const void *s2) { void Encoding_AddToListView(HWND hwnd,int idSel,BOOL bRecodeOnly) { - int i; + size_t i; int iSelItem = -1; LVITEM lvi; WCHAR wchBuf[256]; @@ -853,7 +853,7 @@ BOOL Encoding_GetFromListView(HWND hwnd,int *pidEncoding) void Encoding_AddToComboboxEx(HWND hwnd,int idSel,BOOL bRecodeOnly) { - int i; + size_t i; int iSelItem = -1; COMBOBOXEXITEM cbei; WCHAR wchBuf[256]; @@ -2106,7 +2106,7 @@ void EditEscapeCChars(HWND hwnd) { { if (SC_SEL_RECTANGLE != SendMessage(hwnd,SCI_GETSELECTIONMODE,0,0)) { - EDITFINDREPLACE efr = { "", "", "", "", 0, 0, 0, 0, 0, 0, hwnd }; + EDITFINDREPLACE efr = EDITFINDREPLACE_INIT("", "", "", "", 0, 0, 0, 0, 0, 0, hwnd); SendMessage(hwnd,SCI_BEGINUNDOACTION,0,0); @@ -2140,7 +2140,7 @@ void EditUnescapeCChars(HWND hwnd) { { if (SC_SEL_RECTANGLE != SendMessage(hwnd,SCI_GETSELECTIONMODE,0,0)) { - EDITFINDREPLACE efr = { "", "", "", "", 0, 0, 0, 0, 0, 0, hwnd }; + EDITFINDREPLACE efr = EDITFINDREPLACE_INIT("", "", "", "", 0, 0, 0, 0, 0, 0, hwnd); SendMessage(hwnd,SCI_BEGINUNDOACTION,0,0); @@ -2222,7 +2222,7 @@ void EditHex2Char(HWND hwnd) { if (iSelEnd - iSelStart) { - if (SendMessage(hwnd,SCI_GETSELTEXT,0,0) <= COUNTOF(ch)) { + if ((size_t)SendMessage(hwnd,SCI_GETSELTEXT,0,0) <= COUNTOF(ch)) { SendMessage(hwnd,SCI_GETSELTEXT,0,(LPARAM)ch); @@ -2285,7 +2285,7 @@ void EditModifyNumber(HWND hwnd,BOOL bIncrease) { int iNumber; int iWidth; - if (SendMessage(hwnd,SCI_GETSELTEXT,0,0) <= COUNTOF(chNumber)) { + if ((size_t)SendMessage(hwnd,SCI_GETSELTEXT,0,0) <= COUNTOF(chNumber)) { SendMessage(hwnd,SCI_GETSELTEXT,0,(LPARAM)chNumber); if (StrChrIA(chNumber,'-')) @@ -3818,7 +3818,7 @@ void EditStripTrailingBlanks(HWND hwnd,BOOL bIgnoreSelection) { if (SC_SEL_RECTANGLE != SendMessage(hwnd,SCI_GETSELECTIONMODE,0,0)) { - EDITFINDREPLACE efrTrim = { "[ \t]+$", "", "", "", SCFIND_REGEXP, 0, 0, 0, 0, 0, hwnd }; + EDITFINDREPLACE efrTrim = EDITFINDREPLACE_INIT("[ \t]+$", "", "", "", SCFIND_REGEXP, 0, 0, 0, 0, 0, hwnd); EditReplaceAllInSelection(hwnd,&efrTrim,FALSE); } else @@ -4417,10 +4417,10 @@ void EditSortLines(HWND hwnd,int iSortFlags) int iLineCount; BOOL bIsRectangular = FALSE; - int iRcCurLine; - int iRcAnchorLine; - int iRcCurCol; - int iRcAnchorCol; + int iRcCurLine = 0; + int iRcAnchorLine = 0; + int iRcCurCol = 0; + int iRcAnchorCol = 0; int i, iLine; int cchTotal = 0; @@ -5398,7 +5398,7 @@ HWND EditFindReplaceDlg(HWND hwnd,LPCEDITFINDREPLACE lpefr,BOOL bReplace) iSource++; iDest++; } - szWildcardEscaped[iDest] = (char)NULL; + szWildcardEscaped[iDest] = '\0'; lstrcpynA(szFind2,szWildcardEscaped,COUNTOF(szWildcardEscaped)); } #endif @@ -6379,7 +6379,7 @@ INT_PTR CALLBACK EditModifyLinesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM if (GetActiveWindow() == hwnd) { if (dwId >= 200 && dwId <= 205) { - if (id_capture == dwId || id_capture == 0) { + if ((DWORD)id_capture == dwId || id_capture == 0) { if (id_hover != id_capture || id_hover == 0) { id_hover = dwId; //InvalidateRect(GetDlgItem(hwnd,dwId),NULL,FALSE); @@ -7234,7 +7234,7 @@ BOOL FileVars_IsValidEncoding(LPFILEVARS lpfv) { CPINFO cpi; if (lpfv->mask & FV_ENCODING && lpfv->iEncoding >= 0 && - lpfv->iEncoding < COUNTOF(mEncoding)) { + (size_t)lpfv->iEncoding < COUNTOF(mEncoding)) { if ((mEncoding[lpfv->iEncoding].uFlags & NCP_INTERNAL) || IsValidCodePage(mEncoding[lpfv->iEncoding].uCodePage) && GetCPInfo(mEncoding[lpfv->iEncoding].uCodePage,&cpi)) { @@ -7394,4 +7394,4 @@ int FileVars_GetEncoding(LPFILEVARS lpfv) { -/// End of Edit.c \\\ +/// End of Edit.c /// diff --git a/src/Edit.h b/src/Edit.h index bc3f59bc..f4ebe01b 100644 --- a/src/Edit.h +++ b/src/Edit.h @@ -222,4 +222,4 @@ int FileVars_GetEncoding(LPFILEVARS); -/// End of Edit.h \\\ +/// End of Edit.h /// diff --git a/src/Helpers.c b/src/Helpers.c index 8138467b..67f95d38 100644 --- a/src/Helpers.c +++ b/src/Helpers.c @@ -707,7 +707,7 @@ void MakeColorPickButton(HWND hwnd,int nCtlId,HINSTANCE hInstance,COLORREF crCol if (SendMessage(hwndCtl,BCM_GETIMAGELIST,0,(LPARAM)&bi)) himlOld = bi.himl; - if (IsWindowEnabled(hwndCtl) && crColor != -1) { + if (IsWindowEnabled(hwndCtl) && crColor != (COLORREF)-1) { colormap[0].from = RGB(0x00,0x00,0x00); colormap[0].to = GetSysColor(COLOR_3DSHADOW); } @@ -716,7 +716,7 @@ void MakeColorPickButton(HWND hwnd,int nCtlId,HINSTANCE hInstance,COLORREF crCol colormap[0].to = RGB(0xFF,0xFF,0xFF); } - if (IsWindowEnabled(hwndCtl) && crColor != -1) { + if (IsWindowEnabled(hwndCtl) && crColor != (COLORREF)-1) { if (crColor == RGB(0xFF,0xFF,0xFF)) crColor = RGB(0xFF,0xFF,0xFE); @@ -854,12 +854,14 @@ int Toolbar_GetButtons(HWND hwnd,int cmdBase,LPWSTR lpszButtons,int cchButtons) return(c); } -int Toolbar_SetButtons(HWND hwnd,int cmdBase,LPCWSTR lpszButtons,LPCTBBUTTON ptbb,int ctbb) +int Toolbar_SetButtons(HWND hwnd,int cmdBase,LPCWSTR lpszButtons,void* ptbb_v,int ctbb) { WCHAR tchButtons[512]; WCHAR *p; int i,c; int iCmd; + + TBBUTTON const * ptbb = (TBBUTTON const *) ptbb_v; ZeroMemory(tchButtons,COUNTOF(tchButtons)*sizeof(tchButtons[0])); lstrcpyn(tchButtons,lpszButtons,COUNTOF(tchButtons)-2); @@ -871,7 +873,7 @@ int Toolbar_SetButtons(HWND hwnd,int cmdBase,LPCWSTR lpszButtons,LPCTBBUTTON ptb for (i = 0; i < c; i++) SendMessage(hwnd,TB_DELETEBUTTON,0,0); - for (i = 0; i < COUNTOF(tchButtons); i++) + for (i = 0; (size_t)i < COUNTOF(tchButtons); i++) if (tchButtons[i] == L' ') tchButtons[i] = 0; p = tchButtons; @@ -1896,23 +1898,23 @@ BOOL GetThemedDialogFont(LPWSTR lpFaceName,WORD* wSize) return(bSucceed); } -__inline BOOL DialogTemplate_IsDialogEx(const DLGTEMPLATE* pTemplate) { +static __inline BOOL DialogTemplate_IsDialogEx(const DLGTEMPLATE* pTemplate) { return ((DLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF; } -__inline BOOL DialogTemplate_HasFont(const DLGTEMPLATE* pTemplate) { +static __inline BOOL DialogTemplate_HasFont(const DLGTEMPLATE* pTemplate) { return (DS_SETFONT & (DialogTemplate_IsDialogEx(pTemplate) ? ((DLGTEMPLATEEX*)pTemplate)->style : pTemplate->style)); } -__inline int DialogTemplate_FontAttrSize(BOOL bDialogEx) { +static __inline int DialogTemplate_FontAttrSize(BOOL bDialogEx) { return (int)sizeof(WORD) * (bDialogEx ? 3 : 1); } -__inline BYTE* DialogTemplate_GetFontSizeField(const DLGTEMPLATE* pTemplate) { +static __inline BYTE* DialogTemplate_GetFontSizeField(const DLGTEMPLATE* pTemplate) { BOOL bDialogEx = DialogTemplate_IsDialogEx(pTemplate); WORD* pw; @@ -2052,7 +2054,7 @@ HWND CreateThemedDialogParam( * UnSlash functions * Mostly taken from SciTE, (c) Neil Hodgson, http://www.scintilla.org * -/ +*/ /** * Is the character an octal digit? @@ -2386,4 +2388,4 @@ VOID RestoreWndFromTray(HWND hWnd) -/// End of Helpers.c \\\ +/// End of Helpers.c /// diff --git a/src/Helpers.h b/src/Helpers.h index 490fac20..9601d1d1 100644 --- a/src/Helpers.h +++ b/src/Helpers.h @@ -37,6 +37,7 @@ extern WCHAR szIniFile[MAX_PATH]; WritePrivateProfileString(lpSection,lpName,lpString,szIniFile) #define IniDeleteSection(lpSection) \ WritePrivateProfileSection(lpSection,NULL,szIniFile) +__inline BOOL IniSetInt(LPCWSTR lpSection,LPCWSTR lpName,int i) FORCE_INLINE; __inline BOOL IniSetInt(LPCWSTR lpSection,LPCWSTR lpName,int i) { WCHAR tch[32]; wsprintf(tch,L"%i",i); return IniSetString(lpSection,lpName,tch); } @@ -47,16 +48,19 @@ __inline BOOL IniSetInt(LPCWSTR lpSection,LPCWSTR lpName,int i) { int IniSectionGetString(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,int); int IniSectionGetInt(LPCWSTR,LPCWSTR,int); BOOL IniSectionSetString(LPWSTR,LPCWSTR,LPCWSTR); +__inline BOOL IniSectionSetInt(LPWSTR lpCachedIniSection,LPCWSTR lpName,int i) FORCE_INLINE; __inline BOOL IniSectionSetInt(LPWSTR lpCachedIniSection,LPCWSTR lpName,int i) { WCHAR tch[32]; wsprintf(tch,L"%i",i); return IniSectionSetString(lpCachedIniSection,lpName,tch); } extern HWND hwndEdit; +__inline void BeginWaitCursor() FORCE_INLINE; __inline void BeginWaitCursor() { SendMessage(hwndEdit,SCI_SETCURSOR,(WPARAM)SC_CURSORWAIT,0); } +__inline void EndWaitCursor() FORCE_INLINE; __inline void EndWaitCursor() { POINT pt; @@ -234,4 +238,4 @@ VOID RestoreWndFromTray(HWND hWnd); -/// End of Helpers.h \\\ +/// End of Helpers.h /// diff --git a/src/Notepad2.c b/src/Notepad2.c index d6b2523a..61380575 100644 --- a/src/Notepad2.c +++ b/src/Notepad2.c @@ -59,38 +59,38 @@ HWND hDlgFindReplace = NULL; #define NUMINITIALTOOLS 24 #define MARGIN_FOLD_INDEX 2 -TBBUTTON tbbMainWnd[] = { {0,IDT_FILE_NEW,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {1,IDT_FILE_OPEN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {2,IDT_FILE_BROWSE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {3,IDT_FILE_SAVE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {0,0,0,TBSTYLE_SEP,0,0}, - {4,IDT_EDIT_UNDO,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {5,IDT_EDIT_REDO,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {0,0,0,TBSTYLE_SEP,0,0}, - {6,IDT_EDIT_CUT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {7,IDT_EDIT_COPY,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {8,IDT_EDIT_PASTE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {0,0,0,TBSTYLE_SEP,0,0}, - {9,IDT_EDIT_FIND,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {10,IDT_EDIT_REPLACE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {0,0,0,TBSTYLE_SEP,0,0}, - {11,IDT_VIEW_WORDWRAP,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {0,0,0,TBSTYLE_SEP,0,0}, - {12,IDT_VIEW_ZOOMIN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {13,IDT_VIEW_ZOOMOUT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {0,0,0,TBSTYLE_SEP,0,0}, - {14,IDT_VIEW_SCHEME,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {15,IDT_VIEW_SCHEMECONFIG,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {0,0,0,TBSTYLE_SEP,0,0}, - {16,IDT_FILE_EXIT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {17,IDT_FILE_SAVEAS,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {18,IDT_FILE_SAVECOPY,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {19,IDT_EDIT_CLEAR,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {20,IDT_FILE_PRINT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {21,IDT_FILE_OPENFAV,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {22,IDT_FILE_ADDTOFAV,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {23,IDT_VIEW_TOGGLEFOLDS,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0}, - {24,IDT_FILE_LAUNCH,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0} }; +TBBUTTON tbbMainWnd[] = { TBBUTTON_INIT(0,IDT_FILE_NEW,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(1,IDT_FILE_OPEN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(2,IDT_FILE_BROWSE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(3,IDT_FILE_SAVE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(0,0,0,TBSTYLE_SEP,0,0), + TBBUTTON_INIT(4,IDT_EDIT_UNDO,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(5,IDT_EDIT_REDO,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(0,0,0,TBSTYLE_SEP,0,0), + TBBUTTON_INIT(6,IDT_EDIT_CUT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(7,IDT_EDIT_COPY,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(8,IDT_EDIT_PASTE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(0,0,0,TBSTYLE_SEP,0,0), + TBBUTTON_INIT(9,IDT_EDIT_FIND,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(10,IDT_EDIT_REPLACE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(0,0,0,TBSTYLE_SEP,0,0), + TBBUTTON_INIT(11,IDT_VIEW_WORDWRAP,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(0,0,0,TBSTYLE_SEP,0,0), + TBBUTTON_INIT(12,IDT_VIEW_ZOOMIN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(13,IDT_VIEW_ZOOMOUT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(0,0,0,TBSTYLE_SEP,0,0), + TBBUTTON_INIT(14,IDT_VIEW_SCHEME,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(15,IDT_VIEW_SCHEMECONFIG,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(0,0,0,TBSTYLE_SEP,0,0), + TBBUTTON_INIT(16,IDT_FILE_EXIT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(17,IDT_FILE_SAVEAS,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(18,IDT_FILE_SAVECOPY,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(19,IDT_EDIT_CLEAR,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(20,IDT_FILE_PRINT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(21,IDT_FILE_OPENFAV,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(22,IDT_FILE_ADDTOFAV,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(23,IDT_VIEW_TOGGLEFOLDS,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0), + TBBUTTON_INIT(24,IDT_FILE_LAUNCH,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0) }; WCHAR szIniFile[MAX_PATH] = L""; WCHAR szIniFile2[MAX_PATH] = L""; @@ -245,7 +245,7 @@ UINT msgTaskbarCreated = 0; HMODULE hModUxTheme = NULL; -EDITFINDREPLACE efrData = { "", "", "", "", 0, 0, 0, 0, 0, 0, NULL }; +EDITFINDREPLACE efrData = EDITFINDREPLACE_INIT("", "", "", "", 0, FALSE, FALSE, FALSE, FALSE, FALSE, NULL); UINT cpLastFind = 0; BOOL bReplaceInitialized = FALSE; @@ -1525,8 +1525,10 @@ LRESULT CALLBACK MainWndProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam) if (umsg == msgTaskbarCreated) { if (!IsWindowVisible(hwnd)) + { ShowNotifyIcon(hwnd,TRUE); SetNotifyIconTitle(hwnd); + } return(0); } @@ -1753,7 +1755,8 @@ void CreateBars(HWND hwnd,HINSTANCE hInstance) BOOL bIsAppThemed = PrivateIsAppThemed(); - int i,n; + size_t i; + int n; WCHAR tchDesc[256]; WCHAR tchIndex[256]; @@ -4540,7 +4543,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam) struct tm sst; UINT cp; - EDITFINDREPLACE efrTS = { "", "", "", "", SCFIND_REGEXP, 0, 0, 0, 0, 0, hwndEdit }; + EDITFINDREPLACE efrTS = EDITFINDREPLACE_INIT( "", "", "", "", SCFIND_REGEXP, 0, 0, 0, 0, 0, hwndEdit); IniGetString(L"Settings2",L"TimeStamp",L"\\$Date:[^\\$]+\\$ | $Date: %Y/%m/%d %H:%M:%S $",wchFind,COUNTOF(wchFind)); @@ -4603,7 +4606,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam) cchSelection = (int)SendMessage(hwndEdit,SCI_GETSELECTIONEND,0,0) - (int)SendMessage(hwndEdit,SCI_GETSELECTIONSTART,0,0); - if (cchSelection > 0 && cchSelection <= 500 && SendMessage(hwndEdit,SCI_GETSELTEXT,0,0) < COUNTOF(mszSelection)) + if (cchSelection > 0 && cchSelection <= 500 && (size_t)SendMessage(hwndEdit,SCI_GETSELTEXT,0,0) < COUNTOF(mszSelection)) { SendMessage(hwndEdit,SCI_GETSELTEXT,0,(LPARAM)mszSelection); mszSelection[cchSelection] = 0; // zero terminate @@ -5363,7 +5366,7 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam) case TBN_GETBUTTONINFO: { - if (((LPTBNOTIFY)lParam)->iItem < COUNTOF(tbbMainWnd)) + if ((size_t)((LPTBNOTIFY)lParam)->iItem < COUNTOF(tbbMainWnd)) { WCHAR tch[256]; GetString(tbbMainWnd[((LPTBNOTIFY)lParam)->iItem].idCommand,tch,COUNTOF(tch)); @@ -7021,7 +7024,7 @@ BOOL FileSave(BOOL bSaveAlways,BOOL bAsk,BOOL bSaveAs,BOOL bSaveCopy) } } - if (!bSaveAlways && (!bModified && iEncoding == iOriginalEncoding || bIsEmptyNewFile) && !bSaveAs) + if (!bSaveAlways && (!bModified && (iEncoding == iOriginalEncoding) || bIsEmptyNewFile) && !bSaveAs) return TRUE; if (bAsk) @@ -7904,4 +7907,4 @@ void CALLBACK PasteBoardTimer(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime) -/// End of Notepad2.c \\\ +/// End of Notepad2.c /// diff --git a/src/Notepad2.h b/src/Notepad2.h index a4c71df2..2fab34b7 100644 --- a/src/Notepad2.h +++ b/src/Notepad2.h @@ -144,4 +144,4 @@ LRESULT MsgNotify(HWND,WPARAM,LPARAM); -/// End of Notepad2.h \\\ +/// End of Notepad2.h /// diff --git a/src/Styles.c b/src/Styles.c index e2dace29..b816c05c 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -42,8 +42,8 @@ extern int iEncoding; #define MULTI_STYLE(a,b,c,d) ((a)|(b<<8)|(c<<16)|(d<<24)) -KEYWORDLIST KeyWords_NULL = { -"", "", "", "", "", "", "", "", "" }; +KEYWORDLIST KeyWords_NULL = {{ +"", "", "", "", "", "", "", "", ""}}; EDITLEXER lexDefault = { SCLEX_NULL, 63000, L"Default Text", L"txt; text; wtx; log; asc; doc", L"", &KeyWords_NULL, { @@ -75,7 +75,7 @@ EDITLEXER lexDefault = { SCLEX_NULL, 63000, L"Default Text", L"txt; text; wtx; l { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_HTML = { +KEYWORDLIST KeyWords_HTML = {{ "!doctype ^aria- ^data- a abbr accept accept-charset accesskey acronym action address align alink " "alt and applet archive area article aside async audio autocomplete autofocus autoplay axis b " "background base basefont bb bdi bdo bgcolor big blockquote body border bordercolor br buffered button " @@ -129,7 +129,7 @@ KEYWORDLIST KeyWords_HTML = { "instanceof insteadof interface isset list namespace new not null old_function or parent php_self " "print private protected public require require_once return static stdclass switch this throw trait " "true try unset use var virtual while xor", -"", "", "", "" }; +"", "", "", "" }}; EDITLEXER lexHTML = { SCLEX_HTML, 63001, L"Web Source Code", L"html; htm; asp; aspx; shtml; htd; xhtml; php; php3; phtml; htt; cfm; tpl; dtd; hta; htc", L"", &KeyWords_HTML, { @@ -217,8 +217,8 @@ EDITLEXER lexHTML = { SCLEX_HTML, 63001, L"Web Source Code", L"html; htm; asp; a { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_XML = { -"", "", "", "", "", "", "", "", "" }; +KEYWORDLIST KeyWords_XML = {{ +"", "", "", "", "", "", "", "", "" }}; EDITLEXER lexXML = { SCLEX_XML, 63002, L"XML Document", L"xml; xsl; rss; svg; xul; xsd; xslt; axl; rdf; xaml; vcproj", L"", &KeyWords_XML, { @@ -237,7 +237,7 @@ EDITLEXER lexXML = { SCLEX_XML, 63002, L"XML Document", L"xml; xsl; rss; svg; xu { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_CSS = { +KEYWORDLIST KeyWords_CSS = {{ "align-content align-items align-self alignment-adjust alignment-baseline animation animation-delay " "animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name " "animation-play-state animation-timing-function appearance ascent azimuth backface-visibility " @@ -295,7 +295,7 @@ KEYWORDLIST KeyWords_CSS = { "^-moz- ^-ms- ^-o- ^-webkit-", "^-moz- ^-ms- ^-o- ^-webkit-", "^-moz- ^-ms- ^-o- ^-webkit-", -"" }; +"" }}; EDITLEXER lexCSS = { SCLEX_CSS, 63003, L"CSS Style Sheets", L"css", L"", &KeyWords_CSS, { @@ -321,7 +321,7 @@ EDITLEXER lexCSS = { SCLEX_CSS, 63003, L"CSS Style Sheets", L"css", L"", &KeyWor { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_CPP = { +KEYWORDLIST KeyWords_CPP = {{ "__abstract __alignof __asm __assume __based __box __cdecl __declspec __delegate __event " "__except __except__try __fastcall __finally __forceinline __gc __hook __identifier " "__if_exists __if_not_exists __inline __int16 __int32 __int64 __int8 __interface __leave " @@ -334,7 +334,7 @@ KEYWORDLIST KeyWords_CPP = { "switch template this throw true try typedef typeid typename union unsigned using uuid " "virtual void volatile wchar_t while", "", -"", "", "", "", "", "", "" }; +"", "", "", "", "", "", "" }}; EDITLEXER lexCPP = { SCLEX_CPP, 63004, L"C/C++ Source Code", L"c; cpp; cxx; cc; h; hpp; hxx; hh; m; mm; idl; inl; odl", L"", &KeyWords_CPP, { @@ -354,7 +354,7 @@ EDITLEXER lexCPP = { SCLEX_CPP, 63004, L"C/C++ Source Code", L"c; cpp; cxx; cc; { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_CS = { +KEYWORDLIST KeyWords_CS = {{ "abstract add alias as ascending async await base bool break by byte case catch char checked " "class const continue decimal default delegate descending do double dynamic else " "enum equals event explicit extern false finally fixed float for foreach from get " @@ -486,7 +486,7 @@ KEYWORDLIST KeyWords_CS = { "XslCompiledTransform XsltArgumentList XsltCompileException XsltContext XsltException " "XsltMessageEncounteredEventArgs XsltMessageEncounteredEventHandler XslTransform XsltSettings " "XStreamingElement XText", -"", "", "", "", "" }; +"", "", "", "", "" }}; EDITLEXER lexCS = { SCLEX_CPP, 63005, L"C# Source Code", L"cs", L"", &KeyWords_CS, { @@ -507,7 +507,7 @@ EDITLEXER lexCS = { SCLEX_CPP, 63005, L"C# Source Code", L"cs", L"", &KeyWords_C { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_RC = { +KEYWORDLIST KeyWords_RC = {{ "ACCELERATORS ALT AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON " "BEGIN BITMAP BLOCK BUTTON CAPTION CHARACTERISTICS CHECKBOX " "CLASS COMBOBOX CONTROL CTEXT CURSOR DEFPUSHBUTTON DIALOG " @@ -516,7 +516,7 @@ KEYWORDLIST KeyWords_RC = { "MESSAGETABLE POPUP PUSHBUTTON RADIOBUTTON RCDATA RTEXT " "SCROLLBAR SEPARATOR SHIFT STATE3 STRINGTABLE STYLE " "TEXTINCLUDE VALUE VERSION VERSIONINFO VIRTKEY", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexRC = { SCLEX_CPP, 63006, L"Resource Script", L"rc; rc2; rct; rh; r; dlg", L"", &KeyWords_RC, { @@ -536,8 +536,8 @@ EDITLEXER lexRC = { SCLEX_CPP, 63006, L"Resource Script", L"rc; rc2; rct; rh; r; { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_MAK = { -"", "", "", "", "", "", "", "", "" }; +KEYWORDLIST KeyWords_MAK = {{ +"", "", "", "", "", "", "", "", "" }}; EDITLEXER lexMAK = { SCLEX_MAKEFILE, 63007, L"Makefiles", L"mak; make; mk; dsp; msc; msvc", L"", &KeyWords_MAK, { @@ -551,14 +551,14 @@ EDITLEXER lexMAK = { SCLEX_MAKEFILE, 63007, L"Makefiles", L"mak; make; mk; dsp; { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_VBS = { +KEYWORDLIST KeyWords_VBS = {{ "alias and as attribute begin boolean byref byte byval call case class compare const continue " "currency date declare dim do double each else elseif empty end enum eqv erase error event exit " "explicit false for friend function get global gosub goto if imp implement in integer is let lib " "load long loop lset me mid mod module new next not nothing null object on option optional or " "preserve private property public raiseevent redim rem resume return rset select set single " "static stop string sub then to true type unload until variant wend while with withevents xor", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexVBS = { SCLEX_VBSCRIPT, 63008, L"VBScript", L"vbs; dsm", L"", &KeyWords_VBS, { @@ -580,7 +580,7 @@ EDITLEXER lexVBS = { SCLEX_VBSCRIPT, 63008, L"VBScript", L"vbs; dsm", L"", &KeyW { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_VB = { +KEYWORDLIST KeyWords_VB = {{ "addhandler addressof alias and andalso ansi any as assembly auto boolean byref byte byval call " "case catch cbool cbyte cchar cdate cdbl cdec char cint class clng cobj compare const cshort csng " "cstr ctype date decimal declare default delegate dim directcast do double each else elseif end " @@ -592,7 +592,7 @@ KEYWORDLIST KeyWords_VB = { "redim rem removehandler resume return select set shadows shared short single static step stop " "strict string structure sub synclock then throw to true try typeof unicode until variant when " "while with withevents writeonly xor", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexVB = { SCLEX_VB, 63009, L"Visual Basic", L"vb; bas; frm; cls; ctl; pag; dsr; dob", L"", &KeyWords_VB, { @@ -613,13 +613,13 @@ EDITLEXER lexVB = { SCLEX_VB, 63009, L"Visual Basic", L"vb; bas; frm; cls; ctl; { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_JS = { +KEYWORDLIST KeyWords_JS = {{ "abstract boolean break byte case catch char class const continue debugger default delete do " "double else enum export extends false final finally float for function goto if implements " "import in instanceof int interface let long native new null package private protected public " "return short static super switch synchronized this throw throws transient true try typeof var " "void volatile while with", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexJS = { SCLEX_CPP, 63010, L"JavaScript", L"js; jse; jsm; json; as", L"", &KeyWords_JS, { @@ -639,7 +639,7 @@ EDITLEXER lexJS = { SCLEX_CPP, 63010, L"JavaScript", L"js; jse; jsm; json; as", { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_JAVA = { +KEYWORDLIST KeyWords_JAVA = {{ "@interface abstract assert boolean break byte case catch char class const " "continue default do double else enum extends final finally float for future " "generic goto if implements import inner instanceof int interface long " @@ -650,7 +650,7 @@ KEYWORDLIST KeyWords_JAVA = { "@LargeTest @MediumTest @Override @Retention " "@SmallTest @Smoke @Supress @SupressLint @SupressWarnings @Target @TargetApi " "@TestTarget @TestTargetClass @UiThreadTest", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexJAVA = { SCLEX_CPP, 63011, L"Java Source Code", L"java", L"", &KeyWords_JAVA, { @@ -670,14 +670,14 @@ EDITLEXER lexJAVA = { SCLEX_CPP, 63011, L"Java Source Code", L"java", L"", &KeyW { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_PAS = { +KEYWORDLIST KeyWords_PAS = {{ "absolute abstract alias and array as asm assembler begin break case cdecl class const constructor continue cppdecl default " "destructor dispose div do downto else end end. except exit export exports external false far far16 file finalization finally for " "forward function goto if implementation in index inherited initialization inline interface is label library local message mod " "name near new nil nostackframe not object of oldfpccall on operator or out overload override packed pascal private procedure " "program property protected public published raise read record register reintroduce repeat resourcestring safecall self set shl " "shr softfloat stdcall stored string then threadvar to true try type unit until uses var virtual while with write xor", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexPAS = { SCLEX_PASCAL, 63012, L"Pascal Source Code", L"pas; dpr; dpk; dfm; inc; pp", L"", &KeyWords_PAS, { @@ -694,7 +694,7 @@ EDITLEXER lexPAS = { SCLEX_PASCAL, 63012, L"Pascal Source Code", L"pas; dpr; dpk { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_ASM = { +KEYWORDLIST KeyWords_ASM = {{ "aaa aad aam aas adc add and arpl bound bsf bsr bswap bt btc btr bts call cbw cdq cflush clc cld " "cli clts cmc cmova cmovae cmovb cmovbe cmovc cmove cmovg cmovge cmovl cmovle cmovna cmovnae " "cmovnb cmovnbe cmovnc cmovne cmovng cmovnge cmovnl cmovnle cmovno cmovnp cmovns cmovnz cmovo " @@ -781,7 +781,7 @@ KEYWORDLIST KeyWords_ASM = { "punpcklbw punpckldq punpcklqdq punpcklwd pxor rcpps rcpss roundpd roundps roundsd roundss " "rsqrtps rsqrtss sfence shufpd shufps sqrtpd sqrtps sqrtsd sqrtss stmxcsr subpd subps subsd subss " "ucomisd ucomiss unpckhpd unpckhps unpcklpd unpcklps xorpd xorps", -"", "", "" }; +"", "", "" }}; EDITLEXER lexASM = { SCLEX_ASM, 63013, L"Assembly Script", L"asm", L"", &KeyWords_ASM, { @@ -801,7 +801,7 @@ EDITLEXER lexASM = { SCLEX_ASM, 63013, L"Assembly Script", L"asm", L"", &KeyWord { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_PL = { +KEYWORDLIST KeyWords_PL = {{ "__DATA__ __END__ __FILE__ __LINE__ __PACKAGE__ abs accept alarm and atan2 AUTOLOAD BEGIN " "bind binmode bless break caller chdir CHECK chmod chomp chop chown chr chroot close closedir " "cmp connect continue CORE cos crypt dbmclose dbmopen default defined delete DESTROY die do " @@ -822,7 +822,7 @@ KEYWORDLIST KeyWords_PL = { "system syswrite tell telldir tie tied time times truncate uc ucfirst umask undef UNITCHECK " "unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn " "when while write xor", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexPL = { SCLEX_PERL, 63014, L"Perl Script", L"pl; pm; cgi; pod", L"", &KeyWords_PL, { @@ -864,8 +864,8 @@ EDITLEXER lexPL = { SCLEX_PERL, 63014, L"Perl Script", L"pl; pm; cgi; pod", L"", { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_INI = { -"", "", "", "", "", "", "", "", "" }; +KEYWORDLIST KeyWords_INI = {{ +"", "", "", "", "", "", "", "", "" }}; EDITLEXER lexINI = { SCLEX_PROPERTIES, 63015, L"Configuration Files", L"ini; inf; reg; cfg; properties; oem; sif; url; sed; theme", L"", &KeyWords_INI, { @@ -878,7 +878,7 @@ EDITLEXER lexINI = { SCLEX_PROPERTIES, 63015, L"Configuration Files", L"ini; inf { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_BAT = { +KEYWORDLIST KeyWords_BAT = {{ "arp assoc attrib bcdedit bootcfg break cacls call cd change chcp chdir chkdsk chkntfs choice cipher " "cleanmgr cls cmd cmdkey color com comp compact con convert copy country ctty date defined defrag del " "dir disableextensions diskcomp diskcopy diskpart do doskey driverquery echo echo. else enableextensions " @@ -889,7 +889,7 @@ KEYWORDLIST KeyWords_BAT = { "regsvr32 rem ren rename replace rmdir robocopy route runas rundll32 sc schtasks sclist set setlocal sfc shift " "shutdown sort start subst systeminfo taskkill tasklist time timeout title tracert tree type typeperf ver verify " "vol wmic xcopy", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexBAT = { SCLEX_BATCH, 63016, L"Batch Files", L"bat; cmd", L"", &KeyWords_BAT, { @@ -904,8 +904,8 @@ EDITLEXER lexBAT = { SCLEX_BATCH, 63016, L"Batch Files", L"bat; cmd", L"", &KeyW { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_DIFF = { -"", "", "", "", "", "", "", "", "" }; +KEYWORDLIST KeyWords_DIFF = {{ +"", "", "", "", "", "", "", "", "" }}; EDITLEXER lexDIFF = { SCLEX_DIFF, 63017, L"Diff Files", L"diff; patch", L"", &KeyWords_DIFF, { @@ -921,7 +921,7 @@ EDITLEXER lexDIFF = { SCLEX_DIFF, 63017, L"Diff Files", L"diff; patch", L"", &Ke { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_SQL = { +KEYWORDLIST KeyWords_SQL = {{ "abort accessible action add after all alter analyze and as asc asensitive attach autoincrement " "before begin between bigint binary bit blob both by call cascade case cast change char character " "check collate column commit condition conflict constraint continue convert create cross current_date " @@ -944,7 +944,7 @@ KEYWORDLIST KeyWords_SQL = { "trailing transaction trigger true undo union unique unlock unsigned update usage use using utc_date " "utc_time utc_timestamp vacuum values varbinary varchar varcharacter varying view virtual when where " "while with write xor year_month zerofill", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexSQL = { SCLEX_SQL, 63018, L"SQL Query", L"sql", L"", &KeyWords_SQL, { @@ -960,11 +960,11 @@ EDITLEXER lexSQL = { SCLEX_SQL, 63018, L"SQL Query", L"sql", L"", &KeyWords_SQL, { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_PY = { +KEYWORDLIST KeyWords_PY = {{ "and as assert break class continue def del elif else except " "exec False finally for from global if import in is lambda None " "nonlocal not or pass print raise return True try while with yield", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexPY = { SCLEX_PYTHON, 63019, L"Python Script", L"py; pyw", L"", &KeyWords_PY, { @@ -984,7 +984,7 @@ EDITLEXER lexPY = { SCLEX_PYTHON, 63019, L"Python Script", L"py; pyw", L"", &Key { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_CONF = { +KEYWORDLIST KeyWords_CONF = {{ "acceptfilter acceptmutex acceptpathinfo accessconfig accessfilename action addalt addaltbyencoding " "addaltbytype addcharset adddefaultcharset adddescription addencoding addhandler addicon addiconbyencoding " "addiconbytype addinputfilter addlanguage addmodule addmoduleinfo addoutputfilter addoutputfilterbytype " @@ -1094,7 +1094,7 @@ KEYWORDLIST KeyWords_CONF = { "virtualdocumentrootip virtualhost virtualscriptalias virtualscriptaliasip watchdoginterval win32disableacceptex " "xbithack xml2encalias xml2encdefault xml2startparse", "", //"on off standalone inetd force-response-1.0 downgrade-1.0 nokeepalive indexes includes followsymlinks none x-compress x-gzip", -"", "", "", "", "", "", "" }; +"", "", "", "", "", "", "" }}; EDITLEXER lexCONF = { SCLEX_CONF, 63020, L"Apache Config Files", L"conf; htaccess", L"", &KeyWords_CONF, { @@ -1111,7 +1111,7 @@ EDITLEXER lexCONF = { SCLEX_CONF, 63020, L"Apache Config Files", L"conf; htacces { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_PS = { +KEYWORDLIST KeyWords_PS = {{ "begin break catch continue data do dynamicparam else elseif end exit filter finally for foreach " "from function if in local param private process return switch throw trap try until where while", "add-computer add-content add-history add-member add-pssnapin add-type checkpoint-computer " @@ -1164,7 +1164,7 @@ KEYWORDLIST KeyWords_PS = { "rvpa rwmi sajb sal saps sasv sbp sc select set si sl sleep sort sp spjb spps spsv start sv swmi " "tee type where wjb write", "importsystemmodules prompt psedit tabexpansion", -"", "", "", "", "" }; +"", "", "", "", "" }}; EDITLEXER lexPS = { SCLEX_POWERSHELL, 63021, L"PowerShell Script", L"ps1; psd1; psm1", L"", &KeyWords_PS, { @@ -1182,7 +1182,7 @@ EDITLEXER lexPS = { SCLEX_POWERSHELL, 63021, L"PowerShell Script", L"ps1; psd1; { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_NSIS = { +KEYWORDLIST KeyWords_NSIS = {{ "!addincludedir !addplugindir !appendfile !cd !define !delfile !echo !else !endif !error " "!execute !finalize !getdllversion !if !ifdef !ifmacrodef !ifmacrondef !ifndef !include !insertmacro !macro " "!macroend !macroundef !makensis !packhdr !searchparse !searchreplace !system !tempfile !undef !verbose !warning " @@ -1233,7 +1233,7 @@ KEYWORDLIST KeyWords_NSIS = { "hidden file_attribute_hidden offline file_attribute_offline readonly file_attribute_readonly system " "file_attribute_system temporary file_attribute_temporary custom license components directory instfiles " "uninstconfirm 32 64 enablecancel noworkingdir plugin rawnl winvista win7 win8 win8.1 win10", -"", "", "", "", "", "" }; +"", "", "", "", "", "" }}; EDITLEXER lexNSIS = { SCLEX_NSIS, 63284, L"NSIS Script", L"nsi; nsh", L"", &KeyWords_NSIS, { @@ -1257,7 +1257,7 @@ EDITLEXER lexNSIS = { SCLEX_NSIS, 63284, L"NSIS Script", L"nsi; nsh", L"", &KeyW { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_INNO = { +KEYWORDLIST KeyWords_INNO = {{ "code components custommessages dirs files icons ini installdelete langoptions languages messages " "registry run setup types tasks uninstalldelete uninstallrun _istool", "allowcancelduringinstall allownetworkdrive allownoicons allowrootdirectory allowuncpath alwaysrestart " @@ -1291,7 +1291,7 @@ KEYWORDLIST KeyWords_INNO = { "sub undef", "and begin break case const continue do downto else end except finally for function " "if not of or procedure repeat then to try type until uses var while with", -"", "", "", "" }; +"", "", "", "" }}; EDITLEXER lexINNO = { SCLEX_INNOSETUP, 63293, L"Inno Setup Script", L"iss; isl; islu", L"", &KeyWords_INNO, { @@ -1311,11 +1311,11 @@ EDITLEXER lexINNO = { SCLEX_INNOSETUP, 63293, L"Inno Setup Script", L"iss; isl; { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_RUBY = { +KEYWORDLIST KeyWords_RUBY = {{ "__FILE__ __LINE__ alias and begin break case class def defined? do else elsif end ensure " "false for in if module next nil not or redo rescue retry return self super then true " "undef unless until when while yield", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexRUBY = { SCLEX_RUBY, 63304, L"Ruby Script", L"rb; ruby; rbw; rake; rjs; Rakefile; gemspec", L"", &KeyWords_RUBY, { { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, @@ -1338,7 +1338,7 @@ EDITLEXER lexRUBY = { SCLEX_RUBY, 63304, L"Ruby Script", L"rb; ruby; rbw; rake; { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_LUA = { +KEYWORDLIST KeyWords_LUA = {{ "and break do else elseif end false for function goto if " "in local nil not or repeat return then true until while", // Basic Functions @@ -1364,7 +1364,7 @@ KEYWORDLIST KeyWords_LUA = { "io.read io.tmpfile io.type io.write io.stdin io.stdout io.stderr os.clock os.date os.difftime " "os.execute os.exit os.getenv os.remove os.rename os.setlocale os.time os.tmpname coroutine.running " "package.cpath package.loaded package.loadlib package.path package.preload package.seeall io.popen", -"", "", "", "", "" }; +"", "", "", "", "" }}; EDITLEXER lexLUA = { SCLEX_LUA, 63298, L"Lua Script", L"lua", L"", &KeyWords_LUA, { @@ -1385,7 +1385,7 @@ EDITLEXER lexLUA = { SCLEX_LUA, 63298, L"Lua Script", L"lua", L"", &KeyWords_LUA { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_BASH = { +KEYWORDLIST KeyWords_BASH = {{ "alias ar asa awk banner basename bash bc bdiff break bunzip2 bzip2 cal calendar case cat " "cc cd chmod cksum clear cmp col comm compress continue cp cpio crypt csplit ctags cut date " "dc dd declare deroff dev df diff diff3 dircmp dirname do done du echo ed egrep elif else " @@ -1399,7 +1399,7 @@ KEYWORDLIST KeyWords_BASH = { "unset until uudecode uuencode vi vim vpax wait wc whence which while who wpaste wstart xargs " "zcat chgrp chown chroot dir dircolors factor groups hostid install link md5sum mkfifo mknod " "nice pinky printenv ptx readlink seq sha1sum shred stat su tac unlink users vdir whoami yes", -"", "", "", "", "", "", "", "" }; +"", "", "", "", "", "", "", "" }}; EDITLEXER lexBASH = { SCLEX_BASH, 63259, L"Shell Script", L"sh", L"", &KeyWords_BASH, { @@ -1420,7 +1420,7 @@ EDITLEXER lexBASH = { SCLEX_BASH, 63259, L"Shell Script", L"sh", L"", &KeyWords_ { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_TCL = { +KEYWORDLIST KeyWords_TCL = {{ // TCL Keywords "after append array auto_execok auto_import auto_load auto_load_index auto_qualify beep " "bgerror binary break case catch cd clock close concat continue dde default echo else " @@ -1442,7 +1442,7 @@ KEYWORDLIST KeyWords_TCL = { "@scope body class code common component configbody constructor define destructor hull " "import inherit itcl itk itk_component itk_initialize itk_interior itk_option iwidgets keep " "method private protected public", -"", "", "", "", "", "" }; +"", "", "", "", "", "" }}; #define SCE_TCL__MULTI_COMMENT MULTI_STYLE(SCE_TCL_COMMENT,SCE_TCL_COMMENTLINE,SCE_TCL_COMMENT_BOX,SCE_TCL_BLOCK_COMMENT) @@ -1463,7 +1463,7 @@ EDITLEXER lexTCL = { SCLEX_TCL, 63273, L"Tcl Script", L"tcl; itcl", L"", &KeyWor { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_AU3 = { +KEYWORDLIST KeyWords_AU3 = {{ "and byref case const continuecase continueloop default dim do else elseif endfunc endif " "endselect endswitch endwith enum exit exitloop false for func global if in local next not " "or redim return select static step switch then to true until wend while with", @@ -2106,7 +2106,7 @@ KEYWORDLIST KeyWords_AU3 = { "_worddoclinkgetcollection _worddocopen _worddocprint _worddocpropertyget _worddocpropertyset _worddocsave " "_worddocsaveas _worderrorhandlerderegister _worderrorhandlerregister _worderrornotify _wordmacrorun " "_wordpropertyget _wordpropertyset _wordquit", -"" }; +"" }}; EDITLEXER lexAU3 = { SCLEX_AU3, 63276, L"AutoIt3 Script", L"au3", L"", &KeyWords_AU3, { @@ -2145,7 +2145,7 @@ EDITLEXER lexANSI = { SCLEX_NULL, 63258, L"ANSI Art", L"nfo; diz", L"", &KeyWord { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_AHK = { +KEYWORDLIST KeyWords_AHK = {{ "break continue else exit exitapp gosub goto if ifequal ifexist ifgreater ifgreaterorequal " "ifinstring ifless iflessorequal ifmsgbox ifnotequal ifnotexist ifnotinstring ifwinactive " "ifwinexist ifwinnotactive ifwinnotexist loop onexit pause repeat return settimer sleep " @@ -2249,7 +2249,7 @@ KEYWORDLIST KeyWords_AHK = { "yes no ok cancel abort retry ignore force on off all send wanttab monitorcount monitorprimary " "monitorname monitorworkarea pid this base extends __get __set __call __delete __new new " "useunsetlocal useunsetglobal useenv localsameasglobal", -"", "" }; +"", "" }}; EDITLEXER lexAHK = { SCLEX_AHK, 63305, L"AutoHotkey Script", L"ahk; ia; scriptlet", L"", &KeyWords_AHK, { @@ -2277,7 +2277,7 @@ EDITLEXER lexAHK = { SCLEX_AHK, 63305, L"AutoHotkey Script", L"ahk; ia; scriptle { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_CMAKE = { +KEYWORDLIST KeyWords_CMAKE = {{ "add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library " "add_subdirectory add_test aux_source_directory build_command build_name cmake_minimum_required " "configure_file create_test_sourcelist else elseif enable_language enable_testing endforeach endif " @@ -2303,7 +2303,7 @@ KEYWORDLIST KeyWords_CMAKE = { "RETURN_VALUE RUNTIME_DIRECTORY SEND_ERROR SHARED SOURCES STATIC STATUS STREQUAL STRGREATER STRLESS " "SUFFIX TARGET TOLOWER TOUPPER VAR VARIABLES VERSION WIN32 WRAP_EXCLUDE WRITE APPLE MINGW MSYS CYGWIN " "BORLAND WATCOM MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 CMAKE_COMPILER_2005 OFF ON", -"", "", "", "", "", "", "" }; +"", "", "", "", "", "", "" }}; EDITLEXER lexCmake = { SCLEX_CMAKE, 63324, L"Cmake Script", L"cmake; ctest", L"", &KeyWords_CMAKE, { @@ -2324,7 +2324,7 @@ EDITLEXER lexCmake = { SCLEX_CMAKE, 63324, L"Cmake Script", L"cmake; ctest", L"" { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_AVS = { +KEYWORDLIST KeyWords_AVS = {{ "true false return global", "addborders alignedsplice amplify amplifydb animate applyrange assumebff assumefieldbased assumefps " "assumeframebased assumesamplerate assumescaledfps assumetff audiodub audiodubex avifilesource " @@ -2396,7 +2396,7 @@ KEYWORDLIST KeyWords_AVS = { "audiobits audiochannels audiolength audiolengthf audiorate framecount framerate frameratedenominator " "frameratenumerator getleftchannel getrightchannel hasaudio hasvideo height isaudiofloat isaudioint " "isfieldbased isframebased isinterleaved isplanar isrgb isrgb24 isrgb32 isyuv isyuy2 isyv12 width", -"", "", "", "" }; +"", "", "", "" }}; EDITLEXER lexAVS = { SCLEX_AVS, 63332, L"AviSynth Script", L"avs; avsi", L"", &KeyWords_AVS, { @@ -2415,8 +2415,8 @@ EDITLEXER lexAVS = { SCLEX_AVS, 63332, L"AviSynth Script", L"avs; avsi", L"", &K { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_MARKDOWN = { -"", "", "", "", "", "", "", "", "" }; +KEYWORDLIST KeyWords_MARKDOWN = {{ +"", "", "", "", "", "", "", "", "" }}; EDITLEXER lexMARKDOWN = { SCLEX_MARKDOWN, 63336, L"Markdown", L"md; markdown; mdown; mkdn; mkd", L"", &KeyWords_MARKDOWN, { @@ -2442,8 +2442,8 @@ EDITLEXER lexMARKDOWN = { SCLEX_MARKDOWN, 63336, L"Markdown", L"md; markdown; md { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_YAML = { -"y n yes no on off true false", "", "", "", "", "", "", "", "" }; +KEYWORDLIST KeyWords_YAML = {{ +"y n yes no on off true false", "", "", "", "", "", "", "", "" }}; EDITLEXER lexYAML = { SCLEX_YAML, 63355, L"YAML", L"yaml; yml", L"", &KeyWords_YAML, { { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, @@ -2459,7 +2459,7 @@ EDITLEXER lexYAML = { SCLEX_YAML, 63355, L"YAML", L"yaml; yml", L"", &KeyWords_Y { SCE_YAML_OPERATOR, 63132, L"Operator", L"fore:#333366", L"" }, { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_VHDL = { +KEYWORDLIST KeyWords_VHDL = {{ "access after alias all architecture array assert attribute begin block body buffer bus case component configuration " "constant disconnect downto else elsif end entity exit file for function generate generic group guarded if impure in " "inertial inout is label library linkage literal loop map new next null of on open others out package port postponed " @@ -2475,7 +2475,7 @@ KEYWORDLIST KeyWords_VHDL = { "numeric_bit numeric_std math_complex math_real vital_primitives vital_timing", "boolean bit character severity_level integer real time delay_length natural positive string bit_vector file_open_kind " "file_open_status line text side width std_ulogic std_ulogic_vector std_logic std_logic_vector X01 X01Z UX01 UX01Z unsigned signed", -"", "", "" }; +"", "", "" }}; EDITLEXER lexVHDL = { SCLEX_VHDL, 63370, L"VHDL", L"vhdl; vhd", L"", &KeyWords_VHDL, { { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, @@ -2493,8 +2493,8 @@ EDITLEXER lexVHDL = { SCLEX_VHDL, 63370, L"VHDL", L"vhdl; vhd", L"", &KeyWords_V { -1, 00000, L"", L"", L"" } } }; -KEYWORDLIST KeyWords_COFFEESCRIPT = { -"", "", "", "", "", "", "", "", "" }; +KEYWORDLIST KeyWords_COFFEESCRIPT = {{ +"", "", "", "", "", "", "", "", "" }}; EDITLEXER lexCOFFEESCRIPT = { SCLEX_COFFEESCRIPT, 63362, L"Coffeescript", L"coffee; Cakefile", L"", &KeyWords_COFFEESCRIPT, { @@ -2825,7 +2825,7 @@ BOOL Style_Export(HWND hwnd) // void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew) { - int i; + size_t i; //WCHAR *p; int rgb; int iValue; @@ -3088,7 +3088,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew) SC_MARKNUM_FOLDERMIDTAIL }; - int i; + size_t i; COLORREF clrFore = SciCall_StyleGetFore(STYLE_DEFAULT); COLORREF clrBack = SciCall_StyleGetBack(STYLE_DEFAULT); @@ -3116,7 +3116,7 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew) if (pLexNew->iLexer != SCLEX_NULL || pLexNew == &lexANSI) { - int j; + size_t j; i = 1; while (pLexNew->Styles[i].iStyle != -1) { diff --git a/src/Version.h b/src/Version.h index 9219adee..1689f45a 100644 --- a/src/Version.h +++ b/src/Version.h @@ -56,6 +56,7 @@ #endif // Compiler specific +#ifndef VERSION_COMPILER #if defined(_MSC_VER) #if _MSC_VER == 1910 #if (_MSC_FULL_VER >= 191025017 && _MSC_FULL_VER <= 191025019) @@ -67,5 +68,6 @@ #else #define VERSION_COMPILER L"(Unknown compiler)" #endif +#endif #endif // NOTEPAD2_VERSION_H From 03d2dcfd7756e981ff20820365deeb0767f3360b Mon Sep 17 00:00:00 2001 From: Dejan Budimir Date: Sun, 22 Jul 2018 17:56:55 +0200 Subject: [PATCH 2/2] Add MinGW makefile. --- build/mingw/ansify_rc.py | 131 ++++++++++++++++++++ build/mingw/makefile | 243 ++++++++++++++++++++++++++++++++++++ src/Edit.c | 14 +-- version.py | 258 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 639 insertions(+), 7 deletions(-) create mode 100644 build/mingw/ansify_rc.py create mode 100644 version.py diff --git a/build/mingw/ansify_rc.py b/build/mingw/ansify_rc.py new file mode 100644 index 00000000..a220b6b3 --- /dev/null +++ b/build/mingw/ansify_rc.py @@ -0,0 +1,131 @@ +## Designed with <3 by dejbug. + +import argparse +import codecs +import contextlib +import itertools +import os, os.path +import sys + +DEFAULT_DECODER = "utf16" +DEFAULT_ENCODER = "mbcs" + +class Error(Exception): pass + +class InvalidArgs(Error): pass + +class ConversionFail(Error): + def __init__(self, decoder, encoder, culprit, line_index, e): + super(ConversionFail, self).__init__("%s error at '%s -> %s' conversion trial on line %d : %s" % (culprit, decoder, encoder, line_index, e)) + +def main(argv): + + try: parser, args = parse_args(argv) + except InvalidArgs, e: + print "! invalid arguments : %s" % e + exit(1) + + try: + with autoclosing_open(args.outpath, "wb") as outfile: + for line in convert_file(args.inpath, args.decoder, args.encoder): + outfile.write(line) + except ConversionFail, e: + print >>sys.stderr, "! couldn't convert file : %s" % e + exit(2) + +def parse_args(argv): + info = "Re-encode a file." + note = "Some common codecs to try: utf32, utf16, utf8, mbcs (ansi, only windows), cp1252, cp850, latin1, ascii." + p = argparse.ArgumentParser(description=info, epilog=note) + p.add_argument("inpath", help="path to .rc file") + p.add_argument("-o", "--outpath", help="path to write output to") + p.add_argument("-f", "--force", help="force overwrite of extant outpath", action="store_true") + p.add_argument("-d", "--decoder", help="codec to decode with (default: %s)" % DEFAULT_DECODER, default=DEFAULT_DECODER) + p.add_argument("-e", "--encoder", help="codec to encode into (default: %s)" % DEFAULT_ENCODER, default=DEFAULT_ENCODER) + p.add_argument("-v", "--verbose", help="print more stuff (to stderr)") + p.add_argument("--module-relative-paths", help="paths are relative to location of this python file", action="store_true") + a = p.parse_args(argv[1:]) + validate_and_adjust_args(p, a) + return p, a + +def validate_and_adjust_args(parser, args): + + args.original_inpath = args.inpath + args.original_outpath = args.outpath + + if args.module_relative_paths: + args.inpath = make_module_relative_path(args.inpath) + else: + args.inpath = os.path.abspath(args.inpath) + + if not os.path.isfile(args.inpath): + raise InvalidArgs("no infile found at '%s' (user passed '%s')%s" % (args.inpath, args.original_inpath, "" if args.module_relative_paths else "did you forget the --module-relative-paths flag?")) + + if args.outpath: + if args.module_relative_paths: + args.outpath = make_module_relative_path(args.outpath) + else: + args.outpath = os.path.abspath(args.outpath) + + if os.path.exists(args.outpath): + if not os.path.isfile(args.outpath): + raise InvalidArgs("outpath exists but is not a file") + elif not args.force: + raise InvalidArgs("outpath exists; add -f to force overwrite") + + if not args.decoder: args.encoder = DEFAULT_DECODER + if not args.encoder: args.encoder = DEFAULT_ENCODER + + def translate_codec(codec): + _codec = codec.lower() + if "ansi" == _codec: return "mbcs" + return codec + + args.encoder = translate_codec(args.encoder) + args.decoder = translate_codec(args.decoder) + + try: codecs.getencoder(args.encoder) + except LookupError: + raise InvalidArgs("no such encoder: '%s'" % args.encoder) + + try: codecs.getdecoder(args.decoder) + except LookupError: + raise InvalidArgs("no such decoder: '%s'" % args.decoder) + +def make_module_relative_path(rel_path, argv=None): + if argv: return make_path(dir_from_path(argv[0]), rel_path) + else: return make_path(dir_from_path(__file__), rel_path) + +def make_path(root, rel_path): + return os.path.abspath(os.path.join(root, rel_path)) + +def dir_from_path(path): + return os.path.split(path)[0] + +@contextlib.contextmanager +def autoclosing_open(path, mode): + if path: + with open(path, "wb") as file: + yield file + else: + yield sys.stdout + +def convert_file(inpath, decoder, encoder): + line_index = 1 + try: + with codecs.open(inpath, "rb", decoder) as file: + for line_index, line in enumerate(file, start=1): + yield convert_line(line, encoder) + except UnicodeDecodeError, e: + raise ConversionFail(decoder, encoder, "decoder", line_index, e) + except UnicodeEncodeError, e: + raise ConversionFail(decoder, encoder, "encoder", line_index, e) + +def convert_line(text, encoder): + return text.encode(encoder) + +def exception_to_string(e): + return "[%s] %s" % (type(e).__name__, str(e)) + +if "__main__" == __name__: + main(sys.argv) diff --git a/build/mingw/makefile b/build/mingw/makefile index e69de29b..1099c05e 100644 --- a/build/mingw/makefile +++ b/build/mingw/makefile @@ -0,0 +1,243 @@ +## MinGW makefile. Designed with <3 by dejbug. + +# -- User settings (makefile) + +WARNINGS_LEVEL ?= 1 +ESCALATE_WARNINGS ?= false +SILENCE_KNOWN_WARNINGS ?= true + +# -- User settings (project) + +INLINE_ALL ?= false +INLINE_KEYWORD_OVERRIDE ?= 0 + +NAME ?= Notepad2 +ROOT ?= ../.. + +# -- File paths (project) + +RPATH_MAKEFILE := ./build/mingw/makefile +RPATH_VERSION_PY := ./version.py + +PATH_MAKEFILE := makefile +PATH_MINGW_BUILD_MACROS_H := mingw_build_macros.h +PATH_ANSIFY_RC := ansify_rc.py +PATH_VERSION_PY := $(ROOT)/version.py +PATH_MANIFEST := $(ROOT)/res/$(NAME).exe.manifest +PATH_REVISION := $(ROOT)/src/VersionRev.h +PATH_RC_ORIGINAL := $(ROOT)/src/Notepad2.rc +PATH_RC_ANSIFIED := $(ROOT)/src/$(NAME).ansi.rc + +# -- User settings (extras) +# (will be amended below with non-negotiable settings) + +INCLUDE_DIRS := +SYMBOLS := BOOKMARK_EDITION UNICODE _UNICODE NDEBUG +WINLIBS := + +COMPILER_FLAGS_COMMON := -msse2 -mthreads -Os +CFLAGS := -std=c99 +CXXFLAGS := -std=c++11 +LDFLAGS := + +# -- User settings (tools) + +CC := gcc +CXX := $(CC) +LD := g++ +RC := windres +PYTHON := python + + +# -- Amendations + +INCLUDE_DIRS += $(ROOT)/src +INCLUDE_DIRS += $(ROOT)/scintilla/include +INCLUDE_DIRS += $(ROOT)/scintilla/lexlib +INCLUDE_DIRS += $(ROOT)/scintilla/src + + +SYMBOLS += MINGW_BUILD +SYMBOLS += WIN32 _WINDOWS STRICT +SYMBOLS += STATIC_BUILD SCI_LEXER USE_D2D +SYMBOLS += _CRT_SECURE_NO_WARNINGS +SYMBOLS += _CRT_SECURE_NO_DEPRECATE +SYMBOLS += _SCL_SECURE_NO_WARNINGS + +ifeq ($(INLINE_KEYWORD_OVERRIDE),0) +# Nothing. +else ifeq ($(WARNINGS_LEVEL),1) +SYMBOLS += __inline=inline +else ifeq ($(WARNINGS_LEVEL),2) +SYMBOLS += __inline=__inline__ +else ifeq ($(WARNINGS_LEVEL),3) +SYMBOLS += __inline= +endif + +WINLIBS += gdi32 comctl32 comdlg32 shlwapi +WINLIBS += uuid ole32 oleaut32 +WINLIBS += imm32 msimg32 + + +COMPILER_FLAGS_COMMON += -imacros $(PATH_MINGW_BUILD_MACROS_H) +COMPILER_FLAGS_COMMON += -Wl,--subsystem=windows + +ifeq ($(INLINE_ALL),true) +COMPILER_FLAGS_COMMON += -finline-functions +endif + +ifeq ($(ESCALATE_WARNINGS),true) +COMPILER_FLAGS_COMMON += -Werror +endif + +ifeq ($(WARNINGS_LEVEL),0) +COMPILER_FLAGS_COMMON += +else ifeq ($(WARNINGS_LEVEL),1) +COMPILER_FLAGS_COMMON += -Wall -Wextra +else ifeq ($(WARNINGS_LEVEL),2) +COMPILER_FLAGS_COMMON += -Wall -Wextra -Winline +else ifeq ($(WARNINGS_LEVEL),3) +COMPILER_FLAGS_COMMON += -Wall -Wextra -Winline -pedantic +endif + +ifeq ($(SILENCE_KNOWN_WARNINGS),true) +COMPILER_FLAGS_COMMON += -Wno-unused-parameter +COMPILER_FLAGS_COMMON += -Wno-unused-variable +COMPILER_FLAGS_COMMON += -Wno-unused-but-set-variable +COMPILER_FLAGS_COMMON += -Wno-unused-value +COMPILER_FLAGS_COMMON += -Wno-missing-braces +COMPILER_FLAGS_COMMON += -Wno-missing-field-initializers +COMPILER_FLAGS_COMMON += -Wno-parentheses +COMPILER_FLAGS_COMMON += -Wno-implicit-fallthrough +COMPILER_FLAGS_COMMON += -Wno-sign-compare + +CFLAGS += -Wno-incompatible-pointer-types +endif + +COMPILER_FLAGS_COMMON += $(addprefix -D,$(SYMBOLS)) +COMPILER_FLAGS_COMMON += $(addprefix -I,$(INCLUDE_DIRS)) + + +CFLAGS += $(COMPILER_FLAGS_COMMON) +CXXFLAGS += $(COMPILER_FLAGS_COMMON) +LDFLAGS += $(addprefix -l,$(WINLIBS)) + + +# -- Functions (common) + +compile_cxx = $(CXX) -c -o $1 $(filter %.cpp %.cxx %.c,$2) $(CXXFLAGS) +compile_cc = $(CC) -c -o $1 $(filter %.cpp %.cxx %.c,$2) $(CFLAGS) + +link_cxx = $(LD) -o $1 $(filter %.o %.a %.dll,$2) $(CXXFLAGS) $(LDFLAGS) +link_cc = $(LD) -o $1 $(filter %.o %.a %.dll,$2) $(CFLAGS) $(LDFLAGS) + +create_dir = IF NOT EXIST $(subst /,\,$1) MKDIR $(subst /,\,$1) +move_file = IF EXIST $(subst /,\,$1) MOVE /Y $(subst /,\,$1) $(subst /,\,$2) + +make_from_root = $(MAKE) -C $(ROOT) -f $(RPATH_MAKEFILE) $1 + +ansify_rc = $(PYTHON) $(PATH_ANSIFY_RC) -o $1 -f $(filter %.rc,$2) + + +# -- Targets (generic) + +%.exe : ; $(call link_cc,$@,$^) +%.o : ; $(call compile_cc,$@,$^) +%.rc.o : ; $(RC) -o $@ -i $(filter %.rc,$^) + + +# -- Targets (main) + +.PHONY : all +all : $(PATH_MANIFEST) +all : $(PATH_REVISION) +all : $(NAME).exe + +$(PATH_MANIFEST) : $(PATH_REVISION) ; +$(PATH_REVISION) : ; $(call make_from_root,versions) + + +# -- Targets (main) +# (to be called into from $(ROOT) ) + +.PHONY : versions +versions : ; $(PYTHON) $(RPATH_VERSION_PY) + + +# -- Functions (Scintilla) + +SCI_MODS := +SCI_OBJECTS := + +define sci_mod_target +SCI_$1_DIRPATH := $(ROOT)/scintilla/$1 +SCI_$1_SOURCES := $$(wildcard $$(SCI_$1_DIRPATH)/*.$2) +SCI_$1_NAMEXTS := $$(notdir $$(SCI_$1_SOURCES)) +SCI_$1_OBJECTS := $$(addprefix $1/,$$(SCI_$1_NAMEXTS:%.$2=%.o)) + +SCI_MODS += sci_$1 +SCI_OBJECTS += $$(SCI_$1_OBJECTS) + +sci_mods : sci_$1 + +.PHONY : sci_$1 sci_$1_folder +sci_$1 : $$(SCI_$1_OBJECTS) ; +sci_$1_folder : ; $$(call create_dir,$1) + +$$(SCI_$1_OBJECTS) : $1/%.o : $$(SCI_$1_DIRPATH)/%.$2 | sci_$1_folder + $$(call compile_cxx,$$@,$$^) +endef + + +# -- Targets (Scintilla) + +.PHONY : sci_mods +sci_mods : +$(eval $(call sci_mod_target,lexers,cxx)) +$(eval $(call sci_mod_target,lexlib,cxx)) +$(eval $(call sci_mod_target,src,cxx)) +$(eval $(call sci_mod_target,win32,cxx)) +sci_mods : ; @echo $^ + + +# -- Targets (Notepad2) + +NOTEPAD_SOURCES := $(wildcard $(ROOT)/src/*.c) +NOTEPAD_OBJECTS := $(notdir $(NOTEPAD_SOURCES:%.c=%.o)) + +$(NAME).exe : $(NAME).rc.o EditPrint_dummy.o +$(NAME).exe : $(NOTEPAD_OBJECTS) $(SCI_OBJECTS) +$(NAME).rc.o : $(PATH_RC_ANSIFIED) +EditPrint_dummy.o : EditPrint_dummy.c ; $(call compile_cc,$@,$^) +$(PATH_RC_ANSIFIED) : ; $(call ansify_rc,$@,$(PATH_RC_ORIGINAL)) +$(NOTEPAD_OBJECTS) : %.o : $(ROOT)/src/%.c ; $(call compile_cc,$@,$^) + + +# -- Functions (cleanup and run) + +delete_file = DEL $(subst /,\,$1) 2>NUL +define delete_files + $(foreach file,$1,$(call delete_file,$(file)) +) +endef +delete_dir = @IF EXIST $(subst /,\,$1) RMDIR /S /Q $(subst /,\,$1) +define delete_dirs + $(foreach dir,$1,$(call delete_dir,$(dir)) +) +endef + + +# -- Targets (cleanup and run) + +.PHONY : clean reset run + +clean : + $(call delete_file,$(NAME).exe) + $(call delete_files,*.o *.a) + $(call delete_file,$(PATH_MANIFEST)) + $(call delete_file,$(PATH_REVISION)) + $(call delete_dirs,lexers lexlib src win32) + +reset : | clean ; + +run : $(NAME).exe ; @.\$< diff --git a/src/Edit.c b/src/Edit.c index 6709ae76..094d13b7 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -4408,13 +4408,13 @@ int CmpLogicalRev(const void *s1, const void *s2) { void EditSortLines(HWND hwnd,int iSortFlags) { - int iCurPos; - int iAnchorPos; - int iSelStart; - int iSelEnd; - int iLineStart; - int iLineEnd; - int iLineCount; + int iCurPos = 0; + int iAnchorPos = 0; + int iSelStart = 0; + int iSelEnd = 0; + int iLineStart = 0; + int iLineEnd = 0; + int iLineCount = 0; BOOL bIsRectangular = FALSE; int iRcCurLine = 0; diff --git a/version.py b/version.py new file mode 100644 index 00000000..dcd7ffa5 --- /dev/null +++ b/version.py @@ -0,0 +1,258 @@ +import os, os.path +import re +import shlex +import subprocess + +__doc__ = """ +This is a python rewrite of update_rev.sh. + +Author: Dejan Budimir +Date: 2018-07.19 02:13:00.000 +""" + + +class dec(object): + + @staticmethod + def dictstring(cls): + setattr(cls, "__str__", + lambda self: self.__class__.__name__ + str(self.__dict__)) + return cls + + +class path(object): + + @staticmethod + def root(): + """Return the folder which contains this file. This file should be located in the project's root folder i.e. 'notepad2-mod'.""" + return os.path.abspath(os.path.split(__file__)[0]) + + @classmethod + def make(cls, rel_path): + """Turn {rel_path} into a root-relative path.""" + return os.path.normpath(os.path.join(cls.root(), rel_path)) + + +class run(object): + + @staticmethod + def code(cmd_str, shell=False, no_stderr=True, no_stdout=True): + """Run the {cmd_str} and return the process's exit code.""" + return subprocess.call(cmd_str, shell=shell, + stdout=(subprocess.PIPE if no_stdout else None), + stderr=(subprocess.PIPE if no_stderr else None)) + + @staticmethod + def ok(*aa, **kk): + """Run the {cmd_str} and return True if exit code was 0.""" + return 0 == run.code(*aa, **kk) + + @staticmethod + def out_old(cmd_str, shell=False, no_stderr=False, stripchars=None): + """{OBSOLETE} Run the {cmd_str} and return 2-tuple of (exit_code, stdout).""" + if no_stderr: + raise NotImplementedError("can deadlock based on the child process error volume; use Popen with the communicate()") + try: + stdout = subprocess.check_output(cmd_str, shell=shell, + stderr=(subprocess.PIPE if no_stderr else None)) + if not stdout: return 0, "" + return 0, stdout.strip(stripchars) + except subprocess.CalledProcessError, e: + r = re.match(r'.+?returned non-zero exit status (\d+)$', str(e)) + if not r: raise + return int(r.group(1)), None + + @staticmethod + def out(cmd_str, shell=False, no_stderr=True, stripchars=None): + """Run the {cmd_str} and return 2-tuple of (exit_code, stdout_text).""" + args = shlex.split(cmd_str) + child = subprocess.Popen(args, shell=shell, + stdout=subprocess.PIPE, + stderr=(subprocess.PIPE if no_stderr else None)) + stdout, stderr = child.communicate() + if child.returncode: + return child.returncode, None + if not stdout: return 0, "" + return 0, stdout.strip(stripchars) + + +class git(object): + + # This is the last svn changeset, the number and hash can be automatically + # calculated, but it is slow to do that. So it is better to have it hardcoded. + svnrev = 760 + svnhash = "0cd53aab71b006820233224bbf14c2b18b2caca6" + + @staticmethod + def in_repo(): + return run.ok("git rev-parse --git-dir") + + @staticmethod + def get_current_branch_name(): + exitcode, stdout = run.out("git symbolic-ref -q HEAD") + if 0 == exitcode: + return re.sub(r'refs/heads/', '', stdout) + elif "APPVEYOR_REPO_BRANCH" in os.environ: + return os.environ["APPVEYOR_REPO_BRANCH"] + return "no branch" + + @staticmethod + def ref_exists(exact_ref_path): + return run.ok("git show-ref --verify --quiet " + exact_ref_path) + + @staticmethod + def find_best_common_merge_base(): + exitcode, stdout = run.out("git merge-base master HEAD") + if exitcode: return None + return stdout + + @staticmethod + def count_commits(base_ref="HEAD"): + """Return number of commits since project's move to Github, reachable from {base_ref}.""" + if not base_ref: base_ref = git.find_best_common_merge_base() + exitcode, stdout = run.out("git rev-list --count %s..%s" % (git.svnhash, base_ref)) + if exitcode: return 0 + return int(stdout) + + @staticmethod + def get_short_hash(ref="HEAD"): + exitcode, stdout = run.out("git rev-parse --short %s" % ref) + if exitcode: return None + return stdout + + @staticmethod + def working_tree_differs(ref="HEAD"): + return not run.ok("git diff-index --quiet %s" % ref) + + +class file_t(object): + """Base class for {version_file_t} and {manifest_file_t}.""" + + def __init__(self, root_relative_path): + self.outpath = path.make(root_relative_path) + + def needs_update(self, new_contents): + """Compare {new_contents} with current file contents, return True if different.""" + if not os.path.exists(self.outpath): return True + with open(self.outpath, "rb") as f: + if f.read() != new_contents: return True + return False + + def update(self, new_contents): + """Write {new_contents} to file.""" + with open(self.outpath, "wb") as f: + f.write(new_contents) + + def generate(self, *aa, **kk): + """Override this in the subclass to generate new file contents based on input args.""" + raise NotImplementedError + + +class version_file_t(file_t): + + def __init__(self, outpath): + super(version_file_t, self).__init__(outpath) + + def generate(self, vi): + assert isinstance(vi, version_info_t) + text = "" + text += '#define BRANCH _T("%s")\n' % vi.branch + text += '#define VERSION_HASH _T("%s")\n' % vi.hash + text += '#define VERSION_REV %s\n' % vi.ver + text += '#define VERSION_REV_FULL %s\n' % vi.ver_full + return text + + +class manifest_file_t(file_t): + + def __init__(self, outpath, confpath=None): + super(manifest_file_t, self).__init__(outpath) + self.confpath = confpath or self.outpath + ".conf" + + def generate(self, vi): + assert isinstance(vi, version_info_t) + with open(self.confpath, "rb") as f: + return re.sub(r'\$WCREV\$', str(vi.ver), f.read()) + + +@dec.dictstring +class version_info_t(object): + + def __init__(self): + + # Get the abbreviated hash of the current changeset + self.hash = git.get_short_hash("HEAD") + + # Count how many changesets we have since the last + # svn changeset, add to it last svn revision number. + self.ver = git.count_commits("HEAD") + git.svnrev + + # Get the current branch name + self.branch = git.get_current_branch_name() + + if "master" == self.branch: + self.ver_full = "" + self.base = "" + else: + # If we are on another branch that isn't master, we + # want extra info like on which commit from master + # it is based on and what its hash is. This assumes + # we won't ever branch from a changeset from before + # the move to git. + if not git.ref_exists("refs/heads/master"): + self.ver_full = " (%s)" % self.branch + else: + # Get where the branch is based on master + self.base = git.find_best_common_merge_base() + self.base_ver = git.count_commits(self.base) + git.svnrev + + self.ver_full = " (%s) (master@%s)" % (self.branch, str(self.base_ver)[0:7]) + + self.ver_full = '_T("%s (%s)%s")' % (self.ver, self.hash, self.ver_full) + + def echo(self): + # echo_format = '{0:<10s} {1}' + echo_format = '%-10s %s' + + if self.branch: + print echo_format % ("On branch:", self.branch) + print echo_format % ("Hash:", self.hash) + if self.branch and git.working_tree_differs(): + print echo_format % ("Revision:", "%s (Local modifications found)" % self.ver) + else: + print echo_format % ("Revision:", self.ver) + if len(self.base): + print echo_format % ("Mergebase:", 'master@%s (%s)') % (self.base_ver, self.base[0:7]) + + +def main(pedantic=True): + + if not git.in_repo(): + raise Exception("this is not a git repository") + + if pedantic and not os.getcwd().startswith(path.root()): + raise Exception("{pedantic=1} CWD \"%s\" is not in this script's folder tree \"%s\"." % (os.getcwd(), path.root())) + + version_info = version_info_t() + # print version_info + version_info.echo() + + version_file = version_file_t("./src/VersionRev.h") + manifest_file = manifest_file_t("./res/Notepad2.exe.manifest") + + # Update VersionRev.h if it does not exist, or + # if version information was changed. + newversioninfo = version_file.generate(version_info) + if version_file.needs_update(newversioninfo): + # Write the version information to VersionRev.h + version_file.update(newversioninfo) + + # Update manifest file if it does not exist, or + # if source manifest.conf was changed. + newmanifest = manifest_file.generate(version_info) + if manifest_file.needs_update(newmanifest): + manifest_file.update(newmanifest) + + +if "__main__" == __name__: + main(pedantic=True)