Ignore:
Timestamp:
Apr 17, 2011, 11:56:44 PM (12 years ago)
Author:
Sam Hocevar
Message:

style: remove trailing spaces, fix copyright statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/linked.h

    r481 r494  
    22 *  Abuse - dark 2D side-scrolling platform game
    33 *  Copyright (c) 1995 Crack dot Com
     4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
    45 *
    56 *  This software was released into the Public Domain. As with most public
     
    1516// example compare function
    1617//   virtual int compare(void *n1, int field)
    17 //        {return ((classname *) n1)->data > data);}
     18//        { return ((classname *) n1)->data > data); }
    1819//  should return (1 if n1 is greater than (self)) else return 0
    1920//  field is the value determined by linked_list::set_sort_field
     
    4849  if (first) \
    4950     for (controll=(type *)(first); \
    50           (!x || (controll)!=(type *)(first));\
     51          (!x || (controll)!=(type *)(first)); \
    5152          controll=(type *)(controll->next()),x++)
    5253
    5354#define loop_forct(type,controll,first,cond,x) int x=0; if (first) for \
    54   (controll=(type *)(first);cond && (!x || controll!=(type *)(first));\
     55  (controll=(type *)(first); cond && (!x || controll!=(type *)(first)); \
    5556  controll=(type *)(controll->next()),x++)
    5657
     
    5960  class linked_node *nextp, *lastp;
    6061public:
    61   virtual int compare(void *n1, int field)     {return(0);}  // default is = (equal)
    62   class linked_node *next()              {return nextp;}
    63   class linked_node *last()              {return lastp;}
    64   void set_next(class linked_node *p)    {nextp=p;}
    65   void set_last(class linked_node *p)    {lastp=p;}
     62  virtual int compare(void *n1, int field)     { return(0); }  // default is = (equal)
     63  class linked_node *next()              { return nextp; }
     64  class linked_node *last()              { return lastp; }
     65  void set_next(class linked_node *p)    { nextp=p; }
     66  void set_last(class linked_node *p)    { lastp=p; }
    6667  virtual ~linked_node() { ; }
    6768  linked_node() { nextp=NULL; lastp=NULL; }
     
    9091  void add_end(class linked_node *p);
    9192  void insert(class linked_node *p);
    92   void set_sort_field(int x) {sortby=x;}   // this is passed to compare
    93   class linked_node *current() {return cn;}
    94   class linked_node *first() {return fn;}
    95   class linked_node *last() {return fn->last();}
     93  void set_sort_field(int x) { sortby=x; }   // this is passed to compare
     94  class linked_node *current() { return cn; }
     95  class linked_node *first() { return fn; }
     96  class linked_node *last() { return fn->last(); }
    9697  class linked_node *get_node(int x);
    97   void set_current(class linked_node *p) {cn=p;}
    98   void go_first() {cn=fn;}
    99   void go_end() {cn=fn->last();}
    100   void go_next() {cn=cn->next();}
    101   void go_last() {cn=cn->last();}
    102   int number_nodes()  {return nn;}
     98  void set_current(class linked_node *p) { cn=p; }
     99  void go_first() { cn=fn; }
     100  void go_end() { cn=fn->last(); }
     101  void go_next() { cn=cn->next(); }
     102  void go_last() { cn=cn->last(); }
     103  int number_nodes()  { return nn; }
    103104  int node_number(linked_node *p);
    104105  int unlink(linked_node *p);
Note: See TracChangeset for help on using the changeset viewer.