Ticket #36397: patch-list.c.diff

File patch-list.c.diff, 1.6 KB (added by stevecheckoway (Stephen Checkoway), 12 years ago)
  • list.c

    old new  
    66 */
    77
    88#include <stdio.h>    /* Basic includes and definitions */
     9#include <stdlib.h>
    910#include "list.h"
    1011
    1112#define boolean int
    typedef struct int_list { /* Informatio 
    3233  List free_list;
    3334} *Int_list;
    3435
    35 insert(item, list)      /* Inserts to the end of a list */
    36 List item;
    37 List list;
     36void insert(void *item_, void *list_)   /* Inserts to the end of a list */
    3837{
     38  List item = item_;
     39  List list = list_;
    3940  List last_node;
    4041
    4142  last_node = list->blink;
    List list; 
    4647  item->flink = list;
    4748}
    4849
    49 delete_item(item)               /* Deletes an arbitrary iterm */
    50 List item;
     50void delete_item(void *item_)           /* Deletes an arbitrary iterm */
    5151{
     52  List item = item_;
    5253  item->flink->blink = item->blink;
    5354  item->blink->flink = item->flink;
    5455}
    5556
    56 List make_list(size)    /* Creates a new list */
    57 int size;
     57List make_list(int size)        /* Creates a new list */
    5858{
    5959  Int_list l;
    6060
    int size; 
    6767  return (List) l;
    6868}
    6969 
    70 List get_node(list)   /* Allocates a node to be inserted into the list */
    71 List list;
     70List get_node(void *list_)   /* Allocates a node to be inserted into the list */
    7271{
     72  List list = list_;
    7373  Int_list l;
    7474  List to_return;
    7575
    List list; 
    8383  }
    8484}
    8585
    86 free_node(node, list)    /* Deallocates a node from the list */
    87 List node;
    88 List list;
     86void free_node(void *node_, void *list_)    /* Deallocates a node from the list */
    8987{
     88  List node = node_;
     89  List list = list_;
    9090  Int_list l;
    9191 
    9292  l = (Int_list) list;