• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling TFS 1.0 warning C4245: 'argument' : conversion from 'int' to 'uint16_t', signed/unsigned mismatch

Shadow Dan

Sh4dowDan
Joined
Jun 5, 2010
Messages
344
Reaction score
88
Location
Poland
When i compile TFS 1.2 there are 2 errors. (compile is completed but i want to fix those errors)
Code:
1>..\src\luascript.cpp(1317): warning C4245: 'argument' : conversion from 'int' to 'uint16_t', signed/unsigned mismatch
Code:
1>..\src\protocolgame.cpp(267): warning C4100: 'operatingSystem' : unreferenced formal parameter
Its something with cast system code.
 
Post the codes of both lines.
Second error is that you are pushing an argument but isen't using it - this is a normal error in some cast systems(ProtocolGame::castLogin()) ~
 
Code:
ChatChannel * tmpchat = (g_chat.createChannel(*p, -1));

I suppose it expect the player uid, hard to say without the full source code - if it's even that line.

Code:
void ProtocolGame::connectCast(uint32_t playerId, OperatingSystem_t operatingSystem)
{
    UNREFERENCED_PARAMETER(operatingSystem);
    Player* _player = g_game.getPlayerByID(playerId);
    if (!_player || !_player->cast.isCasting || _player->isCastBanned(getIP())) {
        disconnect();
        return;
    }

    original = false;
    eventConnect = 0;
    _player->addCastViewer(this);
    m_acceptPackets = true;

    player = _player;
    sendAddCreature(_player, _player->getPosition(), _player->getTile()->__getIndexOfThing(_player), false);
    if (_player->cast.mCastChannelId != -1) {
        sendCreatePrivateChannel(_player->cast.mCastChannelId, "Spectators");
    }
}
 
Back
Top