# HG changeset patch # User unc0rr # Date 1336756258 -14400 # Node ID 7e8fb07ef91c8d5ef88d05c79f6364f572894a96 # Parent 8c9dcaedc7a899f54901887df5933d14f7789026 Function to compare string to char ftw diff -r 8c9dcaedc7a8 -r 7e8fb07ef91c hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Fri May 11 20:01:57 2012 +0400 +++ b/hedgewars/hwengine.pas Fri May 11 21:10:58 2012 +0400 @@ -97,7 +97,7 @@ DoTimer:= true; end; gsSuspend: - exit; + exit(false); end; SwapBuffers; diff -r 8c9dcaedc7a8 -r 7e8fb07ef91c hedgewars/pas2c.h --- a/hedgewars/pas2c.h Fri May 11 20:01:57 2012 +0400 +++ b/hedgewars/pas2c.h Fri May 11 21:10:58 2012 +0400 @@ -76,6 +76,7 @@ string255 _strappend(string255 s, char c); string255 _strprepend(char c, string255 s); bool _strcompare(string255 a, string255 b); +bool _strcomparec(string255 a, char b); bool _strncompare(string255 a, string255 b); char * _pchar(string255 s); @@ -99,6 +100,8 @@ void BlockWrite_(int f, void * p, int size); void close(int f); +void write(string255 s); + bool DirectoryExists(string255 dir); bool FileExists(string255 filename); @@ -114,6 +117,7 @@ bool Assigned(void * a); +void randomize(); int random(int max); int abs(int i); double sqr(double n); @@ -123,3 +127,6 @@ string255 ParamStr(int n); int ParamCount(); + +#define val(a, b) _val(a, (LongInt*)&(b)) +void _val(string255 str, LongInt * a); diff -r 8c9dcaedc7a8 -r 7e8fb07ef91c hedgewars/pas2cSystem.pas --- a/hedgewars/pas2cSystem.pas Fri May 11 20:01:57 2012 +0400 +++ b/hedgewars/pas2cSystem.pas Fri May 11 21:10:58 2012 +0400 @@ -134,7 +134,7 @@ Assigned : function : boolean; _strconcat, _strappend, _strprepend : function : string; - _strcompare, _strncompare : function : boolean; + _strcompare, _strncompare, _strcomparec : function : boolean; png_structp, png_set_write_fn, png_get_io_ptr, png_get_libpng_ver, png_create_write_struct, diff -r 8c9dcaedc7a8 -r 7e8fb07ef91c tools/pas2c.hs --- a/tools/pas2c.hs Fri May 11 20:01:57 2012 +0400 +++ b/tools/pas2c.hs Fri May 11 21:10:58 2012 +0400 @@ -673,7 +673,8 @@ ("+", BTString, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strconcat" (BTFunction 2 BTString)) ("+", BTString, BTChar) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strappend" (BTFunction 2 BTString)) ("+", BTChar, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strprepend" (BTFunction 2 BTString)) - ("==", BTString, _) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strcompare" (BTFunction 2 BTBool)) + ("==", BTString, BTChar) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strcomparec" (BTFunction 2 BTBool)) + ("==", BTString, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strcompare" (BTFunction 2 BTBool)) ("!=", BTString, _) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strncompare" (BTFunction 2 BTBool)) ("&", BTBool, _) -> return $ parens e1 <+> text "&&" <+> parens e2 ("|", BTBool, _) -> return $ parens e1 <+> text "||" <+> parens e2