From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Bugfix ob-C.el mixed input variable Date: Thu, 27 Mar 2014 17:54:01 -0400 Message-ID: <874n2jcnpi.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTIHe-0006z4-2o for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 17:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTIHZ-0002EZ-IL for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 17:56:22 -0400 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]:46432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTIHZ-0002EN-CO for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 17:56:17 -0400 Received: by mail-pd0-f169.google.com with SMTP id fp1so3927934pdb.14 for ; Thu, 27 Mar 2014 14:56:16 -0700 (PDT) In-Reply-To: (Jakob Lombacher's message of "Thu, 27 Mar 2014 19:47:53 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jakob Lombacher Cc: emacs-orgmode@gnu.org Applied, Thanks! Jakob Lombacher writes: > When using org-babel with mixed (double, int) input like below, the c file > was not written correctly. The numbers where left out and only the commas > where written. > > I guess it was a typo. Attached is the patch. > > Jakob > > --- > > #+RESULTS[8894f01ba8e219bd6cafb49748f4d5cad8bb6fd1]: test-parameter > | 1 | 2.3 | > | 3 | 4.2 | > > > > #+begin_src cpp :var x=test-parameter :includes '("") > using namespace std; > cout << "hallo" << endl; > #+end_src > > From baea909dd3e6d7e4c8eaa2c506a3c6f31c472f11 Mon Sep 17 00:00:00 2001 > From: Jakob Lombacher > Date: Thu, 27 Mar 2014 19:27:03 +0100 > Subject: [PATCH] Bugfix, there was one entry too much. > > It failed when mixed (int double) table is used as input variable e.g > | 1 | 1.2 | > --- > lisp/ob-C.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lisp/ob-C.el b/lisp/ob-C.el > index 4c2d1ba..bbd0525 100644 > --- a/lisp/ob-C.el > +++ b/lisp/ob-C.el > @@ -264,7 +264,7 @@ FORMAT can be either a format string or a function which is called with VAL." > (when (and type (not (string= type-name tmp-type-name))) > (if (and (member type-name '("int" "double" "int32_t")) > (member tmp-type-name '("int" "double" "int32_t"))) > - (setq tmp-type '("double" "" "%f")) > + (setq tmp-type '("double" "%f")) > (error "Only homogeneous lists are supported by C. You can not mix %s and %s" > type-name > tmp-type-name))) -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D