]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - blob.c
blob.c: Don't initialize table pointer in table->init().
[paraslash.git] / blob.c
diff --git a/blob.c b/blob.c
index 4ecbc45bb15f42c15342e7900f4de94522ef45bb..70d55236ad3b3b932f8e93aef68ed2a316ae9076 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -403,7 +403,7 @@ static int stdin_command(struct command_context *cc,
        if (ret < 0)
                return ret;
        query.size = len + 1 + stdin_obj.size;
-       query.data = para_malloc(query.size);
+       query.data = alloc(query.size);
        memcpy(query.data, lls_input(0, lpr), len + 1);
        if (stdin_obj.size > 0)
                memcpy((char *)query.data + len + 1, stdin_obj.data,
@@ -520,11 +520,11 @@ static int blob_get_name_by_id(struct osl_table *table, uint32_t id,
                return blob_get_name_by_id(table_name ## _table, id, name); \
        }
 
-static int blob_get_def_by_name(struct osl_table *table, char *name,
+static int blob_get_def_by_name(struct osl_table *table, const char *name,
                struct osl_object *def)
 {
        struct osl_row *row;
-       struct osl_object obj = {.data = name, .size = strlen(name) + 1};
+       struct osl_object obj = {.data = (void *)name, .size = strlen(name) + 1};
        int ret;
 
        def->data = NULL;
@@ -538,7 +538,7 @@ static int blob_get_def_by_name(struct osl_table *table, char *name,
 
 /** Define the \p get_def_by_id function for this blob type. */
 #define DEFINE_GET_DEF_BY_NAME(table_name, cmd_prefix) \
-       int cmd_prefix ## _get_def_by_name(char *name, struct osl_object *def) \
+       int cmd_prefix ## _get_def_by_name(const char *name, struct osl_object *def) \
        { \
                return blob_get_def_by_name(table_name ## _table, name, def); \
        }
@@ -625,7 +625,6 @@ static int blob_open(struct osl_table **table,
                        &table_name ## _table_desc, dir); \
        }
 
-
 /** Define the \p init function for this blob type. */
 #define DEFINE_BLOB_INIT(table_name) \
        void table_name ## _init(struct afs_table *t) \
@@ -634,10 +633,8 @@ static int blob_open(struct osl_table **table,
                t->close = table_name ## _close; \
                t->create = table_name ## _create;\
                t->event_handler = table_name ##_event_handler; \
-               table_name ## _table = NULL; \
        }
 
-
 /** Define all functions for this blob type. */
 #define DEFINE_BLOB_FUNCTIONS(table_name, short_name, c_short_name) \
        DEFINE_BLOB_OPEN(table_name) \