fix: resolve a lot of conversion warnings
This commit is contained in:
@@ -60,145 +60,145 @@ public:
|
||||
return TAG_Compound;
|
||||
}
|
||||
|
||||
void put(wchar_t *name, Tag *tag)
|
||||
void put(const wchar_t *name, Tag *tag)
|
||||
{
|
||||
tags[name] = tag->setName(wstring( name ));
|
||||
}
|
||||
|
||||
void putByte(wchar_t * name, byte value)
|
||||
void putByte(const wchar_t * name, byte value)
|
||||
{
|
||||
tags[name] = (new ByteTag(name,value));
|
||||
}
|
||||
|
||||
void putShort(wchar_t * name, short value)
|
||||
void putShort(const wchar_t * name, short value)
|
||||
{
|
||||
tags[name] = (new ShortTag(name,value));
|
||||
}
|
||||
|
||||
void putInt(wchar_t * name, int value)
|
||||
void putInt(const wchar_t * name, int value)
|
||||
{
|
||||
tags[name] = (new IntTag(name,value));
|
||||
}
|
||||
|
||||
void putLong(wchar_t * name, __int64 value)
|
||||
void putLong(const wchar_t * name, __int64 value)
|
||||
{
|
||||
tags[name] = (new LongTag(name,value));
|
||||
}
|
||||
|
||||
void putFloat(wchar_t * name, float value)
|
||||
void putFloat(const wchar_t * name, float value)
|
||||
{
|
||||
tags[name] = (new FloatTag(name,value));
|
||||
}
|
||||
|
||||
void putDouble(wchar_t * name, double value)
|
||||
void putDouble(const wchar_t * name, double value)
|
||||
{
|
||||
tags[name] = (new DoubleTag(name,value));
|
||||
}
|
||||
|
||||
void putString(wchar_t *name, const wstring& value)
|
||||
void putString(const wchar_t *name, const wstring& value)
|
||||
{
|
||||
tags[name] = (new StringTag(name,value));
|
||||
}
|
||||
|
||||
void putByteArray(wchar_t * name, byteArray value)
|
||||
void putByteArray(const wchar_t * name, byteArray value)
|
||||
{
|
||||
tags[name] = (new ByteArrayTag(name,value));
|
||||
}
|
||||
|
||||
void putIntArray(wchar_t * name, intArray value)
|
||||
void putIntArray(const wchar_t * name, intArray value)
|
||||
{
|
||||
tags[name] = (new IntArrayTag(name, value));
|
||||
}
|
||||
|
||||
void putCompound(wchar_t * name, CompoundTag *value)
|
||||
void putCompound(const wchar_t * name, CompoundTag *value)
|
||||
{
|
||||
tags[name] = value->setName( wstring( name ) );
|
||||
}
|
||||
|
||||
void putBoolean(wchar_t * string, bool val)
|
||||
void putBoolean(const wchar_t * string, bool val)
|
||||
{
|
||||
putByte(string, val?static_cast<byte>(1):static_cast<byte>(0));
|
||||
}
|
||||
|
||||
Tag *get(wchar_t *name)
|
||||
Tag *get(const wchar_t *name)
|
||||
{
|
||||
AUTO_VAR(it, tags.find(name));
|
||||
if(it != tags.end()) return it->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool contains(wchar_t * name)
|
||||
bool contains(const wchar_t * name)
|
||||
{
|
||||
return tags.find(name) != tags.end();
|
||||
}
|
||||
|
||||
byte getByte(wchar_t * name)
|
||||
byte getByte(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (byte)0;
|
||||
return ((ByteTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
short getShort(wchar_t * name)
|
||||
short getShort(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (short)0;
|
||||
return ((ShortTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
int getInt(wchar_t * name)
|
||||
int getInt(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (int)0;
|
||||
return ((IntTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
__int64 getLong(wchar_t * name)
|
||||
__int64 getLong(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (__int64)0;
|
||||
return ((LongTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
float getFloat(wchar_t * name)
|
||||
float getFloat(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (float)0;
|
||||
return ((FloatTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
double getDouble(wchar_t * name)
|
||||
double getDouble(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (double)0;
|
||||
return ((DoubleTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
wstring getString(wchar_t * name)
|
||||
wstring getString(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return wstring( L"" );
|
||||
return ((StringTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
byteArray getByteArray(wchar_t * name)
|
||||
byteArray getByteArray(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return byteArray();
|
||||
return ((ByteArrayTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
intArray getIntArray(wchar_t * name)
|
||||
intArray getIntArray(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return intArray(0);
|
||||
return ((IntArrayTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
CompoundTag *getCompound(wchar_t * name)
|
||||
CompoundTag *getCompound(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return new CompoundTag(name);
|
||||
return (CompoundTag *) tags[name];
|
||||
}
|
||||
|
||||
ListTag<Tag> *getList(wchar_t * name)
|
||||
ListTag<Tag> *getList(const wchar_t * name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return new ListTag<Tag>(name);
|
||||
return (ListTag<Tag> *) tags[name];
|
||||
}
|
||||
|
||||
bool getBoolean(wchar_t *string)
|
||||
bool getBoolean(const wchar_t *string)
|
||||
{
|
||||
return getByte(string) != static_cast<byte>(0);
|
||||
}
|
||||
|
||||
@@ -997,7 +997,7 @@ ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...)
|
||||
|
||||
break;
|
||||
case L'c':
|
||||
wchFrom=va_arg(vl,wchar_t);
|
||||
wchFrom=(wchar_t)va_arg(vl,int);
|
||||
break;
|
||||
case L'z':
|
||||
pItemInstance=va_arg(vl,ItemInstance *);
|
||||
@@ -1014,7 +1014,7 @@ ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...)
|
||||
mappings->insert(myMap::value_type(wchFrom,pItemInstance));
|
||||
break;
|
||||
case L'g':
|
||||
wchFrom=va_arg(vl,wchar_t);
|
||||
wchFrom=(wchar_t)va_arg(vl,int);
|
||||
switch(wchFrom)
|
||||
{
|
||||
// case L'W':
|
||||
@@ -1112,7 +1112,7 @@ void Recipes::addShapelessRecipy(ItemInstance *result,... )
|
||||
ingredients->push_back(new ItemInstance(pTile));
|
||||
break;
|
||||
case L'g':
|
||||
wchFrom=va_arg(vl,wchar_t);
|
||||
wchFrom=(wchar_t)va_arg(vl,int);
|
||||
switch(wchFrom)
|
||||
{
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
#include "../Minecraft.Client/ServerConnection.h"
|
||||
#include <algorithm>
|
||||
#include "../Minecraft.Client/PS3/PS3Extras/ShutdownManager.h"
|
||||
#include "../Minecraft.Client/Windows64/Windows64_App.h"
|
||||
|
||||
extern CConsoleMinecraftApp app;
|
||||
|
||||
// This current socket implementation is for the creation of a single local link. 2 sockets can be created, one for either end of this local
|
||||
// link, the end (0 or 1) is passed as a parameter to the ctor.
|
||||
@@ -277,6 +274,7 @@ int Socket::SocketInputStreamLocal::read()
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Try and get an input array of bytes, blocking until enough bytes are available
|
||||
@@ -306,6 +304,7 @@ int Socket::SocketInputStreamLocal::read(byteArray b, unsigned int offset, unsig
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Socket::SocketInputStreamLocal::close()
|
||||
@@ -391,6 +390,7 @@ int Socket::SocketInputStreamNetwork::read()
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Try and get an input array of bytes, blocking until enough bytes are available
|
||||
@@ -420,6 +420,7 @@ int Socket::SocketInputStreamNetwork::read(byteArray b, unsigned int offset, uns
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Socket::SocketInputStreamNetwork::close()
|
||||
@@ -530,4 +531,4 @@ void Socket::SocketOutputStreamNetwork::writeWithFlags(byteArray b, unsigned int
|
||||
void Socket::SocketOutputStreamNetwork::close()
|
||||
{
|
||||
m_streamOpen = false;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ Tag *Tag::newTag(byte type, const wstring &name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wchar_t *Tag::getTagName(byte type)
|
||||
const wchar_t *Tag::getTagName(byte type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
static Tag *readNamedTag(DataInput *dis);
|
||||
static void writeNamedTag(Tag *tag, DataOutput *dos);
|
||||
static Tag *newTag(byte type, const wstring &name);
|
||||
static wchar_t *getTagName(byte type);
|
||||
static const wchar_t *getTagName(byte type);
|
||||
virtual ~Tag() {}
|
||||
virtual bool equals(Tag *obj); // 4J Brought forward from 1.2
|
||||
virtual Tag *copy() = 0; // 4J Brought foward from 1.2
|
||||
|
||||
@@ -318,10 +318,10 @@ public:
|
||||
#define PIXSetMarkerDeprecated(a, b, ...) PIXSetMarker(a, L ## b, __VA_ARGS__)
|
||||
#define PIXAddNamedCounter(a, b) PIXReportCounter( L ## b, a)
|
||||
#else
|
||||
void PIXAddNamedCounter(int a, char *b, ...);
|
||||
void PIXBeginNamedEvent(int a, char *b, ...);
|
||||
void PIXAddNamedCounter(int a, const char *b, ...);
|
||||
void PIXBeginNamedEvent(int a, const char *b, ...);
|
||||
void PIXEndNamedEvent();
|
||||
void PIXSetMarkerDeprecated(int a, char *b, ...);
|
||||
void PIXSetMarkerDeprecated(int a, const char *b, ...);
|
||||
#endif
|
||||
|
||||
void XSetThreadProcessor(HANDLE a, int b);
|
||||
|
||||
Reference in New Issue
Block a user