Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-09-23 08:24:20 +0300
committerCampbell Barton <campbell@blender.org>2022-09-23 08:29:21 +0300
commitfbd78a8d78f460d1ae2972538139ac1602c012f6 (patch)
tree137e77868514388454cd597380db44d285005f39 /intern
parentc655bdfa3156f612b01b55b4c6e24d89fad4c748 (diff)
Cleanup: use ELEM macro
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_DropTargetX11.cpp6
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/intern/ghost/intern/GHOST_DropTargetX11.cpp b/intern/ghost/intern/GHOST_DropTargetX11.cpp
index 4da3c7c996d..1403639a36f 100644
--- a/intern/ghost/intern/GHOST_DropTargetX11.cpp
+++ b/intern/ghost/intern/GHOST_DropTargetX11.cpp
@@ -114,7 +114,7 @@ void *GHOST_DropTargetX11::getURIListGhostData(unsigned char *dropBuffer, int dr
/* Count total number of file paths in buffer. */
for (int i = 0; i <= dropBufferSize; i++) {
- if (dropBuffer[i] == 0 || dropBuffer[i] == '\n' || dropBuffer[i] == '\r') {
+ if (ELEM(dropBuffer[i], 0, '\n', '\r')) {
if (curLength) {
totPaths++;
curLength = 0;
@@ -131,7 +131,7 @@ void *GHOST_DropTargetX11::getURIListGhostData(unsigned char *dropBuffer, int dr
curLength = 0;
for (int i = 0; i <= dropBufferSize; i++) {
- if (dropBuffer[i] == 0 || dropBuffer[i] == '\n' || dropBuffer[i] == '\r') {
+ if (ELEM(dropBuffer[i], 0, '\n', '\r')) {
if (curLength) {
char *curPath = (char *)malloc(curLength + 1);
char *decodedPath;
@@ -182,7 +182,7 @@ void *GHOST_DropTargetX11::getGhostData(Atom dropType,
data = decodedPath;
}
}
- else if (dropType == dndTypePlainText || dropType == dndTypeOctetStream) {
+ else if (ELEM(dropType, dndTypePlainText, dndTypeOctetStream)) {
m_draggedObjectType = GHOST_kDragnDropTypeString;
data = tmpBuffer;
needsFree = false;
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index a4638c18ff9..113f453325d 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -217,7 +217,7 @@ GHOST_WindowX11::GHOST_WindowX11(GHOST_SystemX11 *system,
* So, m_post_init indicate that we need wait for the MapNotify
* event and then set the Window state to the m_post_state.
*/
- else if ((state != GHOST_kWindowStateNormal) && (state != GHOST_kWindowStateMinimized)) {
+ else if (!ELEM(state, GHOST_kWindowStateNormal, GHOST_kWindowStateMinimized)) {
m_post_init = True;
m_post_state = state;
}