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

New API and Syntax


Post New Thread Reply   
 
Thread Tools Display Modes
BAILOPAN
Join Date: Jan 2004
Old 03-26-2015 , 01:23   Re: New API and Syntax
Reply With Quote #441

Ah - yes, you are right.
__________________
egg
BAILOPAN is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 04-08-2015 , 06:48   Re: New API and Syntax
Reply With Quote #442

Hi,

I could not find the anwser, but why this doesn't work?


PHP Code:
char doh 's';

warning 213tag mismatch 
Thanks
kossolax is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-08-2015 , 06:50   Re: New API and Syntax
Reply With Quote #443

Quote:
Originally Posted by kossolax View Post
Hi,

I could not find the anwser, but why this doesn't work?


PHP Code:
char doh 's';

warning 213tag mismatch 
Thanks
's' maps to an int.
__________________
WildCard65 is offline
BAILOPAN
Join Date: Jan 2004
Old 04-08-2015 , 16:22   Re: New API and Syntax
Reply With Quote #444

Quote:
Originally Posted by kossolax View Post
Hi,

I could not find the anwser, but why this doesn't work?


PHP Code:
char doh 's';

warning 213tag mismatch 
Thanks
Please file a bug. This should be made to work.
__________________
egg
BAILOPAN is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-08-2015 , 17:19   Re: New API and Syntax
Reply With Quote #445

Quote:
Originally Posted by BAILOPAN View Post
Please file a bug. This should be made to work.
is {0.0, 0.0, 0.0} being passed to function expecting a float[3] suppose to tag mismatch?
__________________
WildCard65 is offline
BAILOPAN
Join Date: Jan 2004
Old 04-08-2015 , 22:42   Re: New API and Syntax
Reply With Quote #446

Quote:
Originally Posted by WildCard65 View Post
is {0.0, 0.0, 0.0} being passed to function expecting a float[3] suppose to tag mismatch?
I haven't decided. Probably though. I need to read more about how other systems do that kind of type inference. It's tricky because {0.0, 0.0, 0.0} could be a float[3] or a variant[3] in the post-transitional type system, and those are very different structures.

File a bug though. Float:{0.0, 0.0, 0.0} is gross. Something like "float[3]{0.0, 0.0, 0.0}" seems acceptable, and I'm open to other suggestions.
__________________
egg
BAILOPAN is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 04-09-2015 , 02:32   Re: New API and Syntax
Reply With Quote #447

Would viewas work in this instance?
__________________
Neuro Toxin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-09-2015 , 07:03   Re: New API and Syntax
Reply With Quote #448

Quote:
Originally Posted by BAILOPAN View Post
I haven't decided. Probably though. I need to read more about how other systems do that kind of type inference. It's tricky because {0.0, 0.0, 0.0} could be a float[3] or a variant[3] in the post-transitional type system, and those are very different structures.

File a bug though. Float:{0.0, 0.0, 0.0} is gross. Something like "float[3]{0.0, 0.0, 0.0}" seems acceptable, and I'm open to other suggestions.
I just used 3 0s as an example to show any type of floats in an array cause a tag mismatch warning.
Here's another example:
PHP Code:
#pragma semicolon 1

#include <sourcemod>

public Plugin:myinfo = {
    
name        "",
    
author      "",
    
description "",
    
version     "0.0.0",
    
url         ""
};

public 
OnPluginStart()
{
    
PrintToServer("Hello, World!");
    
test({5.05.05.0});
}

void test(float lol[3])
{

results in:
PHP Code:
SourcePawn Compiler 1.7.0-manual
Copyright 
(c1997-2006 ITB CompuPhase
Copyright 
(c2004-2014 AlliedModders LLC

plugin
.sp(16) : warning 213tag mismatch
plugin
.sp(19) : warning 203symbol is never used"lol"
Code size:             3000 bytes
Data size
:             2296 bytes
Stack
/heap size:      16384 bytes
Total requirements
:   21680 bytes 
Quote:
Originally Posted by Neuro Toxin View Post
Would viewas work in this instance?
ya, putting a view_as<float> infront of the first { does remove the warning or storing the array to
PHP Code:
float array[3
works also.
__________________

Last edited by WildCard65; 04-09-2015 at 07:05.
WildCard65 is offline
BAILOPAN
Join Date: Jan 2004
Old 04-09-2015 , 13:31   Re: New API and Syntax
Reply With Quote #449

view_as<> is not supposed to work in that case. That will be fixed.
__________________
egg
BAILOPAN is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-09-2015 , 15:33   Re: New API and Syntax
Reply With Quote #450

Quote:
Originally Posted by BAILOPAN View Post
view_as<> is not supposed to work in that case. That will be fixed.
so this is a compiler bug right:
PHP Code:
int projectile FireProjectile(bossposview_as<float>{-90.00.00.0}, velocitydamage); //Results in no warning 
PHP Code:
int projectile FireProjectile(bosspos, {-90.00.00.0}, velocitydamage); //Results in warning 
Tested with spider.limetech.org
__________________

Last edited by WildCard65; 04-09-2015 at 15:34.
WildCard65 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 08:30.


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