[PATCH] xrandr: Use a prefix for enum type _policy and _relation like other enums in xrandr.c

Yann Droneaud ydroneaud at mandriva.com
Tue Nov 17 06:39:01 PST 2009


Try to apply the same coding style to enum _policy and enum _relation.

This patch is a fix for bug #12958 .

Signed-off-by: Yann Droneaud <ydroneaud at mandriva.com>
---
 xrandr.c |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/xrandr.c b/xrandr.c
index bbbc397..17f43a5 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -204,11 +204,16 @@ reflection_name (Rotation rotation)
 }
 
 typedef enum _policy {
-    clone, extend
+    policy_clone,
+    policy_extend
 } policy_t;
 
 typedef enum _relation {
-    left_of, right_of, above, below, same_as,
+    relation_left_of,
+    relation_right_of,
+    relation_above,
+    relation_below,
+    relation_same_as,
 } relation_t;
 
 typedef struct {
@@ -1758,23 +1763,23 @@ set_positions (void)
 	    }
 	    
 	    switch (output->relation) {
-	    case left_of:
+	    case relation_left_of:
 		output->y = relation->y;
 		output->x = relation->x - mode_width (output->mode_info, output->rotation);
 		break;
-	    case right_of:
+	    case relation_right_of:
 		output->y = relation->y;
 		output->x = relation->x + mode_width (relation->mode_info, relation->rotation);
 		break;
-	    case above:
+	    case relation_above:
 		output->x = relation->x;
 		output->y = relation->y - mode_height (output->mode_info, output->rotation);
 		break;
-	    case below:
+	    case relation_below:
 		output->x = relation->x;
 		output->y = relation->y + mode_height (relation->mode_info, relation->rotation);
 		break;
-	    case same_as:
+	    case relation_same_as:
 		output->x = relation->x;
 		output->y = relation->y;
 	    }
@@ -2050,7 +2055,7 @@ main (int argc, char **argv)
     Bool    	have_pixel_size = False;
     int		ret = 0;
     output_t	*output = NULL;
-    policy_t	policy = clone;
+    policy_t	policy = policy_clone;
     Bool    	setit_1_2 = False;
     Bool    	query_1_2 = False;
     Bool	modeit = False;
@@ -2243,7 +2248,7 @@ main (int argc, char **argv)
 	if (!strcmp ("--left-of", argv[i])) {
 	    if (++i>=argc) usage ();
 	    if (!output) usage();
-	    output->relation = left_of;
+	    output->relation = relation_left_of;
 	    output->relative_to = argv[i];
 	    output->changes |= changes_relation;
 	    continue;
@@ -2251,7 +2256,7 @@ main (int argc, char **argv)
 	if (!strcmp ("--right-of", argv[i])) {
 	    if (++i>=argc) usage ();
 	    if (!output) usage();
-	    output->relation = right_of;
+	    output->relation = relation_right_of;
 	    output->relative_to = argv[i];
 	    output->changes |= changes_relation;
 	    continue;
@@ -2259,7 +2264,7 @@ main (int argc, char **argv)
 	if (!strcmp ("--above", argv[i])) {
 	    if (++i>=argc) usage ();
 	    if (!output) usage();
-	    output->relation = above;
+	    output->relation = relation_above;
 	    output->relative_to = argv[i];
 	    output->changes |= changes_relation;
 	    continue;
@@ -2267,7 +2272,7 @@ main (int argc, char **argv)
 	if (!strcmp ("--below", argv[i])) {
 	    if (++i>=argc) usage ();
 	    if (!output) usage();
-	    output->relation = below;
+	    output->relation = relation_below;
 	    output->relative_to = argv[i];
 	    output->changes |= changes_relation;
 	    continue;
@@ -2275,7 +2280,7 @@ main (int argc, char **argv)
 	if (!strcmp ("--same-as", argv[i])) {
 	    if (++i>=argc) usage ();
 	    if (!output) usage();
-	    output->relation = same_as;
+	    output->relation = relation_same_as;
 	    output->relative_to = argv[i];
 	    output->changes |= changes_relation;
 	    continue;
@@ -2432,13 +2437,13 @@ main (int argc, char **argv)
 	    continue;
 	}
 	if (!strcmp ("--clone", argv[i])) {
-	    policy = clone;
+	    policy = policy_clone;
 	    setit_1_2 = True;
 	    action_requested = True;
 	    continue;
 	}
 	if (!strcmp ("--extend", argv[i])) {
-	    policy = extend;
+	    policy = policy_extend;
 	    setit_1_2 = True;
 	    action_requested = True;
 	    continue;
-- 
1.6.0.2





More information about the xorg-devel mailing list