diff -r 7f29a65aa1e4 -r 0f6878b5395a project_files/hwc/rtl/misc.h --- a/project_files/hwc/rtl/misc.h Mon Feb 10 00:43:03 2014 +0400 +++ b/project_files/hwc/rtl/misc.h Mon Feb 10 23:02:49 2014 +0400 @@ -18,10 +18,9 @@ #define macro_dispatcher_(func, nargs) macro_dispatcher__(func, nargs) #define macro_dispatcher__(func, nargs) func ## nargs -#define FPCRTL_DEBUG +//#define FPCRTL_DEBUG -#define FIX_STRING(s) (s.str[s.len] = 0) - +#define FIX_STRING(s) (s.str[s.len == 255 ? 254 : s.len] = 0) //#define fpcrtl_check_string(s) do{ if(strlen((s).str) != (s).len){ \ // printf("String %s internal inconsistency error. Length should be %d but actually is %d.\n", (s).str, strlen((s).str), (s).len); \ // assert(0);\ @@ -41,6 +40,7 @@ string255 fpcrtl_chrconcat(char a, char b); astring fpcrtl_strconcatA(astring str1, astring str2); +astring fpcrtl_strappendA(astring s, char c); // return true if str1 == str2 bool fpcrtl_strcompare(string255 str1, string255 str2); @@ -48,9 +48,11 @@ bool fpcrtl_strncompare(string255 a, string255 b); bool fpcrtl_strncompareA(astring a, astring b); -char* fpcrtl__pchar(string255 s); -string255 fpcrtl_pchar2str(char *s); -astring fpcrtl_pchar2astr(char *s); +#define fpcrtl__pchar(s) fpcrtl__pchar__vars(&(s)) +#define fpcrtl__pcharA(s) fpcrtl__pcharA__vars(&(s)) +char* fpcrtl__pchar__vars(string255 * s); +string255 fpcrtl_pchar2str(const char *s); +astring fpcrtl_pchar2astr(const char *s); astring fpcrtl_str2astr(string255 s); string255 fpcrtl_astr2str(astring s); #define fpcrtl_TypeInfo sizeof // dummy