ui/common/context.c

changeset 33
458831c574f4
parent 25
78ae3efe463f
child 37
56016468753d
equal deleted inserted replaced
32:9a5f47fbc5c3 33:458831c574f4
116 UiString *s = a->calloc( 116 UiString *s = a->calloc(
117 a->pool, 117 a->pool,
118 1, 118 1,
119 sizeof(UiInteger)); 119 sizeof(UiInteger));
120 return s; 120 return s;
121 }
122 case UI_VAR_TEXT: {
123 UiText *t = a->calloc(
124 a->pool,
125 1,
126 sizeof(UiText));
127 return t;
128 }
129 case UI_VAR_LIST: {
130 UiListVar *l = a->malloc(a->pool, sizeof(UiListVar));
131 UiListPtr *lp = a->malloc(a->pool, sizeof(UiListPtr));
132 l->listptr = lp;
133 lp->list = NULL;
134 // TODO: create empty list
135 return l;
121 } 136 }
122 } 137 }
123 return NULL; 138 return NULL;
124 } 139 }
125 140
179 int nelm = ucx_list_size(ctx->groups); 194 int nelm = ucx_list_size(ctx->groups);
180 int *groups = calloc(sizeof(int), nelm); 195 int *groups = calloc(sizeof(int), nelm);
181 196
182 int i = 0; 197 int i = 0;
183 UCX_FOREACH(elm, ctx->groups) { 198 UCX_FOREACH(elm, ctx->groups) {
184 groups[i++] = (int)elm->data; 199 groups[i++] = (intptr_t)elm->data;
185 } 200 }
186 201
187 *ngroups = nelm; 202 *ngroups = nelm;
188 return groups; 203 return groups;
189 } 204 }

mercurial