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

Patch to port TF2Items over to newdecls


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-22-2015 , 19:03   Patch to port TF2Items over to newdecls
Reply With Quote #1

Hey asherkin, I created a patch to port TF2Items over to the new syntax.
Tell me how I did?
Attached Files
File Type: zip tf2items_patch.zip (14.2 KB, 85 views)
__________________

Last edited by WildCard65; 02-28-2015 at 07:31.
WildCard65 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 02-26-2015 , 16:12   Re: Patch to port TF2Items over to newdecls
Reply With Quote #2

does 'delete' not set the variable to INVALID_HANDLE, and does it even matter to set it to invalid_handle (506) since the variable is in a scope that will soon exit? Talking about line 502.
Theres just a few logic things that could be fixed to make it look less bulky.
Mitchell is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-26-2015 , 17:26   Re: Patch to port TF2Items over to newdecls
Reply With Quote #3

Quote:
Originally Posted by Mitchell View Post
does 'delete' not set the variable to INVALID_HANDLE, and does it even matter to set it to invalid_handle (506) since the variable is in a scope that will soon exit? Talking about line 502.
Theres just a few logic things that could be fixed to make it look less bulky.
I presume delete just maps to CloseHandle
__________________
WildCard65 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-26-2015 , 17:31   Re: Patch to port TF2Items over to newdecls
Reply With Quote #4

delete doesn't a variable to null in C either. Incidentally, you should be setting variables to null rather than INVALID_HANDLE unless you have some specific reason for using INVALID_HANDLE, e.g. you need to view view_as on it such as when you're returning a value in a native. Unless view_as<int>(null) actually works now.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-26-2015 at 17:32.
Powerlord is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-26-2015 , 17:33   Re: Patch to port TF2Items over to newdecls
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
delete doesn't a variable to null in C either. Incidentally, you should be setting variables to null rather than INVALID_HANDLE unless you have some specific reason for using INVALID_HANDLE, e.g. you need to view view_as on it such as when you're returning a value in a native. Unless view_as<int>(null) actually works now.
the invalid handle stuff I just left(well left in, just did the view_as just to remove the wierd tag mismatch warning(which shouldn't happen).
__________________
WildCard65 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-27-2015 , 20:54   Re: Patch to port TF2Items over to newdecls
Reply With Quote #6

delete sets the variable to null.
__________________
asherkin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-28-2015 , 07:16   Re: Patch to port TF2Items over to newdecls
Reply With Quote #7

Quote:
Originally Posted by asherkin View Post
delete sets the variable to null.
It does. Alright I'll remove all the lines setting things to INVALID_HANDLE
__________________
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 03:12.


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