#15 dia2code fails C code generation with dia 0.95

open
nobody
None
5
2014-08-23
2006-11-29
Anonymous
No

the output format of Dia has changed && evidently causes issues with dia2code. Attached new dia file created from same diagram.

-rw-r--r-- 1 rthompso rthompso 15810 2001-10-09 15:40 diagrams/example1.dia
-rw-r--r-- 1 rthompso rthompso 30264 2006-11-29 13:09 example1.dia

The example code generated with the examples:
rthompso@jhereg:/tmp/dia2code$ cat base.c

include "base.h"

static int dummy = ;
int Base_foo ( Base *this, int a ){
this->foo(this, a);
}

int Base_bar ( Base *this, int xint y ){
this->bar(this, x, y);
}

rthompso@jhereg:/tmp/dia2code$ cat base.h

ifndef BASE_H

define BASE_H

define BASE(OBJ) ((Base*)OBJ)

ifndef String

define String char*

endif

// Abstract
typedef struct _Base Base;

struct _Base {
/ Attributes /
/private/
int x;
/ Associations /
/ Operations /
/public/
int (foo) ( Base this, int a );
/protected/
int (bar) ( Base this, int x, int y );
};

/ Operations /
/public/
int Base_foo ( Base this, int a );
/
protected/
int Base_bar ( Base
this, int x, int y );

endif


The same code generated from a duplicate diagram from dia 0.95.rthompso@jhereg:/tmp/dia2code$ cat base.c

include "base.h"

static int dummy = ;
int Base_foo ( Base *this, int a ){
}

int Base_bar ( Base *this, int x, int y ){
}

rthompso@jhereg:/tmp/dia2code$ cat base.h

ifndef BASE_H

define BASE_H

define BASE(OBJ) ((Base*)OBJ)

ifndef String

define String char*

endif

// Abstract
typedef struct _Base Base;

struct _Base {
/ Attributes /
/private/
in x;
/ Associations /
/ Operations /
};

/ Operations /
/public/
int Base_foo ( Base this, int a );
/
protected/
int Base_bar ( Base
this, int x, int y );

endif

Discussion

  • Nobody/Anonymous

    New dia file based off of old example diagram

     
  • Oliver Kellogg

    Oliver Kellogg - 2011-10-21

    Please consider contributing a fix - I don't know generate_code_c.c very well (I've never used it)

     

Log in to post a comment.