[uim-commit] r1213 - branches/r5rs/uim

kzk at freedesktop.org kzk at freedesktop.org
Thu Aug 18 00:21:03 PDT 2005


Author: kzk
Date: 2005-08-18 00:19:43 -0700 (Thu, 18 Aug 2005)
New Revision: 1213

Modified:
   branches/r5rs/uim/uim-compat-scm.c
   branches/r5rs/uim/uim-scm.c
Log:
* uim/uim-compat-scm.c
  - (quote_sym): removed because SigScheme have it
  - (uim_scm_repl_c_string): not to display
  - (uim_scm_nth): supress warning
  - (uim_scm_provide): use ScmOp_provide
  - (uim_init_compat_scm_subrs): no need to process this

* uim/uim-scm.c
  - (uim_scm_make_symbol): use Scm_Intern instead of Scm_NewSymbol
  - (uim_scm_gc_protect): fix invalid pointer type
  - (uim_scm_gc_unprotect_stack, uim_scm_string_equal)
    : supress warning
  - (uim_scm_quote): change args of ScmOp_quote
  - (uim_scm_return_value): throw error
  - (uim_scm_require_file): variable suceeded is not used
  - (uim_scm_init): no need to protect true_sym, false_sym,
    protected_arg0



Modified: branches/r5rs/uim/uim-compat-scm.c
===================================================================
--- branches/r5rs/uim/uim-compat-scm.c	2005-08-18 05:33:56 UTC (rev 1212)
+++ branches/r5rs/uim/uim-compat-scm.c	2005-08-18 07:19:43 UTC (rev 1213)
@@ -39,11 +39,8 @@
 #include "uim-compat-scm.h"
 #include "context.h"
 
-
 static uim_lisp return_val;
-static uim_lisp quote_sym;
 
-
 /* will be deprecated. use uim_scm_c_str() instead */
 char *
 uim_get_c_string(uim_lisp str)
@@ -54,7 +51,10 @@
 long
 uim_scm_repl_c_string(char *str, long want_init, long want_print)
 {
-  ScmOp_display(Scm_eval_c_string(str), NULL);
+  /* TODO: fix return value */
+  Scm_eval_c_string(str);
+
+  return 0;
 }
 
 int
@@ -173,11 +173,8 @@
 uim_lisp
 uim_scm_nth(uim_lisp n, uim_lisp lst)
 {
-  uim_lisp form;
-  form = uim_scm_list3(uim_scm_intern_c_str("nth"),
-		       n,
-		       lst);
-  return uim_scm_eval(form);
+  return (uim_lisp)ScmOp_list_ref((ScmObj)lst,
+				  (ScmObj)n);
 }
 
 /* Is this function used from somewhere? I think this function could be removed. */
@@ -199,10 +196,7 @@
 void
 uim_scm_provide(const char *feature)
 {
-  fprintf(stderr, "uim_scm_provide : not implemented yet.\n");
-#if 0
-  siod_c_provide(feature);
-#endif
+  ScmOp_provide(Scm_NewStringCopying(feature));
 }
 
 
@@ -272,9 +266,4 @@
 void
 uim_init_compat_scm_subrs(void)
 {
-  return_val = uim_scm_f();
-  quote_sym = uim_scm_intern_c_str("quote");
-
-  uim_scm_gc_protect(&return_val);
-  uim_scm_gc_protect(&quote_sym);
 }

Modified: branches/r5rs/uim/uim-scm.c
===================================================================
--- branches/r5rs/uim/uim-scm.c	2005-08-18 05:33:56 UTC (rev 1212)
+++ branches/r5rs/uim/uim-scm.c	2005-08-18 07:19:43 UTC (rev 1213)
@@ -140,7 +140,7 @@
 uim_lisp
 uim_scm_make_symbol(const char *name)
 {
-  return (uim_lisp)Scm_NewSymbol(strdup(name), NULL);
+  return (uim_lisp)Scm_Intern(name);
 }
 
 void *
@@ -170,7 +170,7 @@
 void
 uim_scm_gc_protect(uim_lisp *location)
 {
-  SigScm_gc_protect((ScmObj*)location);
+  SigScm_gc_protect((ScmObj)(*location));
 }
 
 void
@@ -182,7 +182,7 @@
 void
 uim_scm_gc_unprotect_stack(uim_lisp *stack_start)
 {
-  SigScm_gc_unprotect_stack(stack_start);
+  SigScm_gc_unprotect_stack((ScmObj*)stack_start);
 }
 
 uim_bool
@@ -292,7 +292,7 @@
 uim_bool
 uim_scm_string_equal(uim_lisp a, uim_lisp b)
 {
-  if(EQ(ScmOp_string_equal(a, b), SigScm_true))
+  if(EQ(ScmOp_string_equal((ScmObj)a, (ScmObj)b), SigScm_true))
     return UIM_TRUE;
 
   return UIM_FALSE;
@@ -322,7 +322,8 @@
 uim_lisp
 uim_scm_quote(uim_lisp obj)
 {
-  return (uim_lisp)ScmOp_quote((ScmObj)obj);
+  int flag;
+  return (uim_lisp)ScmOp_quote(Scm_NewCons((ScmObj)obj, SigScm_nil), &SigScm_nil, &flag);
 }
 #endif  /* UIM_SCM_EXTENDED_API */
 
@@ -336,6 +337,7 @@
 uim_scm_return_value(void)
 {
   /* FIXME: This function should be removed. */
+  SigScm_Error("uim_scm_return_value is not implemented\n");
 }
 
 uim_lisp
@@ -438,8 +440,6 @@
 uim_bool
 uim_scm_require_file(const char *fn)
 {
-  uim_bool succeeded;
-
   if (!fn)
     return UIM_FALSE;
 
@@ -516,12 +516,7 @@
   SigScm_Initialize();
   true_sym  = (uim_lisp)SigScm_true;
   false_sym = (uim_lisp)SigScm_false;
-
-  uim_scm_gc_protect(&true_sym);
-  uim_scm_gc_protect(&false_sym);
-
   protected_arg0 = uim_scm_f();
-  uim_scm_gc_protect(&protected_arg0);
 }
 
 void



More information about the uim-commit mailing list