changeset 29590:ee385ab885b2

Consistently use sizeof(variable) instead of sizeof(type) where easily possible.
author reimar
date Wed, 02 Sep 2009 14:18:01 +0000
parents 5ed139ad6dfd
children bd3ac7fc0a70
files libvo/vo_quartz.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_quartz.c	Wed Sep 02 14:11:30 2009 +0000
+++ b/libvo/vo_quartz.c	Wed Sep 02 14:18:01 2009 +0000
@@ -233,8 +233,8 @@
         Point mousePos;
         Point winMousePos;
 
-        GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, 0, sizeof(Point), 0, &mousePos);
-        GetEventParameter(event, kEventParamWindowMouseLocation, typeQDPoint, 0, sizeof(Point), 0, &winMousePos);
+        GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, 0, sizeof(mousePos), 0, &mousePos);
+        GetEventParameter(event, kEventParamWindowMouseLocation, typeQDPoint, 0, sizeof(winMousePos), 0, &winMousePos);
 
         switch (kind)
         {
@@ -253,7 +253,7 @@
             int wheel;
             short part;
 
-            GetEventParameter(event, kEventParamMouseWheelDelta, typeSInt32, 0, sizeof(int), 0, &wheel);
+            GetEventParameter(event, kEventParamMouseWheelDelta, typeSInt32, 0, sizeof(wheel), 0, &wheel);
 
             part = FindWindow(mousePos, &tmpWin);
 
@@ -275,7 +275,7 @@
             Rect bounds;
 
             GetWindowPortBounds(theWindow, &bounds);
-            GetEventParameter(event, kEventParamMouseButton, typeMouseButton, 0, sizeof(EventMouseButton), 0, &button);
+            GetEventParameter(event, kEventParamMouseButton, typeMouseButton, 0, sizeof(button), 0, &button);
 
             part = FindWindow(mousePos, &tmpWin);
             if (kind == kEventMouseUp)
@@ -377,7 +377,7 @@
     {
         HICommand theHICommand;
 
-        GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &theHICommand);
+        GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(theHICommand), NULL, &theHICommand);
 
         switch (theHICommand.commandID)
         {
@@ -437,7 +437,7 @@
         WindowRef window;
         Rect rectWindow = { 0, 0, 0, 0 };
 
-        GetEventParameter(event, kEventParamDirectObject, typeWindowRef, NULL, sizeof(WindowRef), NULL, &window);
+        GetEventParameter(event, kEventParamDirectObject, typeWindowRef, NULL, sizeof(window), NULL, &window);
 
         if (window)
         {
@@ -574,7 +574,7 @@
     CGDirectDisplayID *displays;
     // Display IDs might not be consecutive, get the list of all devices up to # device_id
     displayCount = device_id + 1;
-    displays = malloc(sizeof(CGDirectDisplayID) * displayCount);
+    displays = malloc(sizeof(*displays) * displayCount);
     if (kCGErrorSuccess != CGGetActiveDisplayList(displayCount, displays, &displayCount) || displayCount < device_id + 1) {
         mp_msg(MSGT_VO, MSGL_FATAL, "Quartz error: Device ID %d do not exist, falling back to main device.\n", device_id);
         displayId = kCGDirectMainDisplay;