projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stdio.h not needed
[fw/sdcc]
/
support
/
cpp
/
cpplib.c
diff --git
a/support/cpp/cpplib.c
b/support/cpp/cpplib.c
index 19ee1dc2c1b12612299376e5a5e9d7b3a6dca495..5e65415fa603ac083bc68549bcad91b8850cdf03 100644
(file)
--- a/
support/cpp/cpplib.c
+++ b/
support/cpp/cpplib.c
@@
-89,6
+89,7
@@
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// PENDING: Straighten this out into configure
// PENDING: Straighten this out into configure
+#include <time.h> // all compilers need this
#ifdef __MINGW32__
#include <time.h>
#else
#ifdef __MINGW32__
#include <time.h>
#else
@@
-849,7
+850,7
@@
macro_cleanup (
if (macro->type == T_DISABLED)
macro->type = T_MACRO;
if (macro->type != T_MACRO || pbuf->buf != macro->value.defn->expansion)
if (macro->type == T_DISABLED)
macro->type = T_MACRO;
if (macro->type != T_MACRO || pbuf->buf != macro->value.defn->expansion)
- free (pbuf->buf);
+
Safe_
free (pbuf->buf);
return 0;
}
return 0;
}
@@
-860,7
+861,7
@@
file_cleanup (
{
if (pbuf->buf)
{
{
if (pbuf->buf)
{
- free (pbuf->buf);
+
Safe_
free (pbuf->buf);
pbuf->buf = 0;
}
return 0;
pbuf->buf = 0;
}
return 0;
@@
-1916,7
+1917,7
@@
cpp_pop_buffer (pfile)
cpp_buffer *next_buf = CPP_PREV_BUFFER (buf);
(*buf->cleanup) (buf, pfile);
CPP_BUFFER (pfile) = next_buf;
cpp_buffer *next_buf = CPP_PREV_BUFFER (buf);
(*buf->cleanup) (buf, pfile);
CPP_BUFFER (pfile) = next_buf;
- free (buf);
+
Safe_
free (buf);
return next_buf;
#endif
}
return next_buf;
#endif
}
@@
-3659,7
+3660,7
@@
delete_assertion (
{
struct tokenlist_list *next = tail->next;
free_token_list (tail->tokens);
{
struct tokenlist_list *next = tail->next;
free_token_list (tail->tokens);
- free (tail);
+
Safe_
free (tail);
tail = next;
}
tail = next;
}
@@
-3668,7
+3669,7
@@
delete_assertion (
if (hp == *hp->bucket_hdr)
*hp->bucket_hdr = hp->next;
if (hp == *hp->bucket_hdr)
*hp->bucket_hdr = hp->next;
- free (hp);
+
Safe_
free (hp);
}
\f
/* Convert a character string literal into a nul-terminated string.
}
\f
/* Convert a character string literal into a nul-terminated string.
@@
-4389,7
+4390,7
@@
skip_if_group (
temp = pfile->if_stack;
pfile->if_stack = temp->next;
temp = pfile->if_stack;
pfile->if_stack = temp->next;
- free (temp);
+
Safe_
free (temp);
break;
default: ;
}
break;
default: ;
}
@@
-4557,7
+4558,7
@@
FIXME!
}
}
}
}
}
}
- free (temp);
+
Safe_
free (temp);
output_line_command (pfile, 1, same_file);
}
return 0;
output_line_command (pfile, 1, same_file);
}
return 0;
@@
-5473,7
+5474,7
@@
read_name_map (
strcpy (ptr->map_to, dirname);
ptr->map_to[dirlen] = '/';
strcpy (ptr->map_to + dirlen + 1, to);
strcpy (ptr->map_to, dirname);
ptr->map_to[dirlen] = '/';
strcpy (ptr->map_to + dirlen + 1, to);
- free (to);
+
Safe_
free (to);
}
ptr->map_next = map_list_ptr->map_list_map;
}
ptr->map_next = map_list_ptr->map_list_map;
@@
-5685,7
+5686,7
@@
finclude (
indepth--;
input_file_stack_tick++;
indepth--;
input_file_stack_tick++;
- free (fp->buf);
+
Safe_
free (fp->buf);
#endif
return 1;
#endif
return 1;
@@
-5693,7
+5694,7
@@
finclude (
cpp_perror_with_name (pfile, fname);
close (f);
cpp_perror_with_name (pfile, fname);
close (f);
- free (fp->buf);
+
Safe_
free (fp->buf);
return 1;
}
return 1;
}
@@
-6172,7
+6173,7
@@
push_parse_file (
for (pend = opts->pending; pend; )
{
struct cpp_pending *next = pend->next;
for (pend = opts->pending; pend; )
{
struct cpp_pending *next = pend->next;
- free (pend);
+
Safe_
free (pend);
pend = next;
}
opts->pending = NULL;
pend = next;
}
opts->pending = NULL;
@@
-6618,7
+6619,7
@@
cpp_handle_options (
&& (pend->cmd[1] == 'D' || pend->cmd[1] == 'A'))
{
*ptr = pend->next;
&& (pend->cmd[1] == 'D' || pend->cmd[1] == 'A'))
{
*ptr = pend->next;
- free (pend);
+
Safe_
free (pend);
}
else
ptr = &pend->next;
}
else
ptr = &pend->next;
@@
-6760,13
+6761,13
@@
cpp_cleanup (
if (pfile->token_buffer)
{
if (pfile->token_buffer)
{
- free (pfile->token_buffer);
+
Safe_
free (pfile->token_buffer);
pfile->token_buffer = NULL;
}
if (pfile->deps_buffer)
{
pfile->token_buffer = NULL;
}
if (pfile->deps_buffer)
{
- free (pfile->deps_buffer);
+
Safe_
free (pfile->deps_buffer);
pfile->deps_buffer = NULL;
pfile->deps_allocated_size = 0;
}
pfile->deps_buffer = NULL;
pfile->deps_allocated_size = 0;
}
@@
-6775,23
+6776,23
@@
cpp_cleanup (
{
IF_STACK_FRAME *temp = pfile->if_stack;
pfile->if_stack = temp->next;
{
IF_STACK_FRAME *temp = pfile->if_stack;
pfile->if_stack = temp->next;
- free (temp);
+
Safe_
free (temp);
}
while (pfile->dont_repeat_files)
{
struct file_name_list *temp = pfile->dont_repeat_files;
pfile->dont_repeat_files = temp->next;
}
while (pfile->dont_repeat_files)
{
struct file_name_list *temp = pfile->dont_repeat_files;
pfile->dont_repeat_files = temp->next;
- free (temp->fname);
- free (temp);
+
Safe_
free (temp->fname);
+
Safe_
free (temp);
}
while (pfile->all_include_files)
{
struct file_name_list *temp = pfile->all_include_files;
pfile->all_include_files = temp->next;
}
while (pfile->all_include_files)
{
struct file_name_list *temp = pfile->all_include_files;
pfile->all_include_files = temp->next;
- free (temp->fname);
- free (temp);
+
Safe_
free (temp->fname);
+
Safe_
free (temp);
}
for (i = IMPORT_HASH_SIZE; --i >= 0; )
}
for (i = IMPORT_HASH_SIZE; --i >= 0; )
@@
-6800,8
+6801,8
@@
cpp_cleanup (
while (imp)
{
struct import_file *next = imp->next;
while (imp)
{
struct import_file *next = imp->next;
- free (imp->name);
- free (imp);
+
Safe_
free (imp->name);
+
Safe_
free (imp);
imp = next;
}
pfile->import_hash_table[i] = 0;
imp = next;
}
pfile->import_hash_table[i] = 0;
@@
-6961,7
+6962,7
@@
do_unassert (
else
hp->value = tail->next;
free_token_list (tail->tokens);
else
hp->value = tail->next;
free_token_list (tail->tokens);
- free (tail);
+
Safe_
free (tail);
} else {
prev = tail;
}
} else {
prev = tail;
}
@@
-7148,8
+7149,8
@@
free_token_list (
{
while (tokens) {
struct arglist *next = tokens->next;
{
while (tokens) {
struct arglist *next = tokens->next;
- free (tokens->name);
- free (tokens);
+
Safe_
free (tokens->name);
+
Safe_
free (tokens);
tokens = next;
}
}
tokens = next;
}
}