[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] babel C, C++, D enhancement
From: |
Eric Schulte |
Subject: |
Re: [O] babel C, C++, D enhancement |
Date: |
Fri, 13 Jun 2014 07:47:54 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Achim Gratz <address@hidden> writes:
> Eric Schulte writes:
>> This new patch looks great, and the test suite passes locally. I've
>> just applied it.
>
> You also get a warning from the byte-compiler on something that is
> clearly a bug. I think the fix should be:
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/ob-C.el b/lisp/ob-C.el
> index dd03fa7..a794e2a 100644
> --- a/lisp/ob-C.el
> +++ b/lisp/ob-C.el
> @@ -264,7 +264,7 @@ (defun org-babel-C-val-to-C-type (val)
> (list
> (if (equal org-babel-c-variant 'd) "string" "const char*")
> "\"%s\""))
> - (t (error "unknown type %S" type)))))
> + (t (error "unknown type %S" basetype)))))
> (cond
> ((integerp val) type) ;; an integer declared in the #+begin_src line
> ((floatp val) type) ;; a numeric declared in the #+begin_src line
> --8<---------------cut here---------------end--------------->8---
>
Agreed, I've just pushed up a fix. Please feel free to push these sorts
of obvious bug fixes yourself in the future.
>
> The type determination is a tad optimistic, too. An Emacs integer may
> or may not fit into C type "int" depending on how Emacs is compiled and
> which compiler you are using.
>
Certainly, more refinement wouldn't hurt.
Best,
Eric
>
>
> Regards,
> Achim.
--
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)
- Re: [O] Patch for testing `org-open-at-point', Bastien, 2014/06/01
- Re: [O] Patch for testing `org-open-at-point', Achim Gratz, 2014/06/01
- Re: [O] Patch for testing `org-open-at-point', Bastien, 2014/06/01
- [O] babel C, C++, D enhancement, Thierry Banel, 2014/06/01
- Re: [O] babel C, C++, D enhancement, Eric Schulte, 2014/06/06
- Re: [O] babel C, C++, D enhancement, Thierry Banel, 2014/06/07
- Re: [O] babel C, C++, D enhancement, Thierry Banel, 2014/06/08
- Re: [O] babel C, C++, D enhancement, Eric Schulte, 2014/06/08
- Re: [O] babel C, C++, D enhancement, Thierry Banel, 2014/06/09
- Re: [O] babel C, C++, D enhancement, Achim Gratz, 2014/06/13
- Re: [O] babel C, C++, D enhancement,
Eric Schulte <=
- Re: [O] babel C, C++, D enhancement, Thierry Banel, 2014/06/13
- Re: [O] babel C, C++, D enhancement, Achim Gratz, 2014/06/16
- Re: [O] babel C, C++, D enhancement, Thierry Banel, 2014/06/16
- Re: [O] babel C, C++, D enhancement, Thomas S. Dye, 2014/06/16
- Re: [O] babel C, C++, D enhancement, Nick Dokos, 2014/06/16
- Re: [O] babel C, C++, D enhancement, Achim Gratz, 2014/06/17
- Re: [O] babel C, C++, D enhancement, Thierry Banel, 2014/06/17
- Re: [O] babel C, C++, D enhancement, Bastien, 2014/06/13
- Re: [O] conforming commit messages Was: babel C, C++, D enhancement, Eric Schulte, 2014/06/13
- Re: [O] babel C, C++, D enhancement, Eric Abrahamsen, 2014/06/13