[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - COM_Parse and multiline comments/DP save compatibility

COM_Parse and multiline comments/DP save compatibility

Post tutorials on how to do certain tasks within game or engine code here.

Moderator: InsideQC Admins

COM_Parse and multiline comments/DP save compatibility

Postby mh » Fri Jun 22, 2012 9:15 pm

User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: COM_Parse and multiline comments/DP save compatibility

Postby taniwha » Fri Jun 22, 2012 11:15 pm

Hmm, I find it hard to imagine that this would cause any compatibility issues, so it's probably a good thing to spread through the various engines.

However, I see a minor bug: "/*/" is treated as a complete comment because you skip over only the opening "/" but not the opening "*".

The double increment after the check for "*/" seemed suspicious, but then I realized it's skipping the closing "*/". I'm not 100% certain (~98%), but I think you can get away with "if (data[0]) data += 2;" because the only way to get there is for data[0] to be 0, or for data[0..1] to be "*/".
Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: COM_Parse and multiline comments/DP save compatibility

Postby mh » Fri Jun 22, 2012 11:21 pm

I was a bit suspicious of the double data++ myself (it's been a coupla years after all) but I've double-checked against the way DarkPlaces handles this and can see that my code was almost a direct copy & paste from it (which I obviously did and then completely forgot about) so I'll leave everything stand.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: COM_Parse and multiline comments/DP save compatibility

Postby taniwha » Sat Jun 23, 2012 10:52 am

Oh, it's correct, but the second "if (data[0])" is redundant (the double increment should be merged).

However, the first single data++ is not correct (doesn't matter what darkplaces does). I've tested :)
Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: COM_Parse and multiline comments/DP save compatibility

Postby mh » Sat Jun 23, 2012 8:27 pm

I don't disagree. I'm just being wary of the fact that LordHavoc never added a comment explaining his reasons for doing it this way, and am wondering if there was some obscure bug it was intended to fix, or was he just having a brainfart that day? Since the double "if (data[0])" does no harm I'm more inclined to leave it be on account of that.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: COM_Parse and multiline comments/DP save compatibility

Postby taniwha » Sat Jun 23, 2012 11:17 pm

I'd say the biggest problem with the double "if (data[0])" is it is confusing.

Any comments on that single "data++" before the while loop?
Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: COM_Parse and multiline comments/DP save compatibility

Postby mh » Sat Jun 23, 2012 11:31 pm

User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: COM_Parse and multiline comments/DP save compatibility

Postby taniwha » Sat Jun 23, 2012 11:59 pm

Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: COM_Parse and multiline comments/DP save compatibility

Postby szo » Tue Jan 15, 2013 8:12 pm




szo
 
Posts: 132
Joined: Mon Dec 06, 2010 4:42 pm

Re: COM_Parse and multiline comments/DP save compatibility

Postby taniwha » Wed Jan 16, 2013 1:28 am

Yeah, I got the email, too. I'm considering how to write a test case for "make check".
Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am


Return to Programming Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest