diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 2c6d380..c7da9e6 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -93,9 +93,9 @@ void ResolveRoadTypeGUISprites(RoadtypeInfo *rti) * @param second The roadtype to compare. * @return True iff the first should be sorted before the second. */ -static int CDECL CompareRoadTypes(const uint32 first, const uint32 second) +static int CDECL CompareRoadTypes(const RoadTypeIdentifier *first, const RoadTypeIdentifier *second) { - return GetRoadTypeInfo(first)->sorting_order - GetRoadTypeInfo(second)->sorting_order; + return GetRoadTypeInfo(*first)->sorting_order - GetRoadTypeInfo(*second)->sorting_order; } /** @@ -116,7 +116,7 @@ void InitRoadTypes() _sorted_roadtypes[rt][_sorted_roadtypes_size[rt]++] = RoadTypeIdentifier(rt, rst); } } - //QSortT(_sorted_roadtypes[rt], _sorted_roadtypes_size[rt], CompareRoadTypes); + QSortT(_sorted_roadtypes[rt], _sorted_roadtypes_size[rt], CompareRoadTypes); } } diff --git a/src/road_map.h b/src/road_map.h index 247cbb1..73f817d 100644 --- a/src/road_map.h +++ b/src/road_map.h @@ -657,7 +657,8 @@ struct RoadTypeIdentifiers { assert(IsTileType(t, MP_ROAD) || IsTileType(t, MP_STATION) || IsTileType(t, MP_TUNNELBRIDGE)); TileType tt = GetTileType(t); - switch (tt) { + switch (tt) { + default: NOT_REACHED(); case MP_ROAD: if (GetRoadBits(t, ROADTYPE_ROAD) != ROAD_NONE) { road_identifier = GetRoadTypeRoad(t); @@ -787,7 +788,7 @@ struct RoadTypeIdentifiers { * @param rtid The road type identifier to add * @return The combined road types */ -static RoadTypeIdentifiers CombineTileRoadTypeIds(TileIndex tile, RoadTypeIdentifier rtid) +static inline RoadTypeIdentifiers CombineTileRoadTypeIds(TileIndex tile, RoadTypeIdentifier rtid) { /* Extract road types from tile, like "GetRoadTypes(tile)" */ RoadTypeIdentifiers tile_roadtype_ids = RoadTypeIdentifiers(tile); diff --git a/src/table/roadtypes.h b/src/table/roadtypes.h index f410f34..56e56ca 100644 --- a/src/table/roadtypes.h +++ b/src/table/roadtypes.h @@ -136,9 +136,9 @@ static const RoadtypeInfo _original_tramtypes[] = { 0x543, 0x53C, 0x535, 0x538, 0x53D, 0x537, 0x53A, 0x536 }, SPR_TRAMWAY_SLOPED_OFFSET, - NULL, - NULL, - NULL + 0, + 0, + 0 }, /* GUI sprites */