summaryrefslogtreecommitdiff
path: root/x11-drivers/xf86-video-qxl/files/patch-src-qxl_option_helpers.c
blob: 844ab5e0072c1a81401a2b87d83459e28c6d7171 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- src/qxl_option_helpers.c.orig	2015-10-12 16:31:14 UTC
+++ src/qxl_option_helpers.c
@@ -10,31 +10,32 @@
 
 #include "qxl_option_helpers.h"
 
-int get_int_option(OptionInfoPtr options, int option_index,
+int get_int_option(OptionInfoPtr options, int token,
                    const char *env_name)
 {
+    int value;
     if (env_name && getenv(env_name)) {
         return atoi(getenv(env_name));
     }
-    return options[option_index].value.num;
+    return xf86GetOptValInteger(options, token, &value) ? value : 0;
 }
 
-const char *get_str_option(OptionInfoPtr options, int option_index,
+const char *get_str_option(OptionInfoPtr options, int token,
                            const char *env_name)
 {
     if (getenv(env_name)) {
         return getenv(env_name);
     }
-    return options[option_index].value.str;
+    return xf86GetOptValString(options, token);
 }
 
-int get_bool_option(OptionInfoPtr options, int option_index,
+int get_bool_option(OptionInfoPtr options, int token,
                      const char *env_name)
 {
     const char* value = getenv(env_name);
 
     if (!value) {
-        return options[option_index].value.bool;
+        return xf86ReturnOptValBool(options, token, FALSE);
     }
     if (strcmp(value, "0") == 0 ||
         strcasecmp(value, "off") == 0 ||