diff --git Makefile Makefile index 250a5e0cd..cb008b613 100644 --- Makefile +++ Makefile @@ -196,7 +196,7 @@ ifdef WITH_REVISION endif endif -CFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(FLAGS) +CFLAGS += -Wall -Wextra -Wcast-qual -Wpointer-arith -Wcast-align $(FLAGS) CCFLAGS += -ansi -Wstrict-prototypes -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 diff --git dataobj/crossing_logic.cc dataobj/crossing_logic.cc index 1b2f008e0..a6a1be795 100644 --- dataobj/crossing_logic.cc +++ dataobj/crossing_logic.cc @@ -206,8 +206,8 @@ int compare_crossing(const crossing_desc_t *c0, const crossing_desc_t *c1) void crossing_logic_t::register_desc(crossing_desc_t *desc) { // mark if crossing possible - const waytype_t way0 = (const waytype_t)min(desc->get_waytype(0), desc->get_waytype(1)); - const waytype_t way1 = (const waytype_t)max(desc->get_waytype(0), desc->get_waytype(1)); + const waytype_t way0 = (waytype_t)min(desc->get_waytype(0), desc->get_waytype(1)); + const waytype_t way1 = (waytype_t)max(desc->get_waytype(0), desc->get_waytype(1)); if(way0<8 && way1<9 && way0g; +#endif // reached => construct route route.store_at( tmp->count, tmp->gr->get_pos() ); while(tmp != NULL) { diff --git gui/welt.cc gui/welt.cc index 939f1be35..2e85b71a9 100644 --- gui/welt.cc +++ gui/welt.cc @@ -393,11 +393,11 @@ void welt_gui_t::resize_preview() if( world_aspect > 1.0 ) { map_size.w = MAP_PREVIEW_SIZE_X-2; - map_size.h = (sint16) max( (const int)((float)map_size.w / world_aspect), L_PREVIEW_SIZE_MIN-2); + map_size.h = (sint16) max( (int)((float)map_size.w / world_aspect), L_PREVIEW_SIZE_MIN-2); } else { map_size.h = MAP_PREVIEW_SIZE_Y-2; - map_size.w = (sint16) max( (const int)((float)map_size.h * world_aspect), L_PREVIEW_SIZE_MIN-2); + map_size.w = (sint16) max( (int)((float)map_size.h * world_aspect), L_PREVIEW_SIZE_MIN-2); } map.resize( map_size.w, map_size.h ); } diff --git simmem.h simmem.h index 9d720487f..358b2e5c4 100644 --- simmem.h +++ simmem.h @@ -18,6 +18,6 @@ void* xrealloc(void * const ptr, size_t size); // Throws std::bad_alloc on failu #define MALLOCN(type, n) ((type*)xmalloc(sizeof(type) * (n))) // Allocate n objects of a certain type #define MALLOCF(type, member, n) ((type*)xmalloc(offsetof(type, member) + sizeof(*((type*)0)->member) * (n))) -#define REALLOC(ptr, type, n) (type*)xrealloc((void * const)ptr, sizeof(type) * (n)) // Reallocate n objects of a certain type +#define REALLOC(ptr, type, n) (type*)xrealloc((void *)ptr, sizeof(type) * (n)) // Reallocate n objects of a certain type #endif diff --git vehicle/simpeople.cc vehicle/simpeople.cc index 4f6ef51e2..266649f93 100644 --- vehicle/simpeople.cc +++ vehicle/simpeople.cc @@ -322,7 +322,7 @@ void pedestrian_t::get_screen_offset( int &xoff, int &yoff, const sint16 raster_ { // vehicles needs finer steps to appear smoother sint32 display_steps = (uint32)(steps + steps_offset)*(uint16)raster_width; - if(dx*dy) { + if( dx && dy ) { display_steps &= 0xFFFFFC00; } else { diff --git vehicle/simvehicle.cc vehicle/simvehicle.cc index a6b3e99b0..79bf76cfe 100644 --- vehicle/simvehicle.cc +++ vehicle/simvehicle.cc @@ -530,7 +530,7 @@ sint16 vehicle_base_t::get_hoff(const sint16 raster_width) const vehicle_base_t *vehicle_base_t::no_cars_blocking( const grund_t *gr, const convoi_t *cnv, const uint8 current_direction, const uint8 next_direction, const uint8 next_90direction ) { // Search vehicle - for( uint8 pos=1; pos<(volatile uint8)gr->get_top(); pos++ ) { + for( uint8 pos=1; pos<(uint8)gr->get_top(); pos++ ) { if( vehicle_base_t* const v = obj_cast(gr->obj_bei(pos)) ) { if( v->get_typ()==obj_t::pedestrian ) { continue;