]> git.sesse.net Git - vlc/blobdiff - modules/control/unimotion.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / modules / control / unimotion.c
index afcc7a32c1c1a31a0c5c1d879585251c5658e066..39b6c1b9704b5a61f4da56971d0cf5afe7682b7b 100644 (file)
@@ -138,8 +138,8 @@ static int probe_sms(int kernFunc, char *servMatch, int dataType, void *data)
     io_object_t aDevice;
     io_connect_t  dataPort;
 
-    IOItemCount structureInputSize;
-    IOByteCount structureOutputSize;
+    size_t structureInputSize;
+    size_t structureOutputSize;
 
     union motion_data inputStructure;
     union motion_data *outputStructure;
@@ -189,8 +189,8 @@ static int probe_sms(int kernFunc, char *servMatch, int dataType, void *data)
     memset(&inputStructure, 0, sizeof(union motion_data));
     memset(outputStructure, 0, sizeof(union motion_data));
 
-    result = IOConnectMethodStructureIStructureO(dataPort, kernFunc, structureInputSize,
-                &structureOutputSize, &inputStructure, outputStructure);
+    result = IOConnectCallStructMethod(dataPort, kernFunc, &inputStructure, 
+                structureInputSize, outputStructure, &structureOutputSize );
 
     IOServiceClose(dataPort);
 
@@ -251,28 +251,28 @@ int read_sms_raw(int type, int *x, int *y, int *z)
 int read_sms(int type, int *x, int *y, int *z)
 {
     int _x, _y, _z;
-       int xoff, yoff, zoff;
-       Boolean ok;
+    int xoff, yoff, zoff;
+    Boolean ok;
     int ret;
-    
     ret = read_sms_raw(type, &_x, &_y, &_z);
     if ( !ret )
         return 0;
 
-       static CFStringRef app = CFSTR("com.ramsayl.UniMotion");
-       static CFStringRef xoffstr = CFSTR("x_offset");
-       static CFStringRef yoffstr = CFSTR("y_offset");
-       static CFStringRef zoffstr = CFSTR("z_offset");
-       xoff = CFPreferencesGetAppIntegerValue(xoffstr, app, &ok);
-       if ( ok ) _x += xoff;
-       yoff = CFPreferencesGetAppIntegerValue(yoffstr, app, &ok);
-       if ( ok ) _y += yoff;
-       zoff = CFPreferencesGetAppIntegerValue(zoffstr, app, &ok);
-       if ( ok ) _z += zoff;
-       
-       *x = _x;
-       *y = _y;
-       *z = _z;
+    static CFStringRef app = CFSTR("com.ramsayl.UniMotion");
+    static CFStringRef xoffstr = CFSTR("x_offset");
+    static CFStringRef yoffstr = CFSTR("y_offset");
+    static CFStringRef zoffstr = CFSTR("z_offset");
+    xoff = CFPreferencesGetAppIntegerValue(xoffstr, app, &ok);
+    if ( ok ) _x += xoff;
+    yoff = CFPreferencesGetAppIntegerValue(yoffstr, app, &ok);
+    if ( ok ) _y += yoff;
+    zoff = CFPreferencesGetAppIntegerValue(zoffstr, app, &ok);
+    if ( ok ) _z += zoff;
+    
+    *x = _x;
+    *y = _y;
+    *z = _z;
 
     return ret;
 }
@@ -280,29 +280,29 @@ int read_sms(int type, int *x, int *y, int *z)
 int read_sms_real(int type, double *x, double *y, double *z)
 {
     int _x, _y, _z;
-       int xscale, yscale, zscale;
+    int xscale, yscale, zscale;
     int ret;
-       Boolean ok;
-    
+    Boolean ok;
     ret = read_sms_raw(type, &_x, &_y, &_z);
     if ( !ret )
         return 0;
 
-       static CFStringRef app = CFSTR("com.ramsayl.UniMotion");
-       static CFStringRef xscalestr = CFSTR("x_scale");
-       static CFStringRef yscalestr = CFSTR("y_scale");
-       static CFStringRef zscalestr = CFSTR("z_scale");
-       xscale = CFPreferencesGetAppIntegerValue(xscalestr, app, &ok);
-       if ( !ok ) return 0;
-       yscale = CFPreferencesGetAppIntegerValue(yscalestr, app, &ok);
-       if ( !ok ) return 0;
-       zscale = CFPreferencesGetAppIntegerValue(zscalestr, app, &ok);
-       if ( !ok ) return 0;
-       
+    static CFStringRef app = CFSTR("com.ramsayl.UniMotion");
+    static CFStringRef xscalestr = CFSTR("x_scale");
+    static CFStringRef yscalestr = CFSTR("y_scale");
+    static CFStringRef zscalestr = CFSTR("z_scale");
+    xscale = CFPreferencesGetAppIntegerValue(xscalestr, app, &ok);
+    if ( !ok ) return 0;
+    yscale = CFPreferencesGetAppIntegerValue(yscalestr, app, &ok);
+    if ( !ok ) return 0;
+    zscale = CFPreferencesGetAppIntegerValue(zscalestr, app, &ok);
+    if ( !ok ) return 0;
+    
     *x = _x / (double)xscale;
     *y = _y / (double)yscale;
     *z = _z / (double)zscale;
-       
+    
     return 1;
 }