diff --git a/src/cpp.c b/src/cpp.c index 0d68ed46b5d146b7d8313e7ae9a9f59b39a7df69..4c324b1881317263b5b41e249ac6f3e443584372 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -5,7 +5,7 @@ \*/ /* - * $Id: cpp.c,v 1.102 2002/08/15 14:49:20 marcus Exp $ + * $Id: cpp.c,v 1.103 2002/09/11 22:42:12 neotron Exp $ */ #include "global.h" #include "stralloc.h" @@ -1699,7 +1699,7 @@ void f_cpp(INT32 args) if (k->val.type == T_STRING) add_define (&this, k->ind.u.string, k->val.u.string); else - add_define (&this, k->ind.u.string, empty_string); + add_define (&this, k->ind.u.string, empty_pike_string); } free_mapping (predefs); } diff --git a/src/modules/Parser/html.c b/src/modules/Parser/html.c index 49543fb4192452a2b0bea889a5f5b94bec99cb6e..418213578b118abe5baae0c1b4329f50f780de5c 100644 --- a/src/modules/Parser/html.c +++ b/src/modules/Parser/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.152 2002/08/15 14:50:26 marcus Exp $ */ +/* $Id: html.c,v 1.153 2002/09/11 22:42:13 neotron Exp $ */ #include "global.h" #include "config.h" @@ -409,8 +409,6 @@ typedef enum { STATE_DONE=0, STATE_WAIT, STATE_REREAD, STATE_REPARSE } newstate; #define THIS ((struct parser_html_storage*)(Pike_fp->current_storage)) #define THISOBJ (Pike_fp->current_object) -static struct pike_string *empty_string; - static void tag_name(struct parser_html_storage *this, struct piece *feed, ptrdiff_t c, int skip_tag_start); static void tag_args(struct parser_html_storage *this, @@ -1474,7 +1472,7 @@ static INLINE void push_feed_range(struct piece *head, } if (!n) - ref_push_string(empty_string); + ref_push_string(empty_pike_string); else if (n>1) f_add(n); DEBUG((stderr,"push len=%d\n",sp[-1].u.string->len)); @@ -2062,7 +2060,7 @@ next: if (what == SCAN_ARG_PUSH) { if (n>1) f_add(n); - else if (!n) ref_push_string(empty_string); + else if (!n) ref_push_string(empty_pike_string); } return 1; } @@ -5176,8 +5174,6 @@ void init_parser_html(void) init_out_piece_blocks(); init_feed_stack_blocks(); - empty_string = make_shared_binary_string("", 0); - offset = ADD_STORAGE(struct parser_html_storage); PIKE_MAP_VARIABLE(" maptag", offset + OFFSETOF(parser_html_storage, maptag), @@ -5355,7 +5351,6 @@ void init_parser_html(void) void exit_parser_html() { - free_string(empty_string); free_all_piece_blocks(); free_all_out_piece_blocks(); free_all_feed_stack_blocks(); diff --git a/src/modules/spider/spider.c b/src/modules/spider/spider.c index 717e34058ce0bf87760fcabc5ab569cbd8ac48c2..58b739c72ef28905a2b9d47be4459f4c496a5b16 100644 --- a/src/modules/spider/spider.c +++ b/src/modules/spider/spider.c @@ -43,7 +43,7 @@ #include "threads.h" #include "operators.h" -RCSID("$Id: spider.c,v 1.115 2002/05/11 00:27:04 nilsson Exp $"); +RCSID("$Id: spider.c,v 1.116 2002/09/11 22:42:13 neotron Exp $"); #ifdef HAVE_PWD_H #include <pwd.h> @@ -790,7 +790,6 @@ void do_html_parse(struct pike_string *ss, pop_stack(); \ } while(0) -static struct svalue empty_string_svalue; void do_html_parse_lines(struct pike_string *ss, struct mapping *cont,struct mapping *single, int *strings,int recurse_left, @@ -910,7 +909,7 @@ void do_html_parse_lines(struct pike_string *ss, mapping_index_no_free(&sval1,cont,&sval2); if(sval1.type == T_INT) - mapping_index_no_free(&sval1,cont,&empty_string_svalue); + mapping_index_no_free(&sval1,cont,&empty_pike_string); if (sval1.type==T_STRING) { if (last < i-1) @@ -1092,8 +1091,6 @@ void f__dump_obj_table(INT32 args) void pike_module_init(void) { - ref_push_string(make_shared_string("")); - empty_string_svalue = sp[-1]; pop_stack(); ADD_EFUN("_low_program_name", f__low_program_name,tFunc(tPrg(tObj),tStr),0); @@ -1172,7 +1169,6 @@ void pike_module_init(void) void pike_module_exit(void) { - free_string(empty_string_svalue.u.string); { extern void exit_xml(void); exit_xml(); diff --git a/src/stralloc.c b/src/stralloc.c index 702137a4d307bf01ebcb61705c55c8f2ea4ffb87..4d3eece38e5fd5eb2faf5cae52f70a029132f09b 100644 --- a/src/stralloc.c +++ b/src/stralloc.c @@ -27,7 +27,7 @@ #define HUGE HUGE_VAL #endif /*!HUGE*/ -RCSID("$Id: stralloc.c,v 1.143 2002/08/15 14:49:25 marcus Exp $"); +RCSID("$Id: stralloc.c,v 1.144 2002/09/11 22:42:13 neotron Exp $"); /* #define STRALLOC_USE_PRIMES */ @@ -90,7 +90,7 @@ unsigned INT32 htable_size=0; static unsigned int hashprimes_entry=0; static struct pike_string **base_table=0; unsigned INT32 num_strings=0; -PMOD_EXPORT struct pike_string *empty_string = 0; +PMOD_EXPORT struct pike_string *empty_pike_string = 0; /*** Main string hash function ***/ @@ -1801,7 +1801,7 @@ void init_shared_string_table(void) for(h=0;h<BUCKET_LOCKS;h++) mt_init(bucket_locks + h); } #endif - empty_string = make_shared_string(""); + empty_pike_string = make_shared_string(""); } #ifdef DEBUG_MALLOC @@ -1814,9 +1814,9 @@ void cleanup_shared_string_table(void) unsigned INT32 e; struct pike_string *s,*next; - if (empty_string) { - free_string(empty_string); - empty_string = 0; + if (empty_pike_string) { + free_string(empty_pike_string); + empty_pike_string = 0; } #if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC) diff --git a/src/stralloc.h b/src/stralloc.h index 2f1c524daef07ca92653c6d4d45485687c278cdb..44d6e4b3f6395ef065886fe8acc9306827a47603 100644 --- a/src/stralloc.h +++ b/src/stralloc.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: stralloc.h,v 1.67 2002/09/11 14:03:50 marcus Exp $ + * $Id: stralloc.h,v 1.68 2002/09/11 22:42:13 neotron Exp $ */ #ifndef STRALLOC_H #define STRALLOC_H @@ -150,7 +150,7 @@ extern struct shared_string_location *all_shared_string_locations; INLINE void PIKE_CONCAT4(convert_,FROM,_to_,TO)(PIKE_CONCAT(p_wchar,TO) *to, const PIKE_CONCAT(p_wchar,FROM) *from, ptrdiff_t len); \ INLINE INT32 PIKE_CONCAT4(compare_,FROM,_to_,TO)(const PIKE_CONCAT(p_wchar,TO) *to, const PIKE_CONCAT(p_wchar,FROM) *from, ptrdiff_t len); -PMOD_EXPORT extern struct pike_string *empty_string; +PMOD_EXPORT extern struct pike_string *empty_pike_string; /* Prototypes begin here */ PMOD_EXPORT INLINE unsigned INT32 index_shared_string(struct pike_string *s,