]> mj.ucw.cz Git - libucw.git/blobdiff - lib/conf-intr.c
simple fastbuf on memory pools
[libucw.git] / lib / conf-intr.c
index 2d51fd90daca242b7223f0c1b3e0493e6809b48a..9777e5711a426f71e409dd6a4369312e041ac2a7 100644 (file)
@@ -102,7 +102,7 @@ byte *cf_op_names[] = { CF_OPERATIONS };
 #undef T
 byte *cf_type_names[] = { "int", "u64", "double", "ip", "string", "lookup", "user" };
 
-#define DARY_HDR_SIZE ALIGN(sizeof(uns), CPU_STRUCT_ALIGN)
+#define DARY_HDR_SIZE ALIGN_TO(sizeof(uns), CPU_STRUCT_ALIGN)
 
 static byte *
 interpret_set_dynamic(struct cf_item *item, int number, byte **pars, void **ptr)
@@ -151,7 +151,7 @@ interpret_section(struct cf_section *sec, int number, byte **pars, int *processe
   for (struct cf_item *ci=sec->cfg; ci->cls; ci++)
   {
     int taken;
-    byte *msg = interpret_set_item(ci, number, pars, &taken, ptr + (addr_int_t) ci->ptr, allow_dynamic && !ci[1].cls);
+    byte *msg = interpret_set_item(ci, number, pars, &taken, ptr + (uintptr_t) ci->ptr, allow_dynamic && !ci[1].cls);
     if (msg)
       return cf_printf("Item %s: %s", ci->name, msg);
     *processed += taken;
@@ -333,8 +333,8 @@ static int
 cmp_items(void *i1, void *i2, struct cf_item *item)
 {
   ASSERT(item->cls == CC_STATIC);
-  i1 += (addr_int_t) item->ptr;
-  i2 += (addr_int_t) item->ptr;
+  i1 += (uintptr_t) item->ptr;
+  i2 += (uintptr_t) item->ptr;
   if (item->type == CT_STRING)
     return strcmp(* (byte**) i1, * (byte**) i2);
   else                         // all numeric types
@@ -504,7 +504,7 @@ find_item(struct cf_section *curr_sec, byte *name, byte **msg, void **ptr)
        *msg = cf_printf("Unknown item %s", name);
       return NULL;
     }
-    *ptr += (addr_int_t) ci->ptr;
+    *ptr += (uintptr_t) ci->ptr;
     if (!c)
       return ci;
     if (ci->cls != CC_SECTION)