[uim-commit] r2576 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Dec 14 10:29:13 PST 2005


Author: yamaken
Date: 2005-12-14 10:29:07 -0800 (Wed, 14 Dec 2005)
New Revision: 2576

Modified:
   branches/r5rs/sigscheme/debug.c
   branches/r5rs/sigscheme/error.c
   branches/r5rs/sigscheme/io.c
   branches/r5rs/sigscheme/operations-nonstd.c
   branches/r5rs/sigscheme/operations.c
   branches/r5rs/sigscheme/sigschemeinternal.h
   branches/r5rs/sigscheme/storage-gc.c
   branches/r5rs/sigscheme/storage-symbol.c
Log:
* perl -i -pe 's/Scm_([a-z]+alloc)/scm_\1/g' *.[ch]

* sigscheme/error.c
  - (Scm_malloc, Scm_calloc, Scm_realloc): Rename to scm_*()
  - (scm_malloc, scm_calloc, scm_realloc): Renamed from Scm_*()
* sigscheme/sigschemeinternal.h
  - (Scm_malloc, Scm_calloc, Scm_realloc): Rename to scm_*()
  - (scm_malloc, scm_calloc, scm_realloc): Renamed from Scm_*()
  - (LBUF_ALLOC, LBUF_REALLOC): Follow the renamings
* sigscheme/debug.c
  - (hash_grow, SigScm_WriteToPortWithSharedStructure): Ditto
* sigscheme/io.c
  - (find_path, parse_script_prelude): Ditto
* sigscheme/operations.c
  - (ScmOp_string_setd, ScmOp_substring, ScmOp_string_append,
    ScmOp_string_filld, ScmOp_make_vector, ScmOp_vector,
    ScmOp_list2vector): Ditto
* sigscheme/operations-nonstd.c
  - (create_loaded_str): Ditto
* sigscheme/storage-gc.c
  - (SigScm_GC_Protect, scm_malloc_aligned, add_heap): Ditto
* sigscheme/storage-symbol.c
  - (initialize_symbol_hash): Ditto


Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c	2005-12-14 18:19:58 UTC (rev 2575)
+++ branches/r5rs/sigscheme/debug.c	2005-12-14 18:29:07 UTC (rev 2576)
@@ -495,7 +495,7 @@
     new_size = old_size * 2;
     old_ents = tab->ents;
 
-    tab->ents = Scm_calloc(new_size, sizeof(hash_entry));
+    tab->ents = scm_calloc(new_size, sizeof(hash_entry));
     tab->size = new_size;
     tab->used = 0;
 
@@ -640,7 +640,7 @@
 
     ctx.next_index = 1;
     ctx.seen.size = 1 << 8; /* arbitrary initial size */
-    ctx.seen.ents = Scm_calloc(ctx.seen.size, sizeof(hash_entry));
+    ctx.seen.ents = scm_calloc(ctx.seen.size, sizeof(hash_entry));
     for (i = 0; i < ctx.seen.size; i++) {
         ctx.seen.ents[i].key = SCM_INVALID;
     }

Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c	2005-12-14 18:19:58 UTC (rev 2575)
+++ branches/r5rs/sigscheme/error.c	2005-12-14 18:29:07 UTC (rev 2576)
@@ -149,7 +149,7 @@
     va_end(va);
 }
 
-void *Scm_malloc(size_t size)
+void *scm_malloc(size_t size)
 {
     void *p;
 
@@ -160,7 +160,7 @@
     return p;
 }
 
-void *Scm_calloc(size_t number, size_t size)
+void *scm_calloc(size_t number, size_t size)
 {
     void *p;
 
@@ -171,7 +171,7 @@
     return p;
 }
 
-void *Scm_realloc(void *ptr, size_t size)
+void *scm_realloc(void *ptr, size_t size)
 {
     void *p;
 

Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c	2005-12-14 18:19:58 UTC (rev 2575)
+++ branches/r5rs/sigscheme/io.c	2005-12-14 18:29:07 UTC (rev 2576)
@@ -529,7 +529,7 @@
         filename_len = strlen(filename);
         path_len = lib_path_len + sizeof((char)'/') + filename_len + sizeof((char)'\0');
 
-        path = Scm_malloc(path_len);
+        path = scm_malloc(path_len);
         snprintf(path, path_len, "%s/%s", scm_lib_path, filename);
         if (file_existsp(path))
             return path;
@@ -609,7 +609,7 @@
     }
 #endif
 
