AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   TF2Items (https://forums.alliedmods.net/forumdisplay.php?f=146)
-   -   Patch to port TF2Items over to newdecls (https://forums.alliedmods.net/showthread.php?t=258700)

WildCard65 02-22-2015 19:03

Patch to port TF2Items over to newdecls
 
3 Attachment(s)
Hey asherkin, I created a patch to port TF2Items over to the new syntax.
Tell me how I did?

Mitchell 02-26-2015 16:12

Re: Patch to port TF2Items over to newdecls
 
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.

WildCard65 02-26-2015 17:26

Re: Patch to port TF2Items over to newdecls
 
Quote:

Originally Posted by Mitchell (Post 2266926)
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

Powerlord 02-26-2015 17:31

Re: Patch to port TF2Items over to newdecls
 
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.

WildCard65 02-26-2015 17:33

Re: Patch to port TF2Items over to newdecls
 
Quote:

Originally Posted by Powerlord (Post 2266962)
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).

asherkin 02-27-2015 20:54

Re: Patch to port TF2Items over to newdecls
 
delete sets the variable to null.

WildCard65 02-28-2015 07:16

Re: Patch to port TF2Items over to newdecls
 
Quote:

Originally Posted by asherkin (Post 2267561)
delete sets the variable to null.

It does. Alright I'll remove all the lines setting things to INVALID_HANDLE


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

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