From 7863d6ce04722f368ebbcd7fb9498467ef2935a4 Mon Sep 17 00:00:00 2001 From: Martin Nilsson <mani@lysator.liu.se> Date: Fri, 6 May 2005 02:48:32 +0200 Subject: [PATCH] Use push_empty_string() Rev: src/builtin.cmod:1.178 Rev: src/language.yacc:1.358 Rev: src/modules/HTTPLoop/requestobject.c:1.30 Rev: src/modules/Image/encodings/iff.c:1.16 Rev: src/modules/Image/encodings/ras.c:1.25 Rev: src/modules/Image/encodings/xwd.c:1.29 Rev: src/modules/Image/font.c:1.85 Rev: src/modules/Mysql/mysql.c:1.90 Rev: src/modules/Odbc/odbc.c:1.38 Rev: src/modules/Odbc/odbc_result.c:1.40 Rev: src/modules/_Image_GIF/image_gif.c:1.22 Rev: src/modules/_Roxen/roxen.c:1.45 Rev: src/modules/files/efuns.c:1.164 Rev: src/modules/files/file.c:1.350 Rev: src/modules/spider/spider.c:1.130 Rev: src/modules/spider/xml.c:1.74 Rev: src/modules/system/memory.c:1.33 Rev: src/modules/system/passwords.c:1.47 --- src/builtin.cmod | 6 +++--- src/language.yacc | 6 +++--- src/modules/HTTPLoop/requestobject.c | 4 ++-- src/modules/Image/encodings/iff.c | 4 ++-- src/modules/Image/encodings/ras.c | 4 ++-- src/modules/Image/encodings/xwd.c | 4 ++-- src/modules/Image/font.c | 6 +++--- src/modules/Mysql/mysql.c | 7 ++++--- src/modules/Odbc/odbc.c | 6 +++--- src/modules/Odbc/odbc_result.c | 4 ++-- src/modules/_Image_GIF/image_gif.c | 8 ++++---- src/modules/_Roxen/roxen.c | 4 ++-- src/modules/files/efuns.c | 6 +++--- src/modules/files/file.c | 6 +++--- src/modules/spider/spider.c | 20 ++++++++++---------- src/modules/spider/xml.c | 10 +++++----- src/modules/system/memory.c | 10 +++++----- src/modules/system/passwords.c | 4 ++-- 18 files changed, 60 insertions(+), 59 deletions(-) diff --git a/src/builtin.cmod b/src/builtin.cmod index 00140873dc..1195c1bb56 100644 --- a/src/builtin.cmod +++ b/src/builtin.cmod @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: builtin.cmod,v 1.177 2005/01/08 20:11:57 grubba Exp $ +|| $Id: builtin.cmod,v 1.178 2005/05/06 00:41:40 nilsson Exp $ */ #include "global.h" @@ -1878,7 +1878,7 @@ PIKECLASS Buffer } } } - push_text(""); + push_empty_string(); return; } @@ -1900,7 +1900,7 @@ PIKECLASS Buffer RETURN s; } pop_n_elems(args); - push_text(""); + push_empty_string(); return; } diff --git a/src/language.yacc b/src/language.yacc index 1b19b3c51c..0b22267e1f 100644 --- a/src/language.yacc +++ b/src/language.yacc @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: language.yacc,v 1.357 2005/02/28 12:55:46 grubba Exp $ +|| $Id: language.yacc,v 1.358 2005/05/06 00:41:54 nilsson Exp $ */ %pure_parser @@ -412,7 +412,7 @@ low_program_ref: string_constant { ref_push_string(Pike_compiler->last_identifier); }else{ - push_constant_text(""); + push_empty_string(); } $$=$1; @@ -4007,7 +4007,7 @@ void low_yyerror(struct pike_string *str) /* yyerror() can be called from define_function(), which * can be called by the C module initialization code. */ - push_constant_text(""); + push_empty_string(); } push_int(lex.current_line); ref_push_string(str); diff --git a/src/modules/HTTPLoop/requestobject.c b/src/modules/HTTPLoop/requestobject.c index 66ece6b7f6..da3309b4d2 100644 --- a/src/modules/HTTPLoop/requestobject.c +++ b/src/modules/HTTPLoop/requestobject.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: requestobject.c,v 1.29 2004/03/10 16:31:41 nilsson Exp $ +|| $Id: requestobject.c,v 1.30 2005/05/06 00:48:32 nilsson Exp $ */ #include "global.h" @@ -617,7 +617,7 @@ void f_aap_index_op(INT32 args) f_index( 2 ); ref_push_string(s_client); f_aap_index_op( 1 ); - push_constant_text(""); + push_empty_string(); f_multiply( 2 ); apply_svalue( sp-2, 1 ); push_string(s_supports); diff --git a/src/modules/Image/encodings/iff.c b/src/modules/Image/encodings/iff.c index 58a4fb19f9..2cfd16bfc2 100644 --- a/src/modules/Image/encodings/iff.c +++ b/src/modules/Image/encodings/iff.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: iff.c,v 1.15 2004/10/07 22:49:57 nilsson Exp $ +|| $Id: iff.c,v 1.16 2005/05/06 00:48:09 nilsson Exp $ */ #include "global.h" @@ -109,7 +109,7 @@ struct pike_string *make_iff(char *id, struct array *chunks) if(chunks->size > 1) f_add(chunks->size); } else - push_text(""); + push_empty_string(); f_add(2); f_aggregate(2); res = low_make_iff(&sp[-1]); diff --git a/src/modules/Image/encodings/ras.c b/src/modules/Image/encodings/ras.c index d09c59f736..392ecbc8b2 100644 --- a/src/modules/Image/encodings/ras.c +++ b/src/modules/Image/encodings/ras.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: ras.c,v 1.24 2005/01/23 13:30:04 nilsson Exp $ +|| $Id: ras.c,v 1.25 2005/05/06 00:48:09 nilsson Exp $ */ /* @@ -492,7 +492,7 @@ static void img_ras_encode(INT32 args) image_colortable_initiate_dither(ct, &dith, img->xsize); ctfunc = image_colortable_index_8bit_function(ct); } else - push_text(""); + push_empty_string(); if(!rs.ras_depth) { INT32 px = img->xsize * img->ysize; diff --git a/src/modules/Image/encodings/xwd.c b/src/modules/Image/encodings/xwd.c index 03a211c114..68345a557d 100644 --- a/src/modules/Image/encodings/xwd.c +++ b/src/modules/Image/encodings/xwd.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: xwd.c,v 1.28 2005/01/23 13:30:05 nilsson Exp $ +|| $Id: xwd.c,v 1.29 2005/05/06 00:48:09 nilsson Exp $ */ /* @@ -304,7 +304,7 @@ void img_xwd__decode(INT32 args,int header_only,int skipcmap) push_text("image"); if (s->len-(int)(header.header_size+header.ncolors*12)<0) - push_text(""); + push_empty_string(); else push_string(make_shared_binary_string( s->str+(header.header_size+header.ncolors*12), diff --git a/src/modules/Image/font.c b/src/modules/Image/font.c index fa08d42b92..9929c020df 100644 --- a/src/modules/Image/font.c +++ b/src/modules/Image/font.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: font.c,v 1.84 2004/05/19 00:10:10 nilsson Exp $ +|| $Id: font.c,v 1.85 2005/05/06 00:47:42 nilsson Exp $ */ #include "global.h" @@ -536,7 +536,7 @@ void font_write(INT32 args) if (args==0) { - push_text(""); + push_empty_string(); args=1; } @@ -756,7 +756,7 @@ void font_text_extents(INT32 args) if (args==0) { - push_text(""); + push_empty_string(); args=1; } diff --git a/src/modules/Mysql/mysql.c b/src/modules/Mysql/mysql.c index 80124cdc0d..3b483840af 100644 --- a/src/modules/Mysql/mysql.c +++ b/src/modules/Mysql/mysql.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: mysql.c,v 1.89 2005/04/02 20:45:21 nilsson Exp $ +|| $Id: mysql.c,v 1.90 2005/05/06 00:47:26 nilsson Exp $ */ /* @@ -658,9 +658,10 @@ static void mysql__sprintf(INT32 args) if (PIKE_MYSQL->mysql->options.use_ssl) { push_text("using SSL"); } - else push_text(""); + else + push_empty_string(); #else - push_text(""); + push_empty_string(); #endif /* HAVE_MYSQL_SSL */ f_sprintf(3); diff --git a/src/modules/Odbc/odbc.c b/src/modules/Odbc/odbc.c index f4752cb298..0babe61a61 100644 --- a/src/modules/Odbc/odbc.c +++ b/src/modules/Odbc/odbc.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: odbc.c,v 1.37 2005/01/26 18:50:43 grubba Exp $ +|| $Id: odbc.c,v 1.38 2005/05/06 00:47:01 nilsson Exp $ */ /* @@ -221,12 +221,12 @@ static void f_create(INT32 args) } } if (!user) { - push_constant_text(""); + push_empty_string(); user = sp[-1].u.string; args++; } if (!pwd) { - push_constant_text(""); + push_empty_string(); pwd = sp[-1].u.string; args++; } diff --git a/src/modules/Odbc/odbc_result.c b/src/modules/Odbc/odbc_result.c index c805f8f311..6078737f13 100644 --- a/src/modules/Odbc/odbc_result.c +++ b/src/modules/Odbc/odbc_result.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: odbc_result.c,v 1.39 2005/01/20 10:47:55 nilsson Exp $ +|| $Id: odbc_result.c,v 1.40 2005/05/06 00:47:01 nilsson Exp $ */ /* @@ -425,7 +425,7 @@ static void f_fetch_row(INT32 args) #endif /* ODBC_DEBUG */ if (!num_strings) { num_strings++; - push_constant_text(""); + push_empty_string(); } break; } diff --git a/src/modules/_Image_GIF/image_gif.c b/src/modules/_Image_GIF/image_gif.c index 65e3d28603..a68071a36c 100644 --- a/src/modules/_Image_GIF/image_gif.c +++ b/src/modules/_Image_GIF/image_gif.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: image_gif.c,v 1.21 2004/10/07 22:49:58 nilsson Exp $ +|| $Id: image_gif.c,v 1.22 2005/05/06 00:46:32 nilsson Exp $ */ /* @@ -1328,7 +1328,7 @@ static void _decode_get_extension(unsigned char **s, if (*len) { (*len)-=1; (*s)+=1; } if (!n) - push_string(make_shared_binary_string("",0)); + push_empty_string(); else f_add(DO_NOT_WARN(n)); @@ -1414,7 +1414,7 @@ static void _decode_get_render(unsigned char **s, if (*len) { (*len)-=1; (*s)+=1; } if (!n) - push_string(make_shared_binary_string("",0)); + push_empty_string(); else f_add(n); @@ -2544,7 +2544,7 @@ static void image_gif_lzw_decode(INT32 args) if (len<1) { pop_n_elems(args); - push_string(make_shared_binary_string("",0)); + push_empty_string(); return; } diff --git a/src/modules/_Roxen/roxen.c b/src/modules/_Roxen/roxen.c index a68afa03c8..33fec90ec7 100644 --- a/src/modules/_Roxen/roxen.c +++ b/src/modules/_Roxen/roxen.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: roxen.c,v 1.44 2005/04/09 10:35:53 grubba Exp $ +|| $Id: roxen.c,v 1.45 2005/05/06 00:46:06 nilsson Exp $ */ #define NO_PIKE_SHORTHAND @@ -135,7 +135,7 @@ static void f_hp_feed( INT32 args ) */ if( (spc < 2) && tot_slash_n ) { - push_constant_text( "" ); + push_empty_string(); /* This includes (all eventual) \r\n etc. */ push_text((char *)hp->headers); f_aggregate_mapping( 0 ); diff --git a/src/modules/files/efuns.c b/src/modules/files/efuns.c index 362f23a3ff..1b49c2ba2b 100644 --- a/src/modules/files/efuns.c +++ b/src/modules/files/efuns.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: efuns.c,v 1.163 2005/04/30 15:14:18 grubba Exp $ +|| $Id: efuns.c,v 1.164 2005/05/06 00:45:46 nilsson Exp $ */ #include "global.h" @@ -200,7 +200,7 @@ static void f_listxattr(INT32 args) ptr[0]=0; push_string( make_shared_binary_string( ptr, 1 ) ); o_divide(); - push_text( "" ); + push_empty_string(); f_aggregate(1); o_subtract(); @@ -1031,7 +1031,7 @@ void f_get_dir(INT32 args) if(!str) { #if defined(__amigaos4__) - push_constant_text(""); + push_empty_string(); #else push_constant_text("."); #endif diff --git a/src/modules/files/file.c b/src/modules/files/file.c index 0a54055e6a..c0cc3d2d2a 100644 --- a/src/modules/files/file.c +++ b/src/modules/files/file.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: file.c,v 1.349 2005/04/30 13:51:33 grubba Exp $ +|| $Id: file.c,v 1.350 2005/05/06 00:45:46 nilsson Exp $ */ #define NO_PIKE_SHORTHAND @@ -1106,7 +1106,7 @@ static void file_write(INT32 args) if (args > 1) { #endif /* HAVE_WRITEV */ ref_push_array(a); - push_constant_text(""); + push_empty_string(); o_multiply(); Pike_sp--; dmalloc_touch_svalue(Pike_sp); @@ -2173,7 +2173,7 @@ static void file_listxattr(INT32 args) ptr[0]=0; push_string( make_shared_binary_string( ptr, 1 ) ); o_divide(); - push_text( "" ); + push_empty_string(); f_aggregate(1); o_subtract(); diff --git a/src/modules/spider/spider.c b/src/modules/spider/spider.c index f0f4d2380d..e131df59c7 100644 --- a/src/modules/spider/spider.c +++ b/src/modules/spider/spider.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: spider.c,v 1.129 2005/04/09 10:39:22 grubba Exp $ +|| $Id: spider.c,v 1.130 2005/05/06 00:45:14 nilsson Exp $ */ #include "global.h" @@ -196,7 +196,7 @@ void f_parse_html(INT32 args) if(!ss->len) { pop_n_elems(args); - push_text(""); + push_empty_string(); return; } @@ -237,7 +237,7 @@ void f_parse_html(INT32 args) if(strings > 1) f_add(strings); else if(!strings) - push_text(""); + push_empty_string(); } @@ -263,7 +263,7 @@ void f_parse_html_lines(INT32 args) if(!ss->len) { pop_n_elems(args); - push_text(""); + push_empty_string(); return; } @@ -303,7 +303,7 @@ void f_parse_html_lines(INT32 args) if(strings > 1) f_add(strings); else if(!strings) - push_text(""); + push_empty_string(); /* fprintf(stderr, "sp=%p (strings=%d)\n", sp, strings); */ } @@ -404,7 +404,7 @@ done: if(strs > 1) f_add(strs); else if(!strs) - push_text(""); + push_empty_string(); SKIP_SPACE(); return i; @@ -627,7 +627,7 @@ void do_html_parse(struct pike_string *ss, do_html_parse(ss2,cont,single,strings,recurse_left-1,extra_args); continue; } else if (sp[-1].type==T_ARRAY) { - push_text(""); + push_empty_string(); f_multiply(2); copy_shared_string(ss2,sp[-1].u.string); pop_stack(); @@ -710,7 +710,7 @@ void do_html_parse(struct pike_string *ss, continue; } else if (sp[-1].type==T_ARRAY) { - push_text(""); + push_empty_string(); f_multiply(2); copy_shared_string(ss2,sp[-1].u.string); pop_stack(); @@ -770,7 +770,7 @@ void do_html_parse(struct pike_string *ss, #define PARSE_RETURN(END) do{ \ - push_text(""); \ + push_empty_string(); \ f_multiply(2); \ (*strings)++; \ if (last!=i-1) \ @@ -1105,7 +1105,7 @@ void f__dump_obj_table(INT32 args) PIKE_MODULE_INIT { - push_constant_text(""); + push_empty_string(); empty_string_svalue = sp[-1]; pop_stack(); diff --git a/src/modules/spider/xml.c b/src/modules/spider/xml.c index 22a387fb82..8ca8fcef6b 100644 --- a/src/modules/spider/xml.c +++ b/src/modules/spider/xml.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: xml.c,v 1.73 2005/04/09 10:40:47 grubba Exp $ +|| $Id: xml.c,v 1.74 2005/05/06 00:45:14 nilsson Exp $ */ #include "global.h" @@ -860,7 +860,7 @@ static int gobble(struct xmldata *data, char *s) f_replace(3); \ push_constant_text(" "); \ o_divide(); \ - push_constant_text(""); \ + push_empty_string(); \ f_aggregate(1); \ o_subtract(); \ push_constant_text(" "); \ @@ -1105,7 +1105,7 @@ static int gobble(struct xmldata *data, char *s) #define INTERMISSION(X) do { \ if((X).s->len) { \ check_stack(4); \ - push_constant_text(""); \ + push_empty_string(); \ push_int(0); /* No name */ \ push_int(0); /* No attributes */ \ push_string(finish_string_builder(&(X))); \ @@ -1997,7 +1997,7 @@ static int really_low_parse_dtd(struct xmldata *data) break; case '(': /* Enumeration */ - push_constant_text(""); + push_empty_string(); READ(1); SKIPSPACE(); @@ -2076,7 +2076,7 @@ static int really_low_parse_dtd(struct xmldata *data) break; default: - push_constant_text(""); + push_empty_string(); comefrom_fixed: #ifdef VERBOSE_XMLDEBUG diff --git a/src/modules/system/memory.c b/src/modules/system/memory.c index 5d202c529c..ec1be1d03b 100644 --- a/src/modules/system/memory.c +++ b/src/modules/system/memory.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: memory.c,v 1.32 2005/04/09 10:51:02 grubba Exp $ +|| $Id: memory.c,v 1.33 2005/05/06 00:42:35 nilsson Exp $ */ /*! @module System @@ -593,7 +593,7 @@ static void memory_cast(INT32 args) Pike_error(NAME": reading (some) outside allocation\n"); \ \ if (!rlen) \ - push_text(""); \ + push_empty_string(); \ else \ push_string(MAKER((void*)(THIS->p+pos),len)); \ \ @@ -828,7 +828,7 @@ static void memory_index(INT32 args) else { if (THIS->size==0) - push_text(""); + push_empty_string(); else { INT_TYPE pos1,pos2; @@ -840,7 +840,7 @@ static void memory_index(INT32 args) else rpos2=(size_t)pos2; if (rpos2<rpos1) - push_text(""); + push_empty_string(); else push_string(make_shared_binary_string((char *)THIS->p+rpos1, rpos2-rpos1+1)); @@ -884,7 +884,7 @@ static void memory_index_write(INT32 args) else { if (THIS->size==0) - push_text(""); + push_empty_string(); else { INT_TYPE pos1,pos2; diff --git a/src/modules/system/passwords.c b/src/modules/system/passwords.c index 6434bdb7e5..b010e19bec 100644 --- a/src/modules/system/passwords.c +++ b/src/modules/system/passwords.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: passwords.c,v 1.46 2004/09/27 08:30:28 grubba Exp $ +|| $Id: passwords.c,v 1.47 2005/05/06 00:42:35 nilsson Exp $ */ /* @@ -109,7 +109,7 @@ struct group *getgrnam(char *name) #define SAFE_PUSH_TEXT(X) do { \ char *text_ = (X); \ if(text_) push_text(text_); \ - else push_constant_text(""); \ + else push_empty_string(); \ } while(0) /* -- GitLab