Changeset 1392


Ignore:
Timestamp:
May 6, 2007, 1:55:53 AM (12 years ago)
Author:
bruno
Message:

Fix a bug for allocation (pointer manipulation again - Thanks again Michel Loiseleur :-)

Location:
branches/stable/mondo/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-stream.c

    r1370 r1392  
    639639
    640640    assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device);
    641     mr_list_alloc(tapecatalog);
     641    tapecatalog = mr_list_alloc();
    642642    g_tape_posK = 0;
    643643    if (g_tape_stream) {
     
    735735    /*  initialise the catalog */
    736736    g_current_media_number = 1;
    737     mr_list_alloc(tapecatalog);
     737    tapecatalog = mr_list_alloc();
    738738    /* log stuff */
    739739    log_it("Opening OUT cdstream with the command");
     
    765765        return (0);
    766766    }
    767     mr_list_alloc(tapecatalog);
     767    tapecatalog = mr_list_alloc();
    768768    g_tape_posK = 0;
    769769
     
    10801080
    10811081    /* place the data in a list elt */
    1082     mr_list_alloc_elt(elt, (void *)te, mr_free_te);
     1082    elt = mr_list_alloc_elt((void *)te, mr_free_te);
    10831083    mr_list_add_elt_last(tapecatalog, elt);
    10841084
  • branches/stable/mondo/src/include/mr_list.h

    r1363 r1392  
    3434/* functions (public methods) */
    3535
    36 void mr_list_alloc(struct mr_list *list);
    37 void mr_list_alloc_elt(struct mr_list_elt *elt, void *data, void (*mr_free_data)(void *data));
     36struct mr_list *mr_list_alloc(void);
     37struct mr_list_elt *mr_list_alloc_elt(void *data, void (*mr_free_data)(void *data));
    3838void mr_list_free(struct mr_list *list);
    3939void mr_list_free_elt(struct mr_list_elt *elt);
  • branches/stable/mondo/src/lib/mr_list.c

    r1364 r1392  
    1515
    1616/* List allocation and initialization */
    17 void mr_list_alloc(struct mr_list *list) {
     17struct mr_list *mr_list_alloc(void) {
    1818
    1919    list = mr_malloc(sizeof(struct mr_list));
    2020    list->first = NULL;
    2121    list->last = NULL;
     22    return(list);
    2223}
    2324
    2425/* Elt of list allocation and initialization */
    25 void mr_list_alloc_elt(struct mr_list_elt *elt, void *data, void (*mr_free_data)(void *data)) {
     26struct mr_list_elt *mr_list_alloc_elt(void *data, void (*mr_free_data)(void *data)) {
    2627
    2728    elt = mr_malloc(sizeof(struct mr_list_elt));
     
    3031    elt->prev = NULL;
    3132    elt->next = NULL;
     33    return(elt);
    3234}
    3335
Note: See TracChangeset for help on using the changeset viewer.