Update of /cvsroot/alsa/alsa-lib/src/alisp
In directory sc8-pr-cvs1:/tmp/cvs-serv17943/src/alisp

Modified Files:
        alisp.c alisp_local.h 
Log Message:
Fixed lisp for ordinary mixer API

Index: alisp.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/alisp/alisp.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- alisp.c     13 Dec 2003 18:36:01 -0000      1.12
+++ alisp.c     21 Dec 2003 18:25:57 -0000      1.13
@@ -1138,9 +1138,8 @@
                                lisp_warn(instance, "sum with a non integer or float 
operand");
                        }
                        delete_tree(instance, p1);
-                       n = cdr(p);
-                       delete_object(instance, p);
-                       p = n;
+                       p = cdr(n = p);
+                       delete_object(instance, n);
                        if (p == &alsa_lisp_nil)
                                break;
                        p1 = eval(instance, car(p));
@@ -1170,13 +1169,11 @@
                                lisp_warn(instance, "concat with a non string or 
identifier operand");
                        }
                        delete_tree(instance, p1);
-                       n = cdr(p);
-                       delete_object(instance, p);
-                       p = n;
+                       p = cdr(n = p);
+                       delete_object(instance, n);
                        if (p == &alsa_lisp_nil)
                                break;
                        p1 = eval(instance, car(p));
-                       delete_object(instance, car(p));
                }
                p = new_string(instance, str);
                free(str);
@@ -1626,6 +1623,7 @@
                case '\r': snd_output_putc(out, '\\'); snd_output_putc(out, 'r'); 
break;
                case '\t': snd_output_putc(out, '\\'); snd_output_putc(out, 't'); 
break;
                case '\v': snd_output_putc(out, '\\'); snd_output_putc(out, 'v'); 
break;
+               case '"': snd_output_putc(out, '\\'); snd_output_putc(out, '"'); break;
                default: snd_output_putc(out, *p);
                }
        snd_output_putc(out, '"');
@@ -2219,11 +2217,9 @@
        do {
                if (p1)
                        delete_tree(instance, p1);
-               p1 = car(p);
-               delete_tree(instance, unset_object(instance, p1));
-               n = cdr(p);
-               delete_object(instance, p);
-               p = n;
+               p1 = unset_object(instance, car(p));
+               p = cdr(n = p);
+               delete_object(instance, n);
        } while (p != &alsa_lisp_nil);
 
        return p1;
@@ -2482,13 +2478,19 @@
                return p;
        if (alisp_compare_type(p, ALISP_OBJ_INTEGER) ||
            alisp_compare_type(p, ALISP_OBJ_FLOAT)) {
-               char buf[64];
-               if (alisp_compare_type(p, ALISP_INTEGER)) {
+               char *buf = malloc(64);
+               if (buf == NULL) {
+                       delete_tree(instance, p);
+                       nomem();
+                       return NULL;
+               }
+               if (alisp_compare_type(p, ALISP_OBJ_INTEGER)) {
                        snprintf(buf, sizeof(buf), "%ld", p->value.i);
                } else {
                        snprintf(buf, sizeof(buf), "%.f", p->value.f);
                }
                p1 = new_string(instance, buf);
+               free(buf);
        } else {
                lisp_warn(instance, "expected an integer or float for integer 
conversion");
                p1 = &alsa_lisp_nil;

Index: alisp_local.h
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/alisp/alisp_local.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- alisp_local.h       13 Dec 2003 18:36:01 -0000      1.7
+++ alisp_local.h       21 Dec 2003 18:25:57 -0000      1.8
@@ -45,13 +45,12 @@
 
 struct alisp_object;
 
-#define ALISP_MAX_REFS 0x0fffffff
-#define ALISP_MAX_REFS_LIMIT ((ALISP_MAX_REFS + 1) / 2)
-
 #define ALISP_TYPE_MASK        0xf0000000
 #define ALISP_TYPE_SHIFT 28
 #define ALISP_REFS_MASK 0x0fffffff
 #define ALISP_REFS_SHIFT 0
+#define ALISP_MAX_REFS (ALISP_REFS_MASK>>ALISP_REFS_SHIFT)
+#define ALISP_MAX_REFS_LIMIT ((ALISP_MAX_REFS + 1) / 2)
 
 struct alisp_object {
        struct list_head list;



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to