|
-
May 16th, 2011, 04:22 PM
#1
Thread Starter
Fanatic Member
Size Limit Fix
I got error :
Code:
1>c:\users\georgi\documents\visual studio 2010\projects\mfs\mfs\configs.cpp(302): warning C4305: 'argument' : truncation from '__int64' to 'INT'
maybe becouse my code (number is big)
Code:
// Max Zen Config
bool MaxZen ( char * ini )
{
DWORD MaxZ;
MaxZ = GetPrivateProfileInt("Zen","MaxZen_Inventory",200000000000,ini);
*(unsigned int*) GS_MAX_ZEN = MaxZ ;
MaxZ = GetPrivateProfileInt("Zen","MaxZen_Vault",100000000000,ini);
*(unsigned int*) GS_MAX_ZEN_W = MaxZ ;
MaxZ = GetPrivateProfileInt("Zen","MaxZen_Vault2",200000000000,ini);
*(unsigned int*) GS_MAX_ZEN_W2 = MaxZ ;
MaxZ = GetPrivateProfileInt("Zen","MaxZen_Vault3",300000000000,ini);
*(unsigned int*) GS_MAX_ZEN_W3 = MaxZ ;
return 1;
}
//End
-
May 16th, 2011, 05:16 PM
#2
Re: Size Limit Fix
The values you are passing to GetPrivateProfileInt are 64 bit ints. These are truncated in order to fit the INT datatype, which is most likely a 32 bit integer.
-
May 16th, 2011, 05:55 PM
#3
Thread Starter
Fanatic Member
-
May 16th, 2011, 11:24 PM
#4
Re: Size Limit Fix
one crazy idea would be to just pass values that fall within range of the INT type.
-
May 17th, 2011, 04:23 AM
#5
Thread Starter
Fanatic Member
Re: Size Limit Fix
so if it read the value from the .ini file will be okey? or still will not work the code ?
how to fix it what need to be added or changed to work normal
-
May 27th, 2011, 12:22 PM
#6
Junior Member
Re: Size Limit Fix
Whether you are reading from a .ini file or not, you still need to use smaller values to qualify as an integer.
Simply cut off a few digits from the value listed in the .ini, and make the same change in your code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|