* restore.c: Make the code of caller0 correspond to its comment.

This commit is contained in:
Jim Blandy 2001-05-07 00:05:15 +00:00
parent ce696e0556
commit 5a360f470b
2 changed files with 12 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2001-05-06 Jim Blandy <jimb@redhat.com>
* restore.c: Make the code of caller0 correspond to its comment.
2001-05-03 Michael Snyder <msnyder@redhat.com> 2001-05-03 Michael Snyder <msnyder@redhat.com>
* config/sid.exp (gdb_target_sid): Check for error messages. * config/sid.exp (gdb_target_sid): Check for error messages.

View File

@ -14,11 +14,12 @@
(defun caller (n) (format "caller%d" n)) (defun caller (n) (format "caller%d" n))
(defun local (n) (format "l%d" n)) (defun local (n) (format "l%d" n))
(defun local-sum (n) (defun local-sum (n)
(if (zerop n) (insert "0")
(let ((j 1)) (let ((j 1))
(while (<= j n) (while (<= j n)
(insert (local j)) (insert (local j))
(if (< j n) (insert "+")) (if (< j n) (insert "+"))
(setq j (1+ j))))) (setq j (1+ j))))))
(defun local-chain (n previous first-end) (defun local-chain (n previous first-end)
(let ((j 1)) (let ((j 1))
(while (<= j n) (while (<= j n)
@ -53,8 +54,7 @@
(insert "{\n") (insert "{\n")
(local-chain i "n" (callee i)) (local-chain i "n" (callee i))
(insert " return ") (insert " return ")
(if (<= i 0) (insert "n") (local-sum i)
(local-sum i))
(insert ";\n") (insert ";\n")
(insert "}\n\n") (insert "}\n\n")
(setq i (1+ i)))) (setq i (1+ i))))
@ -103,7 +103,7 @@ increment (int n)
int int
callee0 (int n) callee0 (int n)
{ {
return n; return 0;
} }
/* Returns n * 1 + 1 */ /* Returns n * 1 + 1 */