diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-11-17 23:07:10 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-11-17 23:42:36 +0100 |
commit | c291b588356f751ec553d3de77996fa75b3a7515 (patch) | |
tree | cbd91b88170b7c6c1ef1e9aeb1ea37cc599c66e1 | |
parent | c84bdaf6b44ce10fd5c549b8425cb57fb299c599 (diff) | |
download | guile-c291b588356f751ec553d3de77996fa75b3a7515.tar.gz |
Fix stylistic issues revealed by "make syntax-check".
* libguile/gc-malloc.c (scm_must_free): Remove unnecessary `if' before
`free ()'.
* libguile/stime.c (scm_localtime, scm_mktime): Likewise.
* libguile/eval.i.c (ceval): Don't cast the result of alloca(3).
* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Likewise.
* test-suite/standalone/test-unwind.c: Likewise.
* libguile/strings.c (scm_i_deprecated_string_chars): Don't end error
message in period.
-rw-r--r-- | libguile/eval.i.c | 3 | ||||
-rw-r--r-- | libguile/gc-malloc.c | 9 | ||||
-rw-r--r-- | libguile/i18n.c | 2 | ||||
-rw-r--r-- | libguile/stime.c | 9 | ||||
-rw-r--r-- | libguile/strings.c | 10 | ||||
-rw-r--r-- | test-suite/standalone/test-unwind.c | 5 |
6 files changed, 15 insertions, 23 deletions
diff --git a/libguile/eval.i.c b/libguile/eval.i.c index afbe9219c..a28a25a1b 100644 --- a/libguile/eval.i.c +++ b/libguile/eval.i.c @@ -221,8 +221,7 @@ CEVAL (SCM x, SCM env) * * Even frames are eval frames, odd frames are apply frames. */ - debug.vect = (scm_t_debug_info *) alloca (scm_debug_eframe_size - * sizeof (scm_t_debug_info)); + debug.vect = alloca (scm_debug_eframe_size * sizeof (scm_t_debug_info)); debug.info = debug.vect; debug_info_end = debug.vect + scm_debug_eframe_size; scm_i_set_last_debug_frame (&debug); diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c index 669f7894b..9f6c3766d 100644 --- a/libguile/gc-malloc.c +++ b/libguile/gc-malloc.c @@ -322,13 +322,8 @@ scm_must_free (void *obj) #ifdef GUILE_DEBUG_MALLOC scm_malloc_unregister (obj); #endif - if (obj) - free (obj); - else - { - fprintf (stderr,"freeing NULL pointer"); - abort (); - } + + free (obj); } #undef FUNC_NAME diff --git a/libguile/i18n.c b/libguile/i18n.c index 7deb39536..5c1e4b5c6 100644 --- a/libguile/i18n.c +++ b/libguile/i18n.c @@ -735,7 +735,7 @@ SCM_DEFINE (scm_locale_p, "locale?", 1, 0, 0, const char *buf = scm_i_string_chars (s1); \ \ len = scm_i_string_length (s1); \ - c_s1 = (scm_t_wchar *) alloca (sizeof (scm_t_wchar) * (len + 1)); \ + c_s1 = alloca (sizeof (scm_t_wchar) * (len + 1)); \ \ for (i = 0; i < len; i ++) \ c_s1[i] = (unsigned char ) buf[i]; \ diff --git a/libguile/stime.c b/libguile/stime.c index 54022c296..07dedf3b3 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -423,8 +423,8 @@ SCM_DEFINE (scm_localtime, "localtime", 1, 1, 0, result = filltime (<, zoff, zname); SCM_CRITICAL_SECTION_END; - if (zname) - free (zname); + + free (zname); return result; } #undef FUNC_NAME @@ -581,8 +581,7 @@ SCM_DEFINE (scm_mktime, "mktime", 1, 1, 0, result = scm_cons (scm_from_long (itime), filltime (<, zoff, zname)); - if (zname) - free (zname); + free (zname); scm_dynwind_end (); return result; diff --git a/libguile/strings.c b/libguile/strings.c index 1c74c6a1c..0ea50fdeb 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -1833,8 +1833,8 @@ scm_i_deprecated_string_chars (SCM str) null-terminated. */ if (IS_SH_STRING (str)) - scm_misc_error (NULL, - "SCM_STRING_CHARS does not work with shared substrings.", + scm_misc_error (NULL, + "SCM_STRING_CHARS does not work with shared substrings", SCM_EOL); /* We explicitly test for read-only strings to produce a better @@ -1842,10 +1842,10 @@ scm_i_deprecated_string_chars (SCM str) */ if (IS_RO_STRING (str)) - scm_misc_error (NULL, - "SCM_STRING_CHARS does not work with read-only strings.", + scm_misc_error (NULL, + "SCM_STRING_CHARS does not work with read-only strings", SCM_EOL); - + /* The following is still wrong, of course... */ str = scm_i_string_start_writing (str); diff --git a/test-suite/standalone/test-unwind.c b/test-suite/standalone/test-unwind.c index 2b0291dd5..f9820cc22 100644 --- a/test-suite/standalone/test-unwind.c +++ b/test-suite/standalone/test-unwind.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2008, 2009 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -206,8 +206,7 @@ check_ports () if (tmpdir == NULL) tmpdir = "/tmp"; - filename = (char *) alloca (strlen (tmpdir) + - sizeof (FILENAME_TEMPLATE) + 1); + filename = alloca (strlen (tmpdir) + sizeof (FILENAME_TEMPLATE) + 1); strcpy (filename, tmpdir); strcat (filename, FILENAME_TEMPLATE); |