Fix NULL usage

Ignore scintilla files in NULL check.
Allow to use nullptr as an alias.
This commit is contained in:
Maarten Bent 2022-10-22 19:49:40 +02:00
parent 875e127108
commit 619071cb71
No known key found for this signature in database
GPG key ID: 58AAEE3F4A4FD070
6 changed files with 15 additions and 12 deletions

View file

@ -87,8 +87,10 @@ jobs:
- name: Check for obsolete macros use
run: |
git fetch --depth=1 origin master
if git diff origin/master ':!.github/workflows/code_checks.yml' |
grep -E '^\+.*(wxOVERRIDE|wxNOEXCEPT|\WNULL)'; then
if git diff origin/master \
':!.github/workflows/code_checks.yml' \
':!src/stc/scintilla/' \
| grep -E '^\+.*(wxOVERRIDE|wxNOEXCEPT|\WNULL)'; then
echo "::error ::Please use C++11 equivalents of the deprecated macros in the new code."
exit 1
fi

View file

@ -140,6 +140,7 @@ ALIASES += header{1}="Include file:^^ \verbatim #include <\1> \endverbatim"
# some formatting aliases
ALIASES += true="<span class='literal'>true</span>"
ALIASES += false="<span class='literal'>false</span>"
ALIASES += nullptr="<span class='literal'>nullptr</span>"
ALIASES += NULL="<span class='literal'>nullptr</span>"
ALIASES += NUL="<span class='literal'>NUL</span>"

View file

@ -8206,7 +8206,7 @@ public:
The position of the point to check, in window device coordinates.
@param pos
Receives the position of the character at the given position. May
be @NULL.
be @nullptr.
@see PositionToXY(), XYToPosition()
*/
@ -8232,10 +8232,10 @@ public:
The position of the point to check, in window device coordinates.
@param col
Receives the column of the character at the given position. May be
@NULL.
@nullptr.
@param row
Receives the row of the character at the given position. May be
@NULL.
@nullptr.
@see PositionToXY(), XYToPosition()
*/

View file

@ -90,7 +90,7 @@
- (void)drawRect:(NSRect)dirtyRect
{
static_cast<wxWidgetCocoaImpl*>(m_wxWin->GetPeer())->
drawRect(&dirtyRect, self, NULL);
drawRect(&dirtyRect, self, nil);
}
@end

View file

@ -1397,18 +1397,18 @@ public:
}
unsigned int GetImeCaretPos() const noexcept {
return ImmGetCompositionStringW(hIMC, GCS_CURSORPOS, wxNullPtr, 0);
return ImmGetCompositionStringW(hIMC, GCS_CURSORPOS, nullptr, 0);
}
std::vector<BYTE> GetImeAttributes() {
const int attrLen = ::ImmGetCompositionStringW(hIMC, GCS_COMPATTR, wxNullPtr, 0);
const int attrLen = ::ImmGetCompositionStringW(hIMC, GCS_COMPATTR, nullptr, 0);
std::vector<BYTE> attr(attrLen, 0);
::ImmGetCompositionStringW(hIMC, GCS_COMPATTR, &attr[0], static_cast<DWORD>(attr.size()));
return attr;
}
std::wstring GetCompositionString(DWORD dwIndex) {
const LONG byteLen = ::ImmGetCompositionStringW(hIMC, dwIndex, wxNullPtr, 0);
const LONG byteLen = ::ImmGetCompositionStringW(hIMC, dwIndex, nullptr, 0);
std::wstring wcs(byteLen / 2, 0);
::ImmGetCompositionStringW(hIMC, dwIndex, &wcs[0], byteLen);
return wcs;

View file

@ -718,7 +718,7 @@ public:
The position of the point to check, in window device coordinates.
@param pos
Receives the position of the character at the given position. May
be @NULL.
be @nullptr.
@see PositionToXY(), XYToPosition()
*/
@ -744,10 +744,10 @@ public:
The position of the point to check, in window device coordinates.
@param col
Receives the column of the character at the given position. May be
@NULL.
@nullptr.
@param row
Receives the row of the character at the given position. May be
@NULL.
@nullptr.
@see PositionToXY(), XYToPosition()
*/