-    argv = Scm_malloc(sizeof(char *));
+    argv = scm_malloc(sizeof(char *));
     argc = 0;
     for (p = &line[3]; p < &line[SCRIPT_PRELUDE_MAXLEN]; p += len + 1) {
         p += strspn(p, SCRIPT_PRELUDE_DELIM);
@@ -618,7 +618,7 @@
             p[len] = '\0';
             arg = strdup(p);
             argv[argc] = arg;
-            argv = Scm_realloc(argv, sizeof(char *) * (++argc + 1));
+            argv = scm_realloc(argv, sizeof(char *) * (++argc + 1));
             argv[argc] = NULL;
         }
     }         

Modified: branches/r5rs/sigscheme/operations-nonstd.c
===================================================================
--- branches/r5rs/sigscheme/operations-nonstd.c	2005-12-14 18:19:58 UTC (rev 2575)
+++ branches/r5rs/sigscheme/operations-nonstd.c	2005-12-14 18:29:07 UTC (rev 2576)
@@ -135,7 +135,7 @@
 
     /* generate loaded_str, contents is filename-loaded* */
     size = (strlen(SCM_STRING_STR(filename)) + strlen("*-loaded*") + 1);
-    loaded_str = Scm_malloc(size);
+    loaded_str = scm_malloc(size);
     snprintf(loaded_str, size, "*%s-loaded*", SCM_STRING_STR(filename));
 
     return Scm_NewImmutableString(loaded_str);

Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c	2005-12-14 18:19:58 UTC (rev 2575)
+++ branches/r5rs/sigscheme/operations.c	2005-12-14 18:29:07 UTC (rev 2576)
@@ -1244,7 +1244,7 @@
     total_size = prefix_size + newch_size + postfix_size;
 
     /* copy each part */
-    new_str = Scm_malloc(total_size + 1);
+    new_str = scm_malloc(total_size + 1);
     memcpy(new_str, string_str, prefix_size);
     memcpy(new_str+prefix_size, new_ch_str, newch_size);
     memcpy(new_str+prefix_size+newch_size,
@@ -1304,7 +1304,7 @@
     mbs = Scm_mb_substring(mbs, c_start_index, c_end_index - c_start_index);
 
     /* copy from start_ptr to end_ptr */
-    new_str = Scm_malloc(SCM_MBS_GET_SIZE(mbs) + 1);
+    new_str = scm_malloc(SCM_MBS_GET_SIZE(mbs) + 1);
     memcpy(new_str, SCM_MBS_GET_STR(mbs), SCM_MBS_GET_SIZE(mbs));
     new_str[SCM_MBS_GET_SIZE(mbs)] = 0;
 
@@ -1334,7 +1334,7 @@
         total_len  += SCM_STRING_LEN(obj);
     }
 
-    new_str = Scm_malloc(total_size + 1);
+    new_str = scm_malloc(total_size + 1);
 
     /* copy string by string */
     p = new_str;
@@ -1441,7 +1441,7 @@
 
     /* create new str */
     char_size = next - ch_str;
-    new_str = Scm_realloc(SCM_STRING_STR(str), str_len * char_size + 1);
+    new_str = scm_realloc(SCM_STRING_STR(str), str_len * char_size + 1);
     for (p = new_str; p < &new_str[char_size * str_len]; p += char_size) {
         strcpy(p, ch_str);
     }
@@ -1476,7 +1476,7 @@
 
     /* allocate vector */
     len = SCM_INT_VALUE(vector_len);
-    vec = Scm_malloc(sizeof(ScmObj) * len);
+    vec = scm_malloc(sizeof(ScmObj) * len);
 
     /* fill vector */
     filler = SCM_UNDEF;
@@ -1496,7 +1496,7 @@
     DECLARE_FUNCTION("vector", ProcedureVariadic0);
 
     len = SCM_INT_VALUE(ScmOp_length(args));
-    vec = Scm_malloc(sizeof(ScmObj) * len);
+    vec = scm_malloc(sizeof(ScmObj) * len);
 
     for (i = 0; i < len; i++)
         vec[i] = POP_ARG(args);
@@ -1577,7 +1577,7 @@
 
     scm_len = ScmOp_length(lst);
     c_len   = SCM_INT_VALUE(scm_len);
