Skip to content

Commit

Permalink
Remove redundant struct specifiers.
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@5377 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
chmallon committed Feb 18, 2012
1 parent 2a9c9c4 commit e825fe3
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions dataobj/fahrplan.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class schedule_t
schedule_t() : abgeschlossen(false), aktuell(0) {}

public:
minivec_tpl<struct linieneintrag_t> eintrag;
minivec_tpl<linieneintrag_t> eintrag;

/**
* sollte eine Fehlermeldung ausgeben, wenn halt nicht erlaubt ist
Expand Down Expand Up @@ -57,7 +57,7 @@ class schedule_t
uint8 get_aktuell() const { return aktuell; }

// always returns a valid entry to the current stop
const struct linieneintrag_t &get_current_eintrag() const { return aktuell>=eintrag.get_count() ? dummy_eintrag : eintrag[aktuell]; }
linieneintrag_t const& get_current_eintrag() const { return aktuell >= eintrag.get_count() ? dummy_eintrag : eintrag[aktuell]; }

private:
/**
Expand Down Expand Up @@ -152,7 +152,7 @@ class schedule_t
bool abgeschlossen;
uint8 aktuell;

static struct linieneintrag_t dummy_eintrag;
static linieneintrag_t dummy_eintrag;
};


Expand Down
6 changes: 3 additions & 3 deletions gui/components/gui_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void button_t::draw_roundbutton(sint16 x, sint16 y, sint16 w, sint16 h, bool pre
const sint16 rw = skinverwaltung_t::window_skin->get_bild(13)->get_pic()->w;
// first the center (may need extra clipping)
if(w-lw-rw<64) {
struct clip_dimension cl=display_get_clip_wh();
clip_dimension const cl = display_get_clip_wh();
display_set_clip_wh(cl.x, cl.y, max(0,min(x+w-rw,cl.xx)-cl.x), cl.h );
display_button_image(x+lw, y, RB_BODY_BUTTON, pressed);
display_set_clip_wh(cl.x, cl.y, cl.w, cl.h );
Expand Down Expand Up @@ -231,7 +231,7 @@ void button_t::draw_scrollbar(sint16 x, sint16 y, sint16 w, sint16 h, bool horiz
const sint16 rw = skinverwaltung_t::window_skin->get_bild(image_offset+1)->get_pic()->w;
// first the center (may need extra clipping)
if(w-lw-rw<64) {
struct clip_dimension cl=display_get_clip_wh();
clip_dimension const cl = display_get_clip_wh();
display_set_clip_wh(cl.x, cl.y, max(0,min(x+w-rw,cl.xx)-cl.x), cl.h );
display_color_img(skinverwaltung_t::window_skin->get_bild_nr(image_offset+2), x+lw, y, 0, false, true);
display_set_clip_wh(cl.x, cl.y, cl.w, cl.h );
Expand All @@ -254,7 +254,7 @@ void button_t::draw_scrollbar(sint16 x, sint16 y, sint16 w, sint16 h, bool horiz
const sint16 rh = skinverwaltung_t::window_skin->get_bild(image_offset+1)->get_pic()->h;
// first the center (may need extra clipping)
if(h-lh-rh<64) {
struct clip_dimension cl=display_get_clip_wh();
clip_dimension const cl = display_get_clip_wh();
display_set_clip_wh(cl.x, cl.y, cl.w, max(0,min(y+h-rh,cl.yy)-cl.y) );
display_color_img(skinverwaltung_t::window_skin->get_bild_nr(image_offset+2), x, y+lh, 0, false, true);
display_set_clip_wh(cl.x, cl.y, cl.w, cl.h );
Expand Down
2 changes: 1 addition & 1 deletion gui/curiositylist_stats_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void curiositylist_stats_t::recalc_size()
*/
void curiositylist_stats_t::zeichnen(koord offset)
{
const struct clip_dimension cd = display_get_clip_wh();
clip_dimension const cd = display_get_clip_wh();
const int start = cd.y-LINESPACE+1;
const int end = cd.yy;

Expand Down
2 changes: 1 addition & 1 deletion gui/factorylist_stats_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void factorylist_stats_t::recalc_size()
*/
void factorylist_stats_t::zeichnen(koord offset)
{
const struct clip_dimension cd = display_get_clip_wh();
clip_dimension const cd = display_get_clip_wh();
const int start = cd.y-LINESPACE-1;
const int end = cd.yy+LINESPACE+1;

Expand Down
2 changes: 1 addition & 1 deletion gui/labellist_stats_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void labellist_stats_t::zeichnen(koord offset)
// keep previous maximum width
int x_size = get_groesse().x-10-4;

const struct clip_dimension cd = display_get_clip_wh();
clip_dimension const cd = display_get_clip_wh();
const int start = cd.y-LINESPACE+1;
const int end = cd.yy;

Expand Down
2 changes: 1 addition & 1 deletion gui/message_stats_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void message_stats_t::zeichnen(koord offset)
}
}

struct clip_dimension cd = display_get_clip_wh();
clip_dimension const cd = display_get_clip_wh();
sint16 y = offset.y+2;

// changes to loop affecting x_size must be copied to ::recalc_size()
Expand Down
6 changes: 3 additions & 3 deletions simevent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void change_drag_start(int x, int y)
}


