Changeset 519


Ignore:
Timestamp:
Apr 20, 2011, 11:39:47 PM (12 years ago)
Author:
Sam Hocevar
Message:

core: fix a few useless casts.

Location:
abuse/trunk/src
Files:
9 edited

Legend:

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

    r494 r519  
    6868    } else x=y=button=0;
    6969  }
    70   void push_event(event *ev) { events.add_end((linked_node *)ev); }
     70  void push_event(event *ev) { events.add_end(ev); }
    7171  void flush_screen();
    7272  int has_mouse() { return mouse->exsist(); }
  • abuse/trunk/src/imlib/image.cpp

    r518 r519  
    116116    }
    117117
    118     image_list.unlink((linked_node *)this);
     118    image_list.unlink(this);
    119119    DeletePage();
    120120    delete m_special;
     
    155155        m_special = NULL;
    156156    MakePage(size, page_buffer);
    157     image_list.add_end((linked_node *)this);
     157    image_list.add_end(this);
    158158    m_locked = false;
    159159}
     
    168168    for (int i = 0; i < m_size.y; i++)
    169169        fp->read(scan_line(i), m_size.x);
    170     image_list.add_end((linked_node *) this);
     170    image_list.add_end(this);
    171171    m_locked = false;
    172172}
     
    180180    for (int i = 0; i < m_size.y; i++)
    181181        fp->read(scan_line(i), m_size.x);
    182     image_list.add_end((linked_node *) this);
     182    image_list.add_end(this);
    183183    m_locked = false;
    184184}
     
    209209  {
    210210    im=(image *)image_list.first();
    211     image_list.unlink((linked_node *)im);
     211    image_list.unlink(im);
    212212    delete im;
    213213  } */
  • abuse/trunk/src/imlib/linked.h

    r494 r519  
    2828#include <string.h>
    2929
    30 #define loop(controll,first,inside) { (linked_node *)controll=first; \
    31   if (first) do { inside (linked_node *) controll=controll->next(); } \
    32   while ((linked_node *) controll!=first); }
     30#define loop(controll,first,inside) { controll=first; \
     31  if (first) do { inside controll=controll->next(); } \
     32  while (controll!=first); }
    3333
    3434#define loopt(type,controll,first,inside) { controll=(type *)(first); \
     
    3737
    3838
    39 #define loop_rev(controll,last,inside) { (linked_node *)controll=last; \
    40   if (first) do { inside (linked_node *) controll=controll->last(); } \
    41   while ((linked_node *) controll!=last); }
     39#define loop_rev(controll,last,inside) { controll=last; \
     40  if (first) do { inside controll=controll->last(); } \
     41  while (controll!=last); }
    4242
    4343#define loopct(type,controll,first,cond,inside) { controll=(type *)first; \
     
    7373// openly use the functions listed after the keyword PUBLIC
    7474// type conversions may be nessary if you derive a class of nodes of your own
    75 // for example shape is an class derived from linked_node.
    76 // to add a shape to linked lis I have to say
    77 // mylist.add_end( (linked_node *) myshape_pointer);
     75// for example shape is an class derived from linked_node. to add a shape to
     76// linked list I have to say mylist.add_end(myshape_pointer);
    7877// unlink removes a node from the list via pointers but does not deallocate
    7978// it from the heap
  • abuse/trunk/src/imlib/palette.cpp

    r512 r519  
    385385      CONDITION(lev<8,"Levl > 7");
    386386      re_delete(who->children[x],lev+1);
    387       level[lev].unlink((linked_node *)who->children[x]);
     387      level[lev].unlink(who->children[x]);
    388388      delete who->children[x];
    389389    }
     
    408408        pruned=1;                   //  I have a brother! stop
    409409       p=(quant_node *)p->next();
    410       } while ((linked_node *) p!=level[lev-1].first() && !pruned);
     410      } while (p != level[lev-1].first() && !pruned);
    411411    }
    412412  }
     
    447447    printf("h");
    448448      (*p)=new quant_node(lev,fat);
    449       level[lev-1].add_end((linked_node *)(*p));
     449      level[lev-1].add_end(*p);
    450450    }
    451451
  • abuse/trunk/src/imlib/sprite.cpp

    r513 r519  
    4949
    5050void sprite_controller::add_sprite(sprite *sp)
    51 { sprites.add_end((linked_node *)sp); }
     51{ sprites.add_end(sp); }
    5252
    5353void sprite_controller::remove_sprites()
     
    7474void sprite_controller::bring_front(sprite *sp)
    7575{
    76   ERROR(sprites.unlink((linked_node *)sp),"unlink failure");
    77   sprites.add_end((linked_node *)sp);
     76  ERROR(sprites.unlink(sp),"unlink failure");
     77  sprites.add_end(sp);
    7878}
    7979
    8080void sprite_controller::delete_sprite(sprite *sp)
    8181{
    82   ERROR(sprites.unlink((linked_node *)sp),"unlink failure");
     82  ERROR(sprites.unlink(sp),"unlink failure");
    8383  delete sp;
    8484}
  • abuse/trunk/src/objects.cpp

    r512 r519  
    15521552game_object::game_object(int Type, int load)
    15531553{
     1554  lvars = NULL;
     1555
    15541556  if (Type<0xffff)
    15551557  {
    1556     int t=figures[Type]->tv;
     1558    int t = figures[Type]->tv;
    15571559    if (t)
    15581560    {
    1559       lvars=(int32_t *)malloc(t * 4);
    1560       memset(lvars,0,t*4);
    1561     }
    1562     else lvars=NULL;
    1563   } else lvars=NULL;
     1561      lvars = (int32_t *)malloc(t * sizeof(int32_t));
     1562      memset(lvars, 0, t * sizeof(int32_t));
     1563    }
     1564  }
    15641565
    15651566  otype=Type;
     
    16141615void game_object::change_type(int new_type)
    16151616{
    1616   if (lvars) free(lvars);     // free old variable
     1617  free(lvars);     // free old variable
     1618  lvars = NULL;
    16171619
    16181620  if (otype<0xffff)
    16191621  {
    1620     int t=figures[new_type]->tv;
     1622    int t = figures[new_type]->tv;
    16211623    if (t)
    16221624    {
    1623       lvars=(int32_t *)malloc(t*4);
    1624       memset(lvars,0,t*4);
    1625     }
    1626     else lvars=NULL;
    1627   } else return;
     1625      lvars = (int32_t *)malloc(t * sizeof(int32_t));
     1626      memset(lvars, 0, t * sizeof(int32_t));
     1627    }
     1628  }
     1629  else return;
    16281630  otype=new_type;
    16291631
  • abuse/trunk/src/sdlport/event.cpp

    r512 r519  
    121121    ev->redraw.y2 = Y2;
    122122    ev->redraw.start = Start;
    123     events.add_end( (linked_node *)ev );
     123    events.add_end(ev);
    124124}
    125125
     
    143143    {
    144144        ev = *ep;
    145         events.unlink( (linked_node *)ep );
     145        events.unlink(ep);
    146146        delete ep;
    147147        ewaiting = events.first() != NULL;
  • abuse/trunk/src/sdlport/video.cpp

    r515 r519  
    372372            q = dr;
    373373            dr = (dirty_rect *)(dr->next());
    374             im->m_special->dirties.unlink((linked_node *)q);
     374            im->m_special->dirties.unlink(q);
    375375            delete q;
    376376            count--;
  • abuse/trunk/src/unixnfc.cpp

    r494 r519  
    599599      {
    600600    event *ev=(event *)input.first();
    601     input.unlink((linked_node *)ev);
     601    input.unlink(ev);
    602602    wm->push_event(ev);
    603603      }
Note: See TracChangeset for help on using the changeset viewer.