   like (int *foo = 0) includes a default value"
   (equal (nth (- (length words) 2) words) "="))
 
-(defun bde-pointer-p (words)
-  "Check if the function argument represented by a list of words
-  like (int *foo = 0) is a pointer"
-  (let ((variable-name (if (bde-default-value-p words)
-                           (nth (- (length words) 3) words)
-                         (car (last words)))))
-    (pg/string-starts-with variable-name "*")))
+(defun bde-num-stars (words)
+  "Return the number of * in a function argument represented by a
+  list of words"
+  (let ((n 0))
+    (dolist (w words)
+      (cond ((pg/string-starts-with w "**")
+             (setq n (+ n 2)))
+            ((pg/string-starts-with w "*")
+             (setq n (1+ n)))))
+    n))
 
 (defun bde-max-column-in-region ()
   "Return the largest column in region"

  (interactive)
  ;; Get a list of the arguments. Note that the parentheses are included
  (let ((arguments (split-string (thing-at-point 'list) ","))
        (type-lengths ())
        (max-type-length 0)
        (pointers ())
        (has-pointer nil)
        (default-values ()))
    ;; Parse each argument to get the length of its type, and keep track of the
    ;; longest type, the pointers and the default values
    (dolist (arg arguments)
      (let* ((words (split-string arg))
             (len (bde-calculate-type-length words))
             (is-pointer (bde-pointer-p words))
             (is-default-value (bde-default-value-p words)))
        (assert (>= (length words) 2))
        (setq type-lengths (cons len type-lengths)
              max-type-length (max len max-type-length)
              pointers (cons is-pointer pointers)
              has-pointer (or has-pointer is-pointer)
              default-values (cons is-default-value default-values))))
    (setq type-lengths (reverse type-lengths)
          pointers (reverse pointers)
          default-values (reverse default-values))
    ;; Cut the argument list and edit it into a temporary buffer
    (backward-up-list)

    (push-mark)
    (backward-list)
    (indent-region (region-beginning) (region-end))
    ;; If one line goes beyond the dreadful 79th column, insert a new line
    ;; before the first arg and reindent
    (save-excursion
      (when (> (bde-max-column-in-region) 79)
        (backward-list)
