httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject [apreq-2] conditionals
Date Sat, 19 Apr 2003 19:35:47 GMT
For apreq-2, VC++ on Win32 (and perhaps also some other 
compilers?) doesn't like statements like
  (some_condition) ? do_something : do_something_else;
This diff (unfortunately :)

=========================================================
Index: apreq_tables.c
===================================================================
RCS file: /home/cvspublic/httpd-apreq-2/src/apreq_tables.c,v
retrieving revision 1.13
diff -u -r1.13 apreq_tables.c
--- apreq_tables.c	19 Apr 2003 16:21:31 -0000	1.13
+++ apreq_tables.c	19 Apr 2003 19:42:18 -0000
@@ -176,7 +176,12 @@
     if (pivot[o].tree[!direction] >= 0)
         pivot[o].tree[!direction][o].tree[PARENT] = pivot;
 
-    (parent >= 0) ? parent[o].tree[LR(pivot)] : *root = child;
+    if (parent >= 0) {
+        parent[o].tree[LR(pivot)];
+    }
+    else {
+        *root = child;
+    }
 
     child[o].tree[PARENT]      = parent;
     child[o].tree[direction]   = pivot;
@@ -256,7 +261,12 @@
             if (x[o].tree[RIGHT] >= 0)
                 x[o].tree[RIGHT][o].tree[PARENT] = idx;
 
-            (parent >= 0) ? parent[o].tree[LR(x)] : *root = idx;
+            if (parent >= 0) {
+                parent[o].tree[LR(x)];
+            }
+            else {
+                *root = idx;
+            }
 
             elt->tree[PARENT] = parent;
             elt->tree[RIGHT]  = x[o].tree[RIGHT];
@@ -333,7 +343,12 @@
         y[o].tree[RIGHT]  = idx[o].tree[RIGHT];
         y[o].color        = idx[o].color;
 
-        (x >= 0) ? x[o].tree[LR(idx)] : *root = y;
+        if (x >= 0) {
+            x[o].tree[LR(idx)];
+        }
+        else {
+            *root = y;
+        }
 
         idx[o].tree[PARENT] = -1;
         idx[o].tree[LEFT]   = -1;
@@ -356,16 +371,24 @@
     /* remove y from the parent chain */
     x[o].tree[PARENT] = y[o].tree[PARENT];
 
-    (y[o].tree[PARENT] >= 0) ?
-        y[o].tree[PARENT][o].tree[LR(y)] : *root = x;
+    if (y[o].tree[PARENT] >= 0) {
+        y[o].tree[PARENT][o].tree[LR(y)];
+    }
+    else {
+        *root = x;
+    }
 
     if (y != idx) {     /* swap y[o] with idx[o] */
         y[o].tree[LEFT] = idx[o].tree[LEFT];
         y[o].tree[RIGHT] = idx[o].tree[RIGHT];
         y[o].tree[PARENT] = idx[o].tree[PARENT];
         
-        (y[o].tree[PARENT] >= 0) ?
-            y[o].tree[PARENT][o].tree[LR(y)] : *root = y;
+        if (y[o].tree[PARENT] >= 0) {
+            y[o].tree[PARENT][o].tree[LR(y)];
+        }
+        else {
+            *root = y;
+        }
 
         idx[o].tree[LEFT] = -1;
         idx[o].tree[RIGHT] = -1;
================================================================
allows apreq_tables.c to compile.

-- 
best regards,
randy


Mime
View raw message