Raised This Month: $51 Target: $400
 12% 

How can I fix these warnings?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 06-24-2005 , 23:42   How can I fix these warnings?
Reply With Quote #1

I'm pretty sure I don't need to, but how can I fix these warnings?

Quote:
..\..\hl2sdk\public\vstdlib\strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(299) : warning C4311: 'type cast' : pointer truncation from 'char *' to 'int'

\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(299) : warning C4311: 'type cast' : pointer truncation from 'void *' to 'int'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(31 : warning C4311: 'type cast' : pointer truncation from 'char *' to 'int'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(31 : warning C4311: 'type cast' : pointer truncation from 'void *' to 'int'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(337) : warning C4311: 'type cast' : pointer truncation from 'char *' to 'int'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(337) : warning C4311: 'type cast' : pointer truncation from 'void *' to 'int'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(356) : warning C4311: 'type cast' : pointer truncation from 'char *' to 'int'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(356) : warning C4311: 'type cast' : pointer truncation from 'void *' to 'int'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\utlbuffe r.cpp(430) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
interface.cpp
..\..\hl2sdk\public\vstdlib\strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
convar.cpp
..\..\hl2sdk\public\vstdlib\strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\convar.c pp(283) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\convar.c pp(697) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
KeyValues.cpp
..\..\hl2sdk\public\vstdlib\strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\KeyValue s.cpp(644) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\KeyValue s.cpp(1311) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\KeyValue s.cpp(149 : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\KeyValue s.cpp(1930) : warning C4311: 'type cast' : pointer truncation from 'void *' to 'int'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\KeyValue s.cpp(2019) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'void *' of greater size
bitbuf.cpp
..\..\hl2sdk\public\vstdlib\strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\bitbuf.c pp(236) : warning C4311: 'type cast' : pointer truncation from 'unsigned char *' to 'unsigned long'
\Joshs Computer\Desktop\CS\HL2\hl2sdk\tier1\bitbuf.c pp(581) : warning C4311: 'type cast' : pointer truncation from 'unsigned char *' to 'unsigned long'
MRecipientFilter.cpp
..\..\hl2sdk\public\vstdlib\strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
..\..\hl2sdk\public\datamap.h(370) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
CSQL.cpp
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(7 : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(93) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(110) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(114) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(135) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(139) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(166) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(230) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\hl2sdk\public\vstdlib \strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
CPlayer.cpp
d:\Joshs Computer\Desktop\CS\HL2\hl2sdk\public\vstdlib \strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
CHelper.cpp
d:\Joshs Computer\Desktop\CS\HL2\hl2sdk\public\vstdlib \strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\smbans\CHelper.cpp(33 ) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\smbans\CHelper.cpp(35 ) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\smbans\CHelper.cpp(42 ) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
\Joshs Computer\Desktop\CS\HL2\smbans\CHelper.cpp(44 ) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
BanMgr.cpp
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(7 : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(93) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(110) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(114) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(135) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(139) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(166) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(230) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\hl2sdk\public\vstdlib \strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
smbans_convar.cpp
smbans.cpp
d:\Joshs Computer\Desktop\CS\HL2\hl2sdk\public\vstdlib \strtools.h(8 : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(7 : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(93) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(110) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(114) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(135) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(139) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(166) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
d:\Joshs Computer\Desktop\CS\HL2\smbans\CString.h(230) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-25-2005 , 08:48  
Reply With Quote #2

#pragma warning(4267:disable)

IIRC
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 06-25-2005 , 17:07  
Reply With Quote #3

Compile in release mode.
L. Duke is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 06-25-2005 , 19:03  
Reply With Quote #4

The warnings still show up...
__________________
sslice is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-25-2005 , 21:10  
Reply With Quote #5

Quote:
Originally Posted by devicenull
#pragma warning(4267:disable)
needs to go in every file generating a warning
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 06-27-2005 , 09:35  
Reply With Quote #6

it's just so weird though, I made a new project just to see if I knew how to link the mysql shit properly. And the old project doesn't show me these errors, but the new project does.

it's quite strange.
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
BeetleFart
SourceMod Donor
Join Date: Apr 2004
Old 06-27-2005 , 12:29  
Reply With Quote #7

Quote:
Originally Posted by Geesu
it's just so weird though, I made a new project just to see if I knew how to link the mysql shit properly. And the old project doesn't show me these errors, but the new project does.

it's quite strange.
Off topic:

Is their a way to include mysql stuff without forcing the loading of the mysql dll's if they are not used?

I included some mysql stuff into my plugin but even if I didnt use the mysql portion ..my dll forced loading mysql 's dlls..
__________________
CSource Server:
69.90.34.10:27015 Beetlesmod.com And CS-Addicts{US}



http://www.clanuseast.com
BeetleFart is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 06-27-2005 , 13:00  
Reply With Quote #8

Geesu, this may or may not get rid of all those warnings, but I ran into something similar not too long ago with a new project file. Try going to Project -> Properties -> C/C++ -> General and turn off the option that says "Detect 64-bit Portability Issues."
DS is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 06-27-2005 , 17:50  
Reply With Quote #9

DS it worked!!! How in the hell did you come up with that?

And beetlefart, I think it's possible but I have NO idea how, I remember BAIL mentioning something about dynamic loading vs. static or some crap (I could be pulling this out of my ass, I don't know)
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
BeetleFart
SourceMod Donor
Join Date: Apr 2004
Old 06-27-2005 , 19:20  
Reply With Quote #10

Quote:
Originally Posted by Geesu
DS it worked!!! How in the hell did you come up with that?

And beetlefart, I think it's possible but I have NO idea how, I remember BAIL mentioning something about dynamic loading vs. static or some crap (I could be pulling this out of my ass, I don't know)
yeah I figured that ..but I know nothing about MS Visual C's settings etc..
I use borland normally..
I dont know how to make the dll dynamically load.
__________________
CSource Server:
69.90.34.10:27015 Beetlesmod.com And CS-Addicts{US}



http://www.clanuseast.com
BeetleFart is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode