aboutsummaryrefslogtreecommitdiff
path: root/jimregexp.h
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-06-28 19:05:43 +1000
committerSteve Bennett <steveb@workware.net.au>2011-06-29 14:28:37 +1000
commit411e92fea9621630eb350e0c2bb43543e553b84f (patch)
tree46b78810100913d1ebf7f0bfd01658e7b5fd5386 /jimregexp.h
parent9eb6f96f3046cedb65928b9f4d4f775bcea22a4c (diff)
downloadjimtcl-411e92fea9621630eb350e0c2bb43543e553b84f.zip
jimtcl-411e92fea9621630eb350e0c2bb43543e553b84f.tar.gz
jimtcl-411e92fea9621630eb350e0c2bb43543e553b84f.tar.bz2
Change the builtin regexp to avoid compiling twice
Simply guess the program size and realloc if needed. This also fixes a compile warning on some platforms. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jimregexp.h')
-rw-r--r--jimregexp.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/jimregexp.h b/jimregexp.h
index 336e20e..79a87e5 100644
--- a/jimregexp.h
+++ b/jimregexp.h
@@ -56,14 +56,14 @@ typedef struct regexp {
int err; /* Any error which occurred during compile */
int regstart; /* Internal use only. */
int reganch; /* Internal use only. */
- const int *regmust; /* Internal use only. */
+ int regmust; /* Internal use only. */
int regmlen; /* Internal use only. */
int *program; /* Allocated */
/* working state - compile */
const char *regparse; /* Input-scan pointer. */
- int *regcode; /* Code-emit pointer; &regdummy = don't. */
- long regsize; /* Code size. */
+ int p; /* Current output pos in program */
+ int proglen; /* Allocated program size */
/* working state - exec */
int eflags; /* Flags used when executing */