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

[INC] DString - Dynamic Strings


Post New Thread Reply   
 
Thread Tools Display Modes
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 07-07-2015 , 15:01   Re: [INC] DString - Dynamic Strings
Reply With Quote #11

Quote:
Originally Posted by WildCard65 View Post
Emp, your code caused a "Not enough space on the stack" error.
PHP Code:
L 06/25/2015 16:24:11: [SMException reportedNot enough space on the stack
L 06
/25/2015 16:24:11: [SMBlaming plugindstringtest.smx
L 06
/25/2015 16:24:11: [SMCall stack trace:
L 06/25/2015 16:24:11: [SM]   [0Line 22C:\Users\User\Downloads\addons\sourcemod\scripting\dstringtest.sp::DString_Create() 
Does this reproduce the same error?
untested revision
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-08-2015 , 09:46   Re: [INC] DString - Dynamic Strings
Reply With Quote #12

Still causes error Emp.
__________________

Last edited by WildCard65; 07-08-2015 at 09:46.
WildCard65 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-08-2015 , 15:08   Re: [INC] DString - Dynamic Strings
Reply With Quote #13

Quote:
Originally Posted by WildCard65 View Post
Still causes error Emp.
Could you show us code you used that causes stack error?
klippy is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-08-2015 , 16:09   Re: [INC] DString - Dynamic Strings
Reply With Quote #14

Quote:
Originally Posted by KliPPy View Post
Could you show us code you used that causes stack error?
I believe error is caused via using the methodmap DString
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <dstring>

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

public 
void OnPluginStart()
{
    
DString test = new DString("LOL!");
    
PrintToServer(test.ReadEx());

__________________

Last edited by WildCard65; 07-08-2015 at 16:09.
WildCard65 is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 07-08-2015 , 20:46   Re: [INC] DString - Dynamic Strings
Reply With Quote #15

Quote:
Originally Posted by WildCard65 View Post
I believe error is caused via using the methodmap DString
Does this happen when using the DString_Create function directly? It might be a bug with the interpretation of the public DString. Can you also try creating with: view_as < DString > new DataPack(); if DString_Create does not work?

If DString_Create works, a potential fix for the methodmap is:
Code:
public DString(const char[] str = "") { return DString_Create( str ); }
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-09-2015 , 06:52   Re: [INC] DString - Dynamic Strings
Reply With Quote #16

Quote:
Originally Posted by Emp` View Post
Does this happen when using the DString_Create function directly? It might be a bug with the interpretation of the public DString. Can you also try creating with: view_as < DString > new DataPack(); if DString_Create does not work?

If DString_Create works, a potential fix for the methodmap is:
Code:
public DString(const char[] str = "") { return DString_Create( str ); }
DString_Create works, what I believe the cause is where you put the methodmap. If you look at where DataPack has it's methodmap located, I suggest you try to make your version of the include match it.
__________________
WildCard65 is offline
Eun
Member
Join Date: Jan 2011
Old 07-09-2015 , 07:20   Re: [INC] DString - Dynamic Strings
Reply With Quote #17

Just a dump question:
Why dont you use mine?
Eun is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-09-2015 , 09:05   Re: [INC] DString - Dynamic Strings
Reply With Quote #18

Quote:
Originally Posted by Eun View Post
Just a dump question:
Why dont you use mine?
Methodmaps look cleaner in my opinion.
__________________
WildCard65 is offline
Eun
Member
Join Date: Jan 2011
Old 07-09-2015 , 12:05   Re: [INC] DString - Dynamic Strings
Reply With Quote #19

Quote:
Originally Posted by WildCard65 View Post
Methodmaps look cleaner in my opinion.
Well mine has a Methodmap as well.
You can use the map or use the tradional syntax.
Eun is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-09-2015 , 15:47   Re: [INC] DString - Dynamic Strings
Reply With Quote #20

Quote:
Originally Posted by Eun View Post
Well mine has a Methodmap as well.
You can use the map or use the tradional syntax.
Originally it didn't
__________________
WildCard65 is offline
Reply


Thread Tools
Display Modes

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 02:37.


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