Commit 88c81287 authored by Dan Hipschman's avatar Dan Hipschman Committed by Alexandre Julliard

widl: Simplify correlation descriptor code.

parent b95197ac
...@@ -210,6 +210,21 @@ s_sum_cs(cs_t *cs) ...@@ -210,6 +210,21 @@ s_sum_cs(cs_t *cs)
return s_sum_conf_array(cs->ca, cs->n); return s_sum_conf_array(cs->ca, cs->n);
} }
int
s_sum_cps(cps_t *cps)
{
int sum = 0;
int i;
for (i = 0; i < *cps->pn; ++i)
sum += cps->ca1[i];
for (i = 0; i < 2 * cps->n; ++i)
sum += cps->ca2[i];
return sum;
}
void void
s_stop(void) s_stop(void)
{ {
...@@ -393,7 +408,9 @@ array_tests(void) ...@@ -393,7 +408,9 @@ array_tests(void)
}; };
static int c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; static int c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
static vector_t vs[2] = {{1, -2, 3}, {4, -5, -6}}; static vector_t vs[2] = {{1, -2, 3}, {4, -5, -6}};
cps_t cps;
cs_t *cs; cs_t *cs;
int n;
ok(sum_fixed_int_3d(m) == 4116, "RPC sum_fixed_int_3d\n"); ok(sum_fixed_int_3d(m) == 4116, "RPC sum_fixed_int_3d\n");
...@@ -417,6 +434,13 @@ array_tests(void) ...@@ -417,6 +434,13 @@ array_tests(void)
cs->ca[4] = -4; cs->ca[4] = -4;
ok(sum_cs(cs) == 1, "RPC sum_cs\n"); ok(sum_cs(cs) == 1, "RPC sum_cs\n");
HeapFree(GetProcessHeap(), 0, cs); HeapFree(GetProcessHeap(), 0, cs);
n = 5;
cps.pn = &n;
cps.ca1 = &c[2];
cps.n = 3;
cps.ca2 = &c[3];
ok(sum_cps(&cps) == 53, "RPC sum_cps\n");
} }
static void static void
......
...@@ -119,7 +119,16 @@ interface IServer ...@@ -119,7 +119,16 @@ interface IServer
[size_is(n)] int ca[]; [size_is(n)] int ca[];
} cs_t; } cs_t;
typedef struct
{
int *pn;
[size_is(*pn)] int *ca1;
[size_is(n * 2)] int *ca2;
int n;
} cps_t;
int sum_cs(cs_t *cs); int sum_cs(cs_t *cs);
int sum_cps(cps_t *cps);
void stop(void); void stop(void);
} }
...@@ -1387,7 +1387,6 @@ static var_t *make_var(char *name) ...@@ -1387,7 +1387,6 @@ static var_t *make_var(char *name)
v->args = NULL; v->args = NULL;
v->attrs = NULL; v->attrs = NULL;
v->eval = NULL; v->eval = NULL;
v->corrdesc = 0;
return v; return v;
} }
......
...@@ -227,7 +227,6 @@ struct _var_t { ...@@ -227,7 +227,6 @@ struct _var_t {
var_list_t *args; /* for function pointers */ var_list_t *args; /* for function pointers */
attr_list_t *attrs; attr_list_t *attrs;
expr_t *eval; expr_t *eval;
size_t corrdesc; /* offset to correlation descriptor (e.g., for unions) */
/* parser-internal */ /* parser-internal */
struct list entry; struct list entry;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment