aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/ebrowse.c
diff options
context:
space:
mode:
authorGerd Moellmann2000-07-14 17:59:55 +0000
committerGerd Moellmann2000-07-14 17:59:55 +0000
commitc43a1ff693eb7d968bb35edfb189f6689d352c47 (patch)
tree134bf10dd6efd36a533fb5dd5bcd2c7842a04396 /lib-src/ebrowse.c
parent9bd7c104aff6216e0a9b06c45e4124fcd490930d (diff)
downloademacs-c43a1ff693eb7d968bb35edfb189f6689d352c47.tar.gz
emacs-c43a1ff693eb7d968bb35edfb189f6689d352c47.zip
(xrealloc, xmalloc): Renamed from yrealloc and
ymalloc.
Diffstat (limited to 'lib-src/ebrowse.c')
-rw-r--r--lib-src/ebrowse.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 8dcd830793e..e0f2f5ce9ef 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -476,7 +476,7 @@ void add_member_defn P_ ((struct sym *, char *, char *,
476void add_member_decl P_ ((struct sym *, char *, char *, int, 476void add_member_decl P_ ((struct sym *, char *, char *, int,
477 unsigned, int, int, int, int)); 477 unsigned, int, int, int, int));
478void dump_roots P_ ((FILE *)); 478void dump_roots P_ ((FILE *));
479void *ymalloc P_ ((int)); 479void *xmalloc P_ ((int));
480void add_global_defn P_ ((char *, char *, int, unsigned, int, int, int)); 480void add_global_defn P_ ((char *, char *, int, unsigned, int, int, int));
481void add_global_decl P_ ((char *, char *, int, unsigned, int, int, int)); 481void add_global_decl P_ ((char *, char *, int, unsigned, int, int, int));
482void add_define P_ ((char *, char *, int)); 482void add_define P_ ((char *, char *, int));
@@ -542,7 +542,7 @@ yyerror (format, a1, a2, a3, a4, a5)
542 and xrealloc. */ 542 and xrealloc. */
543 543
544void * 544void *
545ymalloc (nbytes) 545xmalloc (nbytes)
546 int nbytes; 546 int nbytes;
547{ 547{
548 void *p = malloc (nbytes); 548 void *p = malloc (nbytes);
@@ -558,7 +558,7 @@ ymalloc (nbytes)
558/* Like realloc but print an error and exit if out of memory. */ 558/* Like realloc but print an error and exit if out of memory. */
559 559
560void * 560void *
561yrealloc (p, sz) 561xrealloc (p, sz)
562 void *p; 562 void *p;
563 int sz; 563 int sz;
564{ 564{
@@ -580,7 +580,7 @@ xstrdup (s)
580 char *s; 580 char *s;
581{ 581{
582 if (s) 582 if (s)
583 s = strcpy (ymalloc (strlen (s) + 1), s); 583 s = strcpy (xmalloc (strlen (s) + 1), s);
584 return s; 584 return s;
585} 585}
586 586
@@ -633,7 +633,7 @@ add_sym (name, nested_in_class)
633 puts (name); 633 puts (name);
634 } 634 }
635 635
636 sym = (struct sym *) ymalloc (sizeof *sym + strlen (name)); 636 sym = (struct sym *) xmalloc (sizeof *sym + strlen (name));
637 bzero (sym, sizeof *sym); 637 bzero (sym, sizeof *sym);
638 strcpy (sym->name, name); 638 strcpy (sym->name, name);
639 sym->namesp = scope; 639 sym->namesp = scope;
@@ -662,8 +662,8 @@ add_link (super, sub)
662 /* Avoid duplicates. */ 662 /* Avoid duplicates. */
663 if (p == NULL || p->sym != sub) 663 if (p == NULL || p->sym != sub)
664 { 664 {
665 lnk = (struct link *) ymalloc (sizeof *lnk); 665 lnk = (struct link *) xmalloc (sizeof *lnk);
666 lnk2 = (struct link *) ymalloc (sizeof *lnk2); 666 lnk2 = (struct link *) xmalloc (sizeof *lnk2);
667 667
668 lnk->sym = sub; 668 lnk->sym = sub;
669 lnk->next = p; 669 lnk->next = p;
@@ -959,7 +959,7 @@ add_member (cls, name, var, sc, hash)
959 int sc; 959 int sc;
960 unsigned hash; 960 unsigned hash;
961{ 961{
962 struct member *m = (struct member *) ymalloc (sizeof *m + strlen (name)); 962 struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name));
963 struct member **list; 963 struct member **list;
964 struct member *p; 964 struct member *p;
965 struct member *prev; 965 struct member *prev;
@@ -1071,7 +1071,7 @@ struct sym *
1071make_namespace (name) 1071make_namespace (name)
1072 char *name; 1072 char *name;
1073{ 1073{
1074 struct sym *s = (struct sym *) ymalloc (sizeof *s + strlen (name)); 1074 struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name));
1075 bzero (s, sizeof *s); 1075 bzero (s, sizeof *s);
1076 strcpy (s->name, name); 1076 strcpy (s->name, name);
1077 s->next = all_namespaces; 1077 s->next = all_namespaces;
@@ -1126,7 +1126,7 @@ register_namespace_alias (new_name, old_name)
1126 if (streq (new_name, p->name)) 1126 if (streq (new_name, p->name))
1127 return; 1127 return;
1128 1128
1129 al = (struct alias *) ymalloc (sizeof *al + strlen (new_name)); 1129 al = (struct alias *) xmalloc (sizeof *al + strlen (new_name));
1130 strcpy (al->name, new_name); 1130 strcpy (al->name, new_name);
1131 al->next = p->namesp_aliases; 1131 al->next = p->namesp_aliases;
1132 p->namesp_aliases = al; 1132 p->namesp_aliases = al;
@@ -1144,7 +1144,7 @@ enter_namespace (name)
1144 if (namespace_sp == namespace_stack_size) 1144 if (namespace_sp == namespace_stack_size)
1145 { 1145 {
1146 int size = max (10, 2 * namespace_stack_size); 1146 int size = max (10, 2 * namespace_stack_size);
1147 namespace_stack = (struct sym **) yrealloc (namespace_stack, size); 1147 namespace_stack = (struct sym **) xrealloc (namespace_stack, size);
1148 namespace_stack_size = size; 1148 namespace_stack_size = size;
1149 } 1149 }
1150 1150
@@ -1204,7 +1204,7 @@ ensure_scope_buffer_room (len)
1204 if (scope_buffer_len + len >= scope_buffer_size) 1204 if (scope_buffer_len + len >= scope_buffer_size)
1205 { 1205 {
1206 int new_size = max (2 * scope_buffer_size, scope_buffer_len + len); 1206 int new_size = max (2 * scope_buffer_size, scope_buffer_len + len);
1207 scope_buffer = (char *) yrealloc (new_size); 1207 scope_buffer = (char *) xrealloc (new_size);
1208 scope_buffer_size = new_size; 1208 scope_buffer_size = new_size;
1209 } 1209 }
1210} 1210}
@@ -1256,7 +1256,7 @@ sym_scope (p)
1256 if (!scope_buffer) 1256 if (!scope_buffer)
1257 { 1257 {
1258 scope_buffer_size = 1024; 1258 scope_buffer_size = 1024;
1259 scope_buffer = (char *) ymalloc (scope_buffer_size); 1259 scope_buffer = (char *) xmalloc (scope_buffer_size);
1260 } 1260 }
1261 1261
1262 *scope_buffer = '\0'; 1262 *scope_buffer = '\0';
@@ -1676,7 +1676,7 @@ yylex ()
1676 if (p == yytext_end - 1) 1676 if (p == yytext_end - 1)
1677 { 1677 {
1678 int size = yytext_end - yytext; 1678 int size = yytext_end - yytext;
1679 yytext = (char *) yrealloc (yytext, 2 * size); 1679 yytext = (char *) xrealloc (yytext, 2 * size);
1680 yytext_end = yytext + 2 * size; 1680 yytext_end = yytext + 2 * size;
1681 p = yytext + size - 1; 1681 p = yytext + size - 1;
1682 } 1682 }
@@ -1954,7 +1954,7 @@ matching_regexp ()
1954 1954
1955 if (buffer == NULL) 1955 if (buffer == NULL)
1956 { 1956 {
1957 buffer = (char *) ymalloc (max_regexp); 1957 buffer = (char *) xmalloc (max_regexp);
1958 end_buf = &buffer[max_regexp] - 1; 1958 end_buf = &buffer[max_regexp] - 1;
1959 } 1959 }
1960 1960
@@ -2119,7 +2119,7 @@ re_init_scanner ()
2119 if (yytext == NULL) 2119 if (yytext == NULL)
2120 { 2120 {
2121 int size = 256; 2121 int size = 256;
2122 yytext = (char *) ymalloc (size * sizeof *yytext); 2122 yytext = (char *) xmalloc (size * sizeof *yytext);
2123 yytext_end = yytext + size; 2123 yytext_end = yytext + size;
2124 } 2124 }
2125} 2125}
@@ -2135,7 +2135,7 @@ insert_keyword (name, tk)
2135{ 2135{
2136 char *s; 2136 char *s;
2137 unsigned h = 0; 2137 unsigned h = 0;
2138 struct kw *k = (struct kw *) ymalloc (sizeof *k); 2138 struct kw *k = (struct kw *) xmalloc (sizeof *k);
2139 2139
2140 for (s = name; *s; ++s) 2140 for (s = name; *s; ++s)
2141 h = (h << 1) ^ *s; 2141 h = (h << 1) ^ *s;
@@ -2158,7 +2158,7 @@ init_scanner ()
2158 2158
2159 /* Allocate the input buffer */ 2159 /* Allocate the input buffer */
2160 inbuffer_size = READ_CHUNK_SIZE + 1; 2160 inbuffer_size = READ_CHUNK_SIZE + 1;
2161 inbuffer = in = (char *) ymalloc (inbuffer_size); 2161 inbuffer = in = (char *) xmalloc (inbuffer_size);
2162 yyline = 1; 2162 yyline = 1;
2163 2163
2164 /* Set up character class vectors. */ 2164 /* Set up character class vectors. */
@@ -2817,7 +2817,7 @@ operator_name (sc)
2817 if (len > id_size) 2817 if (len > id_size)
2818 { 2818 {
2819 int new_size = max (len, 2 * id_size); 2819 int new_size = max (len, 2 * id_size);
2820 id = (char *) yrealloc (id, new_size); 2820 id = (char *) xrealloc (id, new_size);
2821 id_size = new_size; 2821 id_size = new_size;
2822 } 2822 }
2823 strcpy (id, s); 2823 strcpy (id, s);
@@ -2843,7 +2843,7 @@ operator_name (sc)
2843 if (len > id_size) 2843 if (len > id_size)
2844 { 2844 {
2845 int new_size = max (len, 2 * id_size); 2845 int new_size = max (len, 2 * id_size);
2846 id = (char *) yrealloc (id, new_size); 2846 id = (char *) xrealloc (id, new_size);
2847 id_size = new_size; 2847 id_size = new_size;
2848 } 2848 }
2849 strcpy (id, "operator"); 2849 strcpy (id, "operator");
@@ -2859,7 +2859,7 @@ operator_name (sc)
2859 if (len > id_size) 2859 if (len > id_size)
2860 { 2860 {
2861 int new_size = max (len, 2 * id_size); 2861 int new_size = max (len, 2 * id_size);
2862 id = (char *) yrealloc (id, new_size); 2862 id = (char *) xrealloc (id, new_size);
2863 id_size = new_size; 2863 id_size = new_size;
2864 } 2864 }
2865 2865
@@ -2897,7 +2897,7 @@ parse_qualified_ident_or_type (last_id)
2897 int len = strlen (yytext) + 1; 2897 int len = strlen (yytext) + 1;
2898 if (len > id_size) 2898 if (len > id_size)
2899 { 2899 {
2900 id = (char *) yrealloc (id, len); 2900 id = (char *) xrealloc (id, len);
2901 id_size = len; 2901 id_size = len;
2902 } 2902 }
2903 strcpy (id, yytext); 2903 strcpy (id, yytext);
@@ -2937,7 +2937,7 @@ parse_qualified_param_ident_or_type (last_id)
2937 int len = strlen (yytext) + 1; 2937 int len = strlen (yytext) + 1;
2938 if (len > id_size) 2938 if (len > id_size)
2939 { 2939 {
2940 id = (char *) yrealloc (id, len); 2940 id = (char *) xrealloc (id, len);
2941 id_size = len; 2941 id_size = len;
2942 } 2942 }
2943 strcpy (id, yytext); 2943 strcpy (id, yytext);
@@ -3383,8 +3383,8 @@ add_search_path (path_list)
3383 while (*path_list && *path_list != PATH_LIST_SEPARATOR) 3383 while (*path_list && *path_list != PATH_LIST_SEPARATOR)
3384 ++path_list; 3384 ++path_list;
3385 3385
3386 p = (struct search_path *) ymalloc (sizeof *p); 3386 p = (struct search_path *) xmalloc (sizeof *p);
3387 p->path = (char *) ymalloc (path_list - start + 1); 3387 p->path = (char *) xmalloc (path_list - start + 1);
3388 memcpy (p->path, start, path_list - start); 3388 memcpy (p->path, start, path_list - start);
3389 p->path[path_list - start] = '\0'; 3389 p->path[path_list - start] = '\0';
3390 p->next = NULL; 3390 p->next = NULL;
@@ -3426,7 +3426,7 @@ open_file (file)
3426 if (len + 1 >= buffer_size) 3426 if (len + 1 >= buffer_size)
3427 { 3427 {
3428 buffer_size = max (len + 1, 2 * buffer_size); 3428 buffer_size = max (len + 1, 2 * buffer_size);
3429 buffer = (char *) yrealloc (buffer, buffer_size); 3429 buffer = (char *) xrealloc (buffer, buffer_size);
3430 } 3430 }
3431 3431
3432 strcpy (buffer, path->path); 3432 strcpy (buffer, path->path);
@@ -3521,7 +3521,7 @@ process_file (file)
3521 if (nread + READ_CHUNK_SIZE >= inbuffer_size) 3521 if (nread + READ_CHUNK_SIZE >= inbuffer_size)
3522 { 3522 {
3523 inbuffer_size = nread + READ_CHUNK_SIZE + 1; 3523 inbuffer_size = nread + READ_CHUNK_SIZE + 1;
3524 inbuffer = (char *) yrealloc (inbuffer, inbuffer_size); 3524 inbuffer = (char *) xrealloc (inbuffer, inbuffer_size);
3525 } 3525 }
3526 3526
3527 nbytes = fread (inbuffer + nread, 1, READ_CHUNK_SIZE, fp); 3527 nbytes = fread (inbuffer + nread, 1, READ_CHUNK_SIZE, fp);
@@ -3561,7 +3561,7 @@ read_line (fp)
3561 if (i >= buffer_size) 3561 if (i >= buffer_size)
3562 { 3562 {
3563 buffer_size = max (100, buffer_size * 2); 3563 buffer_size = max (100, buffer_size * 2);
3564 buffer = (char *) yrealloc (buffer, buffer_size); 3564 buffer = (char *) xrealloc (buffer, buffer_size);
3565 } 3565 }
3566 3566
3567 buffer[i++] = c; 3567 buffer[i++] = c;
@@ -3573,7 +3573,7 @@ read_line (fp)
3573 if (i == buffer_size) 3573 if (i == buffer_size)
3574 { 3574 {
3575 buffer_size = max (100, buffer_size * 2); 3575 buffer_size = max (100, buffer_size * 2);
3576 buffer = (char *) yrealloc (buffer, buffer_size); 3576 buffer = (char *) xrealloc (buffer, buffer_size);
3577 } 3577 }
3578 3578
3579 buffer[i] = '\0'; 3579 buffer[i] = '\0';
@@ -3621,7 +3621,7 @@ main (argc, argv)
3621 if (n_input_files == input_filenames_size) 3621 if (n_input_files == input_filenames_size)
3622 { 3622 {
3623 input_filenames_size = max (10, 2 * input_filenames_size); 3623 input_filenames_size = max (10, 2 * input_filenames_size);
3624 input_filenames = (char **) yrealloc (input_filenames, 3624 input_filenames = (char **) xrealloc (input_filenames,
3625 input_filenames_size); 3625 input_filenames_size);
3626 } 3626 }
3627 input_filenames[n_input_files++] = xstrdup (optarg); 3627 input_filenames[n_input_files++] = xstrdup (optarg);