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
diff options
context:
space:
mode:
authorAaron Carlisle <carlisle.b3d@gmail.com>2021-10-20 15:45:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-10-20 16:00:01 +0300
commit2743d746ea4f38c098512f6dd6fc33d5a62429d3 (patch)
tree0680f3c4713b7ecd698b91c5d1298734fc55f7ff /source/blender/windowmanager/WM_types.h
parent3435ea014d42d1e223513f448cbdaba63864115c (diff)
Cleanup: use an array for wmEvent cursor position variables
Use arrays for wmEvent coordinates, this quiets warnings with GCC11. - `x, y` -> `xy`. - `prevx, prevy` -> `prev_xy`. - `prevclickx, prevclicky` -> `prev_click_xy`. There is still some cleanup such as using `copy_v2_v2_int()`, this can be done separately. Reviewed By: campbellbarton, Severin Ref D12901
Diffstat (limited to 'source/blender/windowmanager/WM_types.h')
-rw-r--r--source/blender/windowmanager/WM_types.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 081e76e3d5b..105e533ad22 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -597,7 +597,7 @@ typedef struct wmTabletData {
* - The previous values are only set for mouse button and keyboard events.
* See: #ISMOUSE_BUTTON & #ISKEYBOARD macros.
*
- * - Previous x/y are exceptions: #wmEvent.prevx & #wmEvent.prevy
+ * - Previous x/y are exceptions: #wmEvent.prev
* these are set on mouse motion, see #MOUSEMOVE & track-pad events.
*
* - Modal key-map handling sets `prevval` & `prevtype` to `val` & `type`,
@@ -611,7 +611,7 @@ typedef struct wmEvent {
/** Press, release, scroll-value. */
short val;
/** Mouse pointer position, screen coord. */
- int x, y;
+ int xy[2];
/** Region relative mouse position (name convention before Blender 2.5). */
int mval[2];
/**
@@ -638,13 +638,13 @@ typedef struct wmEvent {
/** The time when the key is pressed, see #PIL_check_seconds_timer. */
double prevclicktime;
/** The location when the key is pressed (used to enforce drag thresholds). */
- int prevclickx, prevclicky;
+ int prev_click_xy[2];
/**
- * The previous value of #wmEvent.x #wmEvent.y,
+ * The previous value of #wmEvent.xy,
* Unlike other previous state variables, this is set on any mouse motion.
- * Use `prevclickx` & `prevclicky` for the value at time of pressing.
+ * Use `prevclick` for the value at time of pressing.
*/
- int prevx, prevy;
+ int prev_xy[2];
/** Modifier states. */
/** 'oskey' is apple or windows-key, value denotes order of pressed. */
@@ -665,7 +665,7 @@ typedef struct wmEvent {
/**
* True if the operating system inverted the delta x/y values and resulting
- * `prevx`, `prevy` values, for natural scroll direction.
+ * `prev_xy` values, for natural scroll direction.
* For absolute scroll direction, the delta must be negated again.
*/
char is_direction_inverted;