diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-30 16:17:46 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-30 16:17:46 +0000 |
commit | 7dad3543a2b848f6547b291f812c9643dc0b85f2 (patch) | |
tree | 1054ad62ecba19750bb4531f34e9d033ac1b7244 /plugins/Variables/parse_regexp.cpp | |
parent | 008fe34954b0bda8fd3487a9658c14581ecd813a (diff) |
Variables moved to mir_* memory allocation routines
git-svn-id: http://svn.miranda-ng.org/main/trunk@696 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables/parse_regexp.cpp')
-rw-r--r-- | plugins/Variables/parse_regexp.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/plugins/Variables/parse_regexp.cpp b/plugins/Variables/parse_regexp.cpp index 7642275eee..88e148e02f 100644 --- a/plugins/Variables/parse_regexp.cpp +++ b/plugins/Variables/parse_regexp.cpp @@ -2,7 +2,7 @@ Variables Plugin for Miranda-IM (www.miranda-im.org)
Copyright 2003-2006 P. Boon
- This program is free software; you can redistribute it and/or modify
+ This program is mir_free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@@ -46,29 +46,29 @@ static TCHAR *parseRegExpCheck(ARGUMENTSINFO *ai) { }
ai->flags = AIF_FALSE;
- arg1 = u2a(ai->targv[1]);
- arg2 = u2a(ai->targv[2]);
+ arg1 = mir_t2a(ai->targv[1]);
+ arg2 = mir_t2a(ai->targv[2]);
ppat = pcreCompile(arg1, 0, &err, &erroffset, NULL);
if (ppat == NULL) {
- free(arg1);
- free(arg2);
+ mir_free(arg1);
+ mir_free(arg2);
return NULL;
}
extra = pcreStudy(ppat, 0, &err);
nmat = pcreExec(ppat, extra, arg2, strlen(arg2), 0, 0, offsets, 99);
- free(arg1);
- free(arg2);
+ mir_free(arg1);
+ mir_free(arg2);
if (nmat > 0) {
ai->flags &= ~AIF_FALSE;
_ltoa(nmat, szVal, 10);
- res = a2u(szVal);
+ res = mir_a2t(szVal);
return res;
}
- return _tcsdup(_T("0"));
+ return mir_tstrdup(_T("0"));
}
/*
@@ -88,23 +88,23 @@ static TCHAR *parseRegExpSubstr(ARGUMENTSINFO *ai) { return NULL;
}
- arg1 = u2a(ai->targv[1]);
- arg2 = u2a(ai->targv[2]);
- arg3 = u2a(ai->targv[3]);
+ arg1 = mir_t2a(ai->targv[1]);
+ arg2 = mir_t2a(ai->targv[2]);
+ arg3 = mir_t2a(ai->targv[3]);
number = atoi(arg3);
if (number < 0) {
- free(arg1);
- free(arg2);
- free(arg3);
+ mir_free(arg1);
+ mir_free(arg2);
+ mir_free(arg3);
return NULL;
}
ai->flags = AIF_FALSE;
ppat = pcreCompile(arg1, 0, &err, &erroffset, NULL);
if (ppat == NULL) {
- free(arg1);
- free(arg2);
- free(arg3);
+ mir_free(arg1);
+ mir_free(arg2);
+ mir_free(arg3);
return NULL;
}
extra = pcreStudy(ppat, 0, &err);
@@ -116,24 +116,24 @@ static TCHAR *parseRegExpSubstr(ARGUMENTSINFO *ai) { ai->flags |= AIF_FALSE;
}
else {
- res = _strdup(substring);
+ res = mir_strdup(substring);
pcreFreeSubstring(substring);
- tres = a2u(res);
+ tres = mir_a2t(res);
- free(res);
- free(arg1);
- free(arg2);
- free(arg3);
+ mir_free(res);
+ mir_free(arg1);
+ mir_free(arg2);
+ mir_free(arg3);
return tres;
}
- free(arg1);
- free(arg2);
- free(arg3);
+ mir_free(arg1);
+ mir_free(arg2);
+ mir_free(arg3);
- return _tcsdup(_T(""));
+ return mir_tstrdup(_T(""));
}
int initPcre() {
|