static void fill_event(struct event_t *ev)
static void fill_event(event_t* const ev)
{
// Knightly : variables for detecting double-clicks and triple-clicks
const unsigned long interval = 400;
Expand Down Expand Up @@ -218,7 +218,7 @@ static void fill_event(struct event_t *ev)
* Holt ein Event ohne zu warten
* @author Hj. Malthaner
*/
void display_poll_event(struct event_t *ev)
void display_poll_event(event_t* const ev)
{
// Knightly : if there is any pending meta-event, consume it instead of fetching a new event from the system
if( meta_event.ev_class!=EVENT_NONE ) {
Expand All @@ -239,7 +239,7 @@ void display_poll_event(struct event_t *ev)
* Holt ein Event mit warten
* @author Hj. Malthaner
*/
void display_get_event(struct event_t *ev)
void display_get_event(event_t* const ev)
{
// Knightly : if there is any pending meta-event, consume it instead of fetching a new event from the system
if( meta_event.ev_class!=EVENT_NONE ) {
Expand Down
6 changes: 3 additions & 3 deletions simevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ struct event_t {
* Translate event origin. Useful when transferring events to sub-components.
* @author Hj. Malthaner
*/
static inline void translate_event(struct event_t *ev, int x, int y)
static inline void translate_event(event_t* const ev, int x, int y)
{
ev->mx += x;
ev->cx += x;
Expand All @@ -187,8 +187,8 @@ static inline void translate_event(struct event_t *ev, int x, int y)
}
#endif

void display_poll_event(struct event_t *ev);
void display_get_event(struct event_t *ev);
void display_poll_event(event_t*);
void display_get_event(event_t*);
void change_drag_start(int x, int y);

int event_get_last_control_shift(void);
Expand Down
4 changes: 2 additions & 2 deletions simgraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct clip_dimension {
// save the current clipping and set a new one
#define PUSH_CLIP(x,y,w,h) \
{\
const struct clip_dimension p_cr = display_get_clip_wh(); \
clip_dimension const p_cr = display_get_clip_wh(); \
display_set_clip_wh(x, y, w, h);

// restore a saved clipping rect
Expand Down Expand Up @@ -257,7 +257,7 @@ int display_multiline_text(KOORD_VAL x, KOORD_VAL y, const char *inbuf, PLAYER_C
void display_direct_line(const KOORD_VAL x, const KOORD_VAL y, const KOORD_VAL xx, const KOORD_VAL yy, const PLAYER_COLOR_VAL color);

void display_set_clip_wh(KOORD_VAL x, KOORD_VAL y, KOORD_VAL w, KOORD_VAL h);
struct clip_dimension display_get_clip_wh(void);
clip_dimension display_get_clip_wh();

void display_snapshot(void);

Expand Down
4 changes: 2 additions & 2 deletions simgraph0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ int get_maus_y(void)
return sys_event.my;
}

struct clip_dimension display_get_clip_wh(void)
clip_dimension display_get_clip_wh()
{
struct clip_dimension clip_rect;
clip_dimension clip_rect;
return clip_rect;
}

Expand Down
4 changes: 2 additions & 2 deletions simgraph16.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int old_my = -1;
/*
* Hajo: Current clipping rectangle
*/
static struct clip_dimension clip_rect;
static clip_dimension clip_rect;

// and the variables for polygon clipping

Expand Down Expand Up @@ -637,7 +637,7 @@ static bool clip_lr(KOORD_VAL *x, KOORD_VAL *w, const KOORD_VAL left, const KOOR
* Ermittelt Clipping Rechteck
* @author Hj. Malthaner
*/
struct clip_dimension display_get_clip_wh(void)
clip_dimension display_get_clip_wh()
{
return clip_rect;
}
Expand Down
2 changes: 1 addition & 1 deletion simplan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ void planquadrat_t::display_dinge(const sint16 xpos, const sint16 ypos, const si
}

// clip everything at the next tile above
struct clip_dimension p_cr;
clip_dimension p_cr;
if( i < ground_size ) {
p_cr = display_get_clip_wh();
for(uint8 j=i; j<ground_size; j++) {
Expand Down
4 changes: 2 additions & 2 deletions simwin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1332,13 +1332,13 @@ bool check_pos_win(event_t *ev)
}


void win_get_event(struct event_t *ev)
void win_get_event(event_t* const ev)
{
display_get_event(ev);
}


void win_poll_event(struct event_t *ev)
void win_poll_event(event_t* const ev)
{
display_poll_event(ev);
// main window resized
Expand Down
6 changes: 3 additions & 3 deletions simwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void rdwr_all_win(loadsave_t *file);
int create_win(gui_frame_t*, wintype, long magic);
int create_win(int x, int y, gui_frame_t*, wintype, long magic);

bool check_pos_win(struct event_t *ev);
bool check_pos_win(event_t*);

bool win_is_open(gui_frame_t *ig );
int win_get_posx(gui_frame_t *ig);
Expand Down Expand Up @@ -144,8 +144,8 @@ void win_rotate90( sint16 new_size );
void move_win(int win);

void win_display_flush(double konto); // draw the frame and all windows
void win_get_event(struct event_t *ev);
void win_poll_event(struct event_t *ev);
void win_get_event(event_t*);
void win_poll_event(event_t*);

void win_set_welt(karte_t *welt);

Expand Down

0 comments on commit e825fe3

Please sign in to comment.