Changeset - r20983:4b9faf9002d5
[Not reviewed]
master
0 13 0
rubidium - 11 years ago 2013-11-23 13:12:19
rubidium@openttd.org
(svn r26057) -Fix: a number of possibly uninitialised variables
13 files changed with 28 insertions and 13 deletions:
0 comments (0 inline, 0 general)
src/core/pool_func.hpp
Show inline comments
 
@@ -35,6 +35,9 @@ DEFINE_POOL_METHOD(inline)::Pool(const c
 
		first_free(0),
 
		first_unused(0),
 
		items(0),
 
#ifdef OTTD_ASSERT
 
		checked(0),
 
#endif /* OTTD_ASSERT */
 
		cleaning(false),
 
		data(NULL),
 
		alloc_cache(NULL)
src/fios.h
Show inline comments
 
@@ -41,7 +41,8 @@ struct LoadCheckData {
 
	struct LoggedAction *gamelog_action;          ///< Gamelog actions
 
	uint gamelog_actions;                         ///< Number of gamelog actions
 

	
 
	LoadCheckData() : error_data(NULL), grfconfig(NULL), gamelog_action(NULL)
 
	LoadCheckData() : error_data(NULL), grfconfig(NULL),
 
			grf_compatibility(GLC_NOT_FOUND), gamelog_action(NULL), gamelog_actions(0)
 
	{
 
		this->Clear();
 
	}
src/heightmap.cpp
Show inline comments
 
@@ -46,9 +46,11 @@ static void ReadHeightmapPNGImageData(by
 
	uint x, y;
 
	byte gray_palette[256];
 
	png_bytep *row_pointers = NULL;
 
	bool has_palette = png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE;
 
	uint channels = png_get_channels(png_ptr, info_ptr);
 

	
 
	/* Get palette and convert it to grayscale */
 
	if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) {
 
	if (has_palette) {
 
		int i;
 
		int palette_size;
 
		png_color *palette;
 
@@ -79,11 +81,11 @@ static void ReadHeightmapPNGImageData(by
 
	for (x = 0; x < png_get_image_width(png_ptr, info_ptr); x++) {
 
		for (y = 0; y < png_get_image_height(png_ptr, info_ptr); y++) {
 
			byte *pixel = &map[y * png_get_image_width(png_ptr, info_ptr) + x];
 
			uint x_offset = x * png_get_channels(png_ptr, info_ptr);
 
			uint x_offset = x * channels;
 

	
 
			if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) {
 
			if (has_palette) {
 
				*pixel = gray_palette[row_pointers[y][x_offset]];
 
			} else if (png_get_channels(png_ptr, info_ptr) == 3) {
 
			} else if (channels == 3) {
 
				*pixel = RGBToGrayscale(row_pointers[y][x_offset + 0],
 
						row_pointers[y][x_offset + 1], row_pointers[y][x_offset + 2]);
 
			} else {
src/network/core/tcp_game.cpp
Show inline comments
 
@@ -26,7 +26,7 @@
 
 * Create a new socket for the game connection.
 
 * @param s The socket to connect with.
 
 */
 
NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s) : info(NULL),
 
NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s) : info(NULL), client_id(INVALID_CLIENT_ID),
 
		last_frame(_frame_counter), last_frame_server(_frame_counter), last_packet(_realtime_tick)
 
{
 
	this->sock = s;
src/network/network_internal.h
Show inline comments
 
@@ -155,9 +155,9 @@ bool IsNetworkCompatibleVersion(const ch
 
 */
 
struct CommandPacket : CommandContainer {
 
	/** Make sure the pointer is NULL. */
 
	CommandPacket() : next(NULL) {}
 
	CommandPacket() : next(NULL), company(INVALID_COMPANY), frame(0), my_cmd(false) {}
 
	CommandPacket *next; ///< the next command packet (if in queue)
 
	CompanyByte company; ///< company that is executing the command
 
	CompanyID company;   ///< company that is executing the command
 
	uint32 frame;        ///< the frame in which this packet is executed
 
	bool my_cmd;         ///< did the command originate from "me"
 
};
src/newgrf_config.cpp
Show inline comments
 
@@ -226,7 +226,8 @@ GRFParameterInfo::GRFParameterInfo(uint 
 
	def_value(0),
 
	param_nr(nr),
 
	first_bit(0),
 
	num_bit(32)
 
	num_bit(32),
 
	complete_labels(false)
 
{}
 

	
 
/**
src/newgrf_text.cpp
Show inline comments
 
@@ -882,7 +882,7 @@ struct TextRefStack {
 
	byte position;
 
	bool used;
 

	
 
	TextRefStack() : used(false) {}
 
	TextRefStack() : position(0), used(false) {}
 

	
 
	TextRefStack(const TextRefStack &stack) :
 
		position(stack.position),
src/order_gui.cpp
Show inline comments
 
@@ -349,8 +349,10 @@ void DrawOrderString(const Vehicle *v, c
 

	
 
static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
 
{
 
	Order order;
 
	order.next  = NULL;
 
	/* Hack-ish; unpack order 0, so everything gets initialised with either zero
 
	 * or a suitable default value for the variable. Then also override the index
 
	 * as it is not coming from a pool, so would be initialised. */
 
	Order order(0);
 
	order.index = 0;
 

	
 
	/* check depot first */
src/saveload/station_sl.cpp
Show inline comments
 
@@ -241,7 +241,7 @@ std::list<CargoPacket *> _packets;
 
uint32 _num_dests;
 

	
 
struct FlowSaveLoad {
 
	FlowSaveLoad() : via(0), share(0) {}
 
	FlowSaveLoad() : source(0), via(0), share(0), restricted(false) {}
 
	StationID source;
 
	StationID via;
 
	uint32 share;
src/script/script_info.hpp
Show inline comments
 
@@ -32,6 +32,7 @@ static const int MAX_GET_SETTING_OPS    
 
class ScriptInfo : public SimpleCountedObject {
 
public:
 
	ScriptInfo() :
 
		engine(NULL),
 
		SQ_instance(NULL),
 
		main_script(NULL),
 
		tar_file(NULL),
src/script/script_instance.cpp
Show inline comments
 
@@ -49,6 +49,7 @@ static void PrintFunc(bool error_msg, co
 

	
 
ScriptInstance::ScriptInstance(const char *APIName) :
 
	engine(NULL),
 
	versionAPI(NULL),
 
	controller(NULL),
 
	storage(NULL),
 
	instance(NULL),
src/script/script_storage.hpp
Show inline comments
 
@@ -76,6 +76,9 @@ public:
 
		new_vehicle_id    (0),
 
		new_sign_id       (0),
 
		new_group_id      (0),
 
		new_goal_id       (0),
 
		new_story_page_id (0),
 
		new_story_page_element_id(0),
 
		/* calback_value (can't be set) */
 
		road_type         (INVALID_ROADTYPE),
 
		rail_type         (INVALID_RAILTYPE),
src/station_base.h
Show inline comments
 
@@ -206,6 +206,7 @@ struct GoodsEntry {
 
		rating(INITIAL_STATION_RATING),
 
		last_speed(0),
 
		last_age(255),
 
		amount_fract(0),
 
		link_graph(INVALID_LINK_GRAPH),
 
		node(INVALID_NODE),
 
		max_waiting_cargo(0)
0 comments (0 inline, 0 general)