-    v       = Scm_malloc(sizeof(ScmObj) * c_len);
+    v       = scm_malloc(sizeof(ScmObj) * c_len);
     for (i = 0; i < c_len; i++) {
         v[i] = CAR(lst);
         lst  = CDR(lst);

Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h	2005-12-14 18:19:58 UTC (rev 2575)
+++ branches/r5rs/sigscheme/sigschemeinternal.h	2005-12-14 18:29:07 UTC (rev 2576)
@@ -349,16 +349,16 @@
 
 #define LBUF_ALLOC(lbuf, size)                                               \
     do {                                                                     \
-        (lbuf)._buf = Scm_malloc(size);                                      \
+        (lbuf)._buf = scm_malloc(size);                                      \
         (lbuf)._size = (size);                                               \
     } while (/* CONSTCOND */ 0)
 
 #define LBUF_REALLOC(lbuf, size)                                             \
     do {                                                                     \
         if ((lbuf)._buf == (lbuf)._init_buf) {                               \
-            (lbuf)._buf = memcpy(Scm_malloc(size), LBUF_BUF(lbuf), LBUF_SIZE(lbuf)); \
+            (lbuf)._buf = memcpy(scm_malloc(size), LBUF_BUF(lbuf), LBUF_SIZE(lbuf)); \
         } else {                                                             \
-            (lbuf)._buf = Scm_realloc((lbuf)._buf, (size));                  \
+            (lbuf)._buf = scm_realloc((lbuf)._buf, (size));                  \
         }                                                                    \
         (lbuf)._size = (size);                                               \
     } while (/* CONSTCOND */ 0)
@@ -428,9 +428,9 @@
 
 /* error.c */
 void SigScm_InitError(void);
-void *Scm_malloc(size_t size);
-void *Scm_calloc(size_t number, size_t size);
-void *Scm_realloc(void *ptr, size_t size);
+void *scm_malloc(size_t size);
+void *scm_calloc(size_t number, size_t size);
+void *scm_realloc(void *ptr, size_t size);
 void Scm_ThrowException(ScmObj errorobj) SCM_NORETURN;
 void SigScm_ShowErrorHeader(void);
 void Scm_ErrorObj(const char *func_name, const char *msg, ScmObj obj) SCM_NORETURN;

Modified: branches/r5rs/sigscheme/storage-gc.c
===================================================================
--- branches/r5rs/sigscheme/storage-gc.c	2005-12-14 18:19:58 UTC (rev 2575)
+++ branches/r5rs/sigscheme/storage-gc.c	2005-12-14 18:29:07 UTC (rev 2576)
@@ -209,7 +209,7 @@
         n_empty_protected_vars--;
     } else {
         new_size = sizeof(ScmObj *) * (protected_vars_size + 1);
-        protected_vars = Scm_realloc(protected_vars, new_size);
+        protected_vars = scm_realloc(protected_vars, new_size);
         slot = &protected_vars[protected_vars_size++];
     }
     *slot = var;
@@ -285,7 +285,7 @@
     if (!p)
         ERR("memory exhausted");
 #else
-    p = Scm_malloc(size);
+    p = scm_malloc(size);
     /* heaps must be aligned to sizeof(ScmCell) */
     assert(!((uintptr_t)p % sizeof(ScmCell)));
 #endif
@@ -321,7 +321,7 @@
     if (n_heaps_max <= n_heaps)
         Scm_FatalError("heap exhausted");
 
-    heaps = Scm_realloc(heaps, sizeof(ScmObjHeap) * (n_heaps + 1));
+    heaps = scm_realloc(heaps, sizeof(ScmObjHeap) * (n_heaps + 1));
     heap = scm_malloc_aligned(sizeof(ScmCell) * heap_size);
     heaps[n_heaps++] = heap;
 

Modified: branches/r5rs/sigscheme/storage-symbol.c
===================================================================
--- branches/r5rs/sigscheme/storage-symbol.c	2005-12-14 18:19:58 UTC (rev 2575)
+++ branches/r5rs/sigscheme/storage-symbol.c	2005-12-14 18:29:07 UTC (rev 2576)
@@ -122,7 +122,7 @@
 {
     int i;
 
-    scm_symbol_hash = Scm_malloc(sizeof(ScmObj) * NAMEHASH_SIZE);
+    scm_symbol_hash = scm_malloc(sizeof(ScmObj) * NAMEHASH_SIZE);
 
     for (i = 0; i < NAMEHASH_SIZE; i++)
         scm_symbol_hash[i] = SCM_NULL;



More information about the uim-commit mailing list