ao: Get rid of E_AO_BAD_SAMPLE_FORMAT.
[paraslash.git] / blob.c
diff --git a/blob.c b/blob.c
index 2d7c6050cfb18c198675c1ce4a534dd824983310..e10b522f73a249f5b02b6f50b72788efdc6d7f68 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -1,8 +1,4 @@
-/*
- * Copyright (C) 2007 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2007 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
 
 /** \file blob.c Macros and functions for blob handling. */
 
@@ -33,8 +29,8 @@
  */
 static int uint32_compare(const struct osl_object *obj1, const struct osl_object *obj2)
 {
-       uint32_t d1 = read_u32((const char *)obj1->data);
-       uint32_t d2 = read_u32((const char *)obj2->data);
+       uint32_t d1 = read_u32(obj1->data);
+       uint32_t d2 = read_u32(obj2->data);
 
        if (d1 < d2)
                return 1;
@@ -76,7 +72,6 @@ static struct osl_column_description blob_cols[] = {
 /** Define a pointer to an osl blob table with a canonical name. */
 #define DEFINE_BLOB_TABLE_PTR(table_name) struct osl_table *table_name ## _table;
 
-
 /** Define a blob table. */
 #define INIT_BLOB_TABLE(table_name) \
        DEFINE_BLOB_TABLE_DESC(table_name); \
@@ -125,6 +120,7 @@ static int com_lsblob_callback(const struct lls_command * const cmd,
                .action = print_blob,
        };
        int ret;
+
        ret = lls_deserialize_parse_result(aca->query.data, cmd, &aca->lpr);
        pmd.lpr = aca->lpr;
        assert(ret >= 0);
@@ -180,6 +176,7 @@ static int com_catblob_callback(const struct lls_command * const cmd,
                .data = &aca->fd,
                .action = cat_blob
        };
+
        ret = lls_deserialize_parse_result(aca->query.data, cmd, &aca->lpr);
        assert(ret >= 0);
        pmd.lpr = aca->lpr;
@@ -211,6 +208,7 @@ static int remove_blob(struct osl_table *table, struct osl_row *row,
 {
        struct afs_callback_arg *aca = data;
        int ret = osl(osl_del_row(table, row));
+
        if (ret < 0) {
                para_printf(&aca->pbout, "cannot remove %s\n", name);
                return ret;
@@ -230,6 +228,7 @@ static int com_rmblob_callback(const struct lls_command * const cmd,
                .data = aca,
                .action = remove_blob
        };
+
        ret = lls_deserialize_parse_result(aca->query.data, cmd, &aca->lpr);
        assert(ret >= 0);
        pmd.lpr = aca->lpr;
@@ -378,7 +377,7 @@ again:
  *
  * This function is called from the addblob command handlers to instruct the
  * afs process to store the input in a blob table. Input is read and decrypted
- * from the file descriptor given by cc and appended to arg_obj, which contains
+ * from the file descriptor given by cc and appended to a buffer which also contains
  * the name of the blob to create. The combined buffer is made available to the
  * afs process via the callback method.
  */
@@ -513,7 +512,6 @@ 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,
                struct osl_object *def)
 {
@@ -565,6 +563,7 @@ static int blob_get_name_and_def_by_row(struct osl_table *table,
 {
        struct osl_object obj;
        int ret = osl(osl_get_object(table, row, BLOBCOL_NAME, &obj));
+
        if (ret < 0)
                return ret;
        *name = obj.data;
@@ -600,6 +599,7 @@ static int blob_open(struct osl_table **table,
                const char *dir)
 {
        int ret;
+
        desc->dir = dir;
        ret = osl(osl_open_table(desc, table));
        if (ret >= 0)