+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>
* config/sid.exp (gdb_target_sid): Check for error messages.
(defun caller (n) (format "caller%d" n))
(defun local (n) (format "l%d" n))
(defun local-sum (n)
- (let ((j 1))
- (while (<= j n)
- (insert (local j))
- (if (< j n) (insert "+"))
- (setq j (1+ j)))))
+ (if (zerop n) (insert "0")
+ (let ((j 1))
+ (while (<= j n)
+ (insert (local j))
+ (if (< j n) (insert "+"))
+ (setq j (1+ j))))))
(defun local-chain (n previous first-end)
(let ((j 1))
(while (<= j n)
(insert "{\n")
(local-chain i "n" (callee i))
(insert " return ")
- (if (<= i 0) (insert "n")
- (local-sum i))
+ (local-sum i)
(insert ";\n")
(insert "}\n\n")
(setq i (1+ i))))
int
callee0 (int n)
{
- return n;
+ return 0;
}
/* Returns n * 1 + 